/* Layout idea: a calm, light page that is easy on the eyes, with a small sound-wave motif.
   Muted teal drives actions, and soft tints mark status. */
:root {
  --bg: #1f292d;
  --surface: #283439;
  --ink: #dde6e6;
  --muted: #a4b3b5;
  --line: #3a494e;
  --night: #263338;
  --night-2: #263338;
  --on-night: #e4ecec;
  --on-night-muted: #b4c3c4;
  --coral: #6ba5a5;
  --coral-hover: #7bb3b3;
  --on-coral: #142224;
  --teal: #8fc4c2;
  --teal-soft: #2d4245;
  --amber: #a9d3d0;
  --amber-soft: #33423b;
  --amber-ink: #cfe0cf;
  --violet: #b3c4d3;
  --violet-soft: #303e49;
  --green: #a5d3bb;
  --green-soft: #2c4239;
  --bad: #e3a5a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 18px rgba(0, 0, 0, 0.16);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.55; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 2; }

/* Header */
.top { background: var(--night); color: var(--on-night); border-bottom: 1px solid var(--line); }
.top-inner, nav, main { max-width: 980px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 18px; }
.brand { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--on-night); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--amber); }
.top .ghost { margin-left: auto; background: transparent; color: var(--on-night); border: 1px solid var(--on-night-muted); padding: 5px 14px; font-weight: 500; }
.top .ghost:hover { background: rgba(255, 255, 255, 0.14); }

