:root {
  --ink: #182729;
  --muted: #6f7d7d;
  --line: #dbe4e2;
  --line-strong: #c3d0cd;
  --paper: #f5f8f6;
  --surface: #ffffff;
  --surface-alt: #edf3f0;
  --teal: #1f7a72;
  --teal-dark: #16544f;
  --green: #2aa876;
  --amber: #d69e2e;
  --red: #d85b5b;
  --gray: #8993a4;
  --shadow: 0 12px 32px rgba(31, 53, 51, 0.08);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 22px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.source-line {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions,
.map-tools,
.command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  flex-shrink: 0;
}

.baseline-chip,
.detail-status,
.result-count,
.command-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 11px;
  white-space: nowrap;
}

.button,
.icon-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button {
  padding: 0 12px;
}

.button span {
  margin-right: 5px;
}

.button-primary {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.button-primary:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: #f3f9f6;
}

.button-ghost {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.button-confirm {
  width: 100%;
  margin-top: 9px;
  border-color: #d8b765;
  color: #62480e;
  background: #fff8df;
}

.button-confirm:hover {
  border-color: var(--amber);
  background: #fff2c2;
}

.icon-button {
  width: 34px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: #f3f9f6;
}

.icon-button.light,
.light-button {
  border-color: rgba(255, 255, 255, 0.18);
  color: #edf6f2;
  background: rgba(255, 255, 255, 0.08);
}

.icon-button.light:hover,
.light-button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.light-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 285px minmax(520px, 1fr) 320px;
  gap: 1px;
  background: var(--line);
}

.left-panel,
.right-panel {
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
}

.panel-section,
.detail-panel,
.event-panel {
  padding: 17px 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 13px;
}

.live-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(42, 168, 118, 0.12);
}

.progress-block {
  margin-bottom: 16px;
}

.progress-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-label strong {
  color: var(--ink);
  font-size: 17px;
}

.progress-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e4ece8;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 200ms ease;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.metric-complete strong {
  color: var(--green);
}

.metric-progress strong {
  color: var(--amber);
}

.metric-pending strong {
  color: var(--gray);
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.field-label + .field-label {
  margin-top: 12px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  margin: 5px 0 12px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
}

.search-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 114, 0.1);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.select-control,
.text-control {
  width: 100%;
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

.readonly-value {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: #f5f8f5;
  font-weight: 600;
}

.select-control:focus,
.text-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 114, 0.1);
}

.filter-hint,
.source-note,
.map-tip,
.source-hash,
.provenance-box {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.filter-hint {
  margin-top: 10px;
}

.command-section textarea {
  width: 100%;
  min-height: 104px;
  margin-top: 5px;
  resize: vertical;
}

textarea.text-control,
.command-section textarea {
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.45;
}

textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 114, 0.1);
}

.command-actions {
  justify-content: space-between;
  margin-top: 9px;
}

.command-preview {
  margin-top: 10px;
  padding: 10px;
  border-left: 3px solid var(--amber);
  color: #68500e;
  background: #fff9e7;
  font-size: 12px;
  line-height: 1.5;
}

.source-file {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.5;
}

.source-note {
  margin-top: 8px;
}

.map-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #182729;
}

.map-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #eff7f3;
}

.map-title {
  min-width: 0;
}

.map-title .eyebrow {
  color: #83c8b7;
}

.map-title strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.map-subtitle {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #aabdb8;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-readout {
  min-width: 48px;
  color: #aabdb8;
  font-size: 11px;
  text-align: center;
}

.canvas-frame {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  background: #eef3f0;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#mapCanvas.is-dragging {
  cursor: grabbing;
}

.map-tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  min-width: 104px;
  padding: 8px 10px;
  border: 1px solid rgba(24, 39, 41, 0.14);
  border-radius: 5px;
  box-shadow: var(--shadow);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  font-size: 11px;
  line-height: 1.45;
}

.map-tooltip strong {
  display: block;
  font-size: 13px;
}

.map-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
}

.map-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e5e0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-swatch.completed {
  background: var(--green);
}

.legend-swatch.in-progress {
  background: var(--amber);
}

.legend-swatch.unrecorded {
  border: 1.5px solid #a7d6ca;
  background: transparent;
}

.legend-swatch.unverified {
  background: var(--red);
}

.right-panel {
  display: flex;
  flex-direction: column;
}

.detail-panel {
  flex: 1;
}

.detail-status {
  color: var(--muted);
}

.detail-status.completed {
  border-color: rgba(42, 168, 118, 0.28);
  color: #207c58;
  background: #e7f6ef;
}

.detail-status.inProgress {
  border-color: rgba(214, 158, 46, 0.32);
  color: #7f5a0e;
  background: #fff5dc;
}

