:root {
  color-scheme: dark;
  --bg: #090d18;
  --bg-elevated: #0d1322;
  --surface: #121a2d;
  --surface-strong: #18233a;
  --surface-muted: #0f1728;
  --field: #0b1323;
  --text: #f4f7ff;
  --text-soft: #b4c0d5;
  --text-dim: #77849c;
  --line: rgba(170, 191, 225, .15);
  --line-strong: rgba(170, 191, 225, .25);
  --accent: #8ca7ff;
  --accent-strong: #a9bcff;
  --accent-ink: #0b1230;
  --accent-veil: rgba(140, 167, 255, .14);
  --violet: #b394ff;
  --safe: #5dd9ab;
  --safe-veil: rgba(93, 217, 171, .12);
  --warn: #f8bc62;
  --warn-veil: rgba(248, 188, 98, .12);
  --danger: #ff8d98;
  --danger-veil: rgba(255, 141, 152, .12);
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-elevated: #f7f9fd;
  --surface: #ffffff;
  --surface-strong: #eef2fa;
  --surface-muted: #f8faff;
  --field: #ffffff;
  --text: #162039;
  --text-soft: #52627d;
  --text-dim: #7987a0;
  --line: rgba(48, 70, 113, .15);
  --line-strong: rgba(48, 70, 113, .26);
  --accent: #3c63df;
  --accent-strong: #274fc9;
  --accent-ink: #fff;
  --accent-veil: rgba(60, 99, 223, .1);
  --violet: #714cdd;
  --safe: #188b63;
  --safe-veil: rgba(24, 139, 99, .1);
  --warn: #a66000;
  --warn-veil: rgba(166, 96, 0, .1);
  --danger: #c54051;
  --danger-veil: rgba(197, 64, 81, .1);
  --shadow: 0 24px 70px rgba(31, 52, 95, .13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 10% -5%, rgba(104, 126, 255, .13), transparent 26rem),
    radial-gradient(circle at 95% 20%, rgba(157, 111, 255, .08), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select, input[type="checkbox"], input[type="radio"], input[type="range"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:not(:disabled), select, input[type="checkbox"], input[type="radio"], input[type="range"] { cursor: pointer; }
input, select { min-width: 0; }
input[type="text"], input[type="number"], input[type="datetime-local"], input[type="search"], select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: var(--text-dim); opacity: .8; }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-veil); outline: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 1.6vw, 1.75rem); line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 1.15rem; line-height: 1.2; }
h3 { margin-bottom: 0; font-size: .95rem; line-height: 1.25; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 0 auto; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 7px;
  border-radius: 11px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent-strong), var(--violet));
  box-shadow: 0 8px 18px rgba(77, 98, 209, .26);
}
.brand-mark i { display: block; width: 4px; border-radius: 6px; background: currentColor; }
.brand-mark i:nth-child(1) { height: 8px; opacity: .62; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; opacity: .8; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-copy strong { font-size: .84rem; letter-spacing: .12em; }
.brand-copy small { color: var(--text-dim); font-size: .59rem; font-weight: 700; letter-spacing: .16em; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--text-soft); font-size: .74rem; }
.pulse-dot { width: 7px; height: 7px; border-radius: 100%; background: var(--safe); box-shadow: 0 0 0 4px var(--safe-veil); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.select-wrap select { width: 58px; min-height: 44px; padding: 7px 9px; font-size: .76rem; font-weight: 750; letter-spacing: .07em; }

.button, .icon-button, .text-button {
  border: 0;
  background: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .83rem; font-weight: 700; white-space: nowrap; }
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line-strong); background: var(--surface-strong); }
.button.primary { border-color: transparent; color: var(--accent-ink); background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 8px 20px rgba(87, 112, 232, .21); }
.button.primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); box-shadow: 0 11px 26px rgba(87, 112, 232, .3); }
.button.ghost { color: var(--text-soft); background: var(--surface-muted); }
.button.small { min-height: 40px; padding: 7px 10px; font-size: .75rem; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft); background: var(--surface-muted); }
.theme-icon { font-size: 1.05rem; }
.text-button { padding: 3px 0; color: var(--accent-strong); font-size: .78rem; font-weight: 750; }
.text-button:hover:not(:disabled) { color: var(--text); }
.danger-text { color: var(--danger); }
.wide-button { width: 100%; }
.shortcut-hint { margin-left: 3px; padding: 1px 4px; border: 1px solid currentColor; border-radius: 4px; font-size: .58rem; font-weight: 800; opacity: .65; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 455px); flex: 1; min-height: 0; }
.stage-panel { min-width: 0; padding: clamp(20px, 3vw, 38px); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.stage-head, .inspector-title-row, .section-heading, .tool-section-heading, .queue-header, .map-topline, .privacy-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stage-head-actions { display: flex; align-items: center; gap: 6px; }
.eyebrow, .section-kicker { margin-bottom: 6px; color: var(--text-dim); font-size: .62rem; font-weight: 800; letter-spacing: .14em; }

.preview-stage {
  min-height: clamp(360px, 58vh, 720px);
  flex: 1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 87%, #263458 13%), var(--surface-muted));
  box-shadow: var(--shadow);
  isolation: isolate;
}
.preview-stage.is-dragging { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-veil), var(--shadow); }
.grid-glow { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(142, 163, 213, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(142, 163, 213, .045) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at center, #000, transparent 80%); z-index: -1; }
.empty-state { max-width: 390px; display: flex; flex-direction: column; align-items: center; padding: 32px; text-align: center; }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid var(--line-strong); border-radius: 19px; color: var(--accent-strong); background: var(--accent-veil); }
.empty-icon svg { width: 35px; height: 35px; }
.empty-state h2 { margin-bottom: 8px; font-size: 1.2rem; }
.empty-state p { margin-bottom: 19px; color: var(--text-soft); }
.empty-state .format-note { margin: 13px 0 0; color: var(--text-dim); font-size: .72rem; }
.image-canvas { width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; overflow: auto; }
.image-canvas img { display: block; max-width: 100%; max-height: min(70vh, 720px); object-fit: contain; border-radius: 8px; box-shadow: 0 20px 54px rgba(0, 0, 0, .32); transform-origin: center; transition: transform .18s ease, filter .14s linear; user-select: none; }
.drop-overlay { position: absolute; inset: 14px; display: none; place-content: center; gap: 7px; padding: 32px; border: 1px dashed var(--accent); border-radius: 17px; color: var(--accent-strong); background: color-mix(in srgb, var(--accent-veil) 86%, var(--surface) 14%); text-align: center; font-size: 1rem; backdrop-filter: blur(6px); }
.preview-stage.is-dragging .drop-overlay { display: grid; }
.drop-overlay-icon { font-size: 2rem; }
.image-badges { position: absolute; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.image-badge { padding: 5px 8px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 7px; color: #f1f4ff; background: rgba(5, 9, 18, .64); backdrop-filter: blur(12px); font-size: .68rem; font-weight: 750; }
.before-after { position: absolute; right: 16px; bottom: 16px; padding: 5px 8px; border-radius: 7px; color: var(--accent-ink); background: var(--accent); font-size: .66rem; font-weight: 800; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-action { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); background: var(--surface-muted); text-align: left; }
.quick-action:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.quick-action.privacy { border-color: color-mix(in srgb, var(--safe) 34%, var(--line)); background: color-mix(in srgb, var(--safe-veil) 52%, var(--surface-muted)); }
.quick-action-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--accent-strong); background: var(--accent-veil); }
.quick-action.privacy .quick-action-icon { color: var(--safe); background: var(--safe-veil); }
.quick-action span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.quick-action strong { font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-action small { color: var(--text-dim); font-size: .65rem; line-height: 1.3; }

.inspector { min-height: 0; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-elevated) 90%, transparent); }
.inspector-title-row { padding: 25px 26px 17px; }
.file-count { min-width: 30px; height: 26px; display: inline-grid; place-items: center; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-dim); font-size: .7rem; font-weight: 800; }
.tablist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tab-button { position: relative; min-height: 44px; padding: 8px 3px; border: 0; color: var(--text-dim); background: none; font-size: .75rem; font-weight: 750; }
.tab-button::after { position: absolute; right: 11px; bottom: -1px; left: 11px; height: 2px; content: ""; border-radius: 4px 4px 0 0; background: transparent; }
.tab-button:hover { color: var(--text-soft); }
.tab-button.is-active { color: var(--text); }
.tab-button.is-active::after { background: var(--accent); }
.tab-panels { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.tab-panel { min-height: 100%; padding: 22px 26px 28px; }
.tab-panel[hidden] { display: none; }
.no-image-card { min-height: 250px; display: grid; place-content: center; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-soft); text-align: center; }
.no-image-card h3 { margin-bottom: 7px; color: var(--text); }
.no-image-card p { max-width: 280px; margin-bottom: 0; font-size: .82rem; }
.no-image-symbol { margin-bottom: 12px; color: var(--accent); font-size: 2rem; }

