/* ==========================================================================
   REEL DISTILLER — hardware faceplate stylesheet
   ========================================================================== */

:root {
  --ivory: #ece4d3;
  --ivory-2: #e2d8c2;
  --ivory-shadow: #b8ac91;
  --ivory-hi: #f7f1e1;
  --steel: #b8b3a5;
  --steel-dark: #6e6a5f;
  --ink: #221f1a;
  --ink-soft: #3a362d;
  --muted: #746e5e;
  --led-amber: #ff7a1a;
  --led-amber-glow: #ffbf6a;
  --led-red: #e03826;
  --led-green: #5fd07a;
  --screw: #8f8876;
  --screw-dark: #3c382e;
  --panel-shadow: 0 40px 80px -30px rgba(30,20,10,.55), 0 8px 20px -8px rgba(30,20,10,.35);
}

/* palette variants via data-attr on body */
body[data-tone="graphite"] {
  --ivory: #2a2a2a;
  --ivory-2: #1e1e1e;
  --ivory-shadow: #0a0a0a;
  --ivory-hi: #3a3a3a;
  --ink: #eceae2;
  --ink-soft: #c8c3b6;
  --muted: #8a8578;
  --screw: #5a5648;
  --screw-dark: #18160f;
  --steel: #787367;
  --steel-dark: #2a2720;
}
body[data-tone="olive"] {
  --ivory: #b5ad7f;
  --ivory-2: #a39c6f;
  --ivory-shadow: #6d683f;
  --ivory-hi: #cfc795;
  --ink: #1d1b0f;
}
body[data-tone="oxblood"] {
  --ivory: #6e2822;
  --ivory-2: #561d18;
  --ivory-shadow: #2b0e0a;
  --ivory-hi: #8a3831;
  --ink: #f3e9d6;
  --ink-soft: #e1d5bc;
  --muted: #c8b798;
}

