:root {
  color-scheme: dark;
  --canvas: #0b0e14;
  --surface: #121721;
  --panel: #171e2a;
  --hover: #192334;
  --line: #263044;
  --text: #edf1f8;
  --muted: #a4b0c4;
  --blue: #81b5ff;
  --blue-strong: #388afa;
  --blue-bg: #162b49;
  font: 100%/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--text); }
a { color: var(--blue); }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.skip { position: fixed; top: -100px; left: 10px; z-index: 10; padding: 8px 12px; background: var(--surface); }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.dashboard {
  --sidebar-width: 248px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(236px, 296px);
  min-height: 100vh;
  align-items: start;
}
.dashboard.no-ads { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.dashboard.is-collapsed { --sidebar-width: 68px; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  background: #10151e;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-head, .mobile-bar, .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 68px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 780;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.mark {
  display: inline-block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  background: center / contain no-repeat url("desk-mark.png");
}
:root[data-theme="light"] .mark {
  background-image: url("desk-mark-light.png");
}
.icon-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 20px;
  line-height: 1;
}
.icon-button:hover, .menu-action:hover, .category:hover { background: var(--hover); color: var(--text); }
.is-collapsed .sidebar-head { flex-direction: column; min-height: auto; padding: 17px 0; gap: 12px; }
.is-collapsed .wordmark { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.sidebar-controls { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.sidebar-scroll { min-height: 0; overflow: auto; padding: 18px 14px; }
.section-label { margin: 0 0 11px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.region { display: grid; gap: 9px; padding: 0 3px; }
.region .section-label { margin-bottom: 1px; }
.region label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.region select, .search {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
}
.region select { padding: 5px 8px; font-size: 13px; }
.categories { margin-top: 22px; }
.categories .section-label { padding-left: 3px; }
#categories { display: grid; gap: 3px; }
.category, .menu-action {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}
.category[aria-pressed="true"] { color: #cbe4ff; background: var(--blue-bg); border-color: #284b76; }
.category-icon, .menu-action span { width: 17px; text-align: center; font-size: 15px; color: var(--blue); flex: 0 0 auto; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 13px 14px; display: grid; gap: 4px; }
.upgrade { background: var(--blue-bg); color: #e3efff; border-color: #2a4b78; }

.workspace { min-width: 0; }
#feed { padding: 24px clamp(16px, 2.3vw, 36px) 42px; }
.ad-slot {
  display: grid;
  place-items: center;
  background: #10151e;
  border: 1px dashed #334056;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  min-height: 158px;
}
.banner { min-height: 76px; margin-bottom: 20px; }
.ad-rail { display: grid; gap: 14px; padding: 24px 22px 24px 0; }
.feed-panel { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.feed-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 20px 19px 17px; }
h1 { font-size: clamp(24px, 3vw, 31px); letter-spacing: -.035em; line-height: 1.16; margin: 0; }
.coverage-caption { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
.search { display: flex; align-items: center; gap: 9px; max-width: 248px; padding: 0 10px; background: var(--canvas); }
.search input { background: transparent; border: 0; color: var(--text); padding: 7px 0; min-width: 0; width: 100%; font-size: 13px; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.search input:focus-visible { outline: 0; }
.search input::placeholder { color: var(--muted); }
.magnifier { width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 50%; position: relative; flex: 0 0 auto; margin-right: 4px; }
.magnifier::after { content: ""; position: absolute; width: 5px; height: 1px; background: var(--muted); right: -4px; bottom: -2px; transform: rotate(45deg); }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 19px; border-block: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; }
#active-category { color: var(--blue); font-weight: 720; }
.story + .story { border-top: 1px solid var(--line); }
.story:last-child { border-radius: 0 0 12px 12px; }
.story-header { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 19px; cursor: pointer; border-radius: inherit; }
.story-header::-webkit-details-marker { display: none; }
.story-header:hover, .story[open] { background: var(--hover); }
.story[open] > .story-header { box-shadow: inset 2px 0 var(--blue-strong); }
.headline { display: block; font-size: 16px; font-weight: 690; line-height: 1.36; }
.story-meta { display: flex; align-items: baseline; gap: 3px 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.story-meta > :not(:first-child)::before { content: "·"; margin-right: 8px; color: var(--muted); }
.story-category { color: var(--blue); font-weight: 630; }
.chevron { font-size: 21px; color: var(--blue); flex: 0 0 auto; line-height: 1; }
.story[open] .chevron { transform: rotate(90deg); }
.details { padding: 2px 19px 14px; color: #d4deed; font-size: 14px; }
.details p { margin: 0 0 8px; }
.details p:last-child { margin: 9px 0 0; }
.camera { color: var(--muted); font-size: 13px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px 15px; font-size: 13px; }
.empty { padding: 10px 19px; color: var(--muted); }
.compact .headline { font-size: 15px; }
.compact .story-header { padding-block: 7px; }
.mobile-bar, .scrim { display: none; }

dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 18px; width: min(430px, calc(100% - 32px)); }
dialog::backdrop { background: #05070bbd; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 19px; margin: 0; }
dialog p { color: var(--muted); margin-bottom: 4px; }
.setting { display: block; margin-block: 16px; }
.setting input { accent-color: var(--blue-strong); }
.secondary-button { background: var(--blue-bg); color: var(--text); padding: 7px 12px; border: 1px solid #2a4b78; border-radius: 7px; }

.top { background: #10151e; }
.wrap { width: min(900px, calc(100% - 34px)); margin-inline: auto; }
.top .head { padding-inline: 0; }
.story-page { max-width: 740px; margin-inline: auto; padding-block: 28px 50px; }
.story-page article { margin-top: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(17px, 4vw, 29px); }
.story-page .sources { margin-top: 16px; }

@media (max-width: 1150px) {
  .dashboard { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .ad-rail { display: none; }
}
@media (max-width: 760px) {
  .dashboard, .dashboard.no-ads { display: block; }
  .mobile-bar { display: flex; min-height: 56px; background: #10151e; }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; z-index: 4; width: min(280px, calc(100vw - 38px)); }
  .side-open .sidebar { display: flex; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 3; border: 0; background: #05070bbd; }
  #feed { padding: 14px 12px 32px; }
  .banner { min-height: 54px; margin-bottom: 12px; }
  .feed-heading { padding: 15px 13px; }
  .search { max-width: none; }
  .feed-toolbar, .story-header, .details { padding-inline: 13px; }
}

:root {
  --rail: #10151e;
  --ad-border: #334056;
  --body-secondary: #d4deed;
  --active-text: #cbe4ff;
  --active-border: #284b76;
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #eef2f7;
  --surface: #ffffff;
  --panel: #f3f6fa;
  --hover: #eaf1fb;
  --line: #cbd6e5;
  --text: #182639;
  --muted: #4d6079;
  --blue: #14579f;
  --blue-strong: #1967bc;
  --blue-bg: #dceaff;
  --rail: #f8faff;
  --ad-border: #9caec5;
  --body-secondary: #344966;
  --active-text: #17467d;
  --active-border: #93b6e2;
}
.sidebar, .mobile-bar, .top, .ad-slot { background: var(--rail); }
.ad-slot { border-color: var(--ad-border); }
.category[aria-pressed="true"], .upgrade { color: var(--active-text); border-color: var(--active-border); }
.secondary-button { border-color: var(--active-border); }
.details { color: var(--body-secondary); }
.story { position: relative; }
.story > details:not([open]) { border-radius: inherit; }
.story > details[open] { background: var(--hover); }
.story > details[open] .story-header { box-shadow: inset 2px 0 var(--blue-strong); }
.story > details[open] .chevron { transform: rotate(90deg); }
.story:has(.share-trigger:not([hidden])) .story-header { padding-right: 66px; }
.share-trigger { position: absolute; top: 10px; right: 18px; width: 29px; height: 29px; font-size: 17px; }
.share-icon { position: relative; line-height: 1; padding: 0 2px 3px; }
.share-icon::after { content: ""; position: absolute; inset: 7px -1px 0; border: 1px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; }
.compact .share-trigger { top: 5px; }
.menu-action .action-label, .menu-action .profile-label { flex: 1; width: auto; font-size: inherit; text-align: left; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button { margin-top: 3px; }
.avatar, .menu-action .avatar {
  display: inline-grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center;
  border-radius: 50%; background: var(--blue-bg); border: 1px solid var(--active-border);
  color: var(--active-text); font-size: 12px; font-weight: 760; overflow: hidden;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar.avatar-large { width: 44px; height: 44px; font-size: 19px; }

.settings-dialog { width: min(690px, calc(100% - 24px)); max-height: min(740px, calc(100dvh - 32px)); padding: 0; }
.settings-dialog > .dialog-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.settings-layout { display: grid; grid-template-columns: 155px minmax(0, 1fr); }
.settings-nav { padding: 13px 10px; border-right: 1px solid var(--line); background: var(--rail); }
.settings-nav button { display: block; width: 100%; text-align: left; margin-bottom: 5px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 7px 10px; font-size: 13px; }
.settings-nav button[aria-pressed="true"] { background: var(--blue-bg); color: var(--active-text); font-weight: 720; }
.settings-nav button:hover { color: var(--blue); }
.settings-content { min-width: 0; padding: 17px 18px 20px; font-size: 14px; }
.settings-content h3 { font-size: 17px; margin: 0 0 11px; }
.preference-grid, .account-form { display: grid; gap: 10px; }
.preference-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.preference-grid label, .account-form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.preference-grid select, .account-form input, .copy-preview {
  width: 100%; min-width: 0; padding: 7px 8px;
  color: var(--text); background: var(--canvas);
  border: 1px solid var(--line); border-radius: 6px;
}
.settings-content fieldset { margin: 0 0 14px; padding: 0 10px 8px; border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.settings-content legend { padding-inline: 4px; font-weight: 650; }
.settings-content fieldset .setting { margin: 6px 0 10px; }
.setting small { display: block; margin-left: 24px; color: var(--muted); }
.muted, dialog .muted { color: var(--muted); font-size: 13px; }
.status:empty, [role="status"]:empty { display: none; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.text-button { background: transparent; border: 0; color: var(--blue); padding: 6px; }
.account-form { margin: 12px 0; }
.account-form > button { justify-self: start; }
.profile-card, .plan-card, .connection-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere;
}
.profile-card { justify-content: flex-start; }
.plan-card { margin-top: 12px; }
.plan-card strong { display: block; }
.connection-card { margin-top: 9px; }
.connection-card p { margin: 3px 0 0; font-size: 13px; }
.pill { flex: 0 0 auto; font-size: 11px; color: var(--active-text); background: var(--blue-bg); border-radius: 10px; padding: 3px 8px; }
.editor-dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 28px); }
.draft { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.draft h3 { margin: 0; font-size: 15px; }
.draft a { font-size: 12px; overflow-wrap: anywhere; }
.draft button { justify-self: start; }
.copy-preview { display: block; margin-top: 6px; font: inherit; }
@media (max-width: 760px) {
  .mobile-bar .brand { margin-right: auto; }
  .share-trigger { right: 12px; }
  .story:has(.share-trigger:not([hidden])) .story-header { padding-right: 55px; }
}
@media (max-width: 540px) {
  .settings-layout, .preference-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 7px; }
  .settings-nav button { width: auto; margin-bottom: 0; }
  .settings-content { padding-inline: 13px; }
}