.privacy-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, var(--surface-strong), var(--surface-muted)); }
.privacy-card-top { align-items: flex-start; }
.privacy-card h3 { font-size: 1rem; }
.privacy-score { min-width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent-strong); background: var(--accent-veil); font-size: .83rem; font-weight: 850; }
.privacy-card.is-safe .privacy-score { color: var(--safe); background: var(--safe-veil); border-color: color-mix(in srgb, var(--safe) 33%, transparent); }
.privacy-card.is-warn .privacy-score { color: var(--warn); background: var(--warn-veil); border-color: color-mix(in srgb, var(--warn) 33%, transparent); }
.privacy-card .muted { margin: 13px 0 0; }
.muted { color: var(--text-soft); font-size: .78rem; line-height: 1.52; }
.privacy-signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.signal { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--text-soft); background: rgba(0, 0, 0, .07); font-size: .65rem; font-weight: 700; }
.signal.has-data { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); color: var(--warn); background: var(--warn-veil); }
.signal.safe { border-color: color-mix(in srgb, var(--safe) 35%, var(--line)); color: var(--safe); background: var(--safe-veil); }
.section-block { padding-top: 23px; }
.section-heading { margin-bottom: 11px; }
.section-heading h3 { font-size: .9rem; }
.fact-list { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.fact-list div { min-width: 0; display: grid; grid-template-columns: minmax(90px, .68fr) minmax(0, 1.4fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fact-list dt { color: var(--text-dim); font-size: .71rem; }
.fact-list dd { min-width: 0; margin: 0; color: var(--text-soft); font-size: .75rem; overflow-wrap: anywhere; text-align: right; }
.export-summary { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.export-summary .section-heading { margin-bottom: 5px; }
.export-summary p { margin-bottom: 0; }
.location-overview { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--accent-veil) 43%, var(--surface-muted)), var(--surface-muted)); }
.location-overview .section-heading { align-items: flex-start; margin-bottom: 12px; }
.location-overview .section-kicker { margin-bottom: 4px; }
.location-summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--safe) 32%, var(--line)); border-radius: 10px; color: var(--text-soft); background: color-mix(in srgb, var(--safe-veil) 56%, var(--surface)); font-size: .75rem; font-variant-numeric: tabular-nums; }
.location-summary.is-empty { border-color: var(--line); color: var(--text-dim); background: var(--surface); }
.location-summary-icon { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; color: var(--safe); background: var(--safe-veil); font-size: .94rem; }
.location-summary.is-empty .location-summary-icon { color: var(--text-dim); background: var(--surface-strong); }
.location-export-status { margin-left: auto; padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-dim); background: var(--surface-muted); font-size: .56rem; font-weight: 800; letter-spacing: .03em; text-align: right; }
.location-export-status.is-removing { border-color: color-mix(in srgb, var(--warn) 37%, var(--line)); color: var(--warn); background: var(--warn-veil); }
.location-export-status[hidden] { display: none !important; }
.map-autoshow-toggle { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 11px; color: var(--text-soft); cursor: pointer; }
.map-autoshow-toggle input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.map-autoshow-toggle input:focus-visible + .toggle { outline: 3px solid rgba(140, 167, 255, .65); outline-offset: 3px; }
.map-autoshow-toggle input:checked + .toggle { background: var(--accent); }
.map-autoshow-toggle input:checked + .toggle::after { transform: translateX(11px); background: var(--accent-ink); }
.map-autoshow-toggle > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.map-autoshow-toggle strong { color: var(--text-soft); font-size: .68rem; }
.map-autoshow-toggle small { color: var(--text-dim); font-size: .61rem; line-height: 1.35; }
.overview-map-card { overflow: hidden; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.location-map-note { margin: 11px 0 0; color: var(--text-dim); font-size: .67rem; line-height: 1.45; }

.panel-toolbar { display: flex; gap: 9px; margin-bottom: 12px; }
.search-field { min-width: 0; flex: 1; position: relative; }
.search-field > span { position: absolute; top: 9px; left: 11px; z-index: 1; color: var(--text-dim); font-size: 1rem; pointer-events: none; }
.search-field input { padding-left: 31px; }
.panel-intro { margin: 0 0 16px; color: var(--text-dim); font-size: .73rem; line-height: 1.48; }
.metadata-list { display: grid; gap: 9px; }
.metadata-group { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.metadata-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: 9px 12px; cursor: pointer; color: var(--text-soft); font-size: .77rem; font-weight: 750; list-style: none; }
.metadata-group summary::-webkit-details-marker { display: none; }
.metadata-group summary::after { content: "+"; color: var(--text-dim); font-size: 1rem; transition: transform .16s ease; }
.metadata-group[open] summary { border-bottom: 1px solid var(--line); }
.metadata-group[open] summary::after { transform: rotate(45deg); }
.metadata-group .count { color: var(--text-dim); font-size: .65rem; font-weight: 700; }
.metadata-entries { padding: 0 12px; }
.metadata-entry { display: grid; grid-template-columns: minmax(95px, .8fr) minmax(0, 1.4fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.metadata-entry:last-child { border-bottom: 0; }
.metadata-entry dt { color: var(--text-dim); font-size: .67rem; overflow-wrap: anywhere; }
.metadata-entry dd { margin: 0; color: var(--text-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .66rem; overflow-wrap: anywhere; text-align: right; }
.metadata-empty { padding: 34px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--text-dim); text-align: center; font-size: .77rem; }

.tool-section { padding: 23px 0; border-top: 1px solid var(--line); }
.tool-section:first-child { padding-top: 0; border-top: 0; }
.tool-section.no-top-padding { padding-top: 0; }
.tool-section-heading { align-items: flex-start; margin-bottom: 7px; }
.tool-section-heading h3 { font-size: .93rem; }
.tool-section-heading .section-kicker { margin-bottom: 4px; }
.jpeg-capability { margin-top: 2px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); background: var(--surface-muted); font-size: .61rem; font-weight: 800; letter-spacing: .06em; }
.jpeg-capability.is-enabled { border-color: color-mix(in srgb, var(--safe) 40%, var(--line)); color: var(--safe); background: var(--safe-veil); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid.compact-grid { gap: 11px; }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: var(--text-soft); font-size: .78rem; font-weight: 650; }
.field.wide { grid-column: 1 / -1; }
.field > span { display: flex; justify-content: space-between; gap: 6px; }
.field output, .range-field output { color: var(--text-dim); font-variant-numeric: tabular-nums; font-weight: 700; }
.map-topline { min-height: 42px; padding: 9px 11px; color: var(--text-dim); font-size: .75rem; }
#map { height: 220px; background: linear-gradient(135deg, var(--surface-strong), var(--surface-muted)); }
.map-provider { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-dim); font-size: .58rem; font-weight: 800; letter-spacing: .05em; }
.maplibregl-map { font-family: var(--sans); }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--line) !important; border-radius: 8px !important; box-shadow: 0 5px 14px rgba(0, 0, 0, .2) !important; }
.maplibregl-ctrl-group button { width: 28px; height: 28px; background-color: var(--surface) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-icon { filter: var(--map-control-filter, none); }
:root:not(.light) { --map-control-filter: invert(1) brightness(1.5); }
.maplibregl-ctrl-attrib { max-width: 200px; padding: 1px 4px !important; color: var(--text-dim) !important; background: color-mix(in srgb, var(--surface) 82%, transparent) !important; font-size: 8px !important; }
.maplibregl-ctrl-attrib a { color: var(--text-soft) !important; }
.location-editor-note { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-dim); background: var(--surface-muted); font-size: .67rem; line-height: 1.4; }
.location-editor-note > span:nth-child(2) { min-width: 0; flex: 1; }
.location-editor-note > span:first-child { color: var(--accent-strong); font-size: .95rem; }
.range-stack { display: grid; gap: 14px; }
.range-field { display: grid; gap: 7px; color: var(--text-soft); font-size: .78rem; font-weight: 650; }
.range-field > span { display: flex; justify-content: space-between; }

