:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--surface);
  --surface: #fff;
  --panel: #f9f9f9;
  --hover: #ededed;
  --ink: #202020;
  --muted: #707070;
  --line: #e6e6e6;
  --active: #ffff00;
  --inactive: #00ff00;
  --header-row-height: 43px;
  --segment-width: 123px;
  --segment-height: 29px;
  --segment-gap: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, textarea, select { color: var(--ink); border: 1px solid var(--line); }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
button:hover { background: var(--panel); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid rgb(32 32 32 / .3);
  outline-offset: 3px;
}
input, textarea, select { border-radius: 12px; background: var(--surface); }
input[type=checkbox] { accent-color: var(--ink); }

.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-row-height);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: #f4f6f8;
  border-bottom: 1px solid #e5e7eb;
  z-index: 10;
}
.brand { display: block; width: 126px; max-width: 100%; border-radius: 4px; }
.brand img { display: block; width: 100%; height: auto; }
.header-navigation { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.header-navigation::-webkit-scrollbar { display: none; }
/* Auto margins center short menus without clipping the start of overflowing menus. */
.topbar nav { display: inline-flex; flex: 0 0 auto; align-items: center; gap: var(--segment-gap); margin-left: auto; padding: var(--segment-gap); border: 1px solid #b8c0bb; border-radius: 6px; background: #fff; }
.topbar .segment { flex: 0 0 auto; min-width: var(--segment-width); min-height: var(--segment-height); height: var(--segment-height); padding: 0 9px; border: 0; border-radius: 4px; background: var(--inactive); color: #5e6761; font: 800 13px Arial, sans-serif; white-space: nowrap; }
.topbar .segment:focus-visible { outline-offset: -2px; }
.topbar .segment:hover { background: var(--inactive); }
.topbar .segment.active, .topbar .segment.active:hover { background: var(--active); color: #1c2b21; box-shadow: inset 0 0 0 1px #5f6d63; }
.tools { display: flex; align-items: center; gap: 8px; }
.compact-control { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 6px; margin-right: auto; color: #111827; font: 13px Arial, sans-serif; white-space: nowrap; cursor: pointer; }
.compact-control input { position: absolute; top: 50%; left: 0; width: 100%; height: 18px; margin: 0; opacity: 0; transform: translateY(-50%); cursor: pointer; }
.compact-control .slider { flex: 0 0 auto; width: 36px; height: 18px; background: #d1d5db; border-radius: 999px; position: relative; pointer-events: none; transition: .2s; }
.compact-control .slider::before { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.compact-control input:checked + .slider { background: #22c55e; }
.compact-control input:checked + .slider::before { transform: translateX(18px); }
.compact-control input:focus-visible + .slider { outline: 2px solid rgb(32 32 32 / .3); outline-offset: 3px; }
.compact-control input:disabled + .slider { opacity: .45; }
.switch-label { user-select: none; }
.settings-button { width: 28px; height: 28px; min-height: 28px; padding: 0; border-color: transparent; color: var(--muted); background: transparent; }
.settings-button:hover, .settings-button.active { color: var(--ink); background: var(--hover); }

main { min-width: 0; max-width: 1184px; margin: calc(var(--header-row-height) + 24px) auto 80px; padding: 0 48px; overflow-wrap: break-word; overflow-wrap: anywhere; }
h1 { font-size: 28px; font-weight: 600; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.6px; }
h2 { font-size: 20px; font-weight: 600; margin: 0; }
.page-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 13px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.page-heading h1 { margin: 0; }
.review-date { font-size: 14px; color: var(--muted); }
.empty-state { margin-top: 32px; padding: 72px 24px; text-align: center; line-height: 1.5; color: var(--muted); font-size: 15px; }
.muted, .hint { color: var(--muted); font-size: 14px; line-height: 1.5; }
.hint { font-size: 13px; }
.settings-description { margin: 10px 0 28px; max-width: 640px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.marker-list { display: flex; flex-direction: column; }
.marker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.marker-row:first-child { border-top: 1px solid var(--line); }
.marker-row textarea { width: 100%; min-height: 44px; padding: 11px 14px; resize: vertical; font-size: 14px; line-height: 1.4; }
.delete-button { border-color: transparent; color: #b42318; }
.delete-button:hover { background: #fef3f2; }
.marker-add { margin-top: 28px; padding: 24px; background: var(--panel); border-radius: 16px; }
.marker-add label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.marker-add textarea { display: block; width: 100%; min-height: 100px; resize: vertical; padding: 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.marker-add button { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.marker-add button:hover { opacity: .85; }
.news-card { padding: 28px 0; border-bottom: 1px solid var(--line); }
.news-card:first-of-type { padding-top: 0; }
.news-card h2 { font-size: 21px; line-height: 1.4; margin-bottom: 16px; letter-spacing: -.2px; }
.news-card .body { max-width: 78ch; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.65; }
.sources { font-size: 13px; color: var(--muted); margin: 20px 0 0; white-space: pre-wrap; }
mark { background: #ffffcc; color: inherit; padding: 0; }
mark.search-match { background: #d6f4c9; }
mark.search-match.marker-match { box-shadow: inset 0 -3px #e2bf4e; }
.archive-filter-panels { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; }
.archive-panel { min-width: 0; }
.archive-panel + .archive-panel { border-left: 1px solid var(--line); padding-left: 24px; }
.archive-panel h2 { font-size: 20px; margin: 0 0 16px; }
.archive-filters { display: grid; align-items: end; gap: 12px 8px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.archive-issues .archive-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-reviews .archive-filters { grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) minmax(0, 1.05fr) minmax(0, 1.55fr); }
.archive-reviews .archive-filters label:last-of-type { grid-column: 1 / 4; }
.archive-filters label { display: grid; gap: 5px; min-width: 0; font-size: 13px; font-weight: 600; }
.archive-filters input, .archive-filters select { width: 100%; min-width: 0; height: 36px; padding: 6px 7px; border-radius: 6px; font-size: 13px; }
.archive-filters button { height: 36px; min-height: 0; padding: 5px 14px; border-radius: 6px; font-size: 13px; }
.archive-output { margin-top: 20px; }
.archive-pager:not([hidden]) + .archive-results { margin-top: 12px; }
.archive-empty { color: var(--muted); padding: 12px 0; }
.archive-error { color: #a12635; margin: 10px 0 0; }
.archive-pager { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.archive-pager button { padding: 5px 10px; min-height: 32px; font-size: inherit; }
.archive-issue { display: flex; align-items: baseline; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: #065f46; text-decoration: none; font-weight: 600; }
.archive-issue:hover { text-decoration: underline; }
.archive-issue time { color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.archive-back { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.archive-segments-body > button { margin-bottom: 12px; }
@media (max-width: 950px) {
  .archive-filter-panels { grid-template-columns: minmax(0, 1fr); }
  .archive-panel + .archive-panel { padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .archive-reviews .archive-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-reviews .archive-filters label:last-of-type { grid-column: auto; }
}
body.compact .news-card { padding: 18px 0; }
body.compact .news-card .body { display: none; }
body.compact .news-card h2 { margin-bottom: 6px; }
.review-date-picker { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; font-size: 14px; }
.review-date-picker input { padding: 8px; max-width: 100%; font-size: 16px; }
.feed-block { display: contents; }
.feed-block-title { margin: 0 0 16px; font-size: 28px; line-height: 1.25; font-weight: 600; letter-spacing: -.6px; color: #065f46; overflow-wrap: anywhere; }
.news-group { margin-bottom: 12px; }
.feed-block .news-card { padding: 0; margin: 0; border: 1px solid #222; border-radius: 10px; overflow: hidden; overflow-wrap: anywhere; font-family: Arial, sans-serif; color: #111; background: var(--surface); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.feed-block .news-card h2, .news-card h3 { margin: 0; padding: 3px 40px 3px 10px; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: normal; border-bottom: 1px solid #222; overflow-wrap: anywhere; }
.bundle .news-card + .news-card { margin: 8px 0 0 48px; border-left: 3px solid #222; }
.feed-block .news-card.important-negative { border: 4px solid #dc2626; }
.now-feed { display: grid; gap: 12px; overflow-anchor: none; }
.now-feed .now-card { border: 1px solid #222; }
.now-feed .now-important { border: 3px solid #15803d; }
.now-feed .now-negative { border: 3px solid #dc2626; }
.now-card-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 5px 12px; border-bottom: 1px solid #222; }
.now-feed .now-card-heading h2 { border: 0; padding: 0; font-size: 21px; }
.now-time { font-size: 15px; font-variant-numeric: tabular-nums; color: #424242; }
.now-interfaces { max-width: 24ch; color: #15803d; font-size: 14px; font-weight: 700; text-align: right; }
.now-card .now-more { display: block; margin-top: 8px; }
.now-feed .now-card .sources { padding: 5px 12px; }
.now-status { margin: 16px 0; }
@media (max-width: 600px) {
  .now-card-heading { grid-template-columns: auto minmax(0, 1fr); gap: 5px 10px; }
  .now-interfaces { grid-column: 2; max-width: none; text-align: left; }
}
body.compact .feed-block .news-card { padding: 0; }
body.compact .news-card h3 { margin-bottom: 0; }
.news-card { position: relative; }
.news-card h2 { padding-right: 30px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
.icon-button:hover { background: #edf0f2; border-color: #aab1b8; }
.copy-news { position: absolute; right: 5px; top: 2px; width: 24px; height: 24px; }
.feed-block .news-card .body { max-width: none; padding: 10px 14px; font: 20px/1.35 Arial, sans-serif; border-bottom: 1px solid #222; }
.now-feed .now-card .body { position: relative; min-height: 36px; padding-right: 40px; }
.now-card .body .copy-news { top: 6px; }
.source-line { display: block; }
.source-link, .source-permalink { color: #065f46; text-decoration: underline; overflow-wrap: anywhere; }
.source-link { font-weight: 600; }
.feed-block .sources { margin: 0; padding: 2px 10px; text-align: right; color: #065f46; font: 16px/1.4 Arial, sans-serif; }
.bundle-title { display: flex; align-items: stretch; border-bottom: 1px solid #222; }
.bundle-title h3 { flex: 1; border: 0; }
.bundle-toggle { flex: 0 0 32px; width: 32px; min-height: 28px; padding: 0; border: 0; border-right: 1px solid #222; border-radius: 0; background: #065f46; color: #fff; font: 800 18px Arial, sans-serif; cursor: pointer; }
.bundle-toggle:hover { background: #047857; }
.bundle.is-collapsed .news-card:not(:first-child) { display: none; }
.compact-expand { display: none; }
body.compact .compact-expand { display: inline-flex; margin-top: 4px; }
body.compact .news-card.is-expanded .body { display: block; }
.clipboard-fallback { position: fixed; top: 0; left: -10000px; }
.portal-player { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: 440px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); min-width: 280px; min-height: 180px; overflow: auto; resize: both; background: #f1f3f5; border: 1px solid #707880; border-radius: 6px; box-shadow: 0 8px 28px #0003; color: #111; }
.portal-player[hidden] { display: none; }
.player-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: #e0e5e8; cursor: move; touch-action: none; }
.player-header h2 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.player-media video { display: block; width: 100%; max-height: 50vh; background: #000; }
.player-media video[hidden] { display: none; }
.player-controls { padding: 10px; }
.player-times { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.player-times input { width: 72px; padding: 4px; font-size: 16px; }
.player-times select { padding: 4px; font-size: 16px; }
.player-times button { padding: 4px 8px; }
.player-seek { width: 100%; margin: 14px 0; }
.player-actions { display: flex; justify-content: center; gap: 8px; }
.player-actions button { padding: 8px 12px; }
.portal-player .error { margin: 10px 0 0; font-size: 13px; }
.source-dialog { width: 780px; }
.source-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.source-dialog-header h2 { margin: 0; }
.source-permalink { display: block; margin: 18px 0; }
.external-source { display: inline-block; margin-bottom: 16px; }
.original-source-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }

dialog {
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
  padding: 32px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgb(0 0 0 / .14);
}
dialog::backdrop { background: rgb(0 0 0 / .32); }
.dialog-heading { margin-bottom: 28px; }
.dialog-brand { font-size: 24px; font-weight: 650; letter-spacing: -.8px; }
dialog h1 { font-size: 22px; margin-bottom: 8px; letter-spacing: -.4px; }
dialog form { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
dialog label { display: flex; flex-direction: column; gap: 9px; font-size: 14px; font-weight: 500; }
dialog input:not([type=checkbox]), dialog select { width: 100%; height: 44px; padding: 10px 14px; font-size: 14px; }
dialog .check-label { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; }
dialog input[type=checkbox] { width: 15px; height: 15px; margin: 0; }
.primary { min-height: 44px; background: var(--ink); color: var(--surface); border-color: var(--ink); font-weight: 600; }
.primary:hover { background: var(--ink); opacity: .85; }
.text-button { display: block; min-height: auto; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 20px; }
.text-button:hover { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.error { font-size: 14px; line-height: 1.5; color: #b42318; padding: 12px 14px; background: #fef3f2; border: 1px solid #fee4e2; border-radius: 12px; margin: 0; }
.notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); margin: 0; background: var(--ink); color: var(--surface); padding: 14px 22px; border-radius: 12px; box-shadow: 0 4px 20px rgb(0 0 0 / .12); z-index: 30; overflow-wrap: break-word; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }

@media (max-width: 850px) {
  .topbar { grid-template-columns: 108px minmax(0, 1fr) auto; padding: 0 16px; gap: 8px; }
  .topbar nav { margin-left: 0; }
  .compact-control { margin-right: 0; }
  .tools { gap: 8px; }
  main { padding: 0 24px; }
  .marker-row { grid-template-columns: minmax(0, 1fr) auto; }
  .marker-row textarea { grid-column: 1 / -1; }
  .page-heading { flex-wrap: wrap; gap: 10px; }
  .page-heading h1, .feed-block-title { font-size: 24px; }
}
@media (max-width: 560px) {
  .topbar { height: calc(var(--header-row-height) * 2); grid-template-columns: 1fr auto; grid-template-rows: repeat(2, var(--header-row-height)); gap: 0 12px; padding: 0 12px; }
  .header-navigation { grid-column: 1 / -1; grid-row: 2; gap: 4px; }
  .compact-control { gap: 4px; }
  .tools { grid-column: 2; grid-row: 1; }
  main { margin-top: calc(var(--header-row-height) * 2 + 16px); padding: 0 20px; }
  dialog { padding: 28px 24px; }
  .marker-add { padding: 20px; }
}
@media (max-width: 850px), (pointer: coarse) {
  dialog input:not([type=checkbox]), dialog select, .marker-row textarea, .marker-add textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .compact-control .slider, .compact-control .slider::before { transition: none; }
}
