/* Khabarchin UI — no external assets, intentionally fast and private. */
@font-face {
  font-family: "Vazirmatn";
  src: url("./fonts/Vazirmatn-Variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3f6f2;
  --bg-elevated: #edf2ed;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --surface-strong: #eef4f0;
  --ink: #172420;
  --ink-soft: #3f4e49;
  --muted: #71807a;
  --faint: #97a39e;
  --line: #dfe7e1;
  --line-strong: #ced9d1;
  --primary: #0e756c;
  --primary-deep: #075b54;
  --primary-soft: #e0f2ee;
  --primary-faint: #f0f8f5;
  --amber: #e6a72f;
  --amber-soft: #fff3d9;
  --violet: #6b5acb;
  --violet-soft: #efecff;
  --red: #c3524b;
  --red-soft: #fde9e7;
  --green: #21845f;
  --green-soft: #e4f4ec;
  --shadow-xs: 0 1px 2px rgba(28, 48, 40, .04);
  --shadow-sm: 0 8px 28px rgba(34, 55, 46, .07);
  --shadow-md: 0 20px 60px rgba(27, 48, 39, .13);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --font: "Vazirmatn", "IRANSansX", Tahoma, Arial, sans-serif;
  --sidebar-width: 236px;
  --insights-width: 292px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101715;
  --bg-elevated: #151f1c;
  --surface: #19231f;
  --surface-soft: #1d2925;
  --surface-strong: #22312c;
  --ink: #eef5f1;
  --ink-soft: #c5d1cc;
  --muted: #93a39c;
  --faint: #708079;
  --line: #2c3a35;
  --line-strong: #3a4a44;
  --primary: #57b9ad;
  --primary-deep: #72d1c5;
  --primary-soft: #173b36;
  --primary-faint: #172b27;
  --amber: #efbb58;
  --amber-soft: #3c301c;
  --violet: #a99cf1;
  --violet-soft: #2d2945;
  --red: #ef8a83;
  --red-soft: #402522;
  --green: #6dcc9e;
  --green-soft: #1b382b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .16);
  --shadow-sm: 0 12px 32px rgba(0, 0, 0, .2);
  --shadow-md: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% -15%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 31rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, select { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:where(button,a,input,[tabindex]):focus-visible { outline: 3px solid color-mix(in srgb,var(--primary) 28%,transparent); outline-offset: 2px; }
button:disabled { opacity: .58; cursor: not-allowed !important; transform: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; }

.app-shell {
  width: min(1580px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(520px, 1fr) var(--insights-width);
  gap: clamp(18px, 2.1vw, 34px);
  padding: 0 clamp(18px, 2.2vw, 36px);
}

/* Sidebar */
.sidebar {
  position: sticky;
  inset-block-start: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 0 18px;
  border-inline-end: 1px solid var(--line);
  padding-inline-end: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  display: grid;
  place-items: center;
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.brand-mark svg { width: 42px; height: 42px; }
.brand strong { display: block; font-size: 18px; line-height: 1.25; letter-spacing: -.4px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.side-nav { margin-top: 43px; }
.nav-label {
  margin: 0 11px 9px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}
.nav-item {
  width: 100%;
  min-height: 45px;
  margin: 2px 0;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s, background .18s, transform .18s;
}
.nav-item:hover { background: var(--surface-strong); color: var(--ink); }
.nav-item:active { transform: scale(.985); }
.nav-item.is-active {
  color: var(--primary-deep);
  background: var(--primary-soft);
  font-weight: 800;
}
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; }
.nav-icon svg, .settings-trigger svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-item b {
  min-width: 25px;
  padding: 0 6px;
  border-radius: 20px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.nav-item.is-active b { color: var(--primary-deep); }
.nav-item b.has-issues { color: var(--red); background: var(--red-soft); }
.side-spacer { flex: 1; }
.side-card {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.side-card::after {
  content: "";
  position: absolute;
  width: 70px; height: 70px;
  inset-inline-end: -31px; inset-block-end: -37px;
  border-radius: 50%;
  background: var(--primary-soft);
}
.side-card-icon {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
}
.side-card-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.side-card strong { display: block; font-size: 11px; }
.side-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.settings-trigger { grid-template-columns: 28px 1fr; }
.version { margin: 8px 11px 0; color: var(--faint); font-size: 9px; }

/* Main */
.main-content { min-width: 0; padding: 38px 0 90px; }
.mobile-header { display: none; }
.welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.eyebrow { margin: 0 0 2px; color: var(--primary); font-size: 12px; font-weight: 800; }
.welcome h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.35; letter-spacing: -1.35px; }
.welcome-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.last-sync { margin: 3px 0 0; color: var(--faint); font-size: 9px; }
.update-cadence { margin:1px 0 0;color:var(--primary);font-size:8.5px;font-weight:700; }
.offline-banner { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 9px 12px; border: 1px solid color-mix(in srgb,var(--amber) 35%,var(--line)); border-radius: 12px; color: #a56b0c; background: var(--amber-soft); font-size: 9px; }
.offline-banner svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.welcome-actions { display: flex; align-items: center; gap: 9px; padding-top: 8px; }
.primary-button, .quiet-button, .load-more {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
}
.primary-button {
  padding-inline: 17px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}
.primary-button:hover { background: var(--primary-deep); box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 31%, transparent); }
.primary-button:active, .quiet-button:active, .load-more:active { transform: translateY(1px) scale(.985); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.primary-button svg, .quiet-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-trigger { position:relative; }
.notification-indicator { width:7px;height:7px;display:block;border-radius:50%;background:var(--faint);box-shadow:0 0 0 3px var(--surface); }
.notification-trigger.is-enabled .notification-indicator { background:var(--green); }
.notification-trigger.needs-permission .notification-indicator { background:var(--amber); }
.icon-button .notification-indicator { position:absolute;inset-block-start:5px;inset-inline-start:5px; }
.primary-button.is-loading svg, #settings-refresh.is-loading svg { animation: spin .9s linear infinite; }
.quiet-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-xs);
}
.quiet-button:hover { border-color: var(--line-strong); background: var(--surface-strong); color: var(--ink); }
.quiet-button.compact { min-height: 39px; padding: 7px 11px; font-size: 11px; }
.icon-button {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.icon-button:hover { color: var(--primary); background: var(--surface-strong); }
.icon-button:active { transform: scale(.95); }
.icon-button.small { width: 32px; height: 32px; flex-basis: 32px; border: 0; background: transparent; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.search-area { display: flex; gap: 9px; margin-top: 28px; }
.search-box {
  height: 50px;
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s, box-shadow .18s;
}
.search-box:focus-within {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
}
.search-box svg { width: 21px; height: 21px; flex: 0 0 21px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: var(--faint); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-strong); cursor: pointer; }
.search-clear:hover { color: var(--primary); background: var(--primary-soft); }
.search-clear svg { width: 14px; height: 14px; stroke: currentColor; }
kbd { padding: 2px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; color: var(--faint); background: var(--surface-soft); font: 10px var(--font); direction: ltr; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.stat-card {
  min-width: 0;
  min-height: 80px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  text-align: start;
}
button.stat-card { color: inherit; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
button.stat-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.stat-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; }
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.stat-new .stat-icon { color: var(--primary); background: var(--primary-soft); }
.stat-farabi .stat-icon { color: var(--violet); background: var(--violet-soft); }
.stat-merged .stat-icon { color: #b07114; background: var(--amber-soft); }
.stat-card span:nth-child(2) { min-width: 0; }
.stat-card small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.stat-card strong { display: block; margin-top: -2px; font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card em { align-self: end; padding-bottom: 4px; color: var(--faint); font-size: 8px; font-style: normal; }

.feed-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.category-scroll { min-width: 0; flex: 1; display: flex; gap: 7px; overflow-x: auto; padding: 3px 1px 5px; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.filter-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.filter-chip.is-active { color: #fff; border-color: var(--primary); background: var(--primary); }
.sort-menu { position: relative; z-index: 12; flex: 0 0 auto; }
.sort-trigger { height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: var(--surface); box-shadow: var(--shadow-xs); font-size: 10px; font-weight: 750; cursor: pointer; transition: border-color .18s, background .18s, box-shadow .18s; }
.sort-trigger:hover,.sort-menu.is-open .sort-trigger { border-color: color-mix(in srgb,var(--primary) 35%,var(--line)); background: var(--primary-faint); }
.sort-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sort-trigger .chevron { width: 13px; transition: transform .18s; }
.sort-menu.is-open .chevron { transform: rotate(180deg); }
.sort-options { position: absolute; inset-block-start: calc(100% + 7px); inset-inline-end: 0; width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); animation: menu-in .16s both; }
.sort-options button { width: 100%; display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; text-align: start; cursor: pointer; }
.sort-options button:hover,.sort-options button:focus-visible { background: var(--surface-strong); }
.sort-options button.is-selected { color: var(--primary-deep); background: var(--primary-soft); }
.sort-options button span,.sort-options button strong,.sort-options button small { display: block; }
.sort-options button strong { font-size: 9.5px; }
.sort-options button small { margin-top: 1px; color: var(--muted); font-size: 7.5px; font-weight: 400; }
.sort-options button>svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; opacity: 0; }
.sort-options button.is-selected>svg { opacity: 1; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.active-filters button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 8px; border: 1px solid color-mix(in srgb,var(--primary) 20%,var(--line)); border-radius: 10px; color: var(--primary-deep); background: var(--primary-faint); font-size: 8.5px; cursor: pointer; }
.active-filters button:hover { border-color: var(--primary); background: var(--primary-soft); }
.active-filters svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.feed-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.feed-heading > div { display: flex; align-items: baseline; gap: 8px; }
.feed-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.3px; }
.feed-heading span { color: var(--faint); font-size: 9px; }
.text-button { padding: 3px; border: 0; background: transparent; color: var(--primary); font-size: 10px; font-weight: 800; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

/* Feed cards */
.news-feed { display: grid; gap: 11px; }
.news-card {
  position: relative;
  overflow: hidden;
  padding: 18px 19px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s;
  animation: card-in .35s both;
}
.news-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 18%, var(--line)); box-shadow: var(--shadow-sm); }
.news-card.is-unread::before {
  content: "";
  position: absolute;
  inset-block: 20px;
  inset-inline-start: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}
.news-card.is-read { opacity: .92; }
.news-card.is-read:hover { opacity: 1; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-meta { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 9px; }
.published-label { color: var(--faint); font-size: 8px; }
.category-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--ink-soft); }
.category-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--category-color, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color, var(--primary)) 12%, transparent); }
.meta-separator { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.new-label { padding: 1px 6px; border-radius: 8px; color: var(--primary-deep); background: var(--primary-soft); font-size: 8px; font-weight: 900; }
.ad-label { padding: 1px 6px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 8px; font-weight: 900; }
.card-actions { display: flex; align-items: center; gap: 3px; }
.card-action {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .18s, background .18s, transform .18s;
}
.card-action:hover { color: var(--primary); background: var(--primary-soft); }
.card-action:active { transform: scale(.91); }
.card-action.is-active { color: var(--primary); background: var(--primary-soft); }
.card-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-action.is-active.bookmark svg { fill: currentColor; }
.news-title-button { display: block; width: 100%; margin: 11px 0 0; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: start; cursor: pointer; }
.news-title { margin: 0; font-size: clamp(15px, 1.65vw, 18px); line-height: 1.7; letter-spacing: -.35px; transition: color .18s; }
.news-title-button:hover .news-title { color: var(--primary-deep); }
.farabi-mark { display: inline-flex; vertical-align: .14em; align-items: center; gap: 4px; margin-inline-start: 7px; padding: 2px 7px; border-radius: 9px; color: var(--violet); background: var(--violet-soft); font-size: 8px; font-weight: 900; white-space: nowrap; }
.farabi-mark svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.news-summary { margin: 7px 0 0; color: var(--ink-soft); font-size: 11.5px; line-height: 2; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.tag-button { padding: 3px 8px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-strong); font-size: 8.5px; cursor: pointer; }
.tag-button:hover { color: var(--primary-deep); background: var(--primary-soft); }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-stack { min-width: 0; display: flex; align-items: center; gap: 6px; }
.source-link {
  max-width: 165px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  text-decoration: none;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .18s, color .18s;
}
.source-link:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); }
.source-logo { width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; border-radius: 5px; color: var(--source-color, var(--primary)); background: color-mix(in srgb, var(--source-color, var(--primary)) 12%, transparent); font-size: 8px; font-weight: 900; }
.more-sources { color: var(--primary); font-size: 8px; font-weight: 900; white-space: nowrap; }
.card-open { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; border: 0; background: transparent; color: var(--primary); font-size: 9px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.card-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.load-more { width: 100%; margin-top: 13px; border-color: var(--line); background: var(--surface); color: var(--primary); }
.load-more:hover { border-color: var(--primary); background: var(--primary-faint); }
.empty-state, .error-state {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  text-align: center;
}
.empty-illustration, .error-illustration { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 22px; color: var(--primary); background: var(--primary-soft); }
.empty-illustration svg, .error-illustration svg { width: 35px; height: 35px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3, .error-state h3 { margin: 0; color: var(--ink); font-size: 15px; }
.empty-state p, .error-state p { max-width: 340px; margin: 5px 0 16px; font-size: 10px; }
.skeleton-card { height: 208px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.skeleton-line { height: 10px; margin-bottom: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-strong) 25%, color-mix(in srgb, var(--surface-strong) 40%, var(--surface)) 50%, var(--surface-strong) 75%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
.skeleton-line.short { width: 28%; height: 8px; }
.skeleton-line.title { width: 82%; height: 17px; margin-top: 22px; }
.skeleton-line.body { width: 96%; }
.skeleton-line.body-two { width: 72%; }
.skeleton-footer { width: 100%; height: 1px; margin: 24px 0 14px; background: var(--line); }

/* Right insights */
.insights { position: sticky; inset-block-start: 0; height: 100vh; overflow-y: auto; padding: 38px 0 28px; scrollbar-width: none; }
.insights::-webkit-scrollbar { display: none; }
.insight-card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-heading > div { display: flex; align-items: center; gap: 7px; }
.card-heading h2 { margin: 0; font-size: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.heading-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; color: var(--violet); background: var(--violet-soft); font-weight: 900; }
.card-caption { margin: 6px 0 12px; color: var(--muted); font-size: 9px; }
.source-preview { display: grid; gap: 5px; }
.source-row { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 5px; border-radius: 10px; color: inherit; text-decoration: none; }
.source-row:hover { background: var(--surface-soft); }
.source-kind { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--source-color); background: color-mix(in srgb, var(--source-color) 11%, transparent); font-size: 8px; font-weight: 900; }
.source-row div { min-width: 0; }
.source-row strong { display: block; overflow: hidden; font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.source-row small { display: block; color: var(--faint); font-size: 7.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.fetching { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1s infinite; }
.status-dot.error { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.status-dot.auth_required, .status-dot.stale { background: var(--amber); }
.status-dot.disabled, .status-dot.idle { background: var(--faint); opacity: .65; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hot-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); background: var(--surface-soft); font-size: 8.5px; cursor: pointer; }
.hot-tag:hover { color: var(--primary); border-color: var(--primary); }
.hot-tag b { color: var(--faint); font-size: 7px; }
.muted { color: var(--muted); font-size: 9px; }
.ai-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 15px; border: 1px solid color-mix(in srgb, var(--violet) 18%, var(--line)); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--violet-soft) 40%, var(--surface))); }
.ai-orbit { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); border-radius: 50%; }
.ai-orbit span { width: 18px; height: 18px; border-radius: 7px; background: var(--violet); box-shadow: 0 5px 13px color-mix(in srgb, var(--violet) 35%, transparent); transform: rotate(45deg); }
.ai-orbit i { position: absolute; width: 6px; height: 6px; inset-block-start: 1px; inset-inline-end: 4px; border-radius: 50%; background: var(--amber); }
.ai-card p, .ai-card strong, .ai-card small { display: block; margin: 0; }
.ai-card p { color: var(--muted); font-size: 8px; }
.ai-card strong { font-size: 10px; }
.ai-card small { color: var(--faint); font-size: 7.5px; direction: ltr; text-align: right; }
.privacy-note { display: flex; align-items: flex-start; gap: 7px; margin: 14px 5px; color: var(--faint); font-size: 8px; line-height: 1.8; }
.privacy-note svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Dialogs */
.modal { width: min(680px, calc(100vw - 28px)); max-height: min(88vh, 850px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-xl); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-md); }
.modal[open] { animation: modal-in .22s both; }
.modal::backdrop { background: rgba(13, 24, 20, .52); backdrop-filter: blur(5px); animation: fade-in .2s both; }
.modal-shell { max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
.modal-topbar { position: sticky; z-index: 2; inset-block-start: 0; display: flex; align-items: center; justify-content: space-between; padding: 15px 20px 8px; background: color-mix(in srgb, var(--surface) 91%, transparent); backdrop-filter: blur(12px); }
.modal-kicker { color: var(--primary); font-size: 9px; font-weight: 900; }
.article-detail { padding: 4px 25px 28px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.article-detail h2 { margin: 12px 0 0; font-size: clamp(21px, 4vw, 29px); line-height: 1.6; letter-spacing: -.7px; }
.detail-summary { margin: 12px 0 0; padding: 13px 15px; border-inline-start: 3px solid var(--primary); border-radius: 10px; color: var(--ink-soft); background: var(--primary-faint); font-size: 12px; line-height: 2; }
.detail-body { margin: 21px 0 0; color: var(--ink-soft); font-size: 11.5px; line-height: 2.25; white-space: pre-line; }
.detail-farabi { display: flex; gap: 10px; margin-top: 17px; padding: 12px; border-radius: 13px; color: color-mix(in srgb, var(--violet) 85%, var(--ink)); background: var(--violet-soft); font-size: 10px; }
.detail-farabi svg { width: 20px; height: 20px; flex: 0 0 20px; fill: currentColor; }
.detail-ad { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 11px 13px; border-radius: 12px; color: var(--red); background: var(--red-soft); font-size: 9px; }
.detail-ad span { color: var(--ink-soft); }
.detail-section-title { margin: 24px 0 9px; font-size: 11px; }
.detail-sources { display: grid; gap: 7px; }
.detail-source { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--surface-soft); }
.detail-source:hover { border-color: var(--primary); }
.detail-source > span { min-width: 0; display: flex; align-items: center; gap: 8px; }
.detail-source strong { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.detail-source small { color: var(--muted); font-size: 8px; }
.detail-source svg { width: 16px; height: 16px; fill: none; stroke: var(--primary); stroke-width: 1.8; }
.detail-actions { display: flex; gap: 8px; margin-top: 22px; }
.detail-actions > * { flex: 1; }
.settings-modal { width: min(760px, calc(100vw - 28px)); }
.settings-header { position: sticky; z-index: 2; inset-block-start: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); }
.settings-header h2 { margin: 1px 0 0; font-size: 21px; }
.settings-header p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.settings-body { padding: 20px 24px; }
.settings-section + .settings-section { margin-top: 22px; }
.preference-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.preference-row p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.cadence-settings { padding:13px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface-soft); }
.cadence-settings-head { display:flex;align-items:center;gap:10px; }.cadence-settings-head h3,.cadence-settings-head p { margin:0; }.cadence-settings-head p { color:var(--muted);font-size:8px; }
.cadence-settings-icon { width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border-radius:12px;color:#ad7215;background:var(--amber-soft); }.cadence-settings-icon svg { width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }
.cadence-metrics { display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px; }.cadence-metrics>div { padding:9px 10px;border:1px solid var(--line);border-radius:11px;background:var(--surface); }.cadence-metrics small,.cadence-metrics strong { display:block; }.cadence-metrics small { color:var(--faint);font-size:7px; }.cadence-metrics strong { margin-top:2px;color:var(--ink-soft);font-size:9px; }
.install-settings { display:grid;grid-template-columns:42px 1fr auto auto;align-items:center;gap:10px;padding:13px 14px;border:1px solid color-mix(in srgb,var(--violet) 18%,var(--line));border-radius:15px;background:color-mix(in srgb,var(--violet-soft) 30%,var(--surface)); }.install-settings-icon { width:42px;height:42px;display:grid;place-items:center;border-radius:13px;color:var(--violet);background:var(--violet-soft); }.install-settings-icon svg { width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }.install-settings h3,.install-settings p { margin:0; }.install-settings p { margin-top:2px;color:var(--muted);font-size:8px; }
.notification-settings { overflow:hidden;border:1px solid color-mix(in srgb,var(--primary) 20%,var(--line));border-radius:16px;background:var(--surface-soft); }
.notification-settings-head { display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:10px;padding:13px 14px; }
.notification-settings-icon { width:42px;height:42px;display:grid;place-items:center;border-radius:13px;color:var(--primary);background:var(--primary-soft); }
.notification-settings-icon svg { width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round; }
.notification-settings h3,.notification-settings p { margin:0; }.notification-settings p { color:var(--muted);font-size:8px; }
.notification-options { display:grid;gap:0;border-top:1px solid var(--line);background:var(--surface);transition:opacity .18s; }
.notification-options.is-disabled { opacity:.48;pointer-events:none; }
.notification-option-row,.notification-interval-row { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;border-bottom:1px solid var(--line); }
.notification-option-row strong,.notification-option-row small,.notification-interval-row strong,.notification-interval-row small,.notification-tone-row strong,.notification-tone-row small { display:block; }
.notification-option-row strong,.notification-interval-row strong,.notification-tone-row strong { font-size:9px; }.notification-option-row small,.notification-interval-row small,.notification-tone-row small { margin-top:1px;color:var(--muted);font-size:7.5px; }
.notification-tone-row { display:grid;grid-template-columns:minmax(150px,1fr) auto auto;align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid var(--line); }
.tone-options,.interval-options { display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft); }
.tone-options button,.interval-options button { min-height:30px;padding:4px 9px;border:0;border-radius:7px;color:var(--muted);background:transparent;font-size:7.5px;font-weight:800;cursor:pointer; }
.tone-options button:hover,.interval-options button:hover { color:var(--ink); }.tone-options button.is-active,.interval-options button.is-active { color:var(--primary-deep);background:var(--primary-soft); }
.notification-volume { display:grid;grid-template-columns:78px 1fr 38px;align-items:center;gap:9px;padding:10px 14px;border-bottom:1px solid var(--line);color:var(--ink-soft);font-size:8.5px;font-weight:800; }
.notification-volume output { color:var(--primary);font-size:8px;text-align:end; }
.notification-volume input { width:100%;height:5px;margin:0;border-radius:10px;outline:0;appearance:none;background:linear-gradient(to left,var(--primary) var(--range-progress,45%),var(--line) var(--range-progress,45%));cursor:pointer; }
.notification-volume input::-webkit-slider-thumb { width:17px;height:17px;border:3px solid var(--surface);border-radius:50%;appearance:none;background:var(--primary);box-shadow:0 1px 5px rgba(0,0,0,.2); }
.notification-volume input::-moz-range-thumb { width:12px;height:12px;border:3px solid var(--surface);border-radius:50%;background:var(--primary);box-shadow:0 1px 5px rgba(0,0,0,.2); }
.logout-form { margin: 0; }
.settings-section-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.settings-section h3 { margin: 0; font-size: 12px; }
.settings-section-title p { margin: 1px 0 0; color: var(--muted); font-size: 8px; }
.settings-source-search { height: 39px; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.settings-source-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 9%,transparent); }
.settings-source-search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.settings-source-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 9px; }
.settings-sources { max-height: 390px; overflow:auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding-inline-end: 3px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.settings-sources-empty { grid-column: 1/-1; padding: 35px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: 9px; }
.settings-source { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.settings-source-kind { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--source-color); background: color-mix(in srgb, var(--source-color) 11%, transparent); font-size: 9px; font-weight: 900; }
.settings-source-info { min-width: 0; }
.settings-source-info a { display: block; overflow: hidden; color: var(--ink); font-size: 9.5px; font-weight: 800; text-decoration: none; white-space: nowrap; text-overflow: ellipsis; }
.settings-source-info a:hover { color: var(--primary); }
.settings-source-info span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 7.5px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 38px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: absolute; inset: 0; border-radius: 20px; background: var(--line-strong); cursor: pointer; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; width: 16px; height: 16px; inset-block-start: 3px; inset-inline-start: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(-16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); }
.processing-section { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 15px; border: 1px solid color-mix(in srgb, var(--violet) 18%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--violet-soft) 35%, var(--surface)); }
.processing-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: var(--violet); background: var(--violet-soft); }
.processing-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.processing-section p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.processing-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.processing-meta span, .processing-meta code { padding: 3px 8px; border-radius: 8px; font-size: 8px; }
.processing-meta span { color: var(--green); background: var(--green-soft); }
.processing-meta code { color: var(--violet); background: var(--violet-soft); direction: ltr; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 24px 20px; color: var(--muted); font-size: 8px; }
.settings-footer p { margin: 0; }
.settings-footer code { padding: 2px 5px; border-radius: 5px; background: var(--surface-strong); direction: ltr; }
.settings-footer a { color: var(--primary); font-weight: 800; }
.settings-footer-links { display:flex; align-items:center; gap:12px; white-space:nowrap; }

