:root {
  --navy: #071a2e;
  --navy-2: #102943;
  --panel: rgba(13, 35, 58, 0.94);
  --gold: #d4af37;
  --gold-soft: #f0d88c;
  --cream: #f6f0e3;
  --ink: #eaf0f6;
  --muted: #aebdca;
  --plum: #583750;
  --success: #80c99a;
  --danger: #e98585;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }

/* A keyboard reader must always be able to see where they are. The page had no
   focus styling of its own, leaving only the browser default over a dark theme.
   This matches the ring the rest of MyCueLeaf uses. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Honour the reader's system setting, as the rest of the platform does. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  /* A solid colour under the gradients. Without it, anything that stops the
     gradients painting leaves light text on a white page — and assistive
     tooling cannot determine the contrast at all. */
  background-color: var(--navy);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(212,175,55,.14), transparent 25rem),
    radial-gradient(circle at 82% 12%, rgba(73,88,151,.18), transparent 30rem),
    linear-gradient(180deg, #061526, #0a1e34 58%, #071827);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: radial-gradient(#fff 0.7px, transparent 0.8px);
  background-size: 31px 31px;
}
.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 38px 28px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(212,175,55,.7);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 31px;
  box-shadow: inset 0 0 26px rgba(212,175,55,.1);
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; margin: 0; }
h1 { color: var(--cream); font-size: clamp(2.3rem, 4vw, 4.4rem); letter-spacing: .015em; }
h2 { color: var(--cream); font-size: 1.45rem; }
p { line-height: 1.55; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
/* Link back into the MyCueLeaf app from the Classics reader. */
.home-link { color: var(--gold-soft); text-decoration: none; }
.home-link:hover, .home-link:focus-visible { text-decoration: underline; }
.subtitle { color: var(--muted); margin: 5px 0 0; }
.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  padding: 14px 16px;
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 16px;
  background: rgba(4,18,32,.62);
}
.status-card small { display: block; margin-top: 3px; color: var(--muted); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #65717d; box-shadow: 0 0 0 5px rgba(101,113,125,.12); }
.status-dot.active { background: var(--success); box-shadow: 0 0 0 6px rgba(128,201,154,.14); }
.status-dot.error { background: var(--danger); }
main { max-width: 1440px; margin: 0 auto; padding: 0 28px 54px; }
.privacy-banner {
  padding: 14px 18px;
  margin: 0 0 18px;
  color: #dbe7ee;
  background: rgba(212,175,55,.09);
  border: 1px solid rgba(212,175,55,.26);
  border-radius: 14px;
}
.panel {
  border: 1px solid rgba(212,175,55,.19);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(18,45,72,.95), rgba(8,27,46,.96));
  box-shadow: var(--shadow);
}
.control-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(145px, 1fr));
  gap: 16px;
  align-items: end;
  padding: 18px;
  margin-bottom: 20px;
}
.control-block { display: flex; gap: 10px; flex-wrap: wrap; }
label { display: grid; gap: 7px; color: var(--muted); font-size: .84rem; font-weight: 650; }
select, input[type="number"], textarea {
  width: 100%;
  color: var(--ink);
  background: #071a2e;
  border: 1px solid rgba(212,175,55,.24);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
}
textarea { resize: vertical; min-height: 92px; }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.page-control { display: grid; grid-template-columns: 36px 1fr 36px; }
.page-control button { color: var(--gold); background: #071a2e; border: 1px solid rgba(212,175,55,.24); font-size: 1.3rem; }
.page-control button:first-child { border-radius: 10px 0 0 10px; }
.page-control button:last-child { border-radius: 0 10px 10px 0; }
.page-control input { text-align: center; border-radius: 0; }
.toggle-row { grid-column: 1 / -1; display: flex; gap: 22px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
/* Comfortable tap targets: the checkbox itself is 13px, so the whole label
   carries the hit area. */
.toggle-row label { display: flex; align-items: center; gap: 7px; min-height: 28px; cursor: pointer; }
.toggle-row input { height: 18px; width: 18px; }
.button {
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 11px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(5,22,39,.82);
  font-weight: 750;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); border-color: var(--gold); }
.button-primary { color: #071827; background: linear-gradient(135deg, #f0d88c, #d4af37); }
.button-gold { color: var(--gold-soft); border-color: rgba(212,175,55,.55); }
.text-button { align-items: center; color: var(--gold); border: 0; background: transparent; cursor: pointer; display: inline-flex; min-height: 28px; padding: 0 4px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr); gap: 20px; }
.reading-panel, .transcript-panel, .command-panel, .soundtrack-panel, .log-panel { padding: 22px; }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 17px; }
.mode-badge { padding: 7px 10px; color: var(--gold-soft); border: 1px solid rgba(212,175,55,.35); border-radius: 999px; font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
blockquote {
  margin: 0;
  min-height: 270px;
  padding: 26px 28px;
  color: #2c241d;
  background: linear-gradient(145deg, #fbf7ed, #eee4ce);
  border-left: 5px solid var(--gold);
  border-radius: 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.55;
  white-space: pre-line;
}
.progress-track { height: 8px; overflow: hidden; margin: 18px 0; background: rgba(255,255,255,.08); border-radius: 99px; }
#progressBar { height: 100%; width: 0; background: linear-gradient(90deg, #8b6f22, var(--gold-soft)); border-radius: inherit; transition: width .3s ease; }
.cue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.cue-card { display: grid; gap: 6px; padding: 12px; border: 1px solid rgba(212,175,55,.16); border-radius: 12px; background: rgba(5,20,36,.58); }
.cue-card strong { color: var(--cream); font-size: .88rem; }
.cue-card small { color: var(--muted); }
.cue-card.disabled { opacity: .48; }
.transcript { min-height: 155px; padding: 15px; margin-bottom: 16px; color: #dfe9ef; background: rgba(4,17,30,.72); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; line-height: 1.55; }
.tester { margin-bottom: 10px; }
.definition-box { margin-top: 14px; padding: 13px; color: #f7efd7; background: rgba(88,55,80,.6); border: 1px solid rgba(240,216,140,.22); border-radius: 12px; }
.command-panel, .soundtrack-panel, .log-panel { margin-top: 20px; }
.command-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 11px; }
.command { padding: 12px; border: 1px solid rgba(212,175,55,.14); background: rgba(5,20,36,.48); border-radius: 12px; }
.command code { display: block; margin-bottom: 5px; color: var(--gold-soft); white-space: normal; }
.command small { color: var(--muted); }
.soundtrack-panel { display: flex; justify-content: space-between; gap: 25px; align-items: center; }
.soundtrack-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
#eventLog { display: grid; gap: 7px; max-height: 230px; overflow: auto; padding-left: 24px; color: var(--muted); }
#eventLog strong { color: var(--cream); }
footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1440px; margin: 0 auto; padding: 20px 28px 34px; color: var(--muted); border-top: 1px solid rgba(212,175,55,.12); }
footer a { color: var(--gold-soft); }
@media (max-width: 1080px) {
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-controls { grid-column: 1 / -1; }
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hero { grid-template-columns: auto 1fr; }
  .status-card { grid-column: 1 / -1; }
  .control-grid { grid-template-columns: 1fr; }
  .toggle-row { flex-wrap: wrap; }
  .soundtrack-panel, footer { align-items: flex-start; flex-direction: column; }
  .soundtrack-actions { justify-content: flex-start; }
}

/* A 16px-tall slider is hard to hit with a tremor or a stylus. */
input[type=range] { height: 28px; }
