:root {
  --canvas: #fafaf9;
  --paper: #ffffff;
  --ink: #0a0a09;
  --ink-soft: #3a3a38;
  --ink-mute: #70706b;
  --subtle: #7a7a76;
  --rule: rgba(10, 10, 9, 0.08);
  --rule-strong: rgba(10, 10, 9, 0.22);
  --accent: #84661e;
  --accent-soft: rgba(132, 102, 30, 0.14);
  --danger: #a35030;
  --chip: rgba(10, 10, 9, 0.035);
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --reading-size: 19px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: white; text-decoration: none; border-radius: 999px; }
.skip-link:focus { top: 16px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.topbar {
  height: 68px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--rule);
  background: rgba(250, 250, 249, 0.93);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; font-weight: 500; font-size: 17px; letter-spacing: -0.03em; justify-self: start; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--ink); font-size: 14px; }
.eyebrow, .section-label { font-family: var(--mono); letter-spacing: 0.08em; font-size: 10px; color: var(--ink-mute); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.topbar-workspace { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }

.button, .icon-button, .text-button, .filter, .view-button, .save-button, .rhythm-option { cursor: pointer; border: 0; background: none; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 999px; font-weight: 500; font-size: 13px; letter-spacing: -0.01em; }
.button.primary { background: var(--ink); color: white; }
.button.secondary { border: 1px solid var(--rule-strong); }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .72; transform: none; }
.sync-button.is-syncing svg { animation: sync-rotate 1.2s linear infinite; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.icon-button:hover { background: var(--chip); }
.reader-tools .icon-button { font-size: 12px; font-family: var(--mono); }

.library-view { width: min(1220px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 96px; }
.article-header h1, .dialog-header h2 { font-weight: 500; letter-spacing: -0.045em; line-height: 1.03; margin: 8px 0 0; }

@keyframes sync-rotate { to { transform: rotate(360deg); } }

.search-field { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nav-search { flex: 1 1 250px; max-width: 310px; height: 38px; padding: 0 11px; background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; transition: border-color .14s ease; }
.nav-search:focus-within { border-color: var(--rule-strong); }
.search-field svg { color: var(--ink-mute); flex: 0 0 auto; }
.search-field input { width: 100%; border: 0; background: transparent; outline: 0; color: var(--ink); }
.search-shortcut { border: 0; padding: 4px; background: transparent; color: inherit; cursor: pointer; }
.search-field:focus-within .search-shortcut { color: var(--accent); }
.search-field input::placeholder { color: var(--ink-mute); }
kbd { font-family: var(--mono); font-size: 10px; padding: 2px 7px; border: 1px solid var(--rule); border-bottom-color: var(--rule-strong); border-radius: 4px; color: var(--ink-mute); }
.filter-group { height: 38px; display: flex; align-items: stretch; }
.filter { position: relative; padding: 0 9px; font-size: 12px; color: var(--ink-mute); white-space: nowrap; }
.filter span { font-family: var(--mono); font-size: 9px; margin-left: 4px; }
.filter.is-active { color: var(--ink); }
.filter.is-active::after { content: ""; position: absolute; bottom: -1px; height: 2px; background: var(--accent); left: 9px; right: 9px; }
.nav-disclosure { position: relative; flex: 0 0 auto; }
.nav-disclosure summary { height: 38px; display: flex; align-items: center; gap: 5px; padding: 0 10px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; cursor: pointer; list-style: none; border-left: 1px solid var(--rule); }
.nav-disclosure summary::-webkit-details-marker { display: none; }
.nav-disclosure summary svg { width: 15px; transition: transform .14s ease; }
.nav-disclosure[open] summary svg { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 9px); left: 0; z-index: 40; width: 220px; padding: 7px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 18px 54px rgba(10,10,9,.12); }
.rhythm-option { width: 100%; min-height: 38px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 6px; color: var(--ink-soft); font-size: 12px; text-align: left; }
.rhythm-option:hover { background: var(--chip); }
.rhythm-option.is-active { color: var(--ink); background: var(--accent-soft); }
.rhythm-option span:last-child { color: var(--ink-mute); font: 9px/1 var(--mono); white-space: nowrap; }
.view-switcher { display: flex; padding-left: 8px; border-left: 1px solid var(--rule); }
.view-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-mute); }
.view-button svg { width: 17px; }
.view-button.is-active { background: var(--ink); color: white; }
.active-query { display: flex; align-items: center; justify-content: space-between; background: var(--accent-soft); padding: 10px 14px; font-size: 13px; margin: 0 0 16px; }
.active-query button { border: 0; background: none; text-decoration: underline; cursor: pointer; }