.choice-group { display: grid; gap: 9px; padding: 0; margin: 0; border: 0; }
.choice-card { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text-soft); background: var(--surface-muted); transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.choice-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.choice-card:has(input:checked), .choice-card.is-selected { border-color: var(--accent); background: var(--accent-veil); }
.choice-card input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.choice-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-strong); background: color-mix(in srgb, var(--accent-veil) 65%, var(--surface)); }
.privacy-icon { color: var(--safe); background: var(--safe-veil); }
.choice-card span:last-child { display: flex; flex-direction: column; gap: 2px; }
.choice-card strong { font-size: .75rem; }
.choice-card small { color: var(--text-dim); font-size: .66rem; line-height: 1.35; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.toggle-row { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.toggle-row input, .switch-label input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.toggle { width: 26px; height: 15px; position: relative; display: block; border-radius: 100px; background: var(--line-strong); transition: background .18s ease; }
.toggle::after { width: 11px; height: 11px; position: absolute; top: 2px; left: 2px; content: ""; border-radius: 50%; background: var(--text-dim); transition: transform .18s ease, background .18s ease; }
.toggle-row input:checked + .toggle { background: var(--accent); }
.toggle-row input:checked + .toggle::after { transform: translateX(11px); background: var(--accent-ink); }
.toggle-row > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.toggle-row strong { overflow: hidden; color: var(--text-soft); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.toggle-row small { overflow: hidden; color: var(--text-dim); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--text-soft); font-size: .72rem; }
.switch-label { display: inline-flex; align-items: center; cursor: pointer; }
.switch { width: 35px; height: 20px; position: relative; display: block; border-radius: 20px; background: var(--line-strong); transition: background .18s ease; }
.switch::after { width: 14px; height: 14px; position: absolute; top: 3px; left: 3px; content: ""; border-radius: 50%; background: var(--text-dim); transition: transform .18s ease, background .18s ease; }
.switch-label input:checked + .switch { background: var(--accent); }
.switch-label input:checked + .switch::after { transform: translateX(15px); background: var(--accent-ink); }
.qr-options { margin-top: 13px; }

.inspector-footer { padding: 13px 26px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-elevated) 94%, transparent); }
.inspector-footer p { margin: 0 0 9px; color: var(--text-dim); font-size: .67rem; }

