/* The web app's stylesheet (docs/CHANGE-WEB1.md §7.1, §7.3, §9.1; unit P7). One file for the
   shell, the river and the reader; the P8 screens bring their own under css/. No @import, no
   font, no request: `style-src 'self'` and the precache cover exactly this file. Themes are
   classes on the root (data-theme) over `prefers-color-scheme`; the reader's text size is the
   --reader-scale custom property the app sets on the root (§7.3). */

:root {
  color-scheme: light dark;
  --bg: #f4f8f3;
  --surface: #ffffff;
  --surface-2: #e9f1ea;
  --ink: #14251a;
  --ink-2: #4a5c50;
  --ink-3: #7d8c82;
  --line: #d6e1d8;
  --accent: #2a9d47;
  --accent-ink: #ffffff;
  --accent-soft: #dff1e3;
  --warn: #b8860b;
  --danger: #b3261e;
  --shadow: 0 8px 30px rgba(20, 37, 26, 0.18);
  --radius: 10px;
  --sidebar-w: 16rem;
  --list-w: 26rem;
  --reader-scale: 1;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The names discover.css, folders.css and settings.css use. Without them those sheets
     fall back to fixed light colours, which are wrong in the dark theme. Declared on the
     same element as the themes, so each follows the theme in force. */
  --border: var(--line);
  --text-secondary: var(--ink-2);
  --field-bg: var(--surface);
  --accent-contrast: var(--accent-ink);
  --destructive: var(--danger);
  --warning: var(--warn);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101a13;
    --surface: #182319;
    --surface-2: #1f2e23;
    --ink: #e8efe9;
    --ink-2: #b4c2b7;
    --ink-3: #7f8f84;
    --line: #2b3a2f;
    --accent: #4fc06c;
    --accent-ink: #0d1a10;
    --accent-soft: #1f3a27;
    --warn: #e0b341;
    --danger: #ff7b72;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #101a13;
  --surface: #182319;
  --surface-2: #1f2e23;
  --ink: #e8efe9;
  --ink-2: #b4c2b7;
  --ink-3: #7f8f84;
  --line: #2b3a2f;
  --accent: #4fc06c;
  --accent-ink: #0d1a10;
  --accent-soft: #1f3a27;
  --warn: #e0b341;
  --danger: #ff7b72;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
  flex: none;
}

/* --- boot ------------------------------------------------------------------------------ */

.boot,
.boot-message {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 1rem;
  text-align: center;
  color: var(--ink-2);
}

/* --- the shell ------------------------------------------------------------------------- */

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.columns {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  min-height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem 0.6rem;
}

.brand img {
  border-radius: 7px;
}

