/* Homokdomb bemutató: the console's look (homokdomb/ui/static/style.css) for one job: show a dune, never where it is. */
:root {
  color-scheme: light dark;
  --ochre: #C8A04B; --ochre-deep: #A8742C; --ochre-soft: #F1E6C8;
  --loam: #2B2118; --chalk: #F6F1E7; --moss: #5A7A4B; --brick: #B5452E; --muted: #7A6E60;
  --bg: #F6F1E7; --surface: #FBF8F1; --surface-2: #ECE4D3; --surface-3: #E3D8C2;
  --text: #2B2118; --text-2: #7A6E60; --line: #2B2118; --line-soft: #D6CAB1;
  --grid: rgba(43, 33, 24, .045); --rule: rgba(181, 69, 46, .5);
  --r-sm: 2px; --r: 4px; --r-lg: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1); --t: 150ms;
  --font: 'IBM Plex Sans', system-ui, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --shadow: 0 1px 0 rgba(43, 33, 24, .06), 0 10px 30px rgba(43, 33, 24, .10);
  --rail: 232px;
  --detail: 372px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110C; --surface: #1F1812; --surface-2: #2A2118; --surface-3: #33291E;
    --text: #F1E9DA; --text-2: #B1A38C; --line: #6B5B45; --line-soft: #3F3428; --grid: rgba(241, 233, 218, .035);
    --ochre-soft: #3A2E1A; --rule: rgba(214, 110, 86, .55); --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 30px rgba(0,0,0,.45);
  }
}
*, *::before, *::after { box-sizing: border-box; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ochre-deep); outline-offset: 2px; }
input:focus-visible { outline-offset: -2px; }
::-moz-focus-inner { border: 0; }
html { -webkit-tap-highlight-color: transparent; accent-color: var(--ochre); }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); font-feature-settings: "tnum" 1; }
.mono, .num, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--text-2); font-size: 12.5px; }
.grow { flex: 1; }
[hidden] { display: none !important; }
kbd { font-size: 10.5px; border: 1px solid var(--line-soft); border-bottom-width: 2px; border-radius: var(--r-sm); padding: 0 5px; color: var(--text-2); background: var(--surface); white-space: nowrap; font-weight: 400; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; height: 100dvh; }
.rail {
  display: flex; flex-direction: column; gap: 14px; padding: 18px 12px 14px; border-right: 1px solid var(--line); min-height: 0;
  background: var(--surface);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
}
.wordmark { display: flex; gap: 10px; align-items: center; padding: 2px 8px 12px; border-bottom: 1px solid var(--line-soft); }
.wordmark svg { width: 30px; height: 30px; color: var(--text); flex: none; }
.wordmark b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.wordmark small { display: block; color: var(--text-2); font-size: 12px; }
.rail-g { display: flex; align-items: center; justify-content: space-between; font: 600 10.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); padding: 0 8px; }
.rail-n { font: 500 11.5px var(--mono); letter-spacing: 0; padding: 0 7px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--ochre-soft); color: var(--text); }
.sites { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; }
.site {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; align-items: center; padding: 7px 10px;
  border-radius: var(--r); border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.site:hover { background: var(--surface-2); }
.site:active { transform: translateY(1px); }
.site[aria-selected="true"] { background: var(--bg); border-color: var(--line); }
.site[aria-selected="true"]::before { content: ""; position: absolute; left: -13px; top: 8px; bottom: 8px; width: 3px; background: var(--ochre); border-radius: 0 2px 2px 0; }
.site .k { font: 600 13px var(--mono); grid-row: span 2; }
.site .v { font: 500 12.5px var(--mono); text-align: right; }
.site i { display: block; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.site em { display: block; height: 100%; background: var(--ochre); }
.rail-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 8px 0; border-top: 1px solid var(--line-soft); }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); }
.sum b { font: 600 14px var(--mono); color: var(--text); }
.hidden-loc { display: grid; gap: 6px; font-size: 12.5px; }
.redact { display: block; height: 10px; width: 120px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--text) 0 22px, transparent 22px 26px, var(--text) 26px 40px, transparent 40px 44px); }
.hint { font-size: 11.5px; color: var(--text-2); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); gap: 16px; align-items: center;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.tb-l { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tb-r { display: flex; gap: 8px; justify-self: end; }
.topbar h1 { font: 700 22px var(--font); min-width: 64px; }
.search {
  display: flex; align-items: center; gap: 8px; width: 340px; max-width: 100%; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--text-2); cursor: text; transition: background var(--t) var(--ease);
}
.search:hover { background: var(--surface-2); }
.search svg { flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: 14px var(--font); }
.search input:focus-visible { outline: none; }
.search:focus-within { box-shadow: inset 0 -3px 0 var(--ochre); }
.search input::placeholder { color: var(--text-2); }
.search input::-webkit-search-cancel-button { display: none; }