body[data-led="red"]    { --led-amber: #e53824; --led-amber-glow: #ff8a7a; }
body[data-led="green"]  { --led-amber: #3fbf5b; --led-amber-glow: #8ce8a1; }
body[data-led="blue"]   { --led-amber: #2a86ff; --led-amber-glow: #7db7ff; }
body[data-led="violet"] { --led-amber: #8b54e8; --led-amber-glow: #c49dff; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 50% 0%, #e9e3d2 0%, #c9c1ae 55%, #a9a291 100%);
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding: 40px 20px 80px;
}

body[data-tone="graphite"] {
  background: radial-gradient(1200px 800px at 50% 0%, #3b3b3b 0%, #181818 55%, #0a0a0a 100%);
}
body[data-tone="olive"] {
  background: radial-gradient(1200px 800px at 50% 0%, #d4cc9e 0%, #9e965d 55%, #66602e 100%);
}
body[data-tone="oxblood"] {
  background: radial-gradient(1200px 800px at 50% 0%, #3a1511 0%, #1e0806 55%, #080202 100%);
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.display { font-family: "Unica One", "Helvetica Neue", Impact, sans-serif; letter-spacing: .04em; }

/* ==========================================================================
   FACEPLATE (outer device shell)
   ========================================================================== */
.faceplate {
  max-width: 1180px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, var(--ivory-hi) 0%, var(--ivory) 30%, var(--ivory-2) 100%);
  border-radius: 28px;
  padding: 28px;
  position: relative;
  box-shadow:
    var(--panel-shadow),
    inset 0 2px 0 rgba(255,255,255,.8),
    inset 0 -2px 0 rgba(0,0,0,.1),
    inset 0 0 0 1.5px rgba(0,0,0,.2);
}
.faceplate[data-grain="on"]::after {
  content:"";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .11 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: .55;
}

/* corner screws */
.screw {
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #d6cfbb 0%, #9a9280 45%, #555042 100%);
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.5),
    inset 0 -2px 3px rgba(0,0,0,.4),
    0 1px 2px rgba(0,0,0,.3);
}
.screw::before, .screw::after {
  content:"";
  position: absolute;
  background: var(--screw-dark);
  border-radius: 1px;
}
.screw::before { left: 50%; top: 18%; width: 2px; height: 64%; transform: translateX(-50%) rotate(var(--rot, 20deg)); }
.screw::after  { display: none; }
.screw.tl { top: 14px; left: 14px; --rot: 25deg; }
.screw.tr { top: 14px; right: 14px; --rot: -18deg; }
.screw.bl { bottom: 14px; left: 14px; --rot: 12deg; }
.screw.br { bottom: 14px; right: 14px; --rot: -32deg; }
.screw.ml { top: 50%; left: 14px; --rot: 45deg; transform: translateY(-50%); }
.screw.mr { top: 50%; right: 14px; --rot: -50deg; transform: translateY(-50%); }

/* ==========================================================================
   NAV
   ========================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 6px 18px 20px;
  border-bottom: 1px solid rgba(0,0,0,.12);
  margin-bottom: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-mark {
  width: 46px; height: 46px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #2a2720 0%, #0d0b08 100%);
  color: var(--led-amber);
  display: grid; place-items: center;
  font-family: "Unica One", sans-serif;
  font-size: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    inset 0 -2px 4px rgba(0,0,0,.6),
    0 2px 3px rgba(0,0,0,.3);
  text-shadow: 0 0 6px var(--led-amber-glow);
}
.brand-title {
  font-family: "Unica One", sans-serif;
  font-size: 34px;
  letter-spacing: .08em;
  line-height: 1;
  color: var(--ink);
}
.brand-version {
  display: inline-block;
  margin-left: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ivory-shadow);
  color: var(--ivory-hi);
  letter-spacing: .08em;
  vertical-align: middle;
}
.brand-tagline {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nav-chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,.06);
  color: var(--ink-soft);
  border: 1px solid rgba(0,0,0,.08);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-chip:hover { background: rgba(0,0,0,.1); }

/* knob + grill */
.knob {
  width: 54px; height: 54px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #faf5e7 0%, #c8c0a9 60%, #837c68 100%);
  position: relative;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.7),
    inset 0 -3px 4px rgba(0,0,0,.3),
    0 3px 6px rgba(0,0,0,.2);
  cursor: grab;
  transition: transform .2s;
}
.knob::after {
  content:"";
  position: absolute;
  top: 6px; left: 50%;
  width: 3px; height: 14px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%) rotate(var(--angle, 0deg));
  transform-origin: 50% 20px;
}
.knob:hover { transform: scale(1.03); }
.grill {
  width: 180px; height: 44px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(90deg,
      #3a362d 0 2px, transparent 2px 6px),
    linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.04));
  box-shadow:
    inset 0 2px 3px rgba(0,0,0,.35),
    inset 0 -1px 0 rgba(255,255,255,.4);
}

/* ==========================================================================
   HERO — URL input, Distill button, toggle, demo
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 18px 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(0,0,0,.04) 100%);
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 0 rgba(0,0,0,.08);
}

.hero-row-1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-width: 0;
}
.hero-row-2 {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 4px;
}
@media (max-width: 700px) {
  .hero-row-1 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .nav { flex-direction: column; align-items: stretch; }
  .nav-right { flex-wrap: wrap; justify-content: center; }
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background:
    linear-gradient(180deg, #fbf8ee 0%, #e7e0cc 100%);
  border-radius: 40px;
  padding: 4px 4px 4px 22px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.2),
    inset 0 -1px 0 rgba(255,255,255,.6),
    0 1px 0 rgba(255,255,255,.5);
  border: 1px solid rgba(0,0,0,.15);
}
.search-container input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 16px 12px;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  min-width: 0;
  text-overflow: ellipsis;
}
.search-container input::placeholder {
  color: #9a9079;
}
.search-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background:
    radial-gradient(circle at 35% 30%, #fbf8ee, #c7bfa9 65%, #8c8572);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -2px 3px rgba(0,0,0,.3),
    0 2px 3px rgba(0,0,0,.15);
  display: grid; place-items: center;
  cursor: pointer;
}

.distill-well {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.led {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #3a362d;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.6);
  transition: background .15s, box-shadow .15s;
}
.led.on {
  background: var(--led-amber);
  box-shadow:
    0 0 8px var(--led-amber-glow),
    0 0 14px var(--led-amber),
    inset 0 0 2px rgba(255,255,255,.8);
}
.led.blink { animation: blink 0.9s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.distill-btn {
  width: 150px;
  height: 70px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  font-family: "Unica One", sans-serif;
  font-size: 30px;
  letter-spacing: .1em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  background:
    radial-gradient(ellipse at 50% 20%, #ffb27a 0%, var(--led-amber) 40%, #c14b0c 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.45),
    inset 0 -4px 8px rgba(0,0,0,.35),
    0 6px 0 #7a2d04,
    0 10px 18px rgba(0,0,0,.25);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  position: relative;
}
.distill-btn:hover { filter: brightness(1.08); }
.distill-btn:active, .distill-btn.pressed {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.35),
    inset 0 -2px 6px rgba(0,0,0,.4),
    0 2px 0 #7a2d04,
    0 4px 10px rgba(0,0,0,.2);
}
.distill-btn[disabled] { filter: grayscale(.6) brightness(.85); cursor: not-allowed; }

.btn-label {
  margin-top: 8px;
  text-align: center;
  font-family: "Unica One", sans-serif;
  letter-spacing: .1em;
  font-size: 13px;
  color: var(--ink);
}
.btn-sublabel {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .1em;
}

/* demo line */
.portfolio-note {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.16);
  background:
    linear-gradient(180deg, rgba(255,122,26,.12) 0%, rgba(255,255,255,.28) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    0 2px 4px rgba(0,0,0,.06);
}
.portfolio-note-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--led-amber);
  margin-bottom: 8px;
}
.portfolio-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.demo-line {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(0,0,0,.04);
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
}
@media (max-width: 700px) {
  .demo-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .demo-btn {
    margin-left: 0;
  }
}
.demo-btn {
  margin-left: auto;
  border: 1px solid rgba(0,0,0,.3);
  background: linear-gradient(180deg, #fbf8ee, #d4cdb7);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    0 1px 2px rgba(0,0,0,.15);
}
.demo-btn:hover { filter: brightness(1.04); }

/* ==========================================================================
   PROGRESS / ERROR CARDS
   ========================================================================== */
.inset-card {
  margin-top: 20px;
  padding: 18px 22px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #d8d0ba 0%, #c4bca6 100%);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,.3),
    inset 0 -1px 0 rgba(255,255,255,.5);
  border: 1px solid rgba(0,0,0,.18);
}
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.progress-title {
  font-family: "Unica One", sans-serif;
  letter-spacing: .1em;
  font-size: 18px;
}
.progress-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .06em;
}
.progress-step {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,.08);
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
  border: 1px solid rgba(0,0,0,.08);
  transition: all .2s;
}
.progress-step.done {
  background: var(--led-amber);
  color: #fff;
  box-shadow: 0 0 6px var(--led-amber-glow);
}
.progress-step.active {
  background: rgba(255,255,255,.7);
  color: var(--ink);
  border-color: var(--led-amber);
}
.vu-track {
  height: 18px;
  background: #0f0c08;
  border-radius: 4px;
  padding: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8);
  overflow: hidden;
  position: relative;
}
.vu-fill {
  height: 100%;
  background:
    linear-gradient(90deg, #3fbf5b 0%, #e6c43a 60%, var(--led-amber) 90%, #e03826 100%);
  border-radius: 2px;
  transition: width .4s ease;
  box-shadow: 0 0 4px var(--led-amber-glow);
  position: relative;
}
.vu-fill::after {
  content:"";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px);
}
.vu-readout {
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  margin-top: 8px;
  color: var(--muted);
  letter-spacing: .1em;
}

