:root {
  --ink: #172027;
  --muted: #69757d;
  --line: #d9e0e3;
  --panel: #ffffff;
  --soft: #f3f6f5;
  --green: #1c7253;
  --green-dark: #14543e;
  --teal: #39a586;
  --yellow: #e1b43b;
  --blue: #357db5;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}

/* Data operations workspace */
.management-page { background: #f4f6f5; color: #17211d; min-height: 100vh; }
.management-main { max-width: 1540px; margin: 0 auto; padding: 24px; display: grid; gap: 16px; }
.ops-band { background: #fff; border: 1px solid #dce3df; border-radius: 6px; padding: 18px 20px; min-width: 0; }
.ops-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ops-heading h1, .section-title h2 { margin: 0; letter-spacing: 0; }
.ops-heading h1 { font-size: 22px; }
.section-title h2 { font-size: 16px; }
.ops-heading p, .section-title span { margin: 4px 0 0; color: #6b7771; font-size: 13px; }
.ops-metrics { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 1px; margin-top: 18px; background: #dde4e0; border: 1px solid #dde4e0; }
.ops-metrics > div { background: #f8faf9; padding: 13px 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ops-metrics strong { font-size: 22px; color: #176b50; }
.ops-metrics span { color: #59665f; font-size: 12px; }
.split-band { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; }
.import-pane, .access-pane { min-width: 0; }
.import-form, .grant-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 15px; }
.grant-form { grid-template-columns: 1.2fr 1fr .8fr auto; }
.import-form label, .grant-form label { display: grid; gap: 5px; min-width: 0; color: #526058; font-size: 12px; }
.import-form input, .grant-form select { width: 100%; height: 38px; border: 1px solid #cbd5d0; border-radius: 4px; background: #fff; padding: 0 10px; font: inherit; }
.import-form input[type="file"] { padding: 7px; font-size: 12px; }
.command-button, .table-action { border: 1px solid #bdcbc4; background: #fff; color: #28483b; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.command-button { height: 38px; padding: 0 14px; font-weight: 650; }
.command-button.primary, .table-action.primary { background: #176b50; color: #fff; border-color: #176b50; }
.command-button:disabled, .table-action:disabled { cursor: default; opacity: .5; }
.command-button svg, .table-action svg { width: 15px; height: 15px; }
.grant-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 25px; }
.grant-list span { border: 1px solid #d2ddd7; padding: 4px 7px; border-radius: 4px; background: #f6f9f7; font-size: 12px; }
.table-scroll { overflow-x: auto; margin-top: 14px; }
.ops-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 13px; }
.ops-table th { color: #68756e; background: #f5f7f6; font-size: 11px; text-align: left; font-weight: 700; white-space: nowrap; }
.ops-table th, .ops-table td { padding: 10px 11px; border-bottom: 1px solid #e5eae7; vertical-align: middle; }
.ops-table td strong { display: block; font-size: 13px; }
.ops-table td small { display: block; color: #849089; margin-top: 2px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 190px; }
.table-action { min-height: 30px; padding: 0 8px; font-size: 11px; }
.status-pill { display: inline-flex; padding: 3px 7px; border-radius: 4px; background: #edf1ef; color: #56635c; white-space: nowrap; }
.status-pill.published, .status-pill.succeeded { color: #176b50; background: #e5f3ed; }
.status-pill.private { color: #865718; background: #fff3df; }
.status-pill.ready, .status-pill.running { color: #1d5d86; background: #e8f3fa; }
.status-pill.failed { color: #9a3333; background: #fbeaea; }
.backup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 14px; }
.backup-list > div { border-left: 3px solid #3c8a6d; background: #f5f8f6; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.backup-list small { grid-column: 1 / -1; color: #748078; }
@media (max-width: 1050px) {
  .ops-metrics { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .split-band { grid-template-columns: 1fr; }
  .import-form, .grant-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .management-main { padding: 10px; }
  .ops-band { padding: 14px; }
  .ops-metrics, .import-form, .grant-form { grid-template-columns: 1fr; }
  .workspace-tabs { overflow-x: auto; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
button, input { font: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }

.topbar, .workspace-header {
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 800;
  border-radius: 6px;
}

.brand-mark.small { width: 34px; height: 34px; }
.brand-copy { display: flex; flex-direction: column; margin-left: 12px; line-height: 1.35; }
.brand-copy span, .workspace-title span { color: var(--muted); font-size: 12px; }
.system-state { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.system-state i, .map-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.signin-page { background: var(--soft); min-height: 100vh; }
.signin-layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .75fr); }
.map-preview { position: relative; overflow: hidden; background: #dfe9e4; min-height: 560px; }
.map-grid { position: absolute; inset: 0; opacity: .38; background-image: linear-gradient(#8aa99b 1px, transparent 1px), linear-gradient(90deg, #8aa99b 1px, transparent 1px); background-size: 58px 58px; transform: rotate(-8deg) scale(1.2); }
.map-preview::before { content: ""; position: absolute; inset: 12% 11% 19% 12%; background: #f7faf8; border: 2px solid #adc3b8; clip-path: polygon(12% 3%, 39% 8%, 47% 19%, 64% 17%, 89% 36%, 82% 58%, 69% 63%, 54% 94%, 30% 82%, 22% 60%, 5% 48%); box-shadow: 0 18px 50px rgba(24, 59, 43, .14); }
.map-preview::after { content: ""; position: absolute; inset: 21% 21% 28% 24%; border: 1px solid #b9cac2; clip-path: polygon(0 19%, 44% 0, 100% 28%, 76% 100%, 17% 75%); }
.region { position: absolute; z-index: 2; color: #668175; font-size: 13px; font-weight: 600; }
.region-north { top: 23%; right: 24%; }
.region-east { top: 53%; right: 27%; }
.region-west { top: 46%; left: 25%; }
.sample-dot { position: absolute; z-index: 3; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 2px 8px rgba(0,0,0,.24); }
.dot-1 { top: 28%; right: 31%; } .dot-2 { top: 43%; left: 39%; background: var(--yellow); } .dot-3 { top: 58%; right: 34%; background: var(--blue); } .dot-4 { top: 65%; left: 31%; }
.map-caption { position: absolute; z-index: 4; left: 32px; bottom: 28px; background: rgba(255,255,255,.92); border-left: 4px solid var(--green); padding: 12px 16px; display: flex; flex-direction: column; box-shadow: 0 8px 26px rgba(25, 50, 40, .12); }
.map-caption span { color: var(--muted); font-size: 12px; margin-bottom: 3px; }

.signin-panel { background: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 12vh clamp(32px, 5vw, 72px) 30px; }
.signin-content { width: min(100%, 400px); margin: 0 auto; }
.eyebrow { color: var(--green); font-weight: 700; font-size: 13px; margin: 0 0 12px; }
.signin-content h1 { font-size: 32px; letter-spacing: 0; margin: 0 0 12px; }
.intro { color: var(--muted); margin: 0 0 30px; }
.primary-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 12px; color: white; background: var(--green); text-decoration: none; border-radius: 5px; font-weight: 700; box-shadow: 0 5px 14px rgba(28, 114, 83, .18); }
.primary-button:hover { background: var(--green-dark); }
.button-icon { font-size: 20px; }
.setup-status { display: flex; gap: 12px; padding: 16px; border: 1px solid #e2c875; background: #fffbed; border-radius: 5px; }
.setup-status div { display: flex; flex-direction: column; gap: 4px; }
.setup-status span { color: var(--muted); font-size: 13px; }
.status-icon { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #fff; font-weight: 800; }
.trust-row { display: flex; gap: 10px; margin-top: 24px; }
.trust-row span { border: 1px solid var(--line); color: var(--muted); padding: 5px 8px; font-size: 11px; border-radius: 3px; }
.signin-panel footer { color: #96a0a5; font-size: 12px; text-align: center; }

.workspace-page { height: 100vh; height: 100dvh; overflow: hidden; background: var(--soft); }
.workspace-header { padding: 0 16px; }
.workspace-title { margin-left: 10px; display: flex; flex-direction: column; min-width: 174px; }
.workspace-tabs { display: flex; height: 100%; margin-left: 24px; }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 0 18px; color: var(--muted); display: flex; align-items: center; text-decoration: none; }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #d9ebe4; color: var(--green-dark); font-weight: 800; }
.user-name { font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; }
.workspace-main { height: calc(100vh - 64px); height: calc(100dvh - 64px); display: grid; grid-template-columns: 270px minmax(320px, 1fr) 350px; }
.layer-panel, .detail-panel { background: #fff; z-index: 2; }
.layer-panel { border-right: 1px solid var(--line); }
.dataset-picker { padding: 12px 14px 0; }
.dataset-picker label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.dataset-picker select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); padding: 0 30px 0 10px; font-size: 12px; outline: none; }
.dataset-picker select:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(28, 114, 83, .12); }
.imagery-controls { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 8px; margin: 10px 0 12px; }
.imagery-controls label { min-width: 0; margin: 0; }
.imagery-controls label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.imagery-controls select { height: 34px; padding-left: 8px; font-size: 11px; }
.detail-panel { border-left: 1px solid var(--line); display: grid; place-items: center; }
.panel-heading { height: 54px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.search-box { margin: 14px; height: 38px; border: 1px solid var(--line); background: var(--soft); display: flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 4px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.layer-list { border-top: 1px solid var(--line); }
.layer-item { display: grid; grid-template-columns: 18px 14px 1fr; gap: 9px; align-items: center; padding: 14px; border-bottom: 1px solid #edf0f1; font-size: 13px; }
.layer-item > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.layer-item small { color: var(--muted); }
.layer-swatch.point { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.layer-swatch.imagery { width: 12px; height: 12px; background: #477b91; border: 2px solid #d7b65a; }
.layer-swatch.polygon { width: 12px; height: 12px; background: rgba(53,125,181,.25); border: 2px solid var(--blue); }
.panel-note { margin: 16px 14px; border-left: 3px solid var(--teal); background: var(--soft); padding: 11px; display: flex; flex-direction: column; gap: 4px; }
.panel-note strong { font-size: 12px; }
.panel-note span { font-size: 11px; color: var(--muted); line-height: 1.55; }
.quality-filter { border-bottom: 1px solid var(--line); padding: 10px 14px 12px; }
.filter-heading { min-height: 28px; display: flex; align-items: center; justify-content: space-between; }
.filter-heading strong { font-size: 12px; }
.filter-heading button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 11px; }
.quality-filter > label { min-height: 32px; display: grid; grid-template-columns: 18px 10px 1fr auto; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; }
.quality-filter input { width: 15px; height: 15px; accent-color: var(--green); }
.quality-filter small { color: var(--muted); font-variant-numeric: tabular-nums; }
.quality-dot { width: 8px; height: 8px; border-radius: 50%; }
.quality-dot.draft { background: #87939a; }
.quality-dot.confirmed { background: #357db5; }
.quality-dot.verified { background: #1c7253; }
.map-shell { position: relative; min-width: 0; }
.map-canvas { width: 100%; height: 100%; background: #dde5e1; }
.map-toolbar { position: absolute; z-index: 3; top: 14px; right: 14px; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.tool-button { width: 38px; height: 38px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.tool-button.active { color: var(--green); font-weight: 800; }
.map-status { position: absolute; z-index: 3; left: 14px; bottom: 12px; display: flex; gap: 14px; background: rgba(255,255,255,.92); padding: 7px 10px; color: var(--muted); font-size: 11px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.map-status span { display: flex; align-items: center; gap: 6px; }
.map-status .error { color: #9a3b36; }
.empty-detail { width: 210px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--muted); }
.empty-detail strong { color: var(--ink); font-size: 14px; }
.empty-detail span { font-size: 12px; line-height: 1.6; }
.empty-symbol { width: 44px; height: 44px; display: grid; place-items: center; border: 1px dashed #aeb9bd; border-radius: 50%; font-size: 20px; }
.sample-detail { width: 100%; height: 100%; overflow-y: auto; }
.sample-detail header { min-height: 72px; padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.sample-detail header span { color: var(--muted); font-size: 11px; }
.sample-detail header strong { overflow-wrap: anywhere; font-size: 14px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid #edf0f1; }
.detail-badges span, .quality-badge { padding: 4px 7px; border: 1px solid #ced8dc; border-radius: 3px; background: #f5f7f7; color: #53616a; font-size: 10px; }
.detail-badges .draft, .quality-badge.draft { border-color: #cdd3d6; background: #f1f3f4; color: #59656c; }
.detail-badges .confirmed, .quality-badge.confirmed { border-color: #bbd5e7; background: #edf5fa; color: #2d678f; }
.detail-badges .verified, .quality-badge.verified { border-color: #b9d9cd; background: #eaf4f0; color: var(--green-dark); }
.sample-detail dl { margin: 0; }
.sample-detail dl > div { padding: 13px 16px; border-bottom: 1px solid #edf0f1; }
.sample-detail dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.sample-detail dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.detail-photos { padding-bottom: 16px; border-bottom: 1px solid #edf0f1; }
.detail-section-heading { height: 42px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.detail-section-heading strong { font-size: 12px; }
.detail-section-heading span { color: var(--muted); font-size: 10px; }
.detail-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 16px; }
.detail-photo-grid button { aspect-ratio: 4 / 3; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #e5ebe8; cursor: zoom-in; }
.detail-photo-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-photo-empty { padding: 14px 16px; color: var(--muted); font-size: 11px; }
.vi-panel { padding-bottom: 13px; border-bottom: 1px solid #edf0f1; }
.vi-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 16px 8px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.vi-tabs button { height: 28px; border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; cursor: pointer; }
.vi-tabs button:last-child { border-right: 0; }
.vi-tabs button.active { background: #eaf4f0; color: var(--green-dark); font-weight: 700; }
.vi-chart-wrap { height: 150px; margin: 0 12px; }
.vi-chart-wrap canvas { width: 100%; height: 100%; display: block; }
.vi-status { min-height: 18px; padding: 6px 16px 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.workspace-mobile-nav, .mobile-panel-backdrop { display: none; }
.photo-lightbox { width: min(1120px, calc(100vw - 40px)); height: min(820px, calc(100vh - 40px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: #11191c; color: #fff; }
.photo-lightbox::backdrop { background: rgba(8, 13, 15, .86); }
.photo-lightbox figure { width: 100%; height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) 44px; }
.photo-lightbox figure img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-lightbox figcaption { display: flex; align-items: center; justify-content: center; padding: 0 70px; color: #dce4e6; background: #172125; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-close, .lightbox-nav { position: absolute; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; background: rgba(12,18,20,.78); color: #fff; cursor: pointer; }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-nav.previous { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-nav:disabled { visibility: hidden; }
.photo-lightbox svg { width: 21px; height: 21px; }

.review-page { height: 100vh; overflow: hidden; background: #eef2f1; }
.review-page svg { width: 18px; height: 18px; }
.review-main { height: calc(100vh - 64px); display: grid; grid-template-rows: 60px 68px minmax(0, 1fr); }
.review-toolbar { padding: 0 18px; display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); }
.field.compact { display: grid; grid-template-columns: auto minmax(220px, 360px); align-items: center; gap: 9px; }
.field.inline-filter { display: grid; grid-template-columns: auto 126px; align-items: center; gap: 7px; }
.field select, .field textarea, .field input { width: 100%; border: 1px solid #cbd4d7; border-radius: 4px; background: #fff; color: var(--ink); outline: none; }
.field select { height: 40px; padding: 0 34px 0 10px; }
.field input { height: 40px; padding: 0 10px; }
.field textarea { padding: 9px 10px; resize: vertical; min-height: 82px; line-height: 1.5; }
.field select:focus, .field textarea:focus, .field input:focus, .queue-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px rgba(28, 114, 83, .12); }
.queue-search { height: 40px; width: min(340px, 30vw); display: flex; align-items: center; gap: 8px; border: 1px solid #cbd4d7; border-radius: 4px; padding: 0 10px; }
.queue-search svg { color: var(--muted); flex: 0 0 auto; }
.queue-search input { width: 100%; min-width: 0; border: 0; outline: 0; }
.review-progress { margin-left: auto; display: flex; align-items: baseline; gap: 7px; }
.review-progress strong { color: #a85b21; font-size: 22px; }
.review-progress span { color: var(--muted); font-size: 12px; }

.metric-band { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); background: #f8faf9; border-bottom: 1px solid var(--line); padding: 0 18px; }
.metric-band > div { display: flex; justify-content: center; flex-direction: column; gap: 3px; padding-left: 18px; border-left: 1px solid #e1e6e5; }
.metric-band > div:first-child { border-left: 0; padding-left: 0; }
.metric-band span { color: var(--muted); font-size: 11px; }
.metric-band strong { font-size: 19px; }
.metric-band .metric-warning strong { color: #a85b21; }

.review-layout { min-height: 0; display: grid; grid-template-columns: 320px minmax(440px, 1fr) 350px; }
.review-queue, .sample-review, .decision-panel { min-height: 0; background: #fff; }
.review-queue { border-right: 1px solid var(--line); display: grid; grid-template-rows: 54px minmax(0, 1fr); }
.sample-review { min-width: 0; overflow-y: auto; }
.decision-panel { border-left: 1px solid var(--line); overflow-y: auto; }
.section-heading { min-height: 54px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.section-heading > div { display: flex; align-items: baseline; gap: 8px; }
.section-heading span { color: var(--muted); font-size: 11px; }
.review-groups { overflow-y: auto; }
.review-group { width: 100%; min-height: 82px; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 82px 12px 14px; border: 0; border-bottom: 1px solid #edf0f1; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.review-group:hover { background: #f6f9f8; }
.review-group.active { background: #eaf4f0; box-shadow: inset 3px 0 var(--green); }
.review-group strong { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.review-group span, .review-group small { color: var(--muted); font-size: 11px; }
.review-group b { position: absolute; top: 16px; right: 14px; min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 12px; background: #f0e1ca; color: #91521e; font-size: 11px; }
.review-group .quality-list-badge { width: auto; min-width: 48px; padding: 0 7px; border-radius: 3px; }
.review-group .quality-list-badge.draft { background: #e9edef; color: #59656c; }
.review-group .quality-list-badge.confirmed { background: #dcecf6; color: #2d678f; }
.review-group .quality-list-badge.verified { background: #dcefe8; color: var(--green-dark); }
.queue-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; color: var(--muted); }
.queue-empty[hidden] { display: none; }
.queue-empty svg { width: 34px; height: 34px; color: var(--green); }

.sample-heading { position: sticky; z-index: 3; top: 0; min-height: 58px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fff; }
.sample-heading > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sample-heading span { color: var(--muted); font-size: 11px; }
.sample-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sample-nav { display: flex; gap: 6px; }
.icon-button { display: grid; place-items: center; }
.icon-button svg { pointer-events: none; }
.photo-stage { position: relative; height: clamp(280px, 46vh, 620px); min-height: 220px; display: grid; place-items: center; overflow: hidden; background: #151d1f; }
.photo-stage > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; object-position: center; cursor: zoom-in; }
.photo-resize-handle { width: 100%; height: 20px; padding: 0; display: grid; place-items: center; border: 0; border-top: 1px solid #344043; border-bottom: 1px solid var(--line); border-radius: 0; background: #eef2f1; color: #667478; cursor: ns-resize; touch-action: none; }
.photo-resize-handle:hover, .photo-resize-handle:focus-visible { background: #e1e8e5; color: var(--green); outline: none; }
.photo-resize-handle svg { width: 18px; height: 18px; pointer-events: none; }
.photo-resize-handle[hidden] { display: none; }
body.photo-resizing { cursor: ns-resize; user-select: none; }
.photo-original { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 4px; background: rgba(12,18,20,.78); color: #fff; }
.photo-original[hidden] { display: none; }
.photo-quality { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 120px); padding: 5px 8px; border-radius: 3px; background: rgba(12,18,20,.76); color: #fff; font-size: 11px; }
.photo-quality.warning { background: rgba(143,78,30,.9); }
.photo-quality[hidden] { display: none; }
.photo-empty { display: flex; flex-direction: column; align-items: center; gap: 9px; color: #aebabc; font-size: 12px; }
.photo-empty svg { width: 32px; height: 32px; }
.photo-counter { position: absolute; right: 12px; bottom: 10px; padding: 5px 8px; background: rgba(12, 18, 20, .76); color: #fff; font-size: 11px; border-radius: 3px; }
.photo-strip { min-height: 0; display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.photo-strip:empty { display: none; }
.photo-strip button { width: 56px; height: 44px; flex: 0 0 56px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 3px; background: #dfe5e3; cursor: pointer; }
.photo-strip button.active { border-color: var(--green); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }
.review-satellite { padding: 14px 16px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f9f8; }
.review-satellite-heading, .review-vi-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-satellite-heading { margin-bottom: 10px; }
.review-satellite-heading > div, .review-vi-heading > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.review-satellite-heading strong, .review-vi-heading strong { font-size: 13px; }
.review-satellite-heading span, .review-vi-heading span { color: var(--muted); font-size: 10px; }
.review-imagery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review-s2-figure { min-width: 0; margin: 0; border: 1px solid var(--line); background: #fff; }
.review-s2-figure figcaption { height: 34px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-s2-figure figcaption strong { font-size: 11px; }
.review-s2-figure figcaption span { color: var(--muted); font-size: 9px; }
.review-s2-image { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-top: 1px solid var(--line); background: #dfe7e4; color: var(--muted); text-decoration: none; }
.review-s2-image > span { padding: 12px; text-align: center; font-size: 10px; }
.review-s2-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.review-s2-center { position: absolute; z-index: 2; top: 50%; left: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); display: none; border: 1.5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.75); pointer-events: none; }
.review-s2-image.loaded .review-s2-center { display: block; }
.review-s2-center::before, .review-s2-center::after { content: ""; position: absolute; top: 50%; left: 50%; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.8); transform: translate(-50%, -50%); }
.review-s2-center::before { width: 18px; height: 1px; }
.review-s2-center::after { width: 1px; height: 18px; }
.review-vi-block { margin-top: 14px; border: 1px solid var(--line); background: #fff; }
.review-vi-heading { min-height: 38px; padding-left: 10px; border-bottom: 1px solid var(--line); }
.review-vi-heading .vi-tabs { align-self: stretch; margin: 0; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; }
.review-vi-chart { height: 170px; padding: 8px 8px 0; }
.review-vi-chart canvas { width: 100%; height: 100%; display: block; }
.review-vi-status { min-height: 28px; margin: 0; padding: 5px 10px 8px; color: var(--muted); font-size: 10px; }
.sample-metadata { margin: 0; padding: 12px 16px 15px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; background: #fff; }
.sample-metadata > div { min-width: 0; }
.sample-metadata dt { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.sample-metadata dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }

.decision-panel form { padding: 16px; display: flex; flex-direction: column; gap: 17px; }
.choice-field { margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.choice-field > small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.segmented-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #cbd4d7; border-radius: 4px; overflow: hidden; }
.segmented-choice.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented-choice label { min-width: 0; }
.segmented-choice input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-choice span { min-height: 40px; display: grid; place-items: center; padding: 5px; border-left: 1px solid #cbd4d7; background: #fff; color: #53616a; text-align: center; font-size: 11px; cursor: pointer; }
.segmented-choice label:first-child span { border-left: 0; }
.segmented-choice input:checked + span { background: var(--green); color: #fff; font-weight: 700; }
.segmented-choice input:focus-visible + span { box-shadow: inset 0 0 0 2px #e1b43b; }
.source-label-block { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px; border-left: 3px solid var(--yellow); background: #fbf8ef; }
.source-label-block span, .source-label-block small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.source-label-block strong { overflow-wrap: anywhere; font-size: 15px; }
.classification-field { display: grid; gap: 10px; padding: 0; border: 0; }
.classification-field legend { margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.classification-field .field { gap: 5px; }
.duplicate-alert { border: 1px solid #dca968; background: #fffaf1; }
.duplicate-alert > header { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; color: #8a4e19; border-bottom: 1px solid #ecd7b9; }
.duplicate-alert > header svg { width: 16px; height: 16px; }
.duplicate-alert > header strong { font-size: 12px; }
.duplicate-alert > header span { margin-left: auto; color: var(--muted); font-size: 10px; }
.duplicate-items { max-height: 190px; overflow-y: auto; }
.duplicate-item { padding: 8px 10px; border-bottom: 1px solid #f1e4d1; }
.duplicate-item:last-child { border-bottom: 0; }
.duplicate-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.duplicate-item strong { overflow-wrap: anywhere; font-size: 11px; }
.duplicate-item b { flex: none; color: #9a5a20; font-size: 10px; font-weight: 600; }
.duplicate-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.recommendation { display: flex; gap: 8px; align-items: flex-start; color: #2d678f; background: #edf5fa; border: 1px solid #c9deeb; padding: 9px 10px; font-size: 11px; line-height: 1.45; }
.recommendation svg { flex: 0 0 16px; width: 16px; height: 16px; }
.check-row { display: grid; grid-template-columns: 17px 1fr; align-items: start; gap: 8px; color: var(--ink); font-size: 12px; line-height: 1.45; }
.check-row input { width: 16px; height: 16px; accent-color: var(--green); }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#save-quality { grid-column: 1 / -1; }
.approve-button, .reject-button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 4px; cursor: pointer; font-weight: 700; font-size: 12px; }
.approve-button { border: 1px solid var(--green); background: var(--green); color: #fff; }
.approve-button:hover { background: var(--green-dark); }
.reject-button { border: 1px solid #c9d0d2; background: #fff; color: #9a3b36; }
.reject-button:hover { border-color: #b7625d; background: #fff7f6; }
.permission-note { margin: 0 16px 16px; padding: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: min(420px, calc(100vw - 36px)); padding: 11px 14px; border-radius: 4px; background: #153e31; color: #fff; box-shadow: 0 7px 22px rgba(15, 38, 30, .24); font-size: 13px; }
.toast.error { background: #913d38; }

@media (max-width: 1120px) {
  .review-layout { grid-template-columns: 250px minmax(390px, 1fr) 290px; }
  .sample-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .review-page { height: auto; overflow: auto; }
  .review-main { height: auto; min-height: calc(100vh - 64px); grid-template-rows: auto auto auto; }
  .review-toolbar { min-height: 66px; flex-wrap: wrap; padding: 10px 14px; }
  .field.compact { flex: 1 1 260px; }
  .queue-search { flex: 1 1 220px; width: auto; }
  .review-progress { display: none; }
  .metric-band { min-height: 68px; overflow-x: auto; grid-template-columns: repeat(5, minmax(110px, 1fr)); }
  .review-layout { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(440px, 1.25fr); grid-template-areas: "queue sample" "decision decision"; }
  .review-queue { grid-area: queue; height: 660px; }
  .sample-review { grid-area: sample; height: 660px; }
  .decision-panel { grid-area: decision; border-left: 0; border-top: 1px solid var(--line); }
  .decision-panel form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .decision-panel .source-label-block, .decision-panel .duplicate-alert,
  .decision-panel .classification-field, .decision-panel .decision-actions { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .review-main { display: block; }
  .review-toolbar { display: grid; grid-template-columns: 1fr; }
  .field.compact { display: flex; }
  .metric-band { padding: 0 12px; }
  .review-layout { display: flex; flex-direction: column; }
  .review-queue { height: 330px; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .sample-review { height: auto; flex: none; overflow-y: visible; }
  .photo-stage { height: clamp(300px, 52vh, 560px); }
  .decision-panel form { display: flex; }
  .sample-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.message-page { min-height: 100vh; display: grid; place-items: center; background: var(--soft); padding: 24px; }
.message-box { max-width: 440px; background: #fff; border: 1px solid var(--line); padding: 34px; text-align: center; border-radius: 6px; }
.message-box .status-icon { margin: 0 auto; }
.message-box h1 { font-size: 23px; margin: 16px 0 8px; }
.message-box p { color: var(--muted); line-height: 1.6; }
.message-box a { color: var(--green); }

@media (max-width: 900px) {
  .signin-layout { grid-template-columns: 1fr; }
  .map-preview { min-height: 38vh; }
  .signin-panel { padding: 44px 28px 24px; min-height: calc(62vh - 64px); }
  .signin-panel footer { margin-top: 44px; }
  .workspace-main { position: relative; display: block; }
  .map-shell { width: 100%; height: 100%; }
  .layer-panel, .detail-panel {
    display: none;
    position: absolute;
    z-index: 12;
    top: 54px;
    bottom: 0;
    width: min(86vw, 350px);
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(15, 31, 36, .2);
  }
  .layer-panel { left: 0; }
  .detail-panel { right: 0; }
  .workspace-main[data-mobile-view="layers"] .layer-panel { display: block; }
  .workspace-main[data-mobile-view="detail"] .detail-panel { display: grid; }
  .mobile-panel-backdrop {
    position: absolute;
    z-index: 11;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(16, 29, 34, .26);
    cursor: pointer;
  }
  .workspace-main[data-mobile-view="layers"] .mobile-panel-backdrop,
  .workspace-main[data-mobile-view="detail"] .mobile-panel-backdrop { display: block; }
  .workspace-mobile-nav {
    position: absolute;
    z-index: 14;
    top: 8px;
    left: 50%;
    width: min(280px, calc(100% - 110px));
    height: 40px;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
  }
  .workspace-mobile-nav button, .workspace-mobile-nav a {
    min-width: 0;
    border: 0;
    background: #fff;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    cursor: pointer;
    text-decoration: none;
  }
  .workspace-mobile-nav button.active { color: var(--green); font-weight: 700; }
  .workspace-mobile-nav svg { width: 16px; height: 16px; }
  .map-status { bottom: 12px; max-width: calc(100% - 28px); overflow: hidden; }
  .map-status span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-tabs { display: none; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 14px; }
  .brand-copy span, .system-state { display: none; }
  .map-preview { min-height: 34vh; }
  .signin-content h1 { font-size: 27px; }
  .workspace-title span, .user-name { display: none; }
  .workspace-title { min-width: 0; }
  .workspace-main { display: block; }
  .map-toolbar { top: 10px; right: 10px; }
  .map-status { left: 10px; gap: 8px; }
}