.scope { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.scope-b { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font: 600 13px var(--font); cursor: pointer; transition: background var(--t) var(--ease); white-space: nowrap; }
.scope-b + .scope-b { border-left: 1px solid var(--line); }
.scope-b:hover { background: var(--surface-2); }
.scope-b:disabled { opacity: .45; cursor: not-allowed; }
.scope-b[aria-selected="true"] { background: var(--loam); color: var(--chalk); }
.scope-b[aria-selected="true"] kbd { background: transparent; color: var(--chalk); border-color: rgba(246, 241, 231, .35); }
@media (prefers-color-scheme: dark) { .scope-b[aria-selected="true"] { background: var(--ochre); color: var(--loam); } .scope-b[aria-selected="true"] kbd { color: var(--loam); border-color: rgba(43, 33, 24, .35); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); color: var(--text); font: 600 13px var(--font); cursor: pointer; white-space: nowrap;
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.btn:hover { transform: translateY(-1px); background: var(--surface-2); }
.btn:active { transform: translateY(0); }
.btn.ghost { border-color: var(--line-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* ---------------------------------------------------------------- content */
.content { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--detail); gap: 16px; padding: 20px 24px 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; min-height: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-h h2 { font-size: 15px; font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; margin: 0; }

.viewer { display: flex; flex-direction: column; animation: fade 180ms var(--ease); }
.stage {
  flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r);
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
}
.frame { position: relative; width: min(100cqw - 24px, (100cqh - 24px) * 1.6); aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms var(--ease); }
.frame img.loading { opacity: 0; }
.frame svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity var(--t) var(--ease); }
.frame.no-outline svg { opacity: 0; }
.o-under { fill: none; stroke: rgba(20, 15, 10, .55); stroke-width: 6; stroke-linejoin: round; }
.o-line { fill: rgba(200, 160, 75, .14); stroke: var(--ochre); stroke-width: 2.6; stroke-linejoin: round; }
.scale { position: absolute; left: 12px; bottom: 12px; width: var(--w); display: grid; gap: 4px; font: 500 11px var(--mono); color: #F6F1E7; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.scale i { display: block; height: 7px; border: 2px solid #F6F1E7; border-top: 0; box-shadow: 0 1px 0 rgba(0,0,0,.5), inset 0 -1px 0 rgba(0,0,0,.5); }
.north { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; display: grid; place-items: center; font: 600 11px var(--mono); color: var(--loam); background: rgba(246, 241, 231, .88); border: 1px solid var(--loam); border-radius: 50%; }
.cap { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.cap b { color: var(--text); font-weight: 600; }

/* detail: the console's candidate panel */
.detail { overflow: auto; position: relative; padding-left: 22px; }
.detail::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 14px; width: 1px; background: var(--rule); }
.detail > * { animation: fade 180ms var(--ease) backwards; }
.d-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d-id { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.d-sub { color: var(--text-2); font-size: 13px; }
.vol { margin: 12px 0; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.vol b, .facts b { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.vol span { display: block; font: 600 22px var(--mono); margin: 3px 0 2px; }
.vol small { display: block; font-size: 11.5px; color: var(--text-2); line-height: 1.4; }
.agree { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: var(--r); padding: 8px 12px; margin-bottom: 12px; }
.agree strong { font: 600 18px var(--mono); }
.agree .grow { font-size: 13px; color: var(--text-2); }
.cells { display: flex; gap: 3px; }
.cells i { width: 14px; height: 18px; border: 1px solid var(--loam); border-radius: 2px; background: var(--surface); }
.cells i.on { background: var(--ochre); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
.pill.ok { border-color: var(--moss); }
.pill.ok::before { background: var(--moss); }
.pill.ai { border-color: #0E8FA3; }
.pill.ai::before { background: #22D3EE; box-shadow: 0 0 0 1px #06222A; }
.ai-box { border: 1px solid #0E8FA3; border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; background: color-mix(in srgb, #0E8FA3 6%, var(--surface)); }
.ai-box .ai-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ai-box .ai-h b { display: block; font-size: 13.5px; }
.ai-box .ai-h small { display: block; font-size: 12px; color: var(--text-2); }
.ai-n { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); border: 1px solid var(--loam); background: #22D3EE; color: #06222A; font: 600 12.5px var(--mono); }
.ai-box p { font-size: 13px; margin-top: 6px; }
.ai-box .ai-r b { font-weight: 600; }
.ai-box .ai-was { font-size: 12px; color: var(--text-2); padding-top: 6px; border-top: 1px solid var(--line-soft); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.facts div { background: var(--surface); padding: 7px 9px; min-width: 0; }
.facts span { font: 14px var(--mono); }
.facts .wide { grid-column: 1 / -1; }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.thumbs button { all: unset; cursor: pointer; display: block; }
.thumbs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface-2); transition: transform var(--t) var(--ease), border-color var(--t) var(--ease); }
.thumbs button:hover img { transform: translateY(-1px); }
.thumbs button[aria-pressed="true"] img { border-color: var(--line); box-shadow: inset 0 -3px 0 var(--ochre); outline: 2px solid var(--ochre); outline-offset: -2px; }
.thumbs button:focus-visible img { outline: 2px solid var(--ochre-deep); outline-offset: 2px; }
.thumbs span { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-top: 3px; }
.thumbs button:disabled { cursor: not-allowed; opacity: .5; }
.expl { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.expl li { padding: 6px 0 6px 14px; border-top: 1px solid var(--line-soft); position: relative; }
.expl li::before { content: ""; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; background: var(--ochre); border-radius: 1px; }

/* full size */
.lb { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.lb-scrim { position: absolute; inset: 0; background: rgb(0 0 0 / 62%); animation: fadein 150ms var(--ease); }
.lb-panel { position: relative; width: calc(100vw - 48px); height: calc(100dvh - 48px); display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow), 0 24px 64px rgba(0, 0, 0, .32); animation: rise 180ms var(--ease); }
.lb-bar { display: flex; align-items: center; gap: 10px; }
.lb-bar strong { font-size: 18px; }
.lb-stage { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.lb-stage .frame { cursor: default; }

@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  :root { --detail: 320px; }
  .topbar { grid-template-columns: 1fr auto; }
  .search { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); height: auto; }
  .rail, .main { min-width: 0; }
  .topbar { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .tb-r { justify-self: stretch; }
  .tb-r .btn { flex: 1; }
  .content { padding: 12px 16px 16px; }
  .stage { container-type: inline-size; padding: 8px; }
  .frame { width: 100%; }
  .scope-b kbd, .check kbd, [data-full] kbd { display: none; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .sites { flex-direction: row; overflow-x: auto; }
  .site { grid-template-columns: auto; min-width: 92px; }
  .site[aria-selected="true"]::before { display: none; }
  .content { grid-template-columns: 1fr; }
  .tb-l { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
