:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #162016;
  --muted: #5f685d;
  --panel: #fffaf0;
  --panel-strong: #fff3d5;
  --line: #d9cba9;
  --accent: #295b39;
  --accent-strong: #14351f;
  --warn: #8a4b14;
  --warn-bg: #fff0cf;
  --shadow: 0 18px 50px rgb(48 37 14 / 14%);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgb(255 255 255 / 70%), transparent 30rem),
    linear-gradient(180deg, #faf6ec 0%, var(--bg) 45%, #ece4d3 100%);
  color: var(--ink);
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-header,
.site-footer,
.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 32px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--accent-strong);
  text-decoration: none;
  letter-spacing: -0.04em;
}

.tagline,
.site-footer {
  color: var(--muted);
}

.app-shell {
  padding: 26px 0 44px;
}

.site-footer {
  padding: 22px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.social-links {
  display: flex;
  gap: 8px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: #fffdf6;
}

.social-icon:hover {
  border-color: var(--accent);
  background: var(--panel-strong);
}

.social-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.panel {
  background: rgb(255 250 240 / 86%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 32px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 28px;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  color: var(--accent-strong);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 68ch;
}

.hero .lede {
  max-width: 58ch;
}

.notice {
  background: var(--warn-bg);
  border: 1px solid #e0b964;
  border-radius: 18px;
  padding: 16px 18px;
  color: var(--warn);
  line-height: 1.5;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.session-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 210px;
}

.session-card h2 {
  font-size: 1.25rem;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pill {
  border: 1px solid var(--line);
  background: #fffdf6;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill.good {
  color: #174628;
  border-color: #93bd9e;
  background: #f3fff3;
}

.pill.warn {
  color: var(--warn);
  border-color: #e0b964;
  background: var(--warn-bg);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.button,
button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 999px;
  padding: 9px 14px;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  color: var(--accent);
  background: transparent;
}

/* Pagers (index + transcript) disable their buttons at the bounds; the filled
   button style otherwise gives no visual cue that a click will do nothing. */
button:disabled {
  opacity: 0.45;
  cursor: default;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf6;
  color: var(--ink);
  padding: 9px 11px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.transcript {
  display: grid;
  gap: 10px;
}

.line-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgb(255 253 246 / 78%);
}

.line-row:target,
.line-row.highlight {
  border-color: #bf8d28;
  background: var(--panel-strong);
}

.timestamp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 700;
}

.line-text {
  line-height: 1.62;
  font-size: 1.04rem;
}

.line-content {
  display: grid;
  gap: 6px;
}

.speaker-label {
  width: fit-content;
  border: 1px solid #b9c8ad;
  border-radius: 999px;
  background: #f6fff1;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  padding: 3px 8px;
}

.line-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.small-link {
  font-size: 0.88rem;
}

.report-box {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.corrections-log {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.corrections-log ul {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.corrections-log li {
  display: grid;
  gap: 3px;
}

.filter-bar {
  padding: 16px 18px;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
}

.filter-controls label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-controls select,
.filter-controls input {
  margin: 0;
  min-width: 200px;
}

/* Pager row under the filter controls — reuses the transcript toolbar idiom
   (count label left, Previous/Next controls right). */
.filter-bar .index-pager {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.index-pager #filter-count {
  margin: 0;
  font-size: 0.9rem;
}

.filter-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--ink);
  padding-bottom: 6px;
}

.filter-check input {
  min-width: 0;
  margin: 0;
}

.pill.impeach {
  color: #7a1d1d;
  border-color: #d98b8b;
  background: #ffe9e6;
  font-weight: 700;
}

.pill.type {
  color: #1d3a5f;
  border-color: #9db4cd;
  background: #eaf1f9;
  font-weight: 600;
}

.search-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.search-box input[type="search"] {
  flex: 1 1 260px;
  margin: 0;
}

.speaker-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.speaker-filter select {
  min-width: 150px;
}

.transcript-seek {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: -4px 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.transcript-seek input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.search-box #search-status {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.9rem;
}

.search-results {
  flex-basis: 100%;
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  margin-top: 4px;
}

.search-hit {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  text-align: left;
  align-items: baseline;
  padding: 10px 12px;
  background: #fffdf6;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.search-hit:hover {
  border-color: #bf8d28;
  background: var(--panel-strong);
}

.search-hit-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
}

.search-hit-text {
  line-height: 1.5;
  font-size: 0.98rem;
}

.search-hit mark {
  background: #ffe08a;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* Cross-session search on the index page reuses the session-page hit styles;
   hits there are links (navigate to the transcript anchor), not buttons. */
a.search-hit {
  text-decoration: none;
}

.global-search .search-box {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.global-search .search-results {
  max-height: 60vh;
}

.search-session-head {
  margin: 10px 0 2px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.error {
  color: #7a1d1d;
  background: #ffe9e6;
  border: 1px solid #e5aaa2;
  border-radius: 14px;
  padding: 12px 14px;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .hero {
    display: block;
  }

  .site-footer > * + * {
    display: block;
    margin-top: 10px;
  }

  .site-footer .social-links {
    display: flex;
  }

  .line-row {
    grid-template-columns: 1fr;
  }

  .line-actions {
    justify-content: flex-start;
  }
}