@media (max-width: 700px) {
  .progress-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .progress-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  .progress-step {
    flex: 1 1 auto;
    font-size: 9px;
    padding: 6px 8px;
  }
  .vu-readout {
    flex-direction: column;
    gap: 6px;
  }
}

.error-card { border-left: 6px solid var(--led-red); }
.error-title { color: var(--led-red); font-family: "JetBrains Mono", monospace; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }

/* ==========================================================================
   RESULTS
   ========================================================================== */
.results { margin-top: 24px; display: grid; gap: 18px; }

.panel {
  background:
    linear-gradient(180deg, var(--ivory-hi) 0%, var(--ivory) 100%);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.15);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -1px 0 rgba(0,0,0,.08),
    0 2px 4px rgba(0,0,0,.08);
  padding: 18px 20px;
  position: relative;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.panel-title {
  font-family: "Unica One", sans-serif;
  font-size: 20px;
  letter-spacing: .1em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .16em;
  font-weight: 700;
  text-transform: uppercase;
}
.tag-interactive { background: var(--led-amber); color: #fff; box-shadow: 0 0 6px var(--led-amber-glow); }
.tag-live { background: var(--led-red); color: #fff; }

/* video profile */
.video-profile {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: flex-start;
}
.thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), 0 2px 4px rgba(0,0,0,.2);
  background:
    repeating-linear-gradient(45deg,
      #6b6558 0 6px,
      #756f62 6px 12px);
}
.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.thumb::before {
  content:"";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.12), transparent 60%);
}
.thumb-play {
  position: absolute;
  z-index: 2;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px;
  border: 2px solid rgba(255,255,255,.8);
}
.thumb-chip {
  position: absolute;
  z-index: 2;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}