.brand-name {
  flex: 1;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.sync {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.sync-glyph {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ink-2);
  border-right-color: transparent;
  border-radius: 50%;
}

.sync.busy .sync-glyph {
  animation: spin 0.9s linear infinite;
  border-color: var(--accent);
  border-right-color: transparent;
}

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

.sidebar-body {
  padding: 0 0.5rem 1rem;
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-sections,
.nav-folders,
.nav-tools {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.nav-folders,
.nav-tools {
  border-top: 1px solid var(--line);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  min-height: 2.2rem;
}

.nav-link:hover {
  background: var(--surface);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-count {
  font-size: 0.8rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.nav-folder {
  font-weight: 600;
}

.nav-feeds .nav-link {
  padding-left: 1.6rem;
  font-size: 0.95rem;
}

.nav-feed.failing .nav-label::after {
  content: " •";
  color: var(--warn);
}

.sidebar details > summary {
  list-style: none;
  cursor: pointer;
}

.sidebar details > summary::-webkit-details-marker {
  display: none;
}

.nav-empty {
  margin: 1rem 0.6rem;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.scrim {
  display: none;
}

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.main-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Discover, Add by address, Folders and Settings render straight into the host, which the
   shell clips: the host scrolls for them (the river has its own scroller). */
.shell:is([data-screen="discover"], [data-screen="add"], [data-screen="folders"], [data-screen="settings"]) .main-host {
  overflow-y: auto;
  overscroll-behavior: contain;
  /* At most 46 rem of text, centred in the two columns these screens span on a wide window. */
  padding: 0 max(1rem, calc((100% - 46rem) / 2)) 2rem;
}

/* Sticky like the river's header, so the burger always sits on the header, never on content;
   the negative margin spans the host's padding. */
.screen-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.55rem;
  margin: 0 -1rem 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.screen-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.burger {
  position: absolute;
  top: 0.55rem;
  left: 0.6rem;
  z-index: 3;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 1.1rem;
}

.reader-pane {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  min-width: 0;
}

/* From 48 rem the sidebar stands beside the list; the reader still covers the list column. */
@media (min-width: 48rem) {
  .columns {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .burger {
    display: none;
  }

  .reader-pane {
    left: var(--sidebar-w);
  }
}

/* From 80 rem the reader is a third column; the list keeps its width and its scroll offset. */
@media (min-width: 80rem) {
  .columns {
    grid-template-columns: var(--sidebar-w) var(--list-w) minmax(0, 1fr);
  }

  .shell[data-reader="open"] .main {
    border-right: 1px solid var(--line);
  }

  .reader-pane {
    position: static;
    inset: auto;
    grid-column: 3;
  }

  .shell:not([data-reader="open"]) .main {
    grid-column: 2 / span 2;
  }
}

/* Under 48 rem the sidebar is a drawer. */
@media (max-width: 47.99rem) {
  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 8;
    width: min(var(--sidebar-w), 85vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }

  .shell.drawer-open .sidebar {
    transform: none;
    box-shadow: var(--shadow);
  }

  .shell.drawer-open .scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 7;
    background: rgba(0, 0, 0, 0.3);
  }

  /* Room for the burger; more specific than the header's own padding shorthand below. */
  .main .list-header {
    padding-left: 3.4rem;
  }

  .main .screen-header {
    padding-left: 3.4rem;
  }
}

/* Sign in is the only screen before a session: no sidebar, no drawer, one column. */
.shell[data-screen="signin"] .sidebar,
.shell[data-screen="signin"] .burger,
.shell[data-screen="signin"] .scrim {
  display: none;
}

.shell[data-screen="signin"] .columns {
  grid-template-columns: minmax(0, 1fr);
}

.shell[data-screen="signin"] .main {
  grid-column: 1;
}

/* --- banners, toasts, sheets ------------------------------------------------------------ */

.banners {
  flex: none;
}

.banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 1rem;
  font-size: 0.92rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.banner-text {
  flex: 1;
}

.banner-syncing {
  background: var(--accent-soft);
}

.banner-offline,
.banner-unreachable {
  background: var(--surface-2);
  color: var(--ink-2);
}

.banner-opFailures,
.banner-error,
.banner-storageFull {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
}

.banner-signIn {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
}

.banner-action,
.toast-action,
.primary {
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* Full width and centring the toasts inside: a box at left 50% may only grow to half the
   viewport, which wrapped a short toast one word per line on a phone. */
.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1.2rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 4vw;
  pointer-events: none;
}

.toast {
  max-width: 34rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.toast-text {
  flex: 1;
}

.toast-dismiss,
.sheet-close {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  color: inherit;
  opacity: 0.8;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.35);
}

.sheet-panel {
  position: relative;
  width: min(100%, 36rem);
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.2rem 1.2rem 1.4rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (min-width: 48rem) {
  .sheet {
    place-items: center;
  }

  .sheet-panel {
    border-radius: var(--radius);
  }
}

.sheet-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

.sheet h2 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
}

.shortcuts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}

.shortcuts dt kbd {
  font: 0.85rem var(--mono);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}

.shortcuts dd {
  margin: 0;
}

.failures ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.failures li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.failure-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.failure-message {
  color: var(--ink-2);
  font-size: 0.92rem;
}

/* --- sign in (unit P6's screen, styled here: it has no stylesheet of its own) ------------- */

.signin {
  max-width: 26rem;
  margin: 10vh auto 0;
  padding: 0 1.5rem 3rem;
  text-align: center;
}

.signin-title {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.signin-lede {
  margin: 0 0 1.4rem;
  color: var(--ink-2);
}

.signin-notice {
  margin: 0 0 1.2rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: start;
}

.signin-notice p {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
}

/* The two sign-in buttons (docs/CHANGE-GOOGLE1.md G24, §7.3): the same 40 px pill, 180 px wide —
   the width of Google's button image at 1x — one above the other. Apple's is ours, in the theme's
   ink; Google's is Google's own image, unchanged, in a button that adds only the focus ring and
   the disabled look. */
.signin-buttons {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(100%, 400px);
  margin: 0 auto;
}

.signin-apple,
.signin-google {
  display: block;
  width: 180px;
  height: 40px;
  border-radius: 20px;
  font: 500 14px/20px var(--font);
}

.signin-apple {
  padding: 0 1rem;
  border: 0;
  background: var(--ink);
  color: var(--bg);
}

.signin-google {
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
}

.signin-google img {
  display: block;
  width: 180px;
  height: 40px;
}

/* Google's light image in the light theme, its dark image in the dark one, by the theme rule of
   :root above: a theme forced in Settings (data-theme) wins over the system's, and a switch needs
   no reload. */
.signin-google .signin-google-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .signin-google .signin-google-light {
    display: none;
  }

  :root:not([data-theme="light"]) .signin-google .signin-google-dark {
    display: block;
  }
}

:root[data-theme="dark"] .signin-google .signin-google-light {
  display: none;
}

:root[data-theme="dark"] .signin-google .signin-google-dark {
  display: block;
}

.signin-apple:disabled,
.signin-google:disabled {
  opacity: 0.6;
  cursor: default;
}

.signin-status,
.signin-hint {
  margin: 0.8rem 0 0;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.signin-error {
  margin: 0.8rem 0 0;
  color: var(--danger);
}

.signin-dismiss {
  margin-top: 0.8rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
}

.signin-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.signin-replace {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: start;
}

.signin-replace h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.signin-replace button {
  margin: 0.6rem 0.6rem 0 0;
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.signin-replace-confirm {
  border-color: transparent;
  background: var(--danger);
  color: #fff;
}

.sheet .signin-notice p {
  margin: 0.4rem 0 0;
  color: var(--ink-2);
}

.screen-missing {
  padding: 3rem 1.5rem;
  color: var(--ink-2);
}

.screen-missing h1 {
  margin: 0 0 0.5rem;
  color: var(--ink);
}

/* --- the river ------------------------------------------------------------------------- */

.river {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
}

.list-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem 0.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.list-titles {
  flex: 1;
  min-width: 0;
}

.list-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-unread,
.list-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-3);
}

.list-subtitle.is-warning {
  color: var(--warn);
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tool,
.reader-tool,
.row-action {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
}

.tool:hover,
.reader-tool:hover,
.row-action:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.reader-tool.on,
.row-action.on {
  color: var(--accent);
}

/* A saved article's bookmark is filled, as on iOS. */
.on .icon-bookmark {
  fill: currentColor;
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 1.2rem;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu[open] > summary {
  background: var(--surface-2);
}

.menu-items {
  position: absolute;
  right: 0;
  top: 2.5rem;
  z-index: 4;
  min-width: 13rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-items li > button,
.menu-items li > label {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: start;
}

.menu-items li > button:hover,
.menu-items li > label:hover {
  background: var(--surface-2);
}

.list-form:not(:empty) {
  padding: 0.3rem 1rem 0.6rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 10rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.inline-form button,
.empty-actions button {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

/* The rule above outranks `.primary` and would leave white text on the surface colour. */
.inline-form button.primary,
.empty-actions button.primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.pill {
  position: sticky;
  top: 4.6rem;
  z-index: 3;
  display: block;
  margin: 0 auto 0.4rem;
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.day {
  padding: 0 0 0.5rem;
}

.day-title {
  margin: 0.6rem 1rem 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.row {
  position: relative;
  display: flex;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.row:hover {
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
}

.row.selected {
  background: var(--accent-soft);
}

.row.missing {
  opacity: 0.55;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 650;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.row.read .row-title {
  font-weight: 450;
  color: var(--ink-2);
}

.row-dot {
  color: var(--accent);
  margin-inline-end: 0.15rem;
}

.row-dot .icon {
  width: 0.7em;
  height: 0.7em;
}

.row-meta {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-source {
  color: var(--ink-2);
  font-weight: 500;
}

.row-glyph {
  margin-inline-start: 0.4rem;
}

.row-saved {
  color: var(--accent);
}

.row-excerpt {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.row-thumb {
  flex: none;
  width: 5.2rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}

.row-actions {
  position: absolute;
  right: 0.6rem;
  bottom: 0.4rem;
  display: flex;
  gap: 0.1rem;
  padding: 0.1rem;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: opacity 0.12s;
}

.row:hover .row-actions,
.row:focus-within .row-actions,
.row.selected .row-actions {
  opacity: 1;
}

@media (hover: none) {
  .row-actions {
    position: static;
    opacity: 1;
    box-shadow: none;
    background: transparent;
    align-self: center;
    flex-direction: column;
  }
}

.row-action {
  width: 1.9rem;
  height: 1.9rem;
}

.list-footer {
  margin: 0;
  padding: 1.2rem 1rem 2rem;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.empty {
  margin: 3rem auto;
  max-width: 26rem;
  padding: 0 1.5rem;
  text-align: center;
  color: var(--ink-2);
}

.empty h2 {
  margin: 0 0 0.4rem;
  color: var(--ink);
  font-size: 1.2rem;
}

.empty.busy h2::before {
  content: "";
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0 auto 0.8rem;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* --- the reader ------------------------------------------------------------------------ */

.reader-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.reader-tools {
  margin-inline-start: auto;
  display: flex;
  gap: 0.1rem;
}

.text-size {
  font-weight: 600;
}

.text-size.small {
  font-size: 0.8rem;
}

.text-size.large {
  font-size: 1.15rem;
}

.theme-glyph {
  font-size: 1.1rem;
}

.reader-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.article {
  max-width: 38em;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 4rem;
  font-size: calc(1.0625rem * var(--reader-scale));
  line-height: 1.6;
}

.article-title {
  margin: 0 0 0.4em;
  font-size: 1.7em;
  line-height: 1.2;
  font-weight: 700;
}

.byline {
  margin: 0 0 1.2em;
  font-size: 0.85em;
  color: var(--ink-3);
}

.byline-source {
  color: var(--ink-2);
  font-weight: 500;
}

.summary-card {
  margin: 0 0 1.4em;
  padding: 0.8em 1em;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 0.95em;
}

.summary-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.summary-head h2 {
  flex: 1;
  margin: 0;
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.summary-note {
  font-size: 0.8em;
  color: var(--warn);
}

.summary-toggle,
.link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  padding: 0.1em 0.3em;
}

.summary-body p,
.summary-status {
  margin: 0.5em 0 0;
}

.summary-body ul {
  margin: 0.4em 0 0;
  padding-inline-start: 1.2em;
}

.summary-card .primary {
  margin-top: 0.5em;
}

.offline-line {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 1.2em;
  font-size: 0.85em;
  color: var(--ink-3);
}

.article-body {
  overflow-wrap: anywhere;
}

/* Below the excerpt while the full text is missing; the look of the empty state's buttons. */
.article-original {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body table,
.article-body figure,
.article-body dl {
  margin: 0 0 1em;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  margin: 1.4em 0 0.5em;
  line-height: 1.25;
}

.article-body h1 {
  font-size: 1.4em;
}

.article-body h2 {
  font-size: 1.25em;
}

.article-body h3 {
  font-size: 1.1em;
}

.article-body blockquote {
  padding-inline-start: 1em;
  border-inline-start: 3px solid var(--line);
  color: var(--ink-2);
}

.article-body pre {
  padding: 0.8em 1em;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--surface-2);
  font: 0.85em/1.5 var(--mono);
}

.article-body code,
.article-body kbd,
.article-body samp {
  font: 0.9em var(--mono);
}

.article-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92em;
}

.article-body th,
.article-body td {
  padding: 0.3em 0.6em;
  border: 1px solid var(--line);
  text-align: start;
}

.article-body figcaption {
  font-size: 0.85em;
  color: var(--ink-3);
  text-align: center;
  margin-top: 0.3em;
}

.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5em 0;
}

.article-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.article-img.waiting {
  width: 100%;
  aspect-ratio: var(--img-ratio, 16 / 9);
  background: var(--surface-2);
}

.article-img.failed {
  display: none;
}

.article-excerpt {
  color: var(--ink-2);
}

.article-note {
  color: var(--ink-3);
  font-style: italic;
}

.article-missing {
  text-align: center;
  color: var(--ink-2);
}

.article-missing h1 {
  font-size: 1.2em;
}
