:root {
  --ink: #1c232b;
  --muted: #69727c;
  --line: #d8dee5;
  --paper: #f4f6f8;
  --surface: #ffffff;
  --accent: #0b6f70;
  --signal: #b64036;
  --note: #315f9f;
  --wash: #e9eef3;
  --gold: #a87918;
  --panel: #f9fbfc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  word-break: keep-all;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 36px 18px;
  border-bottom: 2px solid var(--ink);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
  letter-spacing: 0;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

main {
  padding: 18px 36px 36px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 560px);
  gap: 12px;
  align-items: end;
  padding: 14px 0;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

input:focus {
  outline: 2px solid var(--note);
  outline-offset: 1px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  min-width: 0;
  margin-top: 22px;
  align-items: start;
}

.archive {
  position: sticky;
  top: 12px;
  min-width: 0;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.feed {
  min-width: 0;
}

.archive > ol,
.month-group ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive > ol {
  display: grid;
  gap: 8px;
}

.month-group details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.month-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

.month-group summary::-webkit-details-marker {
  display: none;
}

.month-group summary::before {
  content: "+";
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1;
}

.month-group details[open] summary::before {
  content: "-";
}

.month-group summary span {
  flex: 1 1 auto;
}

.month-group summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.month-group ol {
  display: grid;
  gap: 5px;
  padding: 0 8px 8px;
}

.archive button {
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: #f7f9fb;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 7px 9px;
  text-align: left;
}

.archive button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.source-health {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.source-health h2 {
  margin-bottom: 10px;
}

.health-meter {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.health-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.source-health p {
  display: grid;
  gap: 2px;
  margin: 9px 0 0;
}

.source-health strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
}

.source-health span {
  color: var(--muted);
  font-size: 13px;
}

.feed-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.feed-header p {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

#records {
  display: grid;
  gap: 18px;
}

.program-group {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.program-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fafb 100%);
}

.program-group-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.program-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.program-title > div {
  min-width: 0;
}

.program-icon,
.index-icon {
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
}

.program-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.index-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.program-records {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #f6f8fa;
}

.record {
  container-type: inline-size;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.index-record {
  align-content: start;
}

.record-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 30%);
  gap: 14px;
  align-items: start;
  min-width: 0;
  cursor: pointer;
}

.index-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.index-headline {
  display: grid;
  align-items: start;
  min-width: 0;
}

.index-headline span {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.program {
  color: var(--accent);
  font-weight: 800;
}

.record h3 {
  align-self: start;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  text-wrap: pretty;
}

.index-background {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-wrap: pretty;
}

.speaker-chips,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.speaker-chips {
  align-content: start;
  justify-content: end;
}

.speaker-chips span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 12px;
  padding: 3px 8px;
}

.speaker-chips strong {
  font-weight: 900;
}

.speaker-chips em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-list span {
  flex: 0 1 auto;
  max-width: 100%;
  border-radius: 999px;
  background: #eaf1f7;
  color: var(--note);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  padding: 3px 8px;
}

.tag-list {
  margin-top: 1px;
}

.speaker-panel {
  display: grid;
  gap: 4px;
  align-self: start;
  min-width: 0;
  max-height: 116px;
  overflow: auto;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line);
  scrollbar-width: thin;
}

