:root {
  color-scheme: light dark;
  --paper: #f4f1e9;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --ink: #20221f;
  --muted: #686c65;
  --line: #d8d5cc;
  --line-strong: #bbb8ae;
  --accent: #245e4a;
  --accent-soft: #deebe4;
  --danger: #a23c32;
  --danger-soft: #f7e3df;
  --star: #b26b00;
  --shadow: 0 16px 48px rgb(31 37 33 / 10%);
  --radius: 8px;
  --sidebar: 218px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.5;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), transparent 30%);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  color: white;
  background: var(--accent);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.app-shell { min-height: 100vh; }

.reader-page { overflow: hidden; }
.reader-page .app-shell { height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  text-decoration: none;
  letter-spacing: -.02em;
}
.brand-mark, .login-brand, .mobile-brand > span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.category-nav { padding: 8px 12px; }
.category-button, .dialog-category {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.category-button {
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 5px;
  color: var(--muted);
}
.category-button:hover { background: color-mix(in srgb, var(--accent-soft), transparent 35%); }
.category-button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.nav-count { min-width: 22px; color: var(--muted); font-size: 12px; text-align: right; }

.sidebar-actions {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding: 14px 12px 20px;
  border-top: 1px solid var(--line);
}
.sidebar-link {
  padding: 7px 10px;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.sidebar-link:hover { color: var(--ink); }

.main-content {
  width: min(100% - var(--sidebar), 1040px);
  margin-left: var(--sidebar);
  padding: 22px 36px 64px;
  container: reader-content / inline-size;
}
.reader-page .main-content {
  width: min(calc(100% - var(--sidebar) - 12px), 1040px);
  height: 100vh;
  height: 100dvh;
  margin-right: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.reader-page .main-content, .reader-scroll {
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: auto;
}
.reader-page .main-content::-webkit-scrollbar, .reader-scroll::-webkit-scrollbar { width: 13px; }
.reader-page .main-content::-webkit-scrollbar-track, .reader-scroll::-webkit-scrollbar-track { background: transparent; }
.reader-page .main-content::-webkit-scrollbar-thumb, .reader-scroll::-webkit-scrollbar-thumb {
  border: 3px solid var(--paper);
  border-radius: 999px;
  background: var(--line-strong);
}
.reader-page .main-content::-webkit-scrollbar-thumb:hover, .reader-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.compact-header, .title-line, .header-actions, .section-heading, .settings-heading,
.source-group-heading, .category-card-heading, .category-fields, .dialog-header, .dialog-footer {
  display: flex;
  align-items: center;
}
.compact-header { min-height: 48px; justify-content: space-between; gap: 24px; }
.title-line { min-width: 0; gap: 12px; }
h1, h2, h3, p { margin-top: 0; }
.compact-header h1 { margin: 0; font: 700 clamp(22px, 3vw, 29px)/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.header-actions { flex-shrink: 0; gap: 6px; }
.refresh-status { margin-right: 6px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; white-space: nowrap; }

.icon-button {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { border-color: var(--line); background: var(--surface); }
.icon-button:disabled { cursor: wait; opacity: .55; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.view-button[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent), transparent 72%); color: var(--accent); background: var(--accent-soft); }
.view-button[aria-pressed="true"]:hover { border-color: var(--accent); }
.filter-count, .count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.filter-count { position: absolute; top: -2px; right: -3px; }
.is-spinning svg { animation: spin .8s linear infinite; }

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 14px;
  margin: 14px 0 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.filter-view-hint {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.field { display: grid; gap: 5px; }
.filter-search { min-width: min(100%, 220px); flex: 2 1 240px; }
.filter-sort { min-width: 130px; flex: 0 1 145px; }
.filter-source { min-width: 160px; flex: 1 1 180px; }
.filter-panel .field > input,
.filter-panel .field > select { width: 100%; min-width: 0; }
.filter-actions {
  display: flex;
  min-width: min(100%, 360px);
  flex: 1 1 390px;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
}
.filter-toggles, .filter-commands { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.filter-commands { justify-content: flex-end; }
.filter-action-button { width: 34px; height: 34px; color: var(--accent); }
.filter-action-button svg { width: 18px; }
.field label, .login-form > label { color: var(--muted); font-size: 12px; font-weight: 650; }
.field-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
input, select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-strong);
}
input:hover, select:hover { border-color: var(--muted); }
input:disabled, select:disabled { cursor: not-allowed; opacity: .62; }
.checkbox-field { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; white-space: nowrap; }
.checkbox-field input { min-height: auto; accent-color: var(--accent); }
.checkbox-field:has(input:disabled) { color: var(--muted); }

.text-button, .secondary-button, .primary-button, .row-action {
  min-height: 38px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 650;
}
.text-button { padding: 6px 8px; border: 0; color: var(--accent); background: transparent; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }

@container reader-content (max-width: 780px) {
  .filter-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(170px, .85fr);
    gap: 12px 14px;
  }
  .filter-search { grid-column: 1; min-width: 0; }
  .filter-view-hint { grid-column: 1 / -1; }
  .filter-source { grid-column: 2; min-width: 0; }
  .filter-actions {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .filter-panel:has(.filter-sort:not([hidden])) .filter-search { grid-column: 1 / -1; }
  .filter-panel:has(.filter-sort:not([hidden])) .filter-sort { grid-column: 1; min-width: 0; }
  .filter-panel:has(.filter-sort:not([hidden])) .filter-source { grid-column: 2; }
}

@container reader-content (max-width: 540px) {
  .filter-panel { grid-template-columns: minmax(0, 1fr); }
  .filter-search,
  .filter-sort,
  .filter-source,
  .filter-panel:has(.filter-sort:not([hidden])) .filter-search,
  .filter-panel:has(.filter-sort:not([hidden])) .filter-sort,
  .filter-panel:has(.filter-sort:not([hidden])) .filter-source,
  .filter-actions { grid-column: 1; }
  .filter-actions { display: grid; justify-content: stretch; gap: 4px; }
  .filter-toggles, .filter-commands { justify-content: flex-start; }
}
.secondary-button, .row-action { padding: 7px 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.secondary-button:hover, .row-action:hover { border-color: var(--accent); color: var(--accent); }
.primary-button { padding: 9px 18px; border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary-button:hover { filter: brightness(.92); }
button:disabled { cursor: not-allowed; opacity: .6; }

.notice { margin: 12px 0; padding: 8px 11px; border-left: 3px solid var(--accent); color: var(--accent); background: var(--accent-soft); }
.notice.error { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.news-view-bar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 10px;
  padding-block: 7px;
  border-block: 1px solid var(--line);
}
.news-view-switcher { display: inline-flex; padding: 3px; border-radius: 6px; background: var(--surface); }
.news-view-switcher button {
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.news-view-switcher button:hover { color: var(--ink); }
.news-view-switcher button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.briefing-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 5px; }
.briefing-status { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.briefing-refresh { min-height: 32px; }

.list-label {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 17px 2px 18px;
  border-bottom: 1px solid var(--line);
}
.xxxarticle-row h2 {
	margin: 4px 0 5px; font: 700 clamp(17px, 2vw, 20px)/1.27 Georgia, "Times New Roman", serif; letter-spacing: -.012em; 
	
}

.article-row h2 {
	margin: 4px 0 5px; font: 700 clamp(17px, 2vw, 20px)/1.27 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.012em; 
	
}

.article-reader-trigger { padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; letter-spacing: inherit; text-align: left; text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-reader-trigger:hover { color: var(--accent); text-decoration: underline; }
.article-row p { max-width: 760px; margin: 0; color: #51554f; font-size: 15px; line-height: 1.48; }
.article-row .search-snippet { color: var(--ink); }
.search-snippet mark { padding: 0 .08em; border-radius: 2px; color: inherit; background: color-mix(in srgb, var(--star), transparent 68%); }
.article-row img { width: 126px; height: 84px; align-self: center; border-radius: 4px; object-fit: cover; background: var(--line); }
.article-meta { display: flex; min-height: 28px; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.article-source {
  min-width: 0;
  max-width: min(42vw, 250px);
  overflow: hidden;
  color: var(--accent);
  font-weight: 750;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.article-list.hide-descriptions .article-description,
.article-list.hide-descriptions .briefing-topic-description { display: none; }
.article-meta time::before { content: "·"; margin-right: 7px; }
.article-original { display: inline-grid; width: 28px; height: 28px; margin-left: auto; place-items: center; border-radius: 50%; color: var(--muted); }
.article-original:hover { color: var(--accent); background: var(--accent-soft); }
.article-original svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.star-button { display: inline-grid; width: 28px; height: 28px; padding: 4px; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.star-button:hover { color: var(--star); background: color-mix(in srgb, var(--star), transparent 88%); }
.star-button svg { width: 19px; fill: none; stroke: currentColor; stroke-linejoin: round; stroke-width: 1.7; }
.star-button.is-starred { color: var(--star); }
.star-button.is-starred svg { fill: currentColor; }
.star-button:disabled { cursor: wait; }
.article-row.is-read h2, .article-row.is-read p, .article-row.is-read .article-meta > :not(.star-button) { opacity: .64; }
.article-row.is-read h2 { font-weight: 400; }
.briefing-topic { border-bottom: 1px solid var(--line); }
.briefing-topic-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
  padding: 16px 2px 17px;
}
.briefing-rank { color: var(--line-strong); font: 700 12px/1 ui-monospace, monospace; letter-spacing: .04em; }
.briefing-topic-primary { min-width: 0; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.briefing-topic-primary:hover .briefing-topic-heading strong { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.briefing-topic-heading { display: grid; min-width: 0; gap: 4px; }
.briefing-topic-heading strong { font: 700 clamp(17px, 2vw, 20px)/1.25 Georgia, "Times New Roman", serif; letter-spacing: -.012em; }
.briefing-topic-heading > span { max-width: 720px; color: var(--muted); font-size: 14px; line-height: 1.42; }
.briefing-topic.is-read .briefing-rank,
.briefing-topic.is-read .briefing-topic-primary,
.briefing-topic.is-read .briefing-topic-meta { opacity: .64; }
.briefing-topic.is-read .briefing-topic-heading strong { font-weight: 400; }
.briefing-topic-actions { display: flex; align-items: center; gap: 3px; }
.briefing-topic-meta { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.briefing-topic-toggle { display: inline-grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.briefing-topic-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.briefing-topic-toggle svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform .15s; }
.briefing-topic-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.briefing-events { margin: 0 0 16px 44px; border-top: 1px solid var(--line); }
.briefing-event { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.briefing-event:last-child { border-bottom: 0; }
.briefing-event h3 { margin: 2px 0 0; font: 650 15px/1.35 Georgia, "Times New Roman", serif; }
.briefing-event.is-read h3, .briefing-event.is-read .article-meta > :not(.star-button) { opacity: .64; }
.briefing-event .story-sources { margin-top: 7px; }
.story-sources { margin-top: 10px; }
.story-sources > summary { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); cursor: pointer; font-size: 11px; font-weight: 750; list-style: none; }
.story-sources > summary::-webkit-details-marker { display: none; }
.story-sources > summary::after { content: "›"; font-size: 15px; line-height: 1; transition: transform .15s; }
.story-sources[open] > summary::after { transform: rotate(90deg); }
.story-source-list { max-width: 760px; margin-top: 8px; border-top: 1px solid var(--line); }
.story-source-row { display: grid; grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr) 28px; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.story-source-identity { display: grid; gap: 2px; color: var(--muted); font-size: 10px; }
.story-source-identity span { overflow: hidden; color: var(--accent); font-weight: 750; letter-spacing: .025em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.story-source-title { min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; font: 600 13px/1.35 Georgia, serif; text-align: left; }
.story-source-title:hover { color: var(--accent); text-decoration: underline; }
.story-source-row.is-read { opacity: .62; }
.list-actions { display: flex; min-height: 86px; align-items: center; justify-content: center; gap: 10px; padding: 24px; }
.icon-text-button { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); }
.icon-text-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.empty-state { display: grid; min-height: 230px; place-content: center; gap: 5px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font: 700 20px Georgia, serif; }
.skeleton { height: 104px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 55%) 45%, transparent 70%) 0 0/220% 100%; animation: shimmer 1.2s infinite; }

.mobile-bar { display: none; }
.category-dialog { width: min(440px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.category-dialog::backdrop { background: rgb(22 25 23 / 55%); }
.dialog-header { justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font: 700 21px Georgia, serif; }
.dialog-categories { padding: 8px; }
.dialog-category { padding: 12px; border-radius: 5px; }
.dialog-category:hover, .dialog-category[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.dialog-footer { justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); }
.dialog-footer a { color: var(--accent); font-weight: 650; text-decoration: none; }
.dialog-footer button { border: 0; color: var(--muted); background: none; cursor: pointer; }

/* Reader View */
.reader-dialog {
  --reader-content-font-size: clamp(17px, 2vw, 19px);
  --reader-content-line-height: 1.72;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
}
.reader-dialog[data-reader-font-size="small"] {
  --reader-content-font-size: clamp(16px, 1.8vw, 17px);
  --reader-content-line-height: 1.68;
}
.reader-dialog[data-reader-font-size="big"] { --reader-content-font-size: clamp(20px, 2.3vw, 22px); }
.reader-dialog::backdrop { background: rgb(22 25 23 / 60%); }
.reader-shell { display: flex; height: 100%; min-height: 0; flex-direction: column; overflow: hidden; }
.reader-toolbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface), transparent 4%);
  backdrop-filter: blur(12px);
}
.reader-toolbar-source { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.reader-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.reader-star { width: 38px; height: 38px; }
.reader-original { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 5px; color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.reader-original:hover { background: var(--accent-soft); }
.reader-original svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.reader-scroll { min-height: 0; flex: 1; margin-right: 12px; overflow-y: auto; overscroll-behavior: contain; padding: clamp(34px, 7vh, 76px) 24px 96px; scrollbar-gutter: stable; }
.reader-article { width: min(100%, 740px); margin: 0 auto; }
.reader-source { margin-bottom: 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.reader-article > h1 { margin-bottom: 12px; font: 700 clamp(30px, 5vw, 46px)/1.08 Georgia, "Times New Roman", serif; letter-spacing: -.035em; text-wrap: balance; }
.reader-date { margin-bottom: clamp(30px, 5vw, 48px); color: var(--muted); font-size: 13px; }
.reader-loading { display: flex; min-height: 220px; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.reader-spinner { width: 20px; height: 20px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.reader-error { margin-top: 30px; padding: 24px; border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: var(--radius); background: var(--surface); }
.reader-error h2 { margin-bottom: 7px; font: 700 22px Georgia, serif; }
.reader-error p { margin-bottom: 20px; color: var(--muted); }
.reader-error-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reader-error-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.reader-content { overflow-wrap: anywhere; font: 400 var(--reader-content-font-size)/var(--reader-content-line-height) Georgia, "Times New Roman", serif; }
.reader-content > :first-child { margin-top: 0; }
.reader-content p, .reader-content ul, .reader-content ol, .reader-content blockquote, .reader-content pre, .reader-content figure, .reader-content table { margin: 0 0 1.35em; }
.reader-content h2, .reader-content h3, .reader-content h4 { margin: 1.8em 0 .65em; font-family: Georgia, "Times New Roman", serif; line-height: 1.2; letter-spacing: -.02em; }
.reader-content h2 { font-size: 1.55em; }
.reader-content h3 { font-size: 1.3em; }
.reader-content h4 { font-size: 1.12em; }
.reader-content a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reader-content blockquote { padding-left: 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.reader-content img { display: block; width: auto; max-width: 100%; height: auto; margin: 28px auto; border-radius: 4px; background: var(--line); }
.reader-content figcaption { margin-top: -20px; color: var(--muted); font: 400 12px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; text-align: center; }
.reader-content pre { max-width: 100%; overflow-x: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 400 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.reader-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
.reader-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 14px; }
.reader-content th, .reader-content td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }

/* Settings */
.settings-topbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100% - 1100px) / 2)); border-bottom: 1px solid var(--line); background: var(--surface); }
.compact-brand { padding: 10px 0; }
.back-link { color: var(--accent); font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.settings-content { width: min(100% - 40px, 1100px); margin: 0 auto; padding: 38px 0 72px; }
.settings-heading { justify-content: space-between; margin-bottom: 28px; }
.settings-heading h1 { margin: 0; font: 700 34px Georgia, serif; }
.settings-heading-actions, .topbar-links { display: flex; align-items: center; gap: 12px; }
.settings-action-link { display: inline-flex; align-items: center; color: var(--accent); text-decoration: none; }
.kicker { margin-bottom: 4px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.settings-section { margin-top: 38px; }
.section-heading { justify-content: space-between; gap: 28px; margin-bottom: 13px; }
.section-heading h2 { margin-bottom: 3px; font: 700 24px Georgia, serif; }
.section-heading p { margin-bottom: 0; color: var(--muted); }
.reader-size-setting { margin: 0; padding: 15px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.reader-size-setting legend { padding: 0 5px; font-weight: 700; }
.reader-size-options { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.reader-size-options label { position: relative; cursor: pointer; }
.reader-size-options input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.reader-size-options span { display: inline-grid; min-width: 76px; min-height: 38px; padding: 7px 12px; place-items: center; border-radius: 4px; color: var(--muted); font-weight: 650; }
.reader-size-options label:hover span { color: var(--ink); background: var(--surface-strong); }
.reader-size-options input:checked + span { color: var(--accent); background: var(--accent-soft); }
.reader-size-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent), transparent 30%); outline-offset: 2px; }
.reader-size-setting p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.source-search { width: min(280px, 45%); }
.source-group { margin: 0; }
.source-group-heading { margin: 0; border-bottom: 1px solid var(--line-strong); }
.source-group-toggle { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; border: 0; color: var(--ink); background: transparent; cursor: pointer; font: 700 18px Georgia, serif; text-align: left; }
.source-group-toggle:hover { background: color-mix(in srgb, var(--surface), transparent 15%); }
.source-group-summary { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 400 12px Inter, ui-sans-serif, system-ui, sans-serif; white-space: nowrap; }
.source-group-summary svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform .15s; }
.source-group-toggle[aria-expanded="true"] .source-group-summary svg { transform: rotate(180deg); }
.source-row { display: grid; grid-template-columns: minmax(300px, 1.05fr) minmax(330px, 1.35fr) auto; gap: 18px; align-items: center; min-height: 74px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.source-row:hover { background: color-mix(in srgb, var(--surface), transparent 20%); }
.source-main { display: grid; min-width: 0; gap: 7px; }
.switch-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-label input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.switch-control { position: relative; width: 34px; height: 19px; flex: 0 0 auto; border-radius: 20px; background: var(--line-strong); transition: background .15s; }
.switch-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .15s; }
.switch-label input:checked + .switch-control { background: var(--accent); }
.switch-label input:checked + .switch-control::after { transform: translateX(15px); }
.switch-label input:focus-visible + .switch-control { outline: 3px solid color-mix(in srgb, var(--accent), transparent 30%); outline-offset: 3px; }
.switch-label input:disabled + .switch-control { opacity: .5; }
.source-short-name-form { display: grid; grid-template-columns: auto minmax(110px, 190px) auto; align-items: center; gap: 6px; padding-left: 44px; }
.source-short-name-form label { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }
.source-short-name-form input { min-width: 0; min-height: 32px; padding-block: 4px; font-size: 12px; }
.source-short-name-form .row-action { min-height: 32px; padding-block: 4px; white-space: nowrap; }
.source-metrics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 12px; }
.source-metrics b { color: var(--ink); font-weight: 650; }
.type-tag, .source-status { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.type-tag { justify-self: start; color: var(--accent); background: var(--accent-soft); }
.status-ok { color: var(--accent); }
.status-error { color: var(--danger); background: var(--danger-soft); }
.status-muted { color: var(--muted); background: var(--line); }
.row-action { min-height: 32px; padding: 4px 9px; font-size: 12px; }
.category-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.category-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.category-card-heading { justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.category-card-heading h3 { margin: 0; font: 700 18px Georgia, serif; }
.category-card-heading span { color: var(--muted); font-size: 12px; }
.category-fields { flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.retention-field { width: 120px; }
.refresh-interval-field { width: 140px; }
.grouping-window-field { width: 150px; }
.save-category { margin-left: auto; }
.briefing-settings {
  width: 100%;
  margin: 5px 0 0;
  padding: 12px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.briefing-settings legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.briefing-settings:disabled { opacity: .68; }
.briefing-enabled { min-height: 30px; font-weight: 650; }
.briefing-help { display: block; margin: -2px 0 10px 23px; color: var(--muted); font-size: 11px; }
.briefing-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.briefing-target-field input { width: 100%; }
.briefing-facts { margin-top: 8px; }
.briefing-diagnostic-error { margin: 9px 0 0; color: var(--danger); font-size: 12px; }

/* Diagnostics */
.diagnostics-content { max-width: 1180px; }
.diagnostics-heading { align-items: flex-end; gap: 24px; }
.diagnostics-intro { max-width: 620px; margin: 7px 0 0; color: var(--muted); }
.period-selector { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.period-selector button { min-height: 32px; padding: 4px 10px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 650; }
.period-selector button:hover { color: var(--ink); background: var(--surface-strong); }
.period-selector button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.diagnostics-availability { margin: -8px 0 17px; color: var(--muted); font-size: 12px; }
.diagnostics-list { display: grid; gap: 12px; }
.diagnostic-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.diagnostic-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px 12px; }
.diagnostic-card-header h2 { margin: 0; font: 700 22px/1.2 Georgia, serif; }
.diagnostic-category-meta { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.diagnostic-card-actions { display: flex; flex-shrink: 0; align-items: center; gap: 9px; }
.diagnostic-status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 750; }
.diagnostic-status.status-ok { background: var(--accent-soft); }
.status-warning { color: var(--star); background: color-mix(in srgb, var(--star), transparent 88%); }
.diagnostic-toggle svg { transition: transform .16s ease; }
.diagnostic-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.diagnostic-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.diagnostic-metric { min-width: 0; padding: 13px 16px 15px; border-left: 1px solid var(--line); }
.diagnostic-metric:first-child { border-left: 0; }
.diagnostic-metric > span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.diagnostic-metric strong { display: block; overflow-wrap: anywhere; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.diagnostic-metric small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.diagnostic-details { border-top: 1px solid var(--line-strong); background: color-mix(in srgb, var(--paper), var(--surface) 44%); }
.diagnostic-detail-section { padding: 20px 18px 22px; border-top: 1px solid var(--line); }
.diagnostic-detail-section:first-child { border-top: 0; }
.diagnostic-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.diagnostic-section-heading h3 { margin: 0; font: 700 18px Georgia, serif; }
.diagnostic-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.diagnostic-section-heading > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.activity-chart { padding: 13px 14px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.activity-chart svg { display: block; width: 100%; height: 118px; overflow: visible; }
.activity-chart rect { fill: var(--accent); opacity: .78; }
.activity-chart rect:hover { opacity: 1; }
.activity-chart line { stroke: var(--line-strong); stroke-width: 1; }
.chart-range { display: flex; justify-content: space-between; gap: 12px; margin-top: -5px; color: var(--muted); font-size: 10px; }
.grouping-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.grouping-facts + h4 { margin: 19px 0 7px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.largest-groups { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.largest-groups li { display: flex; justify-content: space-between; gap: 18px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.largest-groups span { min-width: 0; overflow-wrap: anywhere; }
.largest-groups strong { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.diagnostic-empty { display: grid; min-height: 92px; place-content: center; gap: 3px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); text-align: center; }
.diagnostic-empty strong { color: var(--ink); }
.diagnostic-empty-copy { margin-bottom: 0; }
.diagnostic-table-wrap { overflow-x: auto; }
.diagnostic-source-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.diagnostic-source-table th { padding: 7px 9px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.diagnostic-source-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.diagnostic-source-table tbody tr:last-child td { border-bottom: 0; }
.diagnostic-source-table td:first-child { width: 36%; }
.diagnostic-source-table td strong, .diagnostic-source-table td small { display: block; }
.diagnostic-source-table td small { margin-top: 2px; color: var(--muted); }

/* Login */
.login-body { display: grid; min-height: 100vh; padding: 20px; place-items: center; background: radial-gradient(circle at 50% 20%, var(--surface) 0, var(--paper) 55%); }
.login-panel { width: min(100%, 390px); padding: 36px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { width: 42px; height: 42px; margin-bottom: 28px; font-size: 20px; }
.login-panel h1 { margin-bottom: 8px; font: 700 29px/1.15 Georgia, serif; letter-spacing: -.02em; }
.login-form { display: grid; gap: 8px; margin-top: 24px; }
.login-form .primary-button { margin-top: 8px; }
.form-error { margin: 2px 0 0; color: var(--danger); font-size: 13px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -220% 0; } }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181b18;
    --surface: #202420;
    --surface-strong: #282d28;
    --ink: #eceee9;
    --muted: #a7ada5;
    --line: #343a34;
    --line-strong: #4b514b;
    --accent: #82c6a8;
    --accent-soft: #253e33;
    --danger: #ef9287;
    --danger-soft: #4a2926;
    --star: #f0b44d;
    --shadow: 0 16px 48px rgb(0 0 0 / 35%);
  }
  .article-row p { color: #bdc2ba; }
  .skeleton { background-image: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 5%) 45%, transparent 70%); }
}

@media (max-width: 900px) {
  .main-content { padding-inline: 24px; }
  .filter-panel { flex-wrap: wrap; }
  .source-row { grid-template-columns: minmax(270px, 1fr) minmax(290px, 1.2fr) auto; gap: 12px; }
  .source-metrics { gap: 4px 10px; }
  .diagnostic-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .diagnostic-metric:nth-child(4) { border-left: 0; }
  .diagnostic-metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .grouping-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grouping-facts .diagnostic-metric:nth-child(3) { border-left: 0; }
  .grouping-facts .diagnostic-metric:nth-child(even) { border-left: 1px solid var(--line); }
  .grouping-facts .diagnostic-metric:nth-child(n+3) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 8;
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface), transparent 5%);
    backdrop-filter: blur(12px);
  }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font-weight: 750; text-decoration: none; }
  .mobile-brand > span { width: 27px; height: 27px; }
  .category-trigger { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong); cursor: pointer; font-weight: 650; }
  .category-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .category-trigger svg { width: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .main-content { width: 100%; margin: 0; padding: 0 16px 50px; }
  .reader-page .main-content { width: calc(100% - 12px); height: calc(100dvh - 56px); margin: 0 12px 0 0; }
  .compact-header { min-height: 48px; gap: 8px; }
  .compact-header h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .title-line { display: flex; }
  .title-line .small { display: block; margin: 0; }
  .list-label { margin-top: 4px; }
  .news-view-bar { margin-top: 4px; }
  .refresh-status { display: none; }
  .article-row { gap: 14px; }
  .article-row img { width: 96px; height: 68px; }
  .filter-panel { align-items: stretch; }
  .field.grow, .filter-panel .field { width: 100%; }
  .checkbox-field { min-height: 32px; }
  .category-dialog { width: 100%; max-width: none; margin: auto 0 0; border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .settings-topbar { padding-inline: 16px; }
  .settings-content { width: min(100% - 28px, 1100px); padding-top: 25px; }
  .section-heading { align-items: end; }
  .source-row { grid-template-columns: 1fr auto; }
  .source-metrics { grid-column: 1 / -1; order: 3; }
  .category-settings { grid-template-columns: 1fr; }
  .diagnostics-heading { align-items: flex-start; }
  .diagnostics-heading .settings-heading-actions { align-items: flex-end; flex-direction: column-reverse; }
}

@media (max-width: 520px) {
  .compact-header h1 { font-size: 22px; }
  .article-row { display: block; padding-block: 15px; }
  .article-row img { display: none; }
  .article-row h2 { font-size: 16px; }
  .article-row p { font-size: 15px; }
  .story-source-row { grid-template-columns: minmax(0, 1fr) 28px; gap: 7px; }
  .story-source-identity { grid-column: 1; display: flex; gap: 7px; }
  .story-source-title { grid-column: 1; }
  .story-source-row > .article-original { grid-column: 2; grid-row: 1 / 3; }
  .list-actions { min-height: 78px; padding-inline: 8px; }
  .icon-text-button { width: 38px; padding: 0; justify-content: center; }
  .icon-text-button .button-label { display: none; }
  .filter-panel { margin-inline: -4px; }
  .news-view-bar { display: grid; gap: 4px; padding-block: 8px; }
  .news-view-switcher { width: 100%; }
  .news-view-switcher button { flex: 1; min-height: 38px; }
  .briefing-actions { justify-content: space-between; }
  .briefing-status { white-space: normal; }
  .briefing-topic-header { grid-template-columns: 26px minmax(0, 1fr); gap: 7px; padding-block: 14px; }
  .briefing-topic-primary { grid-column: 2; }
  .briefing-topic-actions { grid-column: 2; grid-row: 2; justify-self: start; }
  .briefing-topic-meta { white-space: normal; }
  .briefing-events { margin-left: 33px; }
  .briefing-event .article-meta { flex-wrap: wrap; }
  input, select { font-size: 16px; }
  .settings-heading { align-items: end; }
  .settings-heading h1 { font-size: 29px; }
  .settings-heading-actions { gap: 8px; }
  .diagnostics-heading { display: block; }
  .diagnostics-heading .settings-heading-actions { align-items: stretch; margin-top: 18px; flex-direction: row; justify-content: space-between; }
  .period-selector { flex: 1; }
  .period-selector button { flex: 1; padding-inline: 5px; }
  .topbar-links { gap: 10px; font-size: 13px; }
  .diagnostic-card-header { align-items: flex-start; padding-inline: 14px; }
  .diagnostic-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-metric { border-top: 1px solid var(--line); }
  .diagnostic-metric:nth-child(-n+2) { border-top: 0; }
  .diagnostic-metric:nth-child(odd) { border-left: 0; }
  .diagnostic-metric:nth-child(even) { border-left: 1px solid var(--line); }
  .diagnostic-detail-section { padding-inline: 14px; }
  .diagnostic-section-heading { display: block; }
  .diagnostic-section-heading > span, .diagnostic-section-heading > .back-link { display: inline-block; margin-top: 7px; white-space: normal; }
  .activity-chart { padding-inline: 8px; }
  .diagnostic-source-table, .diagnostic-source-table tbody, .diagnostic-source-table tr, .diagnostic-source-table td { display: block; }
  .diagnostic-source-table thead { display: none; }
  .diagnostic-source-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 0; border-bottom: 1px solid var(--line); }
  .diagnostic-source-table tbody tr:last-child { border-bottom: 0; }
  .diagnostic-source-table td, .diagnostic-source-table td:first-child { display: grid; width: auto; padding: 4px 7px; border: 0; grid-template-columns: minmax(76px, auto) 1fr; gap: 8px; }
  .diagnostic-source-table td::before { color: var(--muted); content: attr(data-label); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .diagnostic-source-table td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .diagnostic-source-table td:first-child strong, .diagnostic-source-table td:first-child small { grid-column: 2; }
  .section-heading { display: block; }
  .source-search { width: 100%; margin-top: 14px; }
  .source-row { padding-inline: 5px; }
  .source-main { min-width: 0; }
  .switch-label strong { overflow-wrap: anywhere; }
  .source-short-name-form { grid-template-columns: minmax(0, 1fr) auto; padding-left: 44px; }
  .source-short-name-form label { grid-column: 1 / -1; }
  .source-metrics { display: grid; grid-template-columns: max-content 1fr; }
  .category-fields { display: grid; align-items: start; }
  .retention-field { width: 100%; }
  .refresh-interval-field { width: 100%; }
  .grouping-window-field { width: 100%; }
  .briefing-fields { grid-template-columns: 1fr; }
  .save-category { width: 100%; margin-left: 0; }
  .login-panel { padding: 28px 24px; }
  .reader-toolbar { gap: 5px; padding-inline: max(8px, env(safe-area-inset-left)); }
  .reader-toolbar-source { display: none; }
  .reader-toolbar-actions { grid-column: 3; }
  .reader-original { padding-inline: 7px; }
  .reader-scroll { padding: 28px 18px 72px; }
  .reader-article > h1 { font-size: 30px; }
  .reader-size-options { display: flex; width: 100%; }
  .reader-size-options label { flex: 1; }
  .reader-size-options span { min-width: 0; }
}

@media (max-width: 380px) {
  .diagnostic-source-table td,
  .diagnostic-source-table td:first-child {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .diagnostic-source-table td:first-child strong,
  .diagnostic-source-table td:first-child small { grid-column: 1; }
  .diagnostic-source-table td > * { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
