:root {
  color-scheme: light dark;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f5f5fa;
  --paper: #fff;
  --paper-hover: #faf9fe;
  --ink: #1b1c2b;
  --muted: #575b70;
  --line: #dfdfeb;
  --accent: #5140af;
  --accent-ink: #fff;
  --wash: #efecff;
  --focus: #5a48bf;
  --danger: #a72d49;
  --shadow: 0 16px 72px #27204420;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151e;
    --paper: #1e1e2b;
    --paper-hover: #242434;
    --ink: #f3f1f9;
    --muted: #afafc5;
    --line: #34354a;
    --accent: #c4b9ff;
    --accent-ink: #252047;
    --wash: #30284d;
    --focus: #c4b9ff;
    --danger: #ff9caf;
    --shadow: 0 16px 72px #0007;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 1rem; line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip { position: fixed; z-index: 10; top: .5rem; left: .5rem; padding: .75rem; background: var(--paper); transform: translateY(-150%); }
.skip:focus { transform: none; }

.bar { background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 49rem; min-height: 3.85rem; margin: auto; padding-inline: clamp(1rem, 5vw, 2.5rem); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .67rem; font-size: 1.16rem; font-weight: 760; letter-spacing: -.045em; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 2rem; aspect-ratio: 1; background: var(--accent); color: var(--accent-ink); border-radius: .65rem; flex: 0 0 auto; }
.brand-mark::before { content: ""; width: .87rem; height: .70rem; border-block: 2px solid; background: linear-gradient(currentColor,currentColor) left center / 65% 2px no-repeat; border-radius: 1px; }
.layout { max-width: 49rem; margin-inline: auto; padding: clamp(1.4rem, 5vw, 2.5rem) clamp(1rem, 5vw, 2.5rem) 4rem; }
main { min-width: 0; }
main:focus:not(:focus-visible), h1:focus:not(:focus-visible) { outline: none; }
.menu-toggle { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .6rem; min-height: 2.75rem; border: 0; border-radius: .4rem; background: transparent; color: var(--ink); font-size: .92rem; font-weight: 650; }
.menu-toggle:hover, .menu-toggle[aria-expanded="true"] { background: var(--wash); }
.menu-icon { display: inline-block; width: 1.05rem; height: .8rem; border-block: 1.5px solid; background: linear-gradient(currentColor,currentColor) center / 100% 1.5px no-repeat; }
.navigation { display: grid; max-width: 49rem; margin: auto; padding: 0 clamp(1rem, 5vw, 2.5rem) .65rem; }
.navigation a { display: flex; align-items: center; min-height: 2.75rem; padding: .45rem .6rem; color: var(--muted); text-decoration: none; font-weight: 620; border-top: 1px solid var(--line); }
.navigation a:hover, .navigation a[aria-current="page"] { color: var(--accent); }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5vw, 2.5rem); font-weight: 770; line-height: 1.07; letter-spacing: -.045em; }
h2 { font-size: clamp(1.32rem, 4vw, 1.65rem); line-height: 1.25; letter-spacing: -.035em; }
h3 { font-size: 1.17rem; line-height: 1.32; letter-spacing: -.02em; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .85rem 1.25rem; margin: 0 0 1.45rem; }

.primary, .secondary, .danger, .text-button, .chip, .views button {
  border: 1px solid transparent;
  border-radius: .62rem;
  min-height: 2.75rem;
  padding: .53rem .9rem;
  line-height: 1.35;
  font-weight: 660;
  font-size: .9rem;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(.91); }
.primary span { font-size: 1.17em; margin-right: .2em; }
.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.secondary:hover, .chip:hover { border-color: var(--accent); }
.text-button { background: transparent; color: var(--muted); }
.text-button { padding-inline: .55rem; }
.text-button:hover { color: var(--accent); }
.danger { color: var(--danger); background: var(--paper); border-color: currentColor; }
.danger:hover { background: var(--paper-hover); }
.views { display: flex; gap: .25rem; width: max-content; max-width: 100%; margin: -.25rem 0 1.25rem; }
.views button { background: transparent; color: var(--muted); min-width: 4.7rem; }
.views button[aria-pressed="true"], .chip[aria-pressed="true"] { color: var(--accent); background: var(--wash); }
.filter-chips, .suggestions { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.35rem 0 1.2rem; }
.chip { background: var(--paper); border-color: var(--line); color: var(--muted); min-height: 2.5rem; max-width: 100%; overflow-wrap: anywhere; }
.status-inline { padding: 1rem 0; color: var(--muted); }