.article-collection { margin-top: 0; }
.article-collection.cards { max-width: 900px; margin-left: auto; margin-right: auto; }
.cards .article-card { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(340px, 1.05fr); min-height: 470px; }
.cards .article-visual { height: 100%; min-height: 470px; }
.cards .article-card-content { min-height: 470px; padding: 38px; }
.cards .card-title { margin-top: 28px; font-size: 36px; }
.cards .card-dek { font-size: 16px; line-height: 1.55; -webkit-line-clamp: 5; }
.cards .card-actions { top: 29px; right: 29px; }
.carousel-controls { max-width: 900px; margin: 14px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.carousel-controls[hidden] { display: none; }
.carousel-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.carousel-button:last-child { justify-self: end; }
.carousel-button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.carousel-button:disabled { opacity: .25; cursor: default; }
.carousel-position { font: 9px/1 var(--mono); letter-spacing: .08em; color: var(--ink-mute); }
.article-card { position: relative; min-width: 0; background: var(--paper); border: 1px solid var(--rule); overflow: hidden; transition: border-color .2s ease, transform .2s ease; }
.article-card:hover { border-color: var(--rule-strong); transform: translateY(-2px); }
.article-hitarea { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.article-hitarea:focus-visible { outline-offset: -4px; }
.article-visual { height: 220px; overflow: hidden; background: #e9e6df; position: relative; }
.article-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 55%, rgba(154,122,42,.24)); }
.article-visual img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; filter: saturate(.72) contrast(.96); transition: opacity .2s ease, transform .5s ease; }
.article-card:hover .article-visual img { transform: scale(1.015); }
.article-visual.has-image img { opacity: 1; }
.article-visual.has-image .visual-monogram { display: none; }
.visual-monogram { position: absolute; left: 24px; bottom: 12px; font-size: 86px; line-height: 1; letter-spacing: -.08em; color: rgba(10,10,9,.16); font-weight: 500; }
.article-card-content { padding: 24px; min-height: 274px; display: flex; flex-direction: column; }
.card-meta { display: flex; justify-content: flex-start; gap: 9px; align-items: center; min-height: 16px; }
.card-source, .card-category, .card-time, .article-kicker, .confidence-label, .context-label { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.card-source { color: var(--ink-soft); }
.meta-separator { color: var(--rule-strong); font-size: 10px; }
.unread-marker { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.article-card.is-read .unread-marker { visibility: hidden; }
.card-title { margin: 15px 40px 9px 0; font-size: 25px; font-weight: 500; letter-spacing: -.035em; line-height: 1.14; }
.card-dek { margin: 0; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 28px; color: var(--ink-mute); font-size: 11px; }
.card-footer > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { position: absolute; right: 17px; top: 237px; z-index: 2; display: flex; align-items: center; gap: 4px; }
.save-button, .mark-read-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; color: var(--ink-mute); cursor: pointer; }
.save-button:hover { background: var(--chip); color: var(--ink); }
.save-button.is-saved { color: var(--accent); }
.save-button.is-saved svg { fill: currentColor; }
.mark-read-button { display: none; border: 1px solid var(--rule); background: var(--paper); }
.mark-read-button { display: grid; }
.mark-read-button:hover { border-color: var(--rule-strong); color: var(--ink); }
.mark-read-button:focus-visible { outline-offset: 2px; }
.article-card.is-read .mark-read-button { visibility: hidden; pointer-events: none; }

.article-collection.list, .article-collection.headlines { border-top: 1px solid var(--ink); }
.article-card { content-visibility: auto; contain-intrinsic-size: 360px; }
.list .article-card { contain-intrinsic-size: 160px; }
.headlines .article-card { contain-intrinsic-size: 58px; }
.grid .article-card { contain-intrinsic-size: 345px; }

.list .article-card { display: grid; grid-template-columns: 180px minmax(0, 1fr) 76px; gap: 24px; align-items: center; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 18px 0; }
.list .article-card:hover, .headlines .article-card:hover { transform: none; background: rgba(10,10,9,.018); }
.list .article-visual { width: 180px; height: 116px; }
.list .visual-monogram { left: 12px; bottom: 5px; font-size: 48px; }
.list .article-card-content { min-height: 116px; padding: 0; }
.list .card-title { margin: 8px 0 6px; font-size: 22px; }
.list .card-dek { max-width: 760px; -webkit-line-clamp: 2; }
.list .card-footer { justify-content: flex-start; margin-top: auto; padding-top: 10px; }
.list .card-time { margin-left: auto; }
.list .card-actions { position: relative; inset: auto; justify-self: end; }
.list .mark-read-button { display: grid; }

.headlines .article-card { display: grid; grid-template-columns: minmax(0, 1fr) 180px 22px; gap: 22px; align-items: center; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 17px 0; }
.headlines .article-visual, .headlines .card-dek, .headlines .card-footer, .headlines .card-category, .headlines .meta-separator, .headlines .unread-marker, .headlines .save-button { display: none; }
.headlines .article-card-content { display: contents; }
.headlines .card-title { grid-column: 1; grid-row: 1; margin: 0; font-size: 17px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.headlines .card-meta { grid-column: 2; grid-row: 1; justify-content: flex-end; min-width: 0; }
.headlines .card-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.headlines .card-actions { position: relative; inset: auto; grid-column: 3; grid-row: 1; }
.headlines .mark-read-button { display: grid; width: 22px; height: 22px; }
.headlines .mark-read-button svg { width: 14px; }
.article-load-sentinel { height: 1px; }

.article-collection.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.grid .article-card { border: 0; min-height: 345px; }
.grid .article-card:hover { transform: none; }
.grid .article-visual { height: 120px; }
.grid .visual-monogram { font-size: 54px; }
.grid .article-card-content { min-height: 224px; padding: 19px; }
.grid .card-title { font-size: 19px; margin-top: 12px; }
.grid .card-dek { -webkit-line-clamp: 2; font-size: 13px; }
.grid .card-actions { top: 133px; right: 10px; }

.empty-state { border: 1px solid var(--rule); background: var(--paper); margin-top: 24px; min-height: 370px; padding: 60px; text-align: center; place-items: center; align-content: center; }
.empty-state:not([hidden]) { display: grid; }
.empty-index { font-family: var(--mono); color: var(--accent); }
.empty-state h2 { margin: 14px 0 4px; font-weight: 500; letter-spacing: -.03em; }
.empty-state p { color: var(--ink-mute); margin: 0 0 22px; }

.reading-progress { height: 2px; position: fixed; top: 68px; left: 0; right: 0; z-index: 21; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .1s linear; }
.reader-view { padding-bottom: 120px; }
.reader-toolbar { min-height: 62px; max-width: 1340px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rule); }
.text-button { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 9px 0; }
.reader-tools { display: flex; align-items: center; gap: 6px; }
.article-header { max-width: 900px; margin: 0 auto; padding: 90px 32px 68px; }
.article-kicker-row { display: flex; gap: 10px; }
.confidence-label { color: var(--accent); padding-left: 10px; border-left: 1px solid var(--rule-strong); }
.article-header h1 { font-size: clamp(44px, 6vw, 76px); margin: 18px 0 24px; }
.article-dek { font-size: 21px; color: var(--ink-soft); line-height: 1.45; max-width: 780px; margin: 0; }
.article-byline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; color: var(--ink-mute); font-size: 12px; }
.reader-hero { max-width: 900px; margin: -28px auto 64px; padding: 0 32px; }
.reader-hero img { display: block; width: 100%; max-height: 560px; object-fit: cover; background: #efefeb; }
.article-layout { width: min(1340px, calc(100% - 64px)); margin: 0 auto; display: grid; grid-template-columns: 180px minmax(0, 700px) 180px; justify-content: center; gap: clamp(40px, 6vw, 90px); border-top: 1px solid var(--ink); padding-top: 50px; }
.article-outline { grid-column: 1; grid-row: 1; }
.article-body { grid-column: 2; grid-row: 1; }
.article-context { grid-column: 3; grid-row: 1; }
.article-outline, .article-context { position: sticky; top: 105px; height: fit-content; font-size: 11px; color: var(--ink-mute); }
.article-outline > p { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; margin: 0 0 16px; }
.article-outline nav { display: grid; gap: 10px; }
.article-outline a { color: var(--ink-mute); text-decoration: none; line-height: 1.35; border-left: 1px solid var(--rule); padding-left: 10px; }
.article-outline a:hover { color: var(--ink); border-color: var(--accent); }
.article-context { display: grid; gap: 28px; }
.context-block { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 4px; }
.context-block strong { color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.context-block a { color: var(--accent); text-decoration: none; }
.context-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.context-action { border: 0; padding: 0; background: transparent; color: var(--ink-mute); font: inherit; cursor: pointer; }
.context-action:hover { color: var(--ink); }
.context-action:disabled { color: var(--ink-mute); cursor: default; opacity: .5; }
.context-block code { font-family: var(--mono); font-size: 9px; color: var(--ink-mute); word-break: break-all; }
.article-body { min-width: 0; font-size: var(--reading-size); line-height: 1.7; color: #222220; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.5em; }
.article-body h2, .article-body h3 { font-weight: 500; letter-spacing: -.035em; line-height: 1.15; scroll-margin-top: 100px; }
.article-body h2 { font-size: 32px; margin: 2.2em 0 .65em; }
.article-body h3 { font-size: 23px; margin: 2em 0 .6em; }
.article-body a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.article-body img { display: block; width: calc(100% + 80px); max-height: 680px; object-fit: contain; margin: 2.5em -40px; background: #efefeb; }
.article-body figure { margin: 2.5em -40px; }
.article-body figure img { width: 100%; margin: 0; }
.article-body figcaption { color: var(--ink-mute); font-size: 11px; margin-top: 8px; }
.article-body blockquote { margin: 2em 0; padding: 8px 0 8px 24px; border-left: 2px solid var(--accent); font-size: 1.2em; line-height: 1.5; }
.article-body pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--rule); padding: 18px; font: 12px/1.6 var(--mono); }
.article-body table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 2em 0; }
.article-body th, .article-body td { border-bottom: 1px solid var(--rule); text-align: left; padding: 10px 8px; }
.article-body aside, .article-body form, .article-body nav, .article-body script, .article-body style, .article-body iframe { display: none !important; }

.import-dialog { width: min(640px, calc(100% - 32px)); padding: 0; border: 1px solid var(--rule-strong); border-radius: 14px; background: var(--canvas); color: var(--ink); box-shadow: 0 30px 80px rgba(10,10,9,.18); }
.source-dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--canvas); color: var(--ink); }
.import-dialog::backdrop, .source-dialog::backdrop { background: rgba(10,10,9,.34); backdrop-filter: blur(3px); }
.dialog-shell { padding: 30px; }
.source-shell { width: min(1100px, calc(100% - 64px)); margin: 0 auto; padding: 56px 0 80px; }
.source-shell .dialog-header { padding-bottom: 34px; margin-bottom: 0; border-bottom: 1px solid var(--ink); }
.source-shell .dialog-header h2 { margin-top: 8px; font-size: clamp(38px, 5vw, 64px); }
.source-shell .dialog-header .text-button { flex-direction: row-reverse; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.dialog-header h2 { font-size: 32px; }
.dialog-dek { max-width: 440px; margin: 10px 30px 0 0; color: var(--ink-soft); font-size: 13px; }
.source-search-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.source-search { min-width: 0; display: flex; align-items: center; gap: 12px; }
.source-search svg { flex: 0 0 auto; color: var(--ink-mute); }
.source-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; }
.source-search input::placeholder { color: var(--ink-mute); }
.source-search-panel .cadence-field { margin: 0; }
.source-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); }
.source-tab { position: relative; height: 54px; padding: 0; border: 0; background: transparent; color: var(--ink-mute); cursor: pointer; font-size: 13px; }
.source-tab span { margin-left: 5px; font: 9px/1 var(--mono); }
.source-tab.is-active { color: var(--ink); }
.source-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.feed-entry { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.feed-entry > label, .source-register-header { display: block; font: 9px/1.3 var(--mono); letter-spacing: .08em; color: var(--ink-mute); }
.feed-entry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 10px; }
.feed-entry input { min-width: 0; height: 42px; border: 1px solid var(--rule-strong); border-radius: 0; background: var(--paper); color: var(--ink); padding: 0 13px; outline: 0; }
.feed-entry input:focus { border-color: var(--accent); }
.cadence-field { display: grid !important; grid-template-columns: auto minmax(150px, 220px); align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; }
.cadence-field select, .source-cadence { height: 32px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink-soft); padding: 0 28px 0 9px; font: 10px/1 var(--mono); outline: 0; }
.cadence-field select:focus, .source-cadence:focus { border-color: var(--accent); }
.field-status { min-height: 18px; margin: 8px 0 0; font-size: 11px; color: var(--ink-mute); }
.field-status.is-error { color: var(--danger); }
.source-register { margin-top: 28px; }
.source-register-header { display: flex; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid var(--rule); }
.source-list { display: grid; }
.source-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; min-height: 74px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.source-row-discover, .source-row-removed { grid-template-columns: minmax(0, 1fr) auto; }
.source-identity { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 11px; min-width: 0; }
.source-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--chip); border: 1px solid var(--rule); font: 10px/1 var(--mono); color: var(--accent); }
.source-copy { min-width: 0; display: grid; }
.source-copy strong { font-size: 13px; font-weight: 500; }
.source-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-mute); font: 9px/1.5 var(--mono); }
.source-copy .source-state { color: var(--accent); margin-top: 2px; }
.source-copy .source-state.is-error { color: var(--danger); }
.source-remove { border: 0; background: none; padding: 7px 0 7px 12px; color: var(--ink-mute); font-size: 11px; cursor: pointer; }
.source-remove:hover { color: var(--danger); }
.source-action { min-width: 76px; height: 34px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 999px; background: transparent; color: var(--ink); font-size: 11px; cursor: pointer; }
.source-action:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.source-action:disabled { border-color: var(--rule); color: var(--ink-mute); cursor: default; }
.source-empty { min-height: 180px; display: grid; place-items: center; border-bottom: 1px solid var(--rule); color: var(--ink-mute); font-size: 13px; }
.source-footnote { margin: 18px 0 0; color: var(--ink-mute); font-size: 10px; }
.source-footnote code { font-family: var(--mono); font-size: 9px; color: var(--ink-soft); }
.drop-zone { min-height: 250px; border: 1px dashed var(--rule-strong); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; text-align: center; padding: 36px; transition: border-color .2s, background .2s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: #fffdf7; }
.drop-zone input { display: none; }
.upload-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; margin-bottom: 14px; }
.drop-zone > span:not(.upload-mark) { color: var(--ink-mute); font-size: 13px; }
.drop-zone small { margin-top: 20px; color: var(--ink-mute); font-size: 10px; font-family: var(--mono); }
.import-guidance { display: grid; grid-template-columns: 28px 1fr; gap: 10px 12px; margin-top: 24px; }
.import-guidance p { margin: 0; font-size: 12px; color: var(--ink-soft); }
.guide-index { font-family: var(--mono); color: var(--accent); font-size: 10px; padding-top: 2px; }
.import-status { min-height: 20px; margin-top: 16px; color: var(--accent); font-size: 12px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 999px; padding: 10px 16px; font-size: 12px; transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .topbar { padding: 0 18px; gap: 16px; }
  .nav-search { max-width: 250px; }
  .sync-button { width: 38px; padding: 0; }
  #sync-button-label { display: none; }
}

