/* Landmark Tour - warm stone and slate; light and dark. */
:root {
  --bg: #f6f2ea;
  --card: #fffdf8;
  --ink: #23201b;
  --muted: #6d665b;
  --line: #e3dccf;
  --accent: #b4532a;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6dc;
  --ok: #2f7a4f;
  --ok-soft: #e3f2e8;
  --warn: #a6620b;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --info: #3c5f8a;
  --info-soft: #e5edf7;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 20px rgba(40, 30, 10, .06);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #16140f;
  --card: #201d17;
  --ink: #efe9de;
  --muted: #a79f91;
  --line: #3a352c;
  --accent: #e48a5c;
  --accent-ink: #1d1209;
  --accent-soft: #3b2619;
  --ok: #78c995;
  --ok-soft: #1d3326;
  --warn: #e6b25f;
  --warn-soft: #3a2e17;
  --bad: #f08a80;
  --info: #93b5e0;
  --info-soft: #1d2a3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.note { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand h1 { font-size: 1.15rem; }
.tagline { margin: 0; color: var(--muted); font-size: .85rem; }
.session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-link { font-size: .85rem; text-decoration: none; color: var(--muted); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); }
.credits { font-variant-numeric: tabular-nums; font-size: .9rem; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); }

/* buttons */
.btn {
  font: inherit; font-size: .95rem; cursor: pointer; border-radius: 10px; padding: 8px 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 40px;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); color: var(--accent-ink); }