.wave { display: inline-flex; align-items: center; gap: 3px; height: 24px; }
.wave i { display: block; width: 4px; border-radius: 3px; background: var(--amber); }
.wave i:nth-child(1) { height: 8px; }
.wave i:nth-child(2) { height: 16px; background: #7fa9a8; }
.wave i:nth-child(3) { height: 24px; }
.wave i:nth-child(4) { height: 12px; background: #7fa9a8; }
.wave i:nth-child(5) { height: 20px; }
.wave i:nth-child(6) { height: 10px; background: #7fa9a8; }
.wave i:nth-child(7) { height: 16px; background: #7fa9a8; }

nav { display: flex; flex-wrap: wrap; gap: 2px 20px; padding-top: 10px; }
nav a { padding: 9px 0; color: var(--on-night-muted); text-decoration: none; border-bottom: 3px solid transparent; font-size: 0.95rem; }
nav a:hover { color: var(--on-night); }
nav a[aria-current="page"] { color: var(--on-night); font-weight: 600; border-bottom-color: var(--amber); }

/* Type */
main { padding-top: 30px; padding-bottom: 70px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1.2rem; margin: 28px 0 8px; text-wrap: balance; }
h3 { font-size: 1.02rem; margin: 0; }
.lede { max-width: 66ch; margin: 0 0 20px; color: var(--muted); font-size: 1.07rem; }
.prose { max-width: 68ch; }
.prose dt { font-weight: 600; margin-top: 10px; }
.prose dd { margin: 0; color: var(--muted); }
.meta, .hint { color: var(--muted); font-size: 0.875rem; }

/* Home */
.band { background: var(--teal-soft); border-radius: 12px; padding: 20px 24px; margin: 20px 0; }
.band p { margin: 0 0 6px; max-width: 66ch; }
.eyebrow { font-size: 0.85rem; font-weight: 600; color: var(--teal); }
.phase { font-size: 1.5rem; font-weight: 700; }
.plain { margin: 0; padding-left: 20px; max-width: 72ch; }
.plain li { margin: 6px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* Buttons */
.button, button { display: inline-block; background: var(--coral); color: var(--on-coral); border: 0; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 8px; }
.button:hover, button:hover { background: var(--coral-hover); }
.button.secondary { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.button.secondary:hover { background: var(--teal-soft); }
button:disabled { opacity: 0.6; cursor: wait; }

/* Progress */
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-top-width: 5px; border-radius: 10px; padding: 4px 16px 14px; }
.stage h2 { margin-top: 12px; }
.stage.done { border-top-color: var(--green); }
.stage.doing { border-top-color: var(--amber); }
.stage.next { border-top-color: var(--coral); }
.stage.later { border-top-color: var(--violet); }
.update { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.update p { margin: 4px 0 0; max-width: 72ch; }

/* Milestone plan: one flow of arrows running left to right */
main:has(section[data-view="plan"]:not([hidden])) { max-width: 1320px; }
.flow-wrap { overflow-x: auto; padding-bottom: 8px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); min-width: 1060px; }
.flow-step { display: flex; flex-direction: column; min-width: 0; }
.arrow {
  display: flex; flex-direction: column; justify-content: center; min-height: 92px;
  padding: 10px 30px 10px 32px; margin-right: -14px; color: var(--ink); background: #33494e;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%, 22px 50%);
}
.flow-step:first-child .arrow { padding-left: 16px; clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%); }
.flow-step:last-child .arrow { margin-right: 0; }
.flow-step:nth-child(3) .arrow { background: #344852; }
.flow-step:nth-child(4) .arrow { background: #364655; }
.flow-step:nth-child(5) .arrow { background: #394658; }
.flow-step:nth-child(6) .arrow { background: #3c4559; }
.flow-step.current .arrow { background: #6ba5a5; color: #142224; }
.arrow .num { font-size: 0.78rem; font-weight: 600; opacity: 0.9; }
.arrow .name { font-weight: 700; line-height: 1.25; }
.flow-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px 4px 6px; font-size: 0.9rem; }
.flow-step:first-child .flow-body { padding-left: 4px; }
.flow-body ul { margin: 0; padding-left: 18px; flex: 1; }
.flow-body li { margin: 4px 0; }
.done-when { margin: 4px 0 0; padding: 8px 10px; width: 100%; min-height: 104px; background: var(--teal-soft); border-radius: 6px; }
.done-when strong { display: block; color: var(--teal); }
.after-flow { margin-top: 18px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.after-flow p { margin: 4px 0; max-width: 90ch; }

/* How we'll improve */.keep { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.keep li { background: var(--green-soft); border-radius: 10px; padding: 12px 16px; }
.compare { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.compare thead th { background: var(--night); color: var(--on-night); font-size: 0.92rem; }
.compare tbody th { width: 21%; font-weight: 600; }
.compare td { width: 36%; color: var(--muted); }
.compare td.ours { width: 43%; color: var(--ink); background: var(--teal-soft); }
.compare tbody tr:last-child > * { border-bottom: 0; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.form label:not(.choice), .rating label:not(.chip-choice) { font-weight: 600; margin-top: 12px; }
.form input:not([type="radio"]), select, textarea, .rating input:not([type="radio"]) {
  width: 100%; padding: 9px 10px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px;
}
.form button { align-self: flex-start; margin-top: 14px; }
.form .warning { margin: 10px 0 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.hint { margin: 0; }
.form-message { min-height: 1.5em; margin: 8px 0 0; font-weight: 600; }
.form-message.ok { color: var(--green); }
.form-message.bad { color: var(--bad); }
.warning, .notice { padding: 12px 16px; margin: 0 0 22px; max-width: 74ch; border-radius: 8px; }
.warning { background: var(--amber-soft); color: var(--amber-ink); }
.notice { background: var(--violet-soft); }

/* Test recordings */
.case { margin-bottom: 34px; }
.case > h2 { margin: 0 0 4px; padding-left: 12px; border-left: 6px solid var(--teal); }
.case.tone-1 > h2 { border-left-color: var(--coral); }
.case.tone-2 > h2 { border-left-color: var(--amber); }
.case.tone-3 > h2 { border-left-color: var(--violet); }
.prompt { margin: 0 0 12px; color: var(--muted); max-width: 72ch; }
.recordings { display: grid; gap: 14px; }
.recording { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.recording-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.duration { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.recording audio { display: block; width: 100%; margin: 10px 0; }
.transcript summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: 4px 0; }
.lines { list-style: none; margin: 8px 0 0; padding: 0; max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 52px 130px 1fr; gap: 2px 10px; align-items: baseline; padding: 7px 6px; border-bottom: 1px solid var(--line); border-radius: 4px; }
.line.active { background: var(--amber-soft); }
.line.ignore .said, .line.ignore .speaker { color: var(--muted); }
.time { background: transparent; color: var(--teal); padding: 0; font-weight: 600; font-size: 0.875rem; font-variant-numeric: tabular-nums; text-decoration: underline; text-align: left; }
.time:hover { background: transparent; color: var(--coral); }
.speaker { font-weight: 600; font-size: 0.875rem; }
.said { overflow-wrap: anywhere; }
.ignore-tag { grid-column: 3; justify-self: start; font-size: 0.78rem; font-weight: 600; color: var(--violet); background: var(--violet-soft); padding: 1px 8px; border-radius: 999px; }
.rating { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; max-width: 560px; }
.rating-title { margin: 0 0 4px; font-weight: 600; }
.rating-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-choice { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 400; }
.chip-choice:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); font-weight: 600; }
.rating button { align-self: flex-start; margin-top: 10px; }
.credits { color: var(--muted); font-size: 0.9rem; max-width: 72ch; }

/* Submissions */
.item, .review-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.pill.received { background: var(--teal-soft); color: var(--teal); }
.pill.under_review { background: var(--amber-soft); color: var(--amber-ink); }
.pill.accepted { background: var(--green-soft); color: var(--green); }
.pill.parked { background: var(--violet-soft); color: var(--violet); }
.body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; max-width: 72ch; }
.note { border-left: 3px solid var(--coral); padding-left: 10px; margin: 8px 0; }
.review-actions { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 8px; align-items: start; margin-top: 10px; }
.empty { color: var(--muted); }

/* Sign-in */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--night); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login-card .brand { color: var(--ink); margin: 8px 0 14px; }
.login-card .brand span { color: var(--teal); }
.login-card h1 { font-size: 1.3rem; margin-bottom: 0; }
.login-card input { max-width: none; }

/* Modern finish: soft shadows in place of hard borders */
.stage, .update, .recording, .item, .review-card, .after-flow, .compare, .login-card { border-color: transparent; box-shadow: var(--shadow); }
.stage { border-top-color: var(--line); }
.stage.done, .stage.doing, .stage.next, .stage.later { border-top-color: #5b8a8a; }
.update { border-left-color: #5b8a8a; }
.recording, .after-flow, .item, .review-card, .compare { border-radius: 14px; }
.band, .notice, .warning, .keep li, .done-when { border-radius: 12px; }
.case > h2, .case.tone-1 > h2, .case.tone-2 > h2, .case.tone-3 > h2 { border-left-color: #5b8a8a; }
.compare thead th { background: var(--teal-soft); color: var(--ink); }
.note { border-left-color: #5b8a8a; }
.form input:not([type="radio"]), select, textarea, .rating input:not([type="radio"]) { border-color: #4f6166; }
h1 { font-weight: 600; }
.button, button { border-radius: 10px; }
@media (max-width: 620px) {
  h1 { font-size: 1.65rem; }
  .review-actions { grid-template-columns: 1fr; }
  .line { grid-template-columns: 48px 1fr; }
  .said, .ignore-tag { grid-column: 1 / -1; }
  .top .wave { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto !important; }
  .compare thead { display: none; }
  .compare tbody th { border-bottom: 0; padding-bottom: 2px; }
  .compare td { border-bottom: 0; padding-top: 6px; }
  .compare td::before { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; content: "Suniyo today"; }
  .compare td.ours::before { content: "ListenAI.si aim"; }
  .compare tr { border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
