@import url('/shared/theme.css');

:root {
  /* Glass-panel look, viewer-specific -- derived from the shared surface
     token (recomputes automatically under [data-theme="dark"]) rather than
     hardcoded per-theme, since no other app needs this translucency. */
  --panel: color-mix(in srgb, var(--surface) 90%, transparent);
  --glass: blur(18px) saturate(1.25);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--vignette-highlight), transparent 18%),
    linear-gradient(90deg, var(--vignette-shadow), transparent 32%, var(--vignette-shadow-soft));
  z-index: 1;
}

canvas {
  position: fixed;
  inset: 0;
  outline: none;
  z-index: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body.annotation-placement canvas {
  cursor: crosshair;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

#app-shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.side-panel {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 14px;
  width: min(360px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  transition: transform 220ms ease, opacity 220ms ease;
}

body.panel-collapsed .side-panel {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
}

.panel-header {
  min-height: 72px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 5%, transparent), transparent);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--on-accent-soft);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 24%, transparent);
}

.brand-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.panel-body {
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.panel-section {
  padding: 13px 0 14px;
  border-bottom: 1px solid var(--border);
}

.panel-section:first-child { padding-top: 0; }
.panel-section:last-child { border-bottom: 0; }

.section-heading {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.input-row {
  display: flex;
  gap: 8px;
}

.url-input,
.select-input,
.share-field {
  width: 100%;
  min-width: 0;
  height: 38px;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  outline: none;
}

.url-input:focus,
.select-input:focus,
.share-field:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.select-input option {
  color: var(--text);
  background: var(--surface);
}

.share-field {
  font-family: var(--font-mono);
  font-size: 11px;
}

.primary-btn,
.mini-btn,
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-btn {
  padding: 0 12px;
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  border-color: transparent;
}

.mini-btn {
  padding: 0 10px;
  color: var(--text-muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.tool-btn {
  width: 42px;
  height: 42px;
  color: var(--text-muted-strong);
  position: relative;
}

.primary-btn:hover,
.mini-btn:hover,
.tool-btn:hover {
  transform: translateY(-1px);
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.primary-btn:hover {
  background: color-mix(in srgb, var(--accent) 85%, black);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--text-muted-strong);
  background: transparent;
  border-radius: var(--radius);
}

.icon-btn:hover { background: var(--surface-soft); color: var(--text); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-softer);
}

.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-value {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.control-row {
  display: grid;
  grid-template-columns: minmax(58px, 72px) 1fr minmax(48px, 58px);
  align-items: center;
  gap: 9px;
  margin-top: 10px;
}

.control-row label {
  color: var(--text-muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.range-value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--fixed-light);
  box-shadow: 0 2px 10px var(--drop-shadow);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--fixed-light);
}

.toggle-row,
.select-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted-strong);
  font-size: 12px;
  font-weight: 650;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted-strong);
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + span {
  background: color-mix(in srgb, var(--accent) 44%, transparent);
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
}

.switch input:checked + span::after {
  transform: translateX(18px);
  background: var(--fixed-light);
}

.hint-list {
  display: grid;
  gap: 7px;
  margin-top: 2px;
}

.hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.hint strong {
  color: var(--text-muted-strong);
  font-weight: 650;
}

.floating-top {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  z-index: 3;
}

body:not(.panel-collapsed) #show-panel {
  display: none;
}

.capture-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
  pointer-events: auto;
  font-size: 13px;
  color: var(--text);
}

.capture-bar .primary-btn {
  height: 32px;
  padding: 0 14px;
  white-space: nowrap;
}

.capture-bar-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.capture-done-icon {
  width: 20px;
  height: 20px;
  color: var(--status-ok);
  flex: 0 0 auto;
}

#capture-done-countdown {
  opacity: 0.75;
  font-weight: 600;
}

#install-app {
  position: absolute;
  right: 14px;
  top: 66px;
  z-index: 4;
  display: none;
  pointer-events: auto;
  padding: 0 14px;
}

#install-app.visible { display: inline-flex; }

#VRButton, #ARButton {
  bottom: 14px !important;
  transform: none !important;
  z-index: 12 !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
}

#VRButton, #ARButton {
  right: 14px !important;
  left: auto !important;
}

/* Stacked above VRButton, both right-anchored -- the left edge is occupied
   by .side-panel (full viewport height), so ARButton can't mirror there
   without sitting behind it. Both buttons can be present at once when the
   device/browser supports both session types. */
#ARButton {
  bottom: 64px !important;
}

/* SuperSplat-style overlay toolbar: no bounding card, individual buttons
   carry their own translucent chrome, and the whole row fades out after a
   period of no pointer activity (initToolbarAutoHide() in viewer.js) rather
   than sitting permanently opaque over the splat. */
.bottom-toolbar {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 0);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  max-width: calc(100vw - 28px);
  pointer-events: auto;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  transition: opacity 280ms ease, transform 280ms ease;
}

body.toolbar-hidden .bottom-toolbar {
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
}

.bottom-toolbar .tool-btn {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-color: color-mix(in srgb, var(--border) 55%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
}

.bottom-toolbar .tool-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.toolbar-divider {
  width: 1px;
  height: 26px;
  margin: 0 2px;
  background: color-mix(in srgb, var(--border) 55%, transparent);
  flex: 0 0 auto;
}

.toolbar-group {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in srgb, var(--surface-softer) 55%, transparent);
  backdrop-filter: var(--glass);
}

.toolbar-group .tool-btn {
  width: 36px;
  height: 36px;
}

.mode-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.tool-btn.active {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-soft));
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--text);
}

.tool-btn::before {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: max-content;
  padding: 5px 8px;
  color: var(--tooltip-text);
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.tool-btn:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: min(440px, calc(100vw - 28px));
  padding: 10px 13px;
  color: var(--text);
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--accent) 20%, var(--surface)));
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 28%), var(--bg);
  transition: opacity 280ms ease;
}