.thumb-label {
  position: absolute;
  z-index: 2;
  top: 8px; left: 8px;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .08em;
}
.video-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.video-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.video-profile-copy {
  min-width: 0;
  width: 100%;
  align-self: stretch;
}
.video-pitch {
  line-height: 1.55;
  font-size: 14px;
  color: var(--ink-soft);
  max-width: none;
  width: 100%;
}

.nav-github svg {
  display: block;
  flex-shrink: 0;
}
.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

/* split grid */
.results-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
  align-items: stretch;
}
.results-split > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
@media (max-width: 980px) {
  .results-split { grid-template-columns: 1fr; }
  .video-profile { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}

/* summary workspace */
.summary-workspace {
  display: grid;
  gap: 14px;
}
.summary-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(0,0,0,.05) 100%);
  border: 1px solid rgba(0,0,0,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
  min-width: 0;
}
.summary-tab {
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid #000;
  background: linear-gradient(180deg, #2b2720 0%, #11100d 100%);
  color: #f2e6d1;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 3px 8px rgba(0,0,0,.18);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.summary-tab:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.summary-tab.active {
  background: radial-gradient(ellipse at 50% 20%, #ffb27a 0%, var(--led-amber) 40%, #c14b0c 100%);
  border-color: #7a2d04;
  color: #fff7ef;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.32),
    inset 0 -2px 6px rgba(0,0,0,.24),
    0 0 0 1px rgba(255,122,26,.18),
    0 8px 18px rgba(193,75,12,.28);
}
@media (max-width: 700px) {
  .summary-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 12px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .summary-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 11px;
    scroll-snap-align: start;
  }
}

/* insights */
.insight-caption {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.4);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.06);
  font-size: 13.5px;
  line-height: 1.5;
}
.insight-num {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--led-amber);
  font-size: 14px;
}

.export-menu {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--ivory-shadow);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3);
}
.export-menu-dropdown {
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.export-btn {
  padding: 6px 10px;
  background: linear-gradient(180deg, #fbf8ee, #d4cdb7);
  border: 1px solid rgba(0,0,0,.2);
  border-radius: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--ink);
}
.export-btn:hover { filter: brightness(1.08); }
.export-btn.active { background: var(--led-amber); color: #fff; border-color: #8c3a0c; box-shadow: 0 0 4px var(--led-amber-glow); }
.export-menu-trigger {
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: none;
  border-radius: 8px;
}
.export-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8f2e5, #ddd3bb);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 16px 30px rgba(0,0,0,.18);
  z-index: 20;
}
.export-menu-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.export-menu-item:hover,
.export-menu-item.active {
  background: rgba(255,122,26,.14);
}
.export-menu-item-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.export-menu-item-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}