.btn.quiet { background: transparent; }
.btn.small { font-size: .85rem; padding: 5px 10px; min-height: 34px; }
.btn.tiny { font-size: .78rem; padding: 2px 8px; min-height: 28px; }
.btn.big { font-size: 1.05rem; padding: 12px 20px; width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn:focus-visible, .drop:focus-visible, .example:focus-visible, .h-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* layout */
.layout {
  max-width: 1120px; margin: 0 auto; padding: 18px 16px 8px;
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 18px; align-items: start;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.ask { grid-column: 1; }
.col-main { grid-column: 2; display: grid; gap: 18px; min-width: 0; align-content: start; }
.intro h2 { font: 600 1.35rem Georgia, serif; }
.how { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.result { display: grid; gap: 14px; }
.ask h2 { font-size: 1.25rem; }
.sub { margin: .3rem 0 1rem; color: var(--muted); font-size: .92rem; }
.label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
input[type="text"], select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); min-height: 42px;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* photo drop */
.drop {
  position: relative; border: 2px dashed var(--line); border-radius: 12px; background: var(--bg);
  min-height: 170px; display: grid; place-items: center; cursor: pointer; overflow: hidden; transition: border-color .15s;
}
.drop.drag, .drop:hover { border-color: var(--accent); }
.drop.has-photo { border-style: solid; min-height: 0; }
.drop-empty { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 18px; color: var(--muted); }
.drop-empty svg { width: 40px; height: 40px; color: var(--accent); }
.drop-empty strong { color: var(--ink); }
.drop-empty span { font-size: .85rem; }
.preview { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #0002; }
.photo-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.photo-bar .note { margin: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; margin-top: 8px; color: var(--muted); }
.check input { margin-top: 4px; accent-color: var(--accent); }

.opt-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: end; margin-top: 4px; }
.seg-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg-pick legend { font-weight: 600; font-size: .9rem; margin: 14px 0 6px; padding: 0; }
.pills { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pills label { position: relative; }
.pills input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pills span { display: block; padding: 9px 12px; font-size: .9rem; white-space: nowrap; min-height: 42px; }
.pills input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.actions { margin-top: 16px; }
.meter { font-size: .88rem; color: var(--muted); min-height: 1.3em; margin: .5rem 0 0; }
.gate {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px;
  border-radius: 10px; background: var(--accent-soft); font-size: .88rem;
}
.gate span { flex: 1 1 200px; }

/* examples */
.examples { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.examples h3 { font-size: .95rem; margin-bottom: 8px; }
.example-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.example {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 0; overflow: hidden; text-align: left; display: grid; grid-template-rows: 64px auto;
}
.example:hover { border-color: var(--accent); }
.example img, .ex-typed { width: 100%; height: 64px; object-fit: cover; display: block; }
.ex-typed { display: grid; place-items: center; font: 600 1.4rem Georgia, serif; color: var(--accent); background: var(--accent-soft); }
.ex-label { font-size: .76rem; padding: 5px 7px; line-height: 1.25; }

/* progress */
.pg-head { display: flex; justify-content: space-between; font-weight: 600; }
.pg-clock { font-variant-numeric: tabular-nums; color: var(--muted); }
.pg-steps { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.pg-steps li { padding-left: 26px; position: relative; color: var(--muted); font-size: .92rem; }
.pg-steps li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); }
.pg-steps li.done { color: var(--ink); }
.pg-steps li.done::before { background: var(--ok); border-color: var(--ok); }
.pg-steps li.now { color: var(--ink); font-weight: 600; }
.pg-steps li.now::before { border-color: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { background: var(--accent); } }

/* identification */
.id-row { display: flex; gap: 16px; align-items: flex-start; }
.id-photo { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; flex: none; border: 1px solid var(--line); }
.id-main { min-width: 0; }
.eyebrow { margin: 0 0 2px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.id-name { font: 600 1.6rem/1.2 Georgia, "Times New Roman", serif; }
.id-where { margin: 4px 0 8px; color: var(--muted); }
.id-map { display: inline-block; margin: 0 0 8px; font-size: .9em; }
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.conf-bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.conf-bars i { width: 5px; border-radius: 2px; background: currentColor; opacity: .25; }
.conf-bars i:nth-child(1) { height: 6px; } .conf-bars i:nth-child(2) { height: 9px; } .conf-bars i:nth-child(3) { height: 12px; } .conf-bars i:nth-child(4) { height: 15px; }
.conf-bars i.on { opacity: 1; }
.conf-high { background: var(--ok-soft); color: var(--ok); }
.conf-medium { background: var(--info-soft); color: var(--info); }
.conf-low { background: var(--warn-soft); color: var(--warn); }
.conf-none { background: var(--accent-soft); color: var(--bad); }
.mini-h { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.clues ul { margin: 0; padding-left: 20px; font-size: .92rem; }
.unsure, .ask-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: .92rem; }
.ask-box { background: var(--info-soft); }
.alt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.alt-text { min-width: 0; }
.partial { margin-top: 10px; color: var(--warn); font-weight: 600; font-size: .9rem; }

/* checks */
.checks h3, .verify h3, .again h3, .player h3 { font-size: 1rem; }
.flag-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.flag { padding: 7px 10px 7px 30px; border-radius: 8px; font-size: .9rem; position: relative; }
.flag::before { position: absolute; left: 10px; top: 7px; font-weight: 700; }
.flag.ok { background: var(--ok-soft); } .flag.ok::before { content: "\2713"; color: var(--ok); }
.flag.warn { background: var(--warn-soft); } .flag.warn::before { content: "!"; color: var(--warn); }
.flag.info { background: var(--info-soft); } .flag.info::before { content: "i"; color: var(--info); }

/* player */
.player-head { display: flex; justify-content: space-between; align-items: baseline; }
.voice-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; align-items: center; margin-top: 8px; }
.voice-row .label { margin: 0; }
.natural-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.natural-box .note { margin: 0 0 8px; }
.dl-row, .play-row { display: flex; flex-wrap: wrap; gap: 8px; }
.play-row { margin-top: 12px; }
.bar { height: 8px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.audio { width: 100%; margin-top: 10px; }

/* script */
.script-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.script-head h3 { font: 600 1.3rem Georgia, serif; }
.seg { padding: 12px 12px 4px; margin: 0 -12px; border-radius: 10px; border-left: 4px solid transparent; transition: background .2s; }
.seg.speaking { background: var(--accent-soft); border-left-color: var(--accent); }
.seg-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-h h4 { font-size: 1.02rem; flex: 1 1 auto; }
.kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.seg-look .kind { background: var(--info-soft); color: var(--info); }
.seg-detail .kind { background: var(--warn-soft); color: var(--warn); }
.seg p { margin: 6px 0 8px; font-size: 1.02rem; line-height: 1.65; }
.verify ul { margin: 8px 0 0; padding-left: 20px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; }
.export { display: flex; flex-wrap: wrap; gap: 8px; }

/* history */
.history-head { display: flex; justify-content: space-between; align-items: baseline; }
.history h2 { font-size: 1.1rem; }
.history-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.h-item { display: flex; align-items: center; gap: 6px; }
.h-open { flex: 1; display: flex; gap: 10px; align-items: center; text-align: left; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; min-width: 0; }
.h-open:hover { border-color: var(--accent); }
.h-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.h-noimg { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.h-text { display: grid; min-width: 0; }
.h-text strong, .h-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }

.foot { max-width: 1120px; margin: 10px auto 30px; padding: 0 16px; font-size: .82rem; color: var(--muted); }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 20; width: min(560px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow); transition: opacity .5s; }
.toast a { color: inherit; margin-left: 8px; font-weight: 700; }
.toast.err { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #1b1203; }
.toast.gone { opacity: 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .ask, .col-main { grid-column: 1; }
  .id-photo { width: 96px; height: 96px; }
  .id-name { font-size: 1.35rem; }
}
@media (max-width: 480px) {
  .opt-row { grid-template-columns: minmax(0, 1fr); }
  .voice-row { grid-template-columns: minmax(0, 1fr); }
  .example-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tagline { display: none; }
  .topbar { position: static; padding: 10px 16px; }
  .id-row { flex-direction: column; }
  .id-photo { width: 100%; height: 180px; }
  .add-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