@media (max-width: 1000px) {
  .article-collection.grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: minmax(0, 700px) 170px; }
  .article-outline { display: none; }
  .article-body { grid-column: 1; }
  .article-context { grid-column: 2; }
}

@media (max-width: 900px) {
  .topbar { height: 120px; grid-template-columns: 1fr auto; grid-template-rows: 67px 52px; gap: 0 16px; }
  .topbar-workspace { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; border-top: 1px solid var(--rule); }
  .nav-search { max-width: none; }
  .reading-progress { top: 120px; }
}

@media (max-width: 760px) {
  .local-import-trigger { display: none; }
  .library-view { width: calc(100% - 32px); padding-top: 20px; }
  .article-collection.grid { grid-template-columns: 1fr; }
  .cards .article-card { display: block; min-height: 0; }
  .cards .article-visual { height: 220px; min-height: 0; }
  .cards .article-card-content { min-height: 320px; padding: 24px; }
  .cards .card-title { margin-top: 18px; font-size: 28px; }
  .cards .card-actions { top: 230px; right: 14px; }
  .list .article-card { grid-template-columns: 96px minmax(0, 1fr) 72px; gap: 12px; padding: 14px 0; }
  .list .article-visual { width: 96px; height: 88px; }
  .list .visual-monogram { font-size: 34px; }
  .list .article-card-content { min-height: 88px; }
  .list .card-title { margin: 6px 0 4px; font-size: 17px; }
  .list .card-dek { font-size: 12px; -webkit-line-clamp: 2; }
  .list .card-footer { display: none; }
  .headlines .article-card { grid-template-columns: minmax(0, 1fr) 92px 22px; gap: 10px; padding: 14px 0; }
  .headlines .card-title { white-space: nowrap; display: block; }
  .reader-toolbar { padding: 0 16px; }
  .reader-tools .icon-button { display: none; }
  .article-header { padding: 58px 22px 46px; }
  .article-header h1 { font-size: 42px; }
  .article-dek { font-size: 18px; }
  .article-layout { width: calc(100% - 44px); display: block; padding-top: 36px; }
  .article-body, .article-context { grid-column: auto; grid-row: auto; }
  .article-context { position: static; display: grid; grid-template-columns: 1fr 1fr; margin: 50px 0 0; }
  .article-context .context-block:nth-child(2) { display: none; }
  .article-body img, .article-body figure { width: calc(100% + 20px); margin-left: -10px; margin-right: -10px; }
  .dialog-shell { padding: 22px; }
  .source-shell { width: calc(100% - 32px); padding: 34px 0 60px; }
  .source-shell .dialog-header { padding-bottom: 24px; }
  .source-shell .dialog-header .dialog-dek { margin-right: 0; }
  .source-search-panel { grid-template-columns: 1fr; gap: 16px; }
  .source-search-panel .cadence-field { grid-template-columns: 1fr; gap: 8px; }
  .source-search-panel .cadence-field select { width: 100%; }
  .source-tabs { gap: 20px; }
  .drop-zone { min-height: 220px; }
  .feed-entry-row { grid-template-columns: 1fr; }
  .feed-entry-row .button { justify-self: start; }
  .source-row { grid-template-columns: minmax(0, 1fr) auto; }
  .source-cadence { grid-column: 1; width: fit-content; margin-left: 43px; }
  .source-remove { grid-column: 2; grid-row: 1 / span 2; }
}

@media (max-width: 560px) {
  .topbar { height: 158px; padding: 0 12px; grid-template-rows: 59px 99px; }
  .brand > span:last-child { display: none; }
  .topbar-actions { gap: 2px; }
  .topbar-workspace { align-self: stretch; display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: 44px 46px; gap: 0 6px; padding-top: 8px; }
  .nav-search { grid-column: 1 / -1; grid-row: 1; width: 100%; height: 36px; }
  .filter-group { grid-column: 1; grid-row: 2; height: 38px; }
  .filter { padding: 0 7px; }
  .filter span { display: none; }
  .nav-disclosure { grid-column: 2; grid-row: 2; }
  .nav-disclosure summary { padding: 0 7px; border-left: 0; }
  .nav-menu { left: auto; right: 0; }
  .view-switcher { grid-column: 3; grid-row: 2; justify-self: end; }
  .view-button[data-view="list"], .view-button[data-view="headlines"] { display: none; }
  .reading-progress { top: 158px; }
  .library-view { width: calc(100% - 24px); padding-top: 12px; }
  .cards .article-card-content { min-height: 300px; }
}

@media (max-width: 360px) {
  .filter[data-filter="saved"] { display: none; }
}

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