.loader-card {
  width: min(340px, calc(100vw - 36px));
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass);
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 820ms linear infinite;
}

.loader-title {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
}

.loader-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.loader-progress {
  margin-top: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  place-items: center;
  padding: 18px;
  pointer-events: auto;
  background: var(--scrim);
  backdrop-filter: blur(10px);
}

.modal-backdrop.visible { display: grid; }

.modal {
  width: min(520px, 100%);
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
}

.modal-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.modal-stack {
  display: grid;
  gap: 12px;
}

.qr-box {
  width: 232px;
  min-height: 232px;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: 16px;
  background: var(--fixed-light);
  border-radius: var(--radius);
}

.qr-box canvas {
  position: static;
  width: 200px !important;
  height: 200px !important;
  z-index: auto;
}

.qr-box img {
  width: 200px;
  height: 200px;
  display: block;
}

.annotation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Info panel popover content -- reuses .scan-info/.stat-grid patterns already
   defined for the side panel so the two surfaces read consistently. */
.info-section-heading {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.info-hotspot-list {
  display: grid;
  gap: 6px;
}

.info-hotspot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-softer);
  font-size: 12px;
  color: var(--text-muted-strong);
}

.info-hotspot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* Help overlay: scrollable, config-driven control reference with a
   Desktop/Touch tab toggle (§5 of the toolbar addendum). */
.help-modal {
  width: min(560px, 100%);
  max-height: min(680px, 86vh);
  display: flex;
  flex-direction: column;
}

.help-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}

.help-tab {
  flex: 1 1 0;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.help-tab.active {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.help-content {
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
}

.help-group-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.help-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.help-row:last-child { border-bottom: 0; }

.help-row span { color: var(--text-muted); }

.help-row strong {
  color: var(--text);
  font-weight: 650;
  text-align: right;
}

.annotation-manager {
  display: grid;
  gap: 10px;
}

.annotation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.annotation-list {
  display: grid;
  gap: 8px;
  min-height: 48px;
}

.annotation-empty {
  padding: 12px 8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
}

.annotation-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  color: var(--text);
  background: var(--surface-softer);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.annotation-item button {
  color: inherit;
  background: transparent;
}

.annotation-dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--on-accent-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.annotation-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

.annotation-sub {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.annotation-delete {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-muted);
}

.annotation-delete:hover {
  color: var(--danger);
  background: var(--surface-soft);
}

.annotation-import {
  display: none;
}

.annotation-form-grid {
  display: grid;
  gap: 12px;
}

.field-label {
  display: grid;
  gap: 7px;
  color: var(--text-muted-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-label input,
.field-label textarea {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.annotation-textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  outline: none;
  font: inherit;
  line-height: 1.45;
}

.annotation-textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field-help {
  margin-top: -5px;
  color: var(--text-muted);
  font-size: 12px;
}

.field-help code {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.annotation-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.swatch-row,
.icon-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch-btn,
.icon-choice {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted-strong);
}

.swatch-btn {
  border-color: color-mix(in srgb, var(--fixed-light) 70%, transparent);
}

.swatch-btn.active,
.icon-choice.active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-choice {
  border-radius: var(--radius);
}

.annotation-link-grid {
  display: grid;
  gap: 8px;
}

.annotation-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 4px -16px -16px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .annotation-options { grid-template-columns: 1fr; }
  .annotation-actions { grid-template-columns: 1fr; }
}

.error-state {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.error-card {
  max-width: 620px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.error-card h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.error-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.error-card .error-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .side-panel {
    top: 10px;
    left: 10px;
    bottom: 86px;
    width: calc(100vw - 20px);
  }

  .bottom-toolbar {
    bottom: 12px;
    max-width: calc(100vw - 20px);
    justify-content: center;
  }

  .tool-btn {
    width: 39px;
    height: 39px;
  }

  .toolbar-group .tool-btn {
    width: 34px;
    height: 34px;
  }

  .floating-top { top: 10px; left: 10px; }
  #install-app {
    top: auto;
    right: 10px;
    bottom: 72px;
  }
  body.panel-collapsed .side-panel { transform: translateY(calc(-100% - 24px)); }
}

/* --- Additions for the client-delivery redesign --- */

/* Scan info panel (project/room/accuracy declaration) shown for server-backed scans. */
.scan-info { display: grid; gap: 6px; }
.scan-info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.scan-info-row span:first-child { color: var(--text-muted); }
.scan-info-row span:last-child { color: var(--text-muted-strong); font-weight: 650; text-align: right; }
.accuracy-note {
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-softer);
  color: var(--text-muted-strong);
  font-size: 12px;
  line-height: 1.45;
}

.hidden { display: none !important; }

/* Elements only relevant when annotations are locally editable (local-file / ?url= modes). */
.editable-only { display: none; }
body.annotations-editable .editable-only { display: revert; }
body.annotations-editable .annotation-actions { display: grid; }

/* Elements only relevant on the curated public sample gallery landing experience. */
.landing-only { display: none; }
body.landing-mode .landing-only { display: revert; }

.sample-picker-list { display: grid; gap: 6px; }

.sample-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-btn.active {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  color: var(--text);
}

.admin-link {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-link:hover { color: var(--text-muted-strong); }

.gallery-error-notice {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.gallery-error-message {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 13px;
}

/* Anonymous local-file drop zone (no token, no server involvement — file never leaves the device). */
.drop-zone {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.drop-card {
  width: min(480px, 100%);
  padding: 28px;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-card.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  color: var(--accent);
}

.drop-card h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.drop-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 13px;
}

.drop-card .privacy-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

.drop-file-input { display: none; }