.deep-dive-tag {
  background: rgba(255,122,26,.14);
  color: var(--led-amber);
}
.transcript-tag {
  background: rgba(34,31,26,.08);
  color: var(--ink-soft);
}
.transcript-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.transcript-list {
  display: grid;
  gap: 10px;
}
.transcript-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(0,0,0,.06);
  align-items: start;
}
.transcript-time {
  color: var(--led-amber);
  font-size: 12px;
  letter-spacing: .04em;
}
.transcript-text {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.62;
}
@media (max-width: 700px) {
  .transcript-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .transcript-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.deep-dive-stack {
  display: grid;
  gap: 12px;
}
.deep-dive-copy {
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(0,0,0,.08);
  overflow: hidden;
}
.deep-dive-section {
  margin-bottom: 22px;
  min-width: 0;
}
.deep-dive-section:last-child {
  margin-bottom: 0;
}
.deep-dive-heading {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.deep-dive-copy p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  line-height: 1.72;
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.deep-dive-copy p:last-child {
  margin-bottom: 0;
}
.deep-dive-intro {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(0,0,0,.08);
}
.deep-dive-intro p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}
.deep-dive-eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.deep-dive-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.48);
  -webkit-overflow-scrolling: touch;
}
.deep-dive-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.deep-dive-chip-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.46);
  border: 1px solid rgba(0,0,0,.08);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.deep-dive-chip-index {
  color: var(--led-amber);
  font-size: 12px;
  font-weight: 700;
}