.detail-status.unverified {
  border-color: rgba(216, 91, 91, 0.28);
  color: #9e3c3c;
  background: #fdeaea;
}

.detail-empty {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.detail-empty strong {
  color: var(--ink);
}

.detail-empty span {
  max-width: 190px;
  font-size: 12px;
  line-height: 1.5;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--teal);
  font-size: 25px;
}

.pile-identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.pile-identity strong {
  display: block;
  margin-top: 3px;
  color: var(--teal-dark);
  font-size: 23px;
}

.identity-coordinates {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 9px;
  margin-top: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.subheading {
  margin-top: 19px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.save-button {
  width: 100%;
  margin-top: 14px;
}

.provenance-box {
  margin-top: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfb;
}

.event-panel {
  flex: 0 0 auto;
}

.event-list {
  max-height: 180px;
  overflow: auto;
}

.event-empty {
  color: var(--muted);
  font-size: 11px;
}

.event-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}

.event-item:last-child {
  border-bottom: 0;
}

.event-item strong {
  color: var(--ink);
}

.event-item time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.app-footer {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 18px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 260px minmax(460px, 1fr) 290px;
  }

  .top-actions .baseline-chip {
    display: none;
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 235px minmax(420px, 1fr);
  }

  .right-panel {
    position: fixed;
    z-index: 10;
    top: 79px;
    right: 0;
    bottom: 30px;
    width: 320px;
    box-shadow: -12px 0 30px rgba(31, 53, 51, 0.12);
  }

  .map-toolbar {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 14px;
  }

  .brand-block {
    width: 100%;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    overflow: visible;
  }

  .left-panel {
    order: 2;
  }

  .map-panel {
    order: 1;
    min-height: 62vh;
  }

  .right-panel {
    position: static;
    order: 3;
    width: auto;
    box-shadow: none;
  }

  .canvas-frame {
    min-height: 460px;
  }

  .map-footer,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer {
    padding: 9px 14px;
  }
}

/* Shared-data release: retain the original palette, but give the canvas an
   actual bounded viewport and switch panels rather than stacking a tiny map. */