.queue-bar { border-top: 1px solid var(--line); padding: 15px clamp(18px, 3vw, 42px) 17px; background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); }
.queue-header { align-items: flex-end; }
.queue-header .eyebrow { margin-bottom: 3px; }
.queue-header h2 { font-size: .9rem; }
.queue-actions { display: flex; align-items: center; gap: 8px; }
.queue-actions .text-button { min-height: 44px; display: inline-flex; align-items: center; }
.queue-actions .button { min-height: 44px; }
.queue-list { display: flex; gap: 10px; min-height: 76px; margin-top: 10px; overflow-x: auto; padding: 1px 1px 5px; scrollbar-color: var(--line-strong) transparent; }
.queue-empty { margin: auto 0; color: var(--text-dim); font-size: .75rem; }
.queue-item { width: 160px; min-width: 160px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; color: var(--text-soft); background: var(--surface-muted); }
.queue-item:hover { border-color: var(--line-strong); }
.queue-item.is-active { border-color: var(--accent); background: var(--accent-veil); }
.queue-select { width: 100%; min-height: 62px; display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 42px 7px 7px; border: 0; border-radius: inherit; color: inherit; background: transparent; text-align: left; }
.queue-select:hover { background: color-mix(in srgb, var(--surface-strong) 46%, transparent); }
.queue-thumbnail { width: 48px; height: 48px; overflow: hidden; display: grid; place-items: center; border-radius: 7px; color: var(--text-dim); background: var(--surface-strong); font-size: .62rem; font-weight: 800; }
.queue-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.queue-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-right: 12px; }
.queue-file-copy strong, .queue-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-file-copy strong { font-size: .67rem; }
.queue-file-copy small { color: var(--text-dim); font-size: .61rem; }
.queue-remove { width: 44px; height: 44px; position: absolute; top: 0; right: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 10px 0 10px; color: var(--text-dim); background: transparent; font-size: 1.15rem; line-height: 1; }
.queue-remove:hover { color: var(--danger); background: var(--danger-veil); }
.queue-status { position: absolute; right: 5px; bottom: 5px; padding: 2px 4px; border-radius: 4px; color: var(--safe); background: var(--safe-veil); font-size: .52rem; font-weight: 800; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; max-width: min(390px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: color-mix(in srgb, var(--surface-strong) 94%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(13px); font-size: .75rem; animation: toast-in .2s ease-out; }
.toast.success { border-color: color-mix(in srgb, var(--safe) 45%, var(--line)); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.toast-icon { color: var(--accent-strong); font-weight: 900; }
.toast.success .toast-icon { color: var(--safe); }
.toast.error .toast-icon { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(335px, 390px); }
  .stage-panel { padding: 24px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action { padding: 10px 12px; }
  .quick-action small { display: none; }
}

@media (max-width: 850px) {
  .topbar { min-height: 64px; gap: 12px; padding: 10px 16px; }
  .privacy-pill { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .stage-panel { min-height: auto; padding: 20px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-stage { min-height: min(63vh, 620px); }
  .image-canvas img { max-height: 56vh; }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-action { flex-direction: column; align-items: flex-start; gap: 7px; }
  .inspector { min-height: 670px; }
  .tab-panels { max-height: none; overflow: visible; }
  .queue-bar { padding: 15px 16px 17px; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .topbar { gap: 8px; }
  .brand-copy { display: none; }
  .brand-mark { width: 34px; }
  .top-actions { margin-left: auto; gap: 6px; }
  .select-wrap select { width: 58px; min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .top-actions .button { min-width: 44px; min-height: 44px; padding: 8px 10px; }
  .top-actions .button > span:last-child { display: none; }
  .stage-panel { gap: 14px; }
  .stage-head { align-items: flex-start; }
  .stage-head-actions { gap: 3px; }
  .stage-head-actions .button { padding: 6px 7px; }
  .stage-head-actions .button:not(#zoomReset) { min-width: 32px; font-size: 0; }
  .stage-head-actions .button:not(#zoomReset)::first-letter { font-size: .78rem; }
  .preview-stage { min-height: 360px; border-radius: 18px; }
  .empty-state { padding: 24px 15px; }
  .empty-state h2 { font-size: 1.05rem; }
  .empty-state p { font-size: .82rem; }
  .image-canvas { padding: 10px; }
  .image-canvas img { max-height: 48vh; }
  .image-badges { bottom: 10px; left: 10px; max-width: calc(100% - 20px); }
  .before-after { right: 10px; bottom: 10px; max-width: 154px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .quick-actions { grid-template-columns: 1fr; gap: 8px; }
  .quick-action { flex-direction: row; }
  .quick-action small { display: block; }
  .inspector-title-row { padding: 20px 16px 14px; }
  .tablist { padding: 0 9px; }
  .tab-button { min-height: 44px; padding: 7px 1px; font-size: .75rem; }
  .tab-button::after { right: 5px; left: 5px; }
  .tab-panel { padding: 18px 16px 24px; }
  .inspector-footer { padding: 11px 16px 14px; }
  .form-grid, .toggle-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .metadata-entry, .fact-list div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .metadata-entry dd, .fact-list dd { text-align: left; }
  .queue-header { align-items: center; }
  .queue-actions { gap: 9px; }
  .queue-actions .button { min-height: 44px; padding: 6px 9px; }
  .queue-list { min-height: 70px; }
  .queue-item { width: 150px; min-width: 150px; }
  .toast-region { right: 12px; bottom: 12px; max-width: calc(100vw - 24px); }
}

@media (max-width: 380px) {
  .top-actions .select-wrap { display: none; }
  .stage-head-actions #zoomReset { display: none; }
  .queue-actions .text-button { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