.speaker-row {
  display: grid;
  grid-template-columns: minmax(42px, max-content) minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.speaker-row strong {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  white-space: nowrap;
}

.speaker-row em {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-detail {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.record-detail[hidden] {
  display: none;
}

.speaker-list {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding: 10px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  counter-reset: speakers;
}

.speaker-list li {
  display: grid;
  grid-template-columns: 22px minmax(80px, max-content) minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-width: 0;
  counter-increment: speakers;
}

.speaker-list li::before {
  content: counter(speakers);
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #e4f0ec;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 900;
}

.speaker-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.speaker-role {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.summary-body {
  white-space: pre-wrap;
  margin: 10px 0 12px;
  font-size: 15px;
}

.summary-structured {
  display: grid;
  gap: 12px;
  margin: 10px 0 12px;
}

.summary-lead,
.summary-panel {
  min-width: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.summary-lead {
  border-top: 2px solid var(--ink);
}

.summary-panel {
  border-top: 1px solid var(--line);
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.summary-label span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #eef3f5;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.summary-label strong {
  color: var(--ink);
  font-size: 13px;
}

.summary-list {
  margin: 8px 0 0;
  padding: 0 0 12px 20px;
}

.summary-lead li,
.summary-panel li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.summary-panel li {
  font-size: 13px;
}

.summary-list:not(.expanded) .extra-bullet {
  display: none;
}

.more-bullets {
  margin-top: 7px;
  list-style: none;
}

.more-bullets button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.more-bullets button:hover,
.more-bullets button:focus {
  color: var(--note);
  text-decoration: underline;
}

.summary-lead p,
.summary-panel p {
  margin: 8px 0 13px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  text-wrap: pretty;
}

.summary-panels {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.summary-json .summary-panels {
  grid-template-columns: 1fr;
}

@container (min-width: 900px) {
  .summary-json .summary-panels {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr) minmax(0, 1fr);
  }

  .summary-json .summary-panel {
    padding-left: 14px;
    border-left: 1px solid var(--line);
  }

  .summary-json .summary-panel:first-child {
    padding-left: 0;
    border-left: 0;
  }
}

.brief-grid,
.quote-stack,
.issue-stack,
.headline-stack {
  display: grid;
  gap: 0;
  padding: 0;
}

.brief-block {
  display: grid;
  gap: 5px;
  padding: 0 0 12px;
  background: transparent;
}

.summary-empty {
  margin: 0;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 13px;
}

.brief-block strong,
.quote-group-head strong,
.issue-card strong {
  font-size: 13px;
  font-weight: 900;
}

.brief-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
}

.brief-block ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 0 0 17px;
}

.brief-block li {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.quote-group {
  min-width: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.quote-group-head {
  padding: 10px 0 2px;
}

.quote-group-head strong {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.quote-group-items {
  display: grid;
  gap: 0;
}

.quote-card,
.issue-card,
.headline-card {
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.quote-card {
  padding: 9px 0 11px;
}

.quote-group-items .quote-card:first-child {
  border-top: 0;
}

.quote-card blockquote {
  margin: 0;
  padding-left: 9px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
  text-wrap: pretty;
}

.quote-card p,
.headline-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-wrap: pretty;
}

.issue-card {
  padding: 10px 0 11px;
}

.issue-card small {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.issue-card small span {
  color: var(--ink);
  font-weight: 900;
}

.issue-card small em {
  font-style: normal;
}

.headline-panel {
  border-top-color: #c9d0d8;
}

.headline-card {
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.headline-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  text-wrap: pretty;
}

.headline-card span {
  display: inline-block;
  margin-top: 7px;
  color: var(--signal);
  font-size: 12px;
  font-weight: 900;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 12px;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus {
  background: #000;
  outline: none;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.empty {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar,
  .feed-header {
    display: grid;
  }

  .feed-header p {
    text-align: left;
  }

  .controls,
  .layout,
  #records,
  .program-records,
  .record-index,
  .summary-panels,
  .summary-json .summary-panels,
  .record:only-child .summary-panels {
    grid-template-columns: 1fr;
  }

  .record h3,
  .index-background,
  .speaker-panel {
    grid-column: 1 / -1;
  }

  .record-index {
    gap: 10px;
  }

  .speaker-panel {
    grid-row: auto;
  }

  .speaker-chips {
    justify-content: start;
  }

  .archive {
    position: static;
    display: grid;
    gap: 12px;
  }

  .archive > ol {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .archive > ol::-webkit-scrollbar {
    display: none;
  }

  .archive > ol > li {
    flex: 0 0 min(230px, 78vw);
  }

  .archive button {
    width: 100%;
    min-width: 0;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .month-group ol {
    max-height: 176px;
    overflow: auto;
  }

  .source-health {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 7px 12px;
    align-items: center;
    margin-top: 0;
    padding-top: 11px;
  }

  .source-health h2 {
    margin: 0;
    font-size: 15px;
  }

  .health-meter {
    height: 7px;
  }

  .source-health p {
    display: flex;
    gap: 7px;
    align-items: baseline;
    grid-column: 1 / -1;
    margin: 0;
  }

  .source-health strong {
    font-size: 18px;
  }

  .source-health span {
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .topbar,
  main {
    width: 100%;
    padding-left: 18px;
    padding-right: 18px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .program-records {
    padding: 10px;
  }

  .record {
    padding: 12px;
  }

  .controls,
  .layout,
  .feed,
  .program-group,
  .program-records,
  .record,
  .record-index,
  .index-main,
  .tag-list,
  .speaker-panel {
    max-width: 100%;
  }

  .feed {
    width: calc(100vw - 56px);
  }

  .index-main {
    width: min(100%, calc(100vw - 104px));
  }

  .record h3,
  .index-background {
    max-width: calc(100vw - 116px);
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .record h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .tag-list {
    display: block;
    line-height: 1.9;
  }

  .tag-list span {
    display: inline-block;
    margin: 0 5px 5px 0;
  }

  .speaker-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .speaker-row em {
    grid-column: auto;
  }

  .detail-actions {
    justify-content: stretch;
  }

  .source-link {
    width: 100%;
  }
}