[hidden] { display: none !important; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, canvas:focus-visible, summary:focus-visible { outline: 3px solid #78c8b9; outline-offset: 3px; }
html, body { height: 100%; overflow: hidden; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; }
.topbar, .app-footer, .mobile-nav, .notice-bar, .connection-banner { flex-shrink: 0; }
.workspace { grid-template-columns: 272px minmax(280px, 1fr) 310px; overflow: hidden; }
.left-panel, .right-panel { min-width: 0; overflow: auto; overscroll-behavior: contain; }
.right-panel { position: static; width: auto; box-shadow: none; }
.map-panel { min-height: 0; }
.map-toolbar { flex-wrap: wrap; gap: 9px; padding: 12px 14px; }
.map-tools { flex-shrink: 0; gap: 4px; }
.map-footer { align-items: center; flex-wrap: wrap; flex-direction: row; gap: 8px; }
.map-tip { font-size: 10px; color: #aabdb8; }
.canvas-frame { flex: 1 1 0; min-height: 100px; }
#mapCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.map-tooltip { white-space: pre-line; max-width: 220px; }
.map-selection { position: absolute; bottom: 12px; left: 12px; max-width: calc(100% - 24px); padding: 9px 13px; background: #fff; border: 1px solid #7ba99a; border-radius: 6px; font-size: 12px; box-shadow: var(--shadow); cursor: pointer; }
.source-hash, .provenance-box { overflow-wrap: anywhere; }
.provenance-box, .identity-coordinates { white-space: pre-line; }
.axis-card { padding: 13px 12px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 9px; background: #fbfdfb; }
.axis-card-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.axis-card-title span { font-size: 12px; color: var(--muted); }
.axis-card-title strong { font-size: 27px; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.axis-card .progress-label { font-size: 11px; }
.axis-card .progress-label strong { font-size: 14px; color: var(--teal); }
.reference-total { font-size: 11px; color: var(--muted); line-height: 1.6; }
.data-status-strip { display: flex; flex-wrap: wrap; gap: 5px 8px; margin: 10px 0 2px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.data-status-strip span, .data-status-strip strong { padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: #f8fbf9; }
.data-status-strip strong { color: var(--teal-dark); background: #e9f4ef; }
.status-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.status-pill { padding: 3px 6px; border-radius: 999px; font-size: 10px; line-height: 1.25; white-space: nowrap; }
.status-pill.completed { color: #207c58; background: #e7f6ef; }
.status-pill.in-progress { color: #7f5a0e; background: #fff5dc; }
.status-pill.unrecorded { color: var(--teal-dark); background: #eaf3f0; }
.status-pill.unverified { color: #9e3c3c; background: #fdeaea; }
.filter-controls { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-top: 8px; }
.date-filter-row { display: flex; align-items: stretch; gap: 7px; }
.date-filter-row .text-control { flex: 1 1 auto; min-width: 0; }
.date-filter-row .button { flex: 0 0 auto; margin-top: 5px; white-space: nowrap; }
.date-quick-select { margin-top: 7px; }
.date-filter-summary { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.search-results { margin: -7px 0 12px; border: 1px solid var(--line); padding: 6px; border-radius: 6px; }
.search-results button { display: flex; width: 100%; justify-content: space-between; gap: 7px; padding: 8px 5px; background: white; color: var(--teal-dark); border: 0; text-align: left; }
.search-results button:hover { background: var(--surface-alt); }
.search-results small { color: var(--muted); }
.form-grid .field-label + .field-label { margin-top: 0; }
.form-grid { align-items: start; }
.full-width { width: 100%; margin-top: 12px; }
.design-details { font-size: 11px; }
.design-details dl { display: grid; grid-template-columns: 1fr 1.3fr; margin: 8px 0; }
.design-details dt, .design-details dd { padding: 8px 4px; margin: 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.design-details dt { color: var(--muted); }
.design-state { padding: 8px 10px; margin-top: 9px; border-radius: 4px; color: var(--teal-dark); background: #e9f4ef; line-height: 1.5; }
.pending-state { color: #836527; background: #fff6df; }
.event-item span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.notice-bar, .connection-banner { padding: 8px 18px; background: #fff6df; color: #745621; font-size: 12px; line-height: 1.6; }
.notice-bar .button { margin: 0 10px; }
.connection-banner { color: #912f2f; background: #fde9e7; }
.mobile-nav { display: none; }
dialog { width: min(620px, calc(100vw - 36px)); max-height: min(90vh, 90dvh); padding: 24px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); box-shadow: 0 20px 80px #12382d40; background: #fff; overflow: auto; }
dialog::backdrop { background: #142d2b70; backdrop-filter: blur(2px); }
.wide-dialog { width: min(1020px, calc(100vw - 40px)); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.dialog-header h2 { font-size: 20px; }
dialog p, dialog li { font-size: 13px; line-height: 1.7; margin: 10px 0; }
dialog .field-label { margin-top: 12px; }
dialog .button { margin-top: 10px; min-height: 38px; }
dialog .dialog-header .icon-button { margin: 0; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 10px; position: sticky; bottom: -24px; background: #fff; border-top: 1px solid var(--line); padding-bottom: 12px; z-index: 2; }
.dialog-row { display: flex; gap: 9px; align-items: center; margin: 10px 0; }
.dialog-row > * { min-width: 0; }
.dialog-row .button { flex-shrink: 0; white-space: nowrap; }
.dialog-row .select-control { max-width: 280px; }
.table-scroll { overflow: auto; max-height: 55vh; border: 1px solid var(--line); border-radius: 5px; margin-top: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-alt); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.preview-table td { min-width: 170px; overflow-wrap: anywhere; }
.preview-table td:first-child { min-width: 85px; }
.preview-summary { font-size: 17px; font-weight: 600; }
.warning-box { padding: 10px 12px; margin: 12px 0; background: #fff6e1; color: #785721; border-left: 3px solid #cda146; border-radius: 4px; line-height: 1.65; font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.catalog-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.catalog-stats .metric strong { font-size: 23px; }
.batch-checkpoint { padding: 12px; background: #f3f8f4; border: 1px solid var(--line); border-radius: 6px; }
.batch-checkpoint-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.batch-checkpoint-title > span { color: var(--muted); font-size: 11px; }
.batch-checkpoint > span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.batch-progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.batch-progress-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.batch-progress-label strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.batch-progress-track { height: 7px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: #dfeae4; }
.batch-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.batch-progress-track.material span { background: var(--teal); }
.batch-kpis { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.batch-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.batch-quick-actions .link-button { font-size: 11px; }
.link-button { background: transparent; border: 0; padding: 0; color: var(--teal); text-decoration: underline; white-space: nowrap; }
details { margin: 13px 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
summary { cursor: pointer; font-size: 13px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 12px; color: #325b52; }
pre { padding: 12px; background: var(--paper); max-height: 45vh; overflow: auto; }
.parameter-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.check-line { display: block; margin: 18px 0 7px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.share-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); gap: 10px; font-size: 12px; }
.share-item .button { margin-top: 0; }
.toast { max-width: min(520px, calc(100vw - 24px)); z-index: 100; white-space: pre-wrap; }
.toast[data-tone="error"] { border-color: #db9c8a; color: #813e2e; background: #fff4ef; }
.toast[popover] { inset: auto 16px 18px auto; margin: 0; }
@media (min-width: 1101px) and (max-width: 1350px) {
  .workspace { grid-template-columns: 250px minmax(280px, 1fr) 290px; }
  .topbar { gap: 12px; }
  .top-actions { gap: 5px; }
  .map-toolbar { flex-direction: column; align-items: flex-start; }
  .top-actions .baseline-chip { display: none; }
}
@media (max-width: 1100px) {
  .topbar { min-height: 0; padding: 10px 14px; gap: 8px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .top-actions { width: auto; justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
  .top-actions .baseline-chip { display: none; }
  .brand-block { width: auto; flex: 1; }
  h1 { font-size: 18px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .left-panel, .right-panel, .map-panel { display: none; min-height: 0; position: static; width: 100%; overflow: auto; flex: 1; order: 0; }
  body[data-tab="map"] .map-panel { display: flex; overflow: hidden; }
  body[data-tab="input"] .left-panel { display: block; }
  body[data-tab="detail"] .right-panel { display: block; }
  .canvas-frame { min-height: 100px; flex: 1 1 0; }
  .map-toolbar { flex-direction: row; padding: 10px 13px; }
  .mobile-nav { display: flex; padding-bottom: env(safe-area-inset-bottom, 0); background: #fff; border-top: 1px solid var(--line); }
  .mobile-nav button { flex: 1; min-height: 51px; border: 0; border-top: 2px solid transparent; background: white; color: var(--muted); font-size: 12px; }
  .mobile-nav .active { color: var(--teal-dark); border-top-color: var(--teal); background: #eef6f1; font-weight: 700; }
  .app-footer { flex-direction: row; align-items: center; min-height: 22px; padding: 4px 12px; font-size: 9px; gap: 8px; }
  #footerNotice { display: none; }
  .map-footer { padding: 8px 12px; min-height: 36px; }
  .map-tip { display: none; }
  .left-panel .summary-section { max-width: 700px; }
  .axis-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .reference-total { grid-column: 1/-1; }
  .data-status-strip { margin-bottom: 0; }
  .detail-panel, .event-panel { max-width: 780px; margin: auto; }
  .toast, .toast[popover] { bottom: 67px; }
}
@media (max-width: 600px) {
  .brand-block { flex-basis: 100%; min-width: 0; }
  .eyebrow { font-size: 9px; }
  .topbar .eyebrow { display: none; }
  .source-line { font-size: 10px; margin-top: 3px; max-width: 92vw; }
  .top-actions { flex-basis: 100%; }
  .top-actions .button { min-height: 32px; padding: 0 9px; font-size: 11px; }
  .top-actions .icon-button { min-height: 32px; height: 32px; }
  .map-title strong { font-size: 14px; }
  .map-toolbar { gap: 8px; }
  .map-tools { width: 100%; justify-content: space-between; }
  .map-subtitle { font-size: 10px; }
  .zoom-readout { min-width: 42px; }
  .legend { gap: 11px; }
  .axis-summary { display: block; }
  .data-status-strip { font-size: 9px; }
  .status-pills { gap: 3px; }
  .status-pill { font-size: 9px; }
  .field-label { font-size: 12px; }
  input, select, textarea { font-size: 16px; }
  .button { min-height: 40px; }
  .light-button { min-height: 34px; }
  .dialog-header h2 { font-size: 17px; }
  dialog, .wide-dialog { width: calc(100vw - 16px); max-height: 94dvh; padding: 16px; border-radius: 9px; }
  .dialog-actions { bottom: -16px; flex-wrap: wrap; }
  .dialog-actions .button { flex: 1; font-size: 12px; }
  .dialog-row { flex-wrap: wrap; }
  .dialog-row .select-control { max-width: 100%; flex: 1 1 140px; }
  .catalog-stats { gap: 6px; }
  .catalog-stats .metric { padding: 8px; }
  .catalog-stats .metric strong { font-size: 18px; }
  .parameter-row { grid-template-columns: 1fr; gap: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .parameter-row .field-label { margin-top: 7px; }
  .notice-bar, .connection-banner { font-size: 11px; padding: 6px 12px; }
  .notice-bar span { display: none; }
  .form-grid { gap: 10px 8px; }
  .batch-progress-grid { grid-template-columns: 1fr; gap: 9px; }
}
:root .drawing-conditions {
  margin-top: 14px;
  padding: 11px 12px;
  background: #fff9ec;
  border: 1px solid #e5d8b9;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}
.drawing-conditions summary { color: #795719; font-weight: 600; cursor: pointer; }
.drawing-conditions p { white-space: pre-line; overflow-wrap: anywhere; margin: 9px 0 0; }
.group-evidence-button { width: 100%; margin-top: 10px; white-space: normal; }
.evidence-ids { overflow-wrap: anywhere; font-size: 11px; }