/* Toasts and mobile nav */
.toast-region { position: fixed; z-index: 1000; inset-inline-start: 22px; inset-block-end: 22px; display: grid; gap: 7px; pointer-events: none; }
.toast { min-width: 220px; max-width: min(360px, calc(100vw - 28px)); pointer-events:auto; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); font-size: 10px; animation: toast-in .25s both; }
.toast::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); }
.toast.error::before { background: var(--red); }
.toast>span { flex:1; }
.toast>button { width:25px;height:25px;display:grid;place-items:center;padding:0;border:0;border-radius:7px;color:var(--muted);background:transparent;cursor:pointer; }
.toast>button:hover { color:var(--ink);background:var(--surface-strong); }
.toast>button svg { width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8; }
.toast.leaving { animation: toast-out .22s both; }
.bottom-nav { display: none; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.84); } }
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* Responsive */
@media (max-width: 1180px) {
  :root { --sidebar-width: 210px; }
  .app-shell { grid-template-columns: var(--sidebar-width) minmax(500px, 1fr); }
  .insights { display: none; }
}

@media (max-width: 860px) {
  .app-shell { display: block; padding: 0 18px; }
  .sidebar { display: none; }
  .main-content { padding-top: 0; padding-bottom: 100px; }
  .mobile-header { height: 70px; display: flex; align-items: center; justify-content: space-between; }
  .brand-mobile { gap: 8px; }
  .brand-mobile .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .brand-mobile .brand-mark svg { width: 36px; height: 36px; }
  .brand-mobile strong { font-size: 16px; }
  .mobile-actions { display: flex; gap: 7px; }
  .welcome { padding-top: 11px; }
  .desktop-theme { display: none; }
  .welcome-actions { padding-top: 3px; }
  .bottom-nav {
    position: fixed;
    z-index: 50;
    inset-inline: 12px;
    inset-block-end: max(10px, env(safe-area-inset-bottom));
    height: 65px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
  }
  .bottom-nav button, .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 14px; color: var(--muted); background: transparent; font-size: 8px; text-decoration:none; cursor: pointer; }
  .bottom-nav button.is-active, .bottom-nav a.is-active { color: var(--primary); background: var(--primary-soft); font-weight: 900; }
  .bottom-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .toast-region { inset-inline: 14px; inset-block-end: 87px; }
  .toast { max-width: none; width: 100%; }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .app-shell { padding: 0 12px; }
  .welcome { align-items: center; }
  .welcome h1 { font-size: 27px; }
  .welcome-subtitle { font-size: 11px; }
  .welcome-actions .primary-button { width: 43px; height: 43px; min-height: 43px; padding: 0; border-radius: 13px; }
  .welcome-actions .primary-button span { display: none; }
  .welcome-actions .notification-trigger,.welcome-actions .install-trigger { width:43px;padding:0; }
  .welcome-actions .notification-trigger>span,.welcome-actions .install-trigger>span { display:none; }
  .welcome-actions .notification-trigger .notification-indicator { position:absolute;inset-block-start:5px;inset-inline-start:5px; }
  .search-area { margin-top: 21px; }
  .search-box { height: 47px; }
  .search-box kbd, #mark-all-read span { display: none; }
  #mark-all-read { width: 47px; flex: 0 0 47px; padding: 0; }
  .stats-grid { gap: 7px; }
  .stat-card { min-height: 76px; grid-template-columns: 34px 1fr; gap: 7px; padding: 10px 8px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-card em { display: none; }
  .stat-card strong { font-size: 18px; }
  .stat-card small { font-size: 7.5px; }
  .feed-toolbar { margin-top: 22px; }
  .sort-trigger { width: 40px; padding: 0; justify-content: center; }
  .sort-trigger #sort-label, .sort-trigger .chevron { display:none; }
  .sort-options { width: min(250px,calc(100vw - 30px)); inset-inline-end:0; }
  .news-card { padding: 15px 14px 12px; border-radius: 18px; }
  .news-title { font-size: 15px; line-height: 1.8; }
  .published-label { display:none; }
  .news-summary { font-size: 10.5px; line-height: 2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .source-link:nth-of-type(n+2) { display: none; }
  .source-link { max-width: 160px; }
  .card-footer { margin-top: 12px; }
  .modal { width: calc(100vw - 16px); max-height: calc(100dvh - 20px); border-radius: 22px; }
  .article-detail { padding-inline: 18px; }
  .settings-header, .settings-body { padding-inline: 17px; }
  .settings-sources { grid-template-columns: 1fr; }
  .cadence-metrics { grid-template-columns:1fr; }
  .install-settings { grid-template-columns:42px 1fr; }.install-settings>button { grid-column:1/-1;width:100%; }
  .notification-tone-row { grid-template-columns:1fr;align-items:stretch; }
  .tone-options,.interval-options { display:grid;grid-template-columns:repeat(3,1fr); }
  .notification-tone-row .quiet-button { width:100%; }
  .notification-volume { grid-template-columns:68px 1fr 34px; }
  .settings-footer { align-items: flex-start; padding-inline: 17px; }
}

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