:root {
  --bg: #0c0b0a;
  --panel: #141210;
  --line: #2a2622;
  --text: #f2ebe3;
  --muted: #9a9086;
  --amber: #e8a54b;
  --amber-dim: rgba(232, 165, 75, 0.15);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
.hidden { display: none !important; }
#app { display: contents; }
.view { display: flex; min-height: 100vh; }
.rail {
  width: 200px; flex-shrink: 0; padding: 28px 20px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 28px; background: #0a0908;
}
.brand { font-family: var(--serif); font-size: 28px; color: var(--amber); letter-spacing: 0.02em; }
.rail nav { display: flex; flex-direction: column; gap: 6px; }
.nav, .back {
  background: transparent; border: 0; color: var(--muted); text-align: left;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.nav:hover, .back:hover { color: var(--text); background: #1a1714; }
.nav.active { color: var(--bg); background: var(--amber); font-weight: 600; }
.privacy { margin-top: auto; font-size: 12px; color: var(--muted); }
.privacy::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: middle; }
.main { flex: 1; padding: 28px 40px 48px; max-width: 1100px; }
.top { margin-bottom: 28px; }
.search-pill {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  padding: 14px 18px; border-radius: 999px; cursor: pointer; font-size: 15px;
}
.search-pill:hover { border-color: var(--amber); }
kbd { font-size: 12px; border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; color: var(--muted); }
.chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.chip.on, .chip:hover { border-color: var(--amber); color: var(--amber); }
.h { font-family: var(--serif); font-weight: 500; font-size: 36px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; cursor: pointer; min-height: 140px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--amber); transform: translateY(-2px); }
.card .swatch { height: 6px; border-radius: 99px; width: 48px; }
.card h3 { font-family: var(--serif); font-size: 22px; margin: 0; font-weight: 500; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.stage { display: flex; justify-content: center; }
.spotlight { width: min(720px, 100%); padding-top: 8vh; }
#q {
  width: 100%; background: var(--panel); border: 1px solid var(--amber); color: var(--text);
  font-size: 20px; padding: 18px 20px; border-radius: 14px; outline: none;
}
.scope { margin: 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.recent { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.results { display: flex; flex-direction: column; }
.hit {
  text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 18px 8px; cursor: pointer; color: inherit; width: 100%;
}
.hit:hover { background: var(--amber-dim); }
.hit .who { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.hit .line { font-family: var(--serif); font-size: 20px; line-height: 1.35; }
.hit .line mark { background: transparent; color: var(--amber); font-style: inherit; }
.hit .t { font-size: 12px; color: var(--muted); margin-top: 8px; }
.quote-layout { display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 28px; align-items: start; }
.transcript {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; max-height: calc(100vh - 80px); overflow: auto;
}
.t-line { padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.t-line b { color: var(--text); font-weight: 600; margin-right: 6px; }
.t-line.on { background: var(--amber-dim); color: var(--text); outline: 1px solid var(--amber); }
.peek { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 28px; }
.meta { color: var(--muted); font-size: 13px; }
.meta strong { color: var(--amber); font-family: var(--serif); font-size: 22px; display: block; margin-bottom: 4px; font-weight: 500; }
.player {
  aspect-ratio: 16/10; border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(circle at 30% 30%, #3a2a18, #12100e 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.play {
  width: 56px; height: 56px; border-radius: 50%; background: var(--amber); color: #111;
  display: grid; place-items: center; font-size: 18px;
}
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions button, .make {
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 14px 16px; cursor: pointer; font-size: 15px; text-align: left;
}
.actions button.primary, .make { background: var(--amber); color: #1a1208; border-color: var(--amber); font-weight: 600; text-align: center; }
.actions button:hover { border-color: var(--amber); }
.snip-list { list-style: none; padding: 0; margin: 0; }
.snip-list li {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--panel);
}
.snip-list .tag { color: var(--amber); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 20; padding: 20px;
}
.modal-card {
  width: min(420px, 100%); background: #161310; border: 1px solid var(--line); border-radius: 18px; padding: 24px;
}
.modal-card h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 12px; }
.modal-quote { font-family: var(--serif); font-size: 18px; line-height: 1.4; margin: 0 0 18px; color: var(--text); }
.durations, .formats { display: flex; gap: 8px; margin-bottom: 14px; }
.durations button, .formats button {
  flex: 1; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 10px; cursor: pointer;
}
.durations button.on, .formats button.on { border-color: var(--amber); color: var(--amber); }
.cancel { display: block; width: 100%; margin-top: 10px; background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 10px; }
.make { width: 100%; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f1a14; border: 1px solid var(--amber); color: var(--text);
  padding: 12px 18px; border-radius: 999px; z-index: 30; font-size: 14px;
}
@media (max-width: 860px) {
  .view { flex-direction: column; }
  .rail { width: 100%; flex-direction: row; align-items: center; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail nav { flex-direction: row; }
  .privacy, .back { display: none; }
  .quote-layout { grid-template-columns: 1fr; }
  .main { padding: 20px; }
}