/* mindmap */
.mindmap-wrap {
  flex: 1 1 auto;
  min-height: 560px;
  height: auto;
  background:
    linear-gradient(180deg, #0f0c08 0%, #1a1610 100%);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
  border: 1px solid #000;
}
.mindmap-loading {
  flex: 1 1 auto;
  min-height: 560px;
  height: auto;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid #000;
  background:
    linear-gradient(180deg, #0f0c08 0%, #1a1610 100%);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.7);
  display: grid;
  place-items: center;
}
.mindmap-loading-grid {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  opacity: 0.9;
}
.mindmap-loading-grid span {
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,190,120,.18) 50%, rgba(255,255,255,.04) 100%);
  border: 1px solid rgba(255,180,100,.18);
  animation: mindmapPulse 1.4s ease-in-out infinite;
}
.mindmap-loading-grid span:nth-child(1) { height: 72px; animation-delay: 0s; }
.mindmap-loading-grid span:nth-child(2) { height: 124px; animation-delay: .08s; }
.mindmap-loading-grid span:nth-child(3) { height: 88px; animation-delay: .16s; }
.mindmap-loading-grid span:nth-child(4) { height: 110px; animation-delay: .24s; }
.mindmap-loading-grid span:nth-child(5) { height: 84px; animation-delay: .32s; }
.mindmap-loading-grid span:nth-child(6) { height: 132px; animation-delay: .4s; }
.mindmap-loading-copy {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(255,255,255,.8);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,180,100,.28);
  box-shadow: 0 0 18px rgba(255,122,26,.16);
}
.mindmap-wrap svg { display: block; cursor: grab; }
.mindmap-wrap svg:active { cursor: grabbing; }
@media (max-width: 700px) {
  .mindmap-wrap,
  .mindmap-loading {
    min-height: 360px;
    height: min(62vh, 420px);
  }
  .map-legend {
    left: 8px;
    right: 8px;
    bottom: 8px;
    font-size: 9px;
    letter-spacing: .06em;
    background: rgba(0,0,0,.36);
    padding: 6px 8px;
    border-radius: 8px;
    text-align: center;
    pointer-events: none;
  }
  .map-controls {
    top: 8px;
    right: 8px;
  }
  .map-ctrl {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .mindmap-wrap,
  .mindmap-loading {
    min-height: 320px;
    height: min(56vh, 360px);
  }
  .mindmap-wrap {
    border-radius: 8px;
  }
  .mindmap-wrap svg {
    width: 100%;
    height: 100%;
    touch-action: none;
  }
  .mindmap-loading-grid {
    inset: 14px;
    gap: 10px;
  }
  .mindmap-loading-copy {
    font-size: 10px;
    letter-spacing: .12em;
    padding: 8px 10px;
  }
  .map-legend {
    display: none;
  }
}
@keyframes mindmapPulse {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: .95; transform: translateY(-3px); }
}
.map-controls {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  gap: 4px;
}
.map-ctrl {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: #ddd;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.map-ctrl:hover { background: rgba(255,255,255,.15); }
.map-legend {
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(255,255,255,.5);
  letter-spacing: .1em;
}

/* details accordion */
details.accordion {
  background:
    linear-gradient(180deg, var(--ivory-hi) 0%, var(--ivory) 100%);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 2px 4px rgba(0,0,0,.06);
  overflow: hidden;
}
details.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Unica One", sans-serif;
  font-size: 18px;
  letter-spacing: .1em;
  user-select: none;
}
details.accordion summary::-webkit-details-marker { display: none; }
.acc-led {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.4);
}
details[open] .acc-led {
  background: var(--led-amber);
  box-shadow: 0 0 6px var(--led-amber-glow);
}
.acc-caret { margin-left: auto; transition: transform .2s; color: var(--muted); font-family: monospace; font-size: 16px; }
details[open] .acc-caret { transform: rotate(90deg); }
.acc-body {
  padding: 4px 20px 20px;
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: 0;
  font-size: 14px;
  line-height: 1.55;
}
.panel-subblock {
  margin-bottom: 18px;
  padding-bottom: 4px;
}
.panel-subhead {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 14px;
  font-family: "Unica One", sans-serif;
  font-size: 18px;
  letter-spacing: .1em;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin-bottom: 6px;
}
.section-empty {
  padding: 14px 0 18px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(0,0,0,.12);
}
.section-item:last-child { border-bottom: 0; }
.section-copy {
  min-width: 0;
}
.section-time {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #fff;
  background: #2a2720;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.18;
  max-width: 100%;
}
.section-body {
  color: var(--ink-soft);
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.72;
  max-width: 100%;
}
.concept-sig {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.concept {
  padding: 10px 12px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
}
.concept-term {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--led-amber);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.concept-def { font-size: 13px; line-height: 1.4; }

.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-table th, .cmp-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.cmp-table th {
  background: rgba(0,0,0,.06);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cmp-table tr:last-child td { border-bottom: 0; }

@media (max-width: 820px) {
  .panel {
    padding: 16px;
  }
  .panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .panel-title {
    min-width: 0;
    font-size: 18px;
    line-height: 1.15;
    flex-wrap: wrap;
  }
  .export-menu-dropdown,
  .transcript-actions {
    width: 100%;
  }
  .export-menu-trigger,
  .transcript-actions .export-btn {
    width: 100%;
    justify-content: center;
  }
  .export-menu-popover {
    left: 0;
    right: 0;
    min-width: 0;
  }
  .video-title {
    font-size: 20px;
  }
  .video-meta {
    gap: 8px 12px;
    font-size: 10px;
  }
  .section-title {
    font-size: 16px;
  }
  .panel[data-screen-label="Deep Dive"] .panel-head {
    align-items: stretch;
  }
  .panel[data-screen-label="Deep Dive"] .panel-title {
    width: 100%;
  }
  .panel[data-screen-label="Deep Dive"] .export-menu-dropdown {
    width: 100%;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-copy {
    padding: 14px;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-section {
    margin-bottom: 18px;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-heading {
    font-size: 16px;
    line-height: 1.3;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-chip-grid,
  .panel[data-screen-label="Deep Dive"] .concepts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 20px 12px 48px;
  }
  .faceplate {
    padding: 16px;
    border-radius: 22px;
  }
  .nav {
    padding: 0 0 16px;
    margin-bottom: 18px;
    gap: 14px;
    flex-wrap: wrap;
  }
  .nav-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .grill {
    flex: 0 0 100%;
    margin-inline: auto;
  }
  .panel-head {
    gap: 10px;
  }
  .panel-title {
    font-size: 16px;
    gap: 8px;
  }
  .tag {
    letter-spacing: .1em;
  }
  .summary-workspace {
    gap: 12px;
  }
  .summary-tab {
    border-radius: 14px;
  }
  .section-item {
    padding: 10px 0;
  }
  .section-title {
    font-size: 15px;
    line-height: 1.18;
  }
  .section-time {
    font-size: 11px;
    padding: 3px 7px;
  }
  .section-body {
    font-size: 14px;
    line-height: 1.65;
  }
  .deep-dive-copy {
    padding: 14px 12px;
  }
  .deep-dive-heading {
    font-size: 16px;
  }
  .deep-dive-copy p,
  .transcript-text,
  .insight {
    font-size: 13px;
  }
  .deep-dive-chip-grid,
  .concepts-grid {
    grid-template-columns: 1fr;
  }
  .deep-dive-chip-card {
    grid-template-columns: 24px 1fr;
    gap: 10px;
    padding: 10px 12px;
  }
  .cmp-table {
    min-width: 560px;
    font-size: 12px;
  }
  .cmp-table th,
  .cmp-table td {
    padding: 8px 10px;
  }
  .panel[data-screen-label="Deep Dive"] {
    overflow: hidden;
  }
  .panel[data-screen-label="Deep Dive"] .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .panel[data-screen-label="Deep Dive"] .panel-title {
    width: 100%;
    justify-content: space-between;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-tag {
    flex-shrink: 0;
  }
  .panel[data-screen-label="Deep Dive"] .export-menu-trigger {
    width: 100%;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-copy {
    padding: 12px 10px;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-section {
    margin-bottom: 16px;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-heading {
    font-size: 15px;
    margin-bottom: 8px;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-copy p {
    margin-bottom: 12px;
    line-height: 1.62;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-table-wrap {
    margin-inline: -10px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  .panel[data-screen-label="Deep Dive"] .deep-dive-chip-card,
  .panel[data-screen-label="Deep Dive"] .concept {
    padding: 10px;
  }
}

.rec-list { margin: 0; padding-left: 20px; }
.rec-list li { padding: 6px 0; }

/* bottom grill + footer */
.grill-bottom {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 30px;
}
.grill-strip {
  flex: 1;
  height: 24px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg,
      #3a362d 0 2px, transparent 2px 6px),
    rgba(0,0,0,.05);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.3);
}
.serial {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .14em;
}
.footer-links {
  display: flex;
  gap: 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  padding: 12px 30px 4px;
  letter-spacing: .08em;
  text-transform: uppercase;
  justify-content: center;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ==========================================================================
   TWEAKS panel
   ========================================================================== */
.tweaks-panel {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 280px;
  background: #1a1610;
  border-radius: 12px;
  border: 1px solid #000;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.6);
  color: #e0dcd1;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  z-index: 1000;
  overflow: hidden;
}
.tweaks-head {
  padding: 10px 14px;
  background: #000;
  font-family: "Unica One", sans-serif;
  font-size: 14px;
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tweak-row { display: flex; flex-direction: column; gap: 6px; }
.tweak-label { color: #8f887a; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; }
.tweak-options { display: flex; gap: 4px; flex-wrap: wrap; }
.tweak-opt {
  padding: 6px 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .05em;
}
.tweak-opt.on { background: var(--led-amber); color: #fff; border-color: #000; box-shadow: 0 0 6px var(--led-amber-glow); }
.tweak-swatch { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(255,255,255,.2); }
.tweak-swatch.on { border-color: #fff; transform: scale(1.1); }

/* screen-label hidden chip */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* AI Chat tab */
.chat-container { display: flex; flex-direction: column; height: 100%; min-height: 400px; min-width: 0; }
.chat-messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chat-message { display: flex; }
.chat-message--user { justify-content: flex-end; }
.chat-message--assistant { justify-content: flex-start; }
.chat-message__bubble { max-width: 80%; min-width: 0; padding: 10px 14px; border-radius: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.chat-message--user .chat-message__bubble { background: var(--led-amber); color: #fff; }
.chat-message--assistant .chat-message__bubble { background: rgba(0,0,0,.06); color: var(--ink); border: 1px solid rgba(0,0,0,.08); }
.chat-message--general .chat-message__bubble { font-style: italic; opacity: 0.85; }
.chat-timestamp-chip { display: inline-block; background: var(--led-amber); color: #fff; border: none; border-radius: 4px; padding: 1px 6px; font-size: 0.78em; cursor: pointer; margin: 0 2px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.chat-timestamp-chip:hover { opacity: 0.8; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(0,0,0,.1); min-width: 0; }
.chat-input { flex: 1; min-width: 0; background: rgba(255,255,255,.65); border: 1px solid rgba(0,0,0,.12); color: var(--ink); border-radius: 8px; padding: 10px 14px; font-size: 0.95rem; }
.chat-input:disabled { opacity: 0.5; }
.chat-send { background: var(--led-amber); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; cursor: pointer; font-size: 1rem; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-indexing { padding: 32px 24px; text-align: center; }
.chat-indexing__label { color: var(--ink); margin-bottom: 12px; }
.chat-indexing__bar { background: rgba(0,0,0,.08); border-radius: 4px; height: 8px; overflow: hidden; }
.chat-indexing__fill { background: var(--led-amber); height: 100%; transition: width 0.4s ease; }
.chat-blocked, .chat-failed { padding: 32px 24px; color: var(--muted); text-align: center; }
.chat-failed button { margin-top: 12px; background: var(--led-amber); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; cursor: pointer; }

/* Study tabs */
.study-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 400px;
  min-width: 0;
}
.study-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.study-progress {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .14em;
}
.study-score {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}
.study-loading,
.study-empty,
.study-failed {
  padding: 32px 24px;
  border-radius: 12px;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255,255,255,.3);
  border: 1px solid rgba(0,0,0,.08);
}
.study-failed button {
  margin-top: 12px;
  background: var(--led-amber);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
}
.study-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.study-primary-btn {
  border: 1px solid #7a2d04;
  background: radial-gradient(ellipse at 50% 20%, #ffb27a 0%, var(--led-amber) 40%, #c14b0c 100%);
  color: #fff7ef;
  border-radius: 999px;
  padding: 11px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(193,75,12,.22);
}
.study-primary-btn:disabled,
.export-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.flashcard {
  display: grid;
  gap: 16px;
  padding: 20px;
  min-height: 270px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.22) 100%);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 14px 30px rgba(0,0,0,.08);
}
.flashcard-panel {
  display: grid;
  gap: 12px;
}
.flashcard-panel__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}
.flashcard-panel__content {
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.flashcard.is-revealed .flashcard-panel__content {
  font-size: 18px;
  color: var(--ink-soft);
}
.flashcard-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.quiz-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.22) 100%);
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 14px 30px rgba(0,0,0,.08);
}
.quiz-card__prompt {
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.quiz-options {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.quiz-option {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.1);
  background: rgba(255,255,255,.45);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.quiz-option:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255,255,255,.65);
}
.quiz-option__marker {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1f1c17;
  color: #f2e6d1;
  font-size: 11px;
}
.quiz-option.is-selected {
  border-color: rgba(193,75,12,.45);
  background: rgba(255,183,122,.25);
}
.quiz-option.is-correct {
  border-color: rgba(95,208,122,.45);
  background: rgba(95,208,122,.18);
}
.quiz-option.is-wrong {
  border-color: rgba(224,56,38,.35);
  background: rgba(224,56,38,.12);
}
.quiz-feedback {
  padding: 16px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.08);
  color: var(--ink-soft);
}
.quiz-feedback__status {
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--led-amber);
}
@media (max-width: 700px) {
  .chat-message__bubble {
    max-width: 100%;
  }
  .chat-input-row {
    flex-direction: column;
  }
  .chat-send,
  .chat-input,
  .study-primary-btn,
  .study-actions .export-btn,
  .study-toolbar .export-btn {
    width: 100%;
  }
  .study-toolbar,
  .study-actions,
  .flashcard-meta {
    flex-direction: column;
    align-items: stretch;
  }
  .flashcard,
  .quiz-card,
  .study-loading,
  .study-empty,
  .study-failed,
  .chat-blocked,
  .chat-failed,
  .chat-indexing {
    padding: 18px 16px;
  }
  .flashcard-panel__content,
  .quiz-card__prompt {
    font-size: 18px;
  }
  .quiz-option {
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 12px;
  }
  .quiz-option__marker {
    width: 20px;
    height: 20px;
  }
}