.empty { background: var(--paper); border: 1px solid var(--line); border-radius: 1.1rem; padding: clamp(1.35rem, 6vw, 3rem); min-height: 16.5rem; display: flex; align-items: flex-start; justify-content: center; flex-direction: column; gap: .65rem; }
.empty p { max-width: 36ch; color: var(--muted); }
.empty .primary { margin-top: .38rem; }
.empty-symbol { position: relative; display: grid; place-items: center; width: 3.15rem; height: 3.15rem; margin-bottom: .55rem; border-radius: .95rem; background: var(--wash); color: var(--accent); }
.empty-symbol::before { content: ""; width: 1.22rem; height: 1.25rem; border: 1.5px solid currentColor; border-radius: .22rem; background: linear-gradient(currentColor,currentColor) center 36% / 62% 1.5px no-repeat, linear-gradient(currentColor,currentColor) center 65% / 62% 1.5px no-repeat; }

.rows { border-block: 1px solid var(--line); }
.row { padding: 1rem 0; min-width: 0; }
.row + .row { border-top: 1px solid var(--line); }
.row h2 { font-size: 1.14rem; overflow-wrap: anywhere; }
.row h2 a { text-decoration-thickness: 1px; text-underline-offset: .19em; }
.article h2 a { text-decoration: none; }
.article h2 a:hover { text-decoration: underline; }
.article.unread h2 a, .article.unread h2 { font-weight: 770; }
.article .excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.article .post-text { font-size: 1rem; overflow-wrap: anywhere; }
.article .post-text a { text-decoration: none; }
.article .post-text a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .18rem .52rem; margin-bottom: .45rem; color: var(--muted); font-size: .85rem; }
.meta .source-name { font-weight: 730; color: var(--accent); }
.meta > * { overflow-wrap: anywhere; }
.row p:not(.meta) { color: var(--muted); margin-top: .38rem; overflow-wrap: anywhere; }
.row p.post-text { color: var(--ink); }
.row .source-error { color: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin: .4rem -.5rem -.45rem; }
.row-actions button[aria-pressed="true"] { color: var(--accent); }
.day { font-size: .94rem; color: var(--muted); font-weight: 680; margin: 1.25rem 0 .55rem; text-transform: capitalize; }
.day:first-child { margin-top: 0; }
.load-more { margin-top: 1.2rem; width: 100%; }
.account { margin-top: 1rem; }
.account button { margin-left: -.55rem; }
.toast { position: fixed; right: 1rem; bottom: 1rem; padding: .7rem 1rem; max-width: calc(100% - 2rem); border-radius: .65rem; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: .94rem; z-index: 2; }

.editor { margin: 0 0 1.5rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.editor-heading { margin-bottom: .6rem; }
.inline-confirm { margin: .65rem 0 0; padding: .5rem .85rem .85rem; background: var(--paper); border-left: 2px solid var(--danger); }
label { display: block; color: var(--ink); font-size: .92rem; font-weight: 670; margin: .85rem 0 .32rem; }
input, select { width: 100%; min-height: 2.8rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: .55rem; padding: .5rem .65rem; font-size: 1rem; }
input::placeholder { color: var(--muted); }
.help, .preview { color: var(--muted); font-size: .88rem; margin-top: .38rem; }
.suggestions { margin: .6rem 0 0; }
.editor-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: 1.15rem; }
.form-error { color: var(--danger); margin-top: .65rem; }
.preview { background: var(--bg); border-radius: .55rem; padding: .6rem .7rem; margin-top: .7rem; }
.preview ul { padding-left: 1.2rem; margin: .35rem 0 0; }
.login { display: grid; min-block-size: 100vh; min-block-size: 100svh; place-items: center; padding: 1.1rem; }
.login-panel { width: min(100%, 26rem); background: var(--paper); border: 1px solid var(--line); padding: clamp(1.4rem, 6vw, 2.4rem); border-radius: 1.15rem; }
.login-panel h1 { margin: 1.5rem 0 .45rem; }
.login-panel p { color: var(--muted); }
.login-panel form { margin-top: 1.15rem; }
.login-panel .primary { width: 100%; margin-top: 1rem; }
.login-panel .form-error { color: var(--danger); }

@media (max-width: 35rem) {
  .views { width: 100%; }
  .views button { flex: 1 1 0; min-width: 0; padding-inline: .35rem; }
  .editor-actions { justify-content: flex-start; }
}
