/* Kolophon's dashboard (dashboard.html). */

/* Literata, served from here: works offline, and asks nothing of a third party. Latin
   and Latin Extended; other scripts fall back to Georgia. Licence: fonts/OFL.txt */
@font-face {
  font-family: Literata;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/literata-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/literata-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/literata-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/literata-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #ecedea;
  /* what is raised off the page: cards, menus, the hero */
  --surface: #f6f6f3;
  --ink: #22252a;
  --ink-soft: #5d6066;
  --rule: #cfd1cc;
  --g0: #dfe0dc;
  --g1: #bfc1bc;
  --g2: #959893;
  --g3: #626560;
  --g4: #2e312e;
  --finish: #2f6f6a;
  /* the one accent: what is current, what is pressed, a primary button, stars, progress */
  --accent: #2f6f6a; --on-accent: #fff;
  /* the calendar's shades of time read, teal; its finished-a-book corner is in ink or paper, whichever shows on the shade */
  --t1: #c3ddd9; --t2: #87bdb6; --t3: #3f8f87; --t4: #1d625c;
  --focus: #2f6f6a;
  --hl-0: #d8b53a; --hl-1: #d27b94; --hl-2: #5f8fc4; --hl-3: #6c9e5a;
  --s-book: #008c84; --s-comic: #b5621a; /* the Stats page's books and comics */
  /* a cover's shadow, at rest and lifted */
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.14), 0 2px 8px rgb(0 0 0 / 0.1); --shadow-2: 0 2px 4px rgb(0 0 0 / 0.14), 0 14px 30px rgb(0 0 0 / 0.2);
  /* every control: one height, one corner, one edge */
  --ctl: 40px; --r: 8px; --edge: var(--g1);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}
/* Dark: warm, as a lamp on a page at night, not a screen's grey. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"], [data-theme="sepia"]) {
    --paper: #1b1a18; --surface: #252320; --ink: #e3dfd6; --ink-soft: #a49f95; --rule: #383531;
    --g0: #282623; --g1: #403d38; --g2: #645f58; --g3: #948e84; --g4: #d4cfc5;
    --t1: #1f3a38; --t2: #285b56; --t3: #34877f; --t4: #64bdb3;
    --finish: #6fb3ab; --accent: #6fb3ab; --on-accent: #10201e; --focus: #6fb3ab; --s-book: #1a9e97; --s-comic: #cc7f33;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.35); --shadow-2: 0 2px 4px rgb(0 0 0 / 0.5), 0 14px 30px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1a18; --surface: #252320; --ink: #e3dfd6; --ink-soft: #a49f95; --rule: #383531;
  --g0: #282623; --g1: #403d38; --g2: #645f58; --g3: #948e84; --g4: #d4cfc5;
  --t1: #1f3a38; --t2: #285b56; --t3: #34877f; --t4: #64bdb3;
  --finish: #6fb3ab; --accent: #6fb3ab; --on-accent: #10201e; --focus: #6fb3ab; --s-book: #1a9e97; --s-comic: #cc7f33;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 8px rgb(0 0 0 / 0.35); --shadow-2: 0 2px 4px rgb(0 0 0 / 0.5), 0 14px 30px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
/* Sepia: a book's own paper, picked like light or dark. */
:root[data-theme="sepia"] {
  --paper: #f1e7d3; --surface: #f8f0e0; --ink: #3a2f23; --ink-soft: #75654f; --rule: #dacdb2;
  --g0: #e6dac2; --g1: #cfc0a3; --g2: #a8977a; --g3: #74654e; --g4: #3a2f23;
  --t1: #cfdcc6; --t2: #97bda6; --t3: #4a8f80; --t4: #1f6259;
  --finish: #2b6a62; --accent: #2b6a62; --on-accent: #fff; --focus: #2b6a62; --s-book: #00857d; --s-comic: #a8581a;
  --shadow-1: 0 1px 2px rgb(60 40 10 / 0.16), 0 2px 8px rgb(60 40 10 / 0.12); --shadow-2: 0 2px 4px rgb(60 40 10 / 0.16), 0 14px 30px rgb(60 40 10 / 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
/* the page's colour on html too: body's containment (container-type, below) keeps its own
   from filling the window, which left a short page white under it */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Literata, Georgia, serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
/* Side gutter, widened past a notch in landscape. */
:root { --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right)); }
/* the page's width, for what spans all of it (the header's background) */
body { container-type: inline-size; }
main {
  max-width: 1000px; margin: 0 auto;
  padding: 28px var(--gutter) max(64px, calc(env(safe-area-inset-bottom) + 32px));
}
a, button, summary, label { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px 28px; flex-wrap: wrap; }
/* The header stays at the top, across the page, with a rule under it once scrolled. What
   is scrolled to (an anchor, a focused field) stops under it (--head, its height). */
html { scroll-padding-top: calc(var(--head, 0px) + 8px); }
.top {
  position: sticky; top: 0; z-index: 20; isolation: isolate;
  padding: max(12px, env(safe-area-inset-top)) 0 12px; margin-bottom: -12px;
}
.top::before {
  content: ''; position: absolute; z-index: -1; inset: 0 calc(50% - 50cqw);
  background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color 0.15s;
}
.top.stuck::before { border-bottom-color: var(--rule); }
/* The search, on the right by the account: books, series, authors and collections (js/search.js), their
   rows as in the lists, under it. */
.search { position: relative; flex: 0 1 17rem; min-width: 10rem; margin-left: auto; align-self: center; }
/* a tablet: the sections, search and account still on one line, closer together */
@media (min-width: 601px) and (max-width: 860px) {
  .top { column-gap: 16px; }
  .brand { column-gap: 20px; }
  .nav { gap: 16px; }
  .search { flex-basis: 10rem; min-width: 7rem; }
}
.search .ico { position: absolute; left: 9px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.search input {
  appearance: none; width: 100%; padding: 5px 10px 5px 34px; border: 1px solid var(--rule); border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 5%, transparent); font-size: 0.9375rem;
}
.search input:hover { border-color: var(--g2); }
.search input:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background: var(--paper); outline: none; }
.search input::-webkit-search-cancel-button, .lfind input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer; background: var(--ink-soft);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 2l10 10M12 2L2 12' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search-results {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1; width: min(36rem, calc(100cqw - 2 * var(--gutter)));
  max-height: calc(100dvh - var(--head, 80px) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 16px 4px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); font-size: 1rem; letter-spacing: normal;
}
.search-results .qsum { margin: 0 0 8px; font-size: 0.8125rem; }
.search-results .books li:last-child { padding-bottom: 8px; }
.search-results .books:has(.stars) li:last-child { padding-bottom: calc(8px + 22px * (1 / 11 + 0.163)); }
.top h1 { font-size: 1.0625rem; font-weight: 650; margin: 0; letter-spacing: -0.005em; }
.nav { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
/* a page's title: Literata's display cut (its optical size follows the size), light and large */
.view-title { font-size: clamp(1.75rem, 4.2vw, 2.75rem); font-weight: 350; line-height: 1.12; margin: 0; letter-spacing: -0.018em; text-wrap: balance; }
.view-title:focus, #dayTitle:focus, #activityTitle:focus { outline: none; }
/* for screen readers only */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.who { color: var(--ink-soft); font-size: 0.875rem; display: none; align-items: baseline; gap: 12px; min-width: 0; }
#who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who button, .who a { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; white-space: nowrap; }
/* Who is signed in, the theme, importing and signing out: behind a button with their initial. */
.acct { display: inline-flex; align-self: center; margin: -10px -6px -10px 0; background: none; border: 0; padding: 0; cursor: pointer; width: 44px; height: 44px; align-items: center; justify-content: center; }
/* without popovers (Safari before 17), the email, the theme, Import and Sign out are in a row */
.no-popover .who { display: flex; }
.no-popover .acct { display: none; }
.acct span {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 12%, transparent); font-weight: 600; font-size: 0.9375rem;
}
.acct-menu {
  position: fixed; inset: auto; margin: 0; padding: 12px 16px 4px; min-width: 17rem; max-width: calc(100vw - 2 * var(--gutter));
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}
.acct-menu p { margin: 0; font-size: 0.8125rem; color: var(--ink-soft); }
.acct-menu p + p { color: var(--ink); font-size: 0.9375rem; overflow-wrap: anywhere; margin-bottom: 4px; }
.acct-menu button, .acct-menu a.item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0; border: 0; border-top: 1px solid var(--rule);
  background: none; text-align: left; cursor: pointer; color: inherit; text-decoration: none; font-size: 1rem;
}
.acct-menu a.item:hover, .acct-menu .refresh:hover, .acct-menu .signout:hover { text-decoration: underline; }
.no-popover .acct-menu { display: none; }
/* Syncing every source: a ring turning round the account's initial, and beside the menu's button */
.acct { position: relative; }
.acct.syncing::after, .refresh.syncing::after {
  content: ''; box-sizing: border-box; border: 2px solid var(--rule); border-top-color: var(--ink-soft); border-radius: 50%;
}
.acct.syncing::after { position: absolute; inset: 3px; }
.refresh.syncing::after { display: inline-block; flex: none; width: 14px; height: 14px; margin-left: 8px; }
@media (prefers-reduced-motion: no-preference) { .syncing::after { animation: spin 0.9s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* Language: the locale picked (js/locale.js), its words, dates and numbers; a row in the account menu. */
.acct-menu .locale-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-soft); }
.locale-pick select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--edge); border-radius: var(--r); padding: 4px 6px; max-width: 11rem; }
.who select.locale-pick { font-size: 0.8125rem; align-self: center; }
/* Theme: as the system has it, light or dark (js/theme.js). Icons by the email; a row in the account menu. */
.theme { display: inline-flex; gap: 2px; }
.theme button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 4px; border: 0; border-radius: 50%;
  background: none; color: var(--ink-soft); text-decoration: none; cursor: pointer;
}
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.theme .ico { display: block; width: 18px; height: 18px; flex: none; }
.who .theme { align-self: center; margin-right: 4px; }
.who .theme span { display: none; }
.acct-menu .theme { display: flex; margin: 10px 0 12px; padding: 2px; border: 1px solid var(--edge); border-radius: var(--r); }
.acct-menu .theme button { flex: 1 1 0; flex-direction: column; gap: 2px; width: auto; min-height: 52px; padding: 4px 6px; border: 0; border-radius: calc(var(--r) - 2px); font-size: 0.75rem; }

.year { display: flex; align-items: baseline; gap: 4px; margin: 48px 0 12px; }
.year button {
  background: none; border: 0; border-radius: 50%; cursor: pointer; padding: 2px 8px; font-size: 1.25rem; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.year button:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.year button:disabled { opacity: 0.25; cursor: default; }
.year output { font-weight: 600; }


kolophon-calendar { display: block; }
.cal-wrap { overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-left: 34px; }
.cal { display: grid; grid-template-columns: 28px 1fr; gap: 6px; min-width: 720px; }
/* The weekday labels stay put while the weeks scroll under them. */
.cal > :nth-child(odd) { position: sticky; left: 0; z-index: 1; background: var(--paper); box-shadow: 6px 0 0 var(--paper); }
.cal .months { grid-column: 2; display: grid; font-size: 0.75rem; color: var(--ink-soft); height: 18px; }
/* Scrolling settles on a month's start, so its name isn't cut under the weekdays. */
.cal .months span { scroll-snap-align: start; }
.cal .days { display: grid; grid-template-rows: repeat(7, 1fr); font-size: 0.6875rem; color: var(--ink-soft); }
.cal .days span { display: flex; align-items: center; }
.grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.cell {
  aspect-ratio: 1; border: 0; padding: 0; border-radius: 3px; background: var(--g0); cursor: pointer; position: relative;
}
/* the year, the first time it is shown: its weeks come in one after the other (--c, a
   cell's week, set by js/calendar.js) */
@media (prefers-reduced-motion: no-preference) {
  .grid.intro .cell { animation: cell-in 0.45s var(--ease) backwards; animation-delay: calc(var(--c, 0) * 9ms); }
  .grid .cell:not(:disabled):hover { transform: scale(1.25); z-index: 1; }
  .grid .cell { transition: transform 0.12s var(--ease); }
}
@keyframes cell-in { from { opacity: 0; transform: scale(0.4); } }
.cell[data-l="1"] { background: var(--t1); }
.cell[data-l="2"] { background: var(--t2); }
.cell[data-l="3"] { background: var(--t3); }
.cell[data-l="4"] { background: var(--t4); }
.cell.out { visibility: hidden; }
.cell.future { opacity: 0.35; cursor: default; }
/* a book finished: the day's top corner turned down, as a page's; in ink on the lighter
   shades, in paper on the two deepest */
.cell.fin::after, .legend .fin::after {
  content: ""; position: absolute; top: 0; right: 0; width: 50%; height: 50%; background: var(--ink);
  border-top-right-radius: inherit; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.cell.fin:is([data-l="3"], [data-l="4"])::after, .mgrid .cell.fin:is([data-l="3"], [data-l="4"]) .n::after { background: var(--paper); }
/* today, ringed lightly; the day picked, in ink */
.grid .cell.today { outline: 1.5px solid var(--ink-soft); outline-offset: 1px; }
.cell[aria-pressed="true"], .grid .cell.today[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }

/* Phones: one month at a time, swiped sideways, with days large enough to tap. */
.mcal {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.mcal::-webkit-scrollbar { display: none; }
.month { scroll-snap-align: start; scroll-snap-stop: always; min-width: 0; padding: 0 4px 4px; }
.mhead { display: flex; align-items: center; justify-content: space-between; }
.mhead h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.mnav {
  min-width: 44px; min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 1.375rem; color: var(--ink-soft);
}
.mnav:disabled { opacity: 0.3; cursor: default; }
.wk, .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 4px; }
.wk span { text-align: center; font-size: 0.75rem; color: var(--ink-soft); padding: 2px 0 6px; }
/* a day: its number on a disc shaded by the time read (none, unread); a finished book, a dot under the number */
.mgrid .cell, .mgrid .cell[data-l] {
  aspect-ratio: auto; height: 44px; background: none; border-radius: 8px; font-size: 0.875rem; color: var(--ink-soft);
  display: grid; place-items: center;
}
.mgrid .n { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.mgrid .cell[data-l="1"] .n { background: var(--t1); color: var(--ink); }
.mgrid .cell[data-l="2"] .n { background: var(--t2); color: var(--ink); }
.mgrid .cell[data-l="3"] .n { background: var(--t3); color: var(--paper); }
.mgrid .cell[data-l="4"] .n { background: var(--t4); color: var(--paper); }
.mgrid .cell.today .n { font-weight: 700; }
.mgrid .cell.fin::after { content: none; }
.mgrid .cell.fin .n::after { content: ""; position: absolute; bottom: 4px; left: calc(50% - 2.5px); width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.mgrid .cell[aria-pressed="true"] { outline: 0; }
.mgrid .cell[aria-pressed="true"] .n { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.nav .ico { display: none; }

.legend { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--ink-soft); margin-top: 10px; flex-wrap: wrap; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.legend .sep { width: 16px; }
.legend i[data-l="0"] { background: var(--g0); }
.legend i[data-l="1"] { background: var(--t1); }
.legend i[data-l="2"] { background: var(--t2); }
.legend i[data-l="3"] { background: var(--t3); }
.legend i[data-l="4"] { background: var(--t4); }
.legend .fin { position: relative; background: var(--g0); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; margin: 40px 0 0; padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
/* each a label over its figure, the row's labels on one row of the grid and their figures
   on the next (a subgrid): a label on two lines ("Average reading day") keeps its figure
   level with the others, and a figure on two lines starts where the others do */
.facts > div { margin: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.facts dt { align-self: end; }
.facts dd { align-self: start; }
.facts dt, .eyebrow { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin: 4px 0 0; font-size: 1.4375rem; font-weight: 450; letter-spacing: -0.01em; }

/* Activity: first what is going on now, the books being read and up next side by side
   where there is room; then the year. */
.now { margin-top: 0; }
.welcome:not([hidden]) + .now { margin-top: 32px; }
.now .facts { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The book last read, large, to pick up again, on a wash of its cover's colour (--tint,
   as a book's page's head); beside it, where there is room, the figures in a column. */
.now-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.hero {
  --w: 132px; display: grid; grid-template-columns: var(--w) minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 24px 28px 24px 24px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--tint, var(--ink)) 12%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--ink)) 22%, var(--paper)), color-mix(in srgb, var(--tint, var(--ink)) 5%, var(--paper)) 75%);
  transition: background 0.4s, border-color 0.4s;
}
.hero .c { display: block; transition: transform 0.25s var(--ease); }
.hero .cover { width: var(--w); border-radius: 3px 5px 5px 3px; box-shadow: var(--shadow-2); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .hero .c:hover { transform: translateY(-4px); } }
.hero .eyebrow { margin: 0; }
.hero-title { margin: 6px 0 0; font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 400; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere; }
.hero .by { margin-top: 6px; font-size: 1rem; }
.hero .bar { height: 6px; margin-top: 18px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.hero-meta { display: flex; flex-wrap: wrap; margin: 10px 0 0; font-size: 0.9375rem; color: var(--ink-soft); }
.hero-meta b { color: var(--ink); font-weight: 600; }
.hero-meta span::before { content: '·'; margin: 0 0.5em; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.hero-acts .kbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border-radius: var(--r); }
@media (min-width: 861px) {
  .now-top:has(> .hero:not([hidden])) { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
  .now-top:has(> .hero:not([hidden])) .facts { grid-template-columns: minmax(0, 1fr); align-content: space-evenly; gap: 12px; padding: 4px 0 4px 28px; border: 0; border-left: 1px solid var(--rule); }
}
/* a figure with its picture before it: today against the day's goal, the week's days */
.facts dd:has(> .ring, > .spark) { display: flex; align-items: center; gap: 10px; }
.ring { flex: none; width: 28px; height: 28px; }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.ring .arc { stroke: var(--accent); stroke-linecap: round; }
.ring.none .arc { display: none; }
.spark { flex: none; height: 24px; width: auto; }
.spark rect { fill: var(--g1); }
.spark .now { fill: var(--accent); }
.spark .later { fill: var(--g0); }
@media (prefers-reduced-motion: no-preference) { .ring .arc { animation: ring-in 1s var(--ease) backwards; } }
@keyframes ring-in { from { stroke-dasharray: 0 101; } }
/* Nothing read at all yet: how reading gets here. */
.welcome { max-width: 34rem; margin: 56px auto 8px; text-align: center; }
.welcome svg { width: 120px; color: var(--accent); }
.welcome .soft { opacity: 0.45; }
.welcome p { margin: 12px 0 20px; color: var(--ink-soft); }
.welcome .kbtn { display: inline-flex; align-items: center; text-decoration: none; }
.welcome:not([hidden]) + .now .facts { display: none; }
/* While the reading loads the first time: the page's outline, the light moving across it. */
.loading { display: grid; gap: 32px; padding-top: 24px; }
.sk { border-radius: 8px; background: linear-gradient(100deg, var(--g0) 30%, color-mix(in srgb, var(--g0) 45%, var(--paper)) 50%, var(--g0) 70%) 0 0 / 250% 100%; }
@media (prefers-reduced-motion: no-preference) { .sk { animation: shimmer 1.6s linear infinite; } }
.sk-head { width: min(100%, 30rem); height: 36px; }
.sk-row { display: flex; align-items: center; gap: 28px; }
.sk-cover { flex: none; width: 132px; aspect-ratio: 2 / 3; }
.sk-lines { flex: 1 1 auto; display: grid; gap: 14px; }
.sk-line { height: 14px; }
.sk-line.big { height: 30px; }
.sk .w30, .w30 { width: 30%; } .w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }
.sk-block { height: 180px; }
.shelves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 48px; margin-top: 32px; }
.shelves:not(:has(> :not([hidden]))) { display: none; }
@media (min-width: 761px) { .shelves { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
/* side by side, each shelf runs the row's height, so their scrollbars line up however tall the cards */
.shelves > section { display: flex; flex-direction: column; }
.shelves .covers { flex: 1 0 auto; }
#books + .more-row { margin-top: 16px; }

.lower { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; margin-top: 40px; }
@media (max-width: 760px) { .lower { grid-template-columns: 1fr; gap: 40px; } }
h2 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.005em; margin: 0 0 16px; }
.lower > * { min-width: 0; }
.covers { list-style: none; margin: 0 -8px; padding: 8px 8px 12px; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 8px; overscroll-behavior-x: contain; scrollbar-width: thin; }
/* more covers past an edge: that edge fades (dashboard.js sets the classes as they scroll) */
.covers.more-r { mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.covers.more-l { mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
.covers.more-l.more-r { mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.covers li { flex: 0 0 112px; min-width: 0; scroll-snap-align: start; }
.covers .c { display: block; }
.covers .cover { width: 112px; }
.covers .c { transition: transform 0.25s var(--ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .covers li:hover .c, .rv-covers li:hover a, .find-card:hover .cover { transform: translateY(-4px); }
  .covers li:hover .cover, .rv-covers li:hover .cover { box-shadow: var(--shadow-2); }
}
.covers .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 10px; font-weight: 500; font-size: 0.875rem; line-height: 1.3; overflow-wrap: anywhere; }
.covers .s { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 0.75rem; }
.covers .bar { margin-top: 8px; }
/* a card with no bar (Up next) keeps its title level with those that have one: the bar's 8px + 3px */
.covers .c + .t { margin-top: 21px; }
/* a section's title, and a link to all of it on the right */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.sec-head h2 { margin: 0; }
.sec-head a { color: var(--ink-soft); font-size: 0.875rem; text-decoration-color: var(--g1); text-underline-offset: 0.2em; }
.sec-head a:hover { color: var(--ink); }

.day-total { color: var(--ink-soft); font-size: 0.9375rem; margin: -8px 0 16px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); align-items: baseline; }
.entries time { color: var(--ink-soft); font-size: 0.875rem; }
.entries .t, .books .t, .rlist .t, .qbook summary .t { overflow-wrap: anywhere; }
.entries .t { font-weight: 500; }
.entries .p { color: var(--ink-soft); font-size: 0.875rem; }
.entries .m { font-weight: 500; white-space: nowrap; }
.entries .done { color: var(--finish); font-size: 0.875rem; font-weight: 600; }
.books .s .marked { font-style: italic; }
.entries .marked { color: var(--ink-soft); font-size: 0.875rem; font-style: italic; }
.quiet { color: var(--ink-soft); }
/* a book's readings, on its page */
.readings { border-collapse: collapse; width: 100%; }
.readings th, .readings td { padding: 10px 16px 10px 0; text-align: left; font-weight: 400; white-space: nowrap; border-top: 1px solid var(--rule); }
.readings thead th { padding-top: 0; font-size: 0.8125rem; color: var(--ink-soft); border-top: 0; }
.readings :is(th, td):nth-child(n+3) { text-align: right; }
.readings :is(th, td):last-child { padding-right: 0; font-weight: 500; }
.readings thead th:last-child { font-weight: 400; }
.offline {
  margin: 16px 0 0; padding: 8px 12px; border-radius: 6px; font-size: 0.9375rem;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.entries li.empty, .books li.empty { display: block; }
/* nothing there yet: said in a quiet box of its own, not as a row that looks cut off */
.lower .entries li.empty, .lower .books li.empty, .bsec .entries li.empty {
  padding: 26px 16px; border: 1px dashed var(--g1); border-radius: 12px; text-align: center; font-size: 0.9375rem;
}

.books { list-style: none; margin: 0; padding: 0; }
.books li { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); align-items: center; }
/* A cover: a book lying on the page, with a shadow under it and the light along its spine.
   Until its picture is there, a blank one the light moves across. */
.cover {
  position: relative; width: 44px; aspect-ratio: 2 / 3; background: var(--g0); border-radius: 2px 3px 3px 2px; overflow: hidden; display: block;
  box-shadow: var(--shadow-1); transition: box-shadow 0.25s var(--ease);
}
.cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(to right, rgb(0 0 0 / 0.16), rgb(255 255 255 / 0.2) 3.5%, rgb(0 0 0 / 0.07) 6.5%, transparent 11%, transparent 96%, rgb(0 0 0 / 0.07));
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
.cover:empty::after { background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--paper) 55%, transparent) 50%, transparent 70%) 0 0 / 250% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .cover:empty::after { animation: shimmer 1.6s linear infinite; }
  .cover > img { animation: fade-in 0.3s ease-out; }
}
@keyframes shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
@keyframes fade-in { from { opacity: 0; } }
.books .t { font-weight: 500; line-height: 1.3; }
/* a row with one link (its title) opens it from anywhere on it, cover included: the link
   stretched over the row, what else in it can be pressed above it */
.books li:has(> span > a.t) { position: relative; }
.books li > span > a.t::after { content: ''; position: absolute; inset: 0; }
.books li:has(> span > a.t) :is(a:not(.t), button, select, input, summary, label) { position: relative; z-index: 1; }
@media (hover: hover) {
  .books:not(.tiles) li:has(> span > a.t):hover { background: linear-gradient(to right, transparent, color-mix(in srgb, var(--ink) 4%, transparent) 24px, color-mix(in srgb, var(--ink) 4%, transparent) calc(100% - 24px), transparent); }
  .books:not(.tiles) li:hover .t { color: var(--accent); }
}
.rlist .bk-link { display: block; }
.books .s { color: var(--ink-soft); font-size: 0.8125rem; }
.bar { display: flex; height: 3px; background: var(--g0); margin-top: 8px; border-radius: 2px; overflow: hidden; }
/* in a row, under what it says of a book being read; and wherever a bar is only how far
   (a card, the hero), in the accent */
.books .bar.inline { max-width: 11rem; margin-top: 6px; }
.bar.inline span, .covers .bar span, .hero .bar span { background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .bar span { animation: bar-in 0.7s var(--ease) backwards; transform-origin: left; } }
@keyframes bar-in { from { transform: scaleX(0); } }
/* grey while reading; teal finished (with `fin`, the first part, then grey being read) */
.bar span, .strip span { flex: none; height: 100%; background: var(--g3); }
.bar.fin span, .strip.fin span { background: var(--finish); }
.bar.fin span + span, .strip.fin span + span { background: var(--g3); }
.books .r { text-align: right; white-space: nowrap; }
.books .r .m { font-weight: 500; }
.books .r .w { display: block; color: var(--ink-soft); font-size: 0.8125rem; }
.warn { color: var(--ink-soft); font-size: 0.75rem; display: block; }
/* The backlog: each book's place before its cover; in Edit mode, its buttons on the right,
   the handle last, and the row being dragged raised above the others. */
.bl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.bl-head .kbtn { flex: none; min-height: 36px; }
.books li.bl { grid-template-columns: 1.25rem 44px 1fr auto; background: var(--paper); }
.books .pos { color: var(--ink-soft); font-size: 0.875rem; text-align: right; font-variant-numeric: tabular-nums; }
.books .r.tools { display: flex; gap: 4px; }
.books .grip { cursor: grab; touch-action: none; border-color: transparent; }
.books li.dragging { position: relative; z-index: 2; box-shadow: 0 6px 20px rgb(0 0 0 / 0.18); border-radius: 6px; }
.books li.dragging .grip { cursor: grabbing; }
/* a book's time and when, then its backlog button */
.books .r.with-bl { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--edge); border-radius: var(--r);
  background: none; color: var(--ink-soft); cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-soft); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* How the backlog's reading time is split between books and comics: a button of its icon
   alone among the backlog's tools, in the accent while a plan is on, opening a menu under it: the
   slider between each kind's part, how long for, a line on what it means, Save */
.filter.splitmenu summary { padding: 6px 8px; background-image: none; color: var(--ink-soft); }
.shelf-tools .filter.splitmenu { flex: none; }
.splitmenu summary:hover { color: var(--ink); }
.splitmenu summary .ico { width: 20px; height: 20px; }
.splitmenu summary.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background-color: color-mix(in srgb, var(--accent) 10%, transparent); }
.splitmenu .filter-menu { width: 21rem; padding: 12px 16px 14px; }
.splitmenu .kl { margin: 0 0 8px; font-size: 0.8125rem; color: var(--ink-soft); }
/* the time a day you mean to read: its label, the minutes, and what it is lately */
.split-time { display: grid; grid-template-columns: auto 5.5em 1fr; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 0.8125rem; color: var(--ink-soft); }
.split-time input { min-width: 0; min-height: 32px; padding: 4px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); font: inherit; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.split-time .meta { margin: 0; text-align: right; }
.split-range[hidden] { display: none; }
.split-range { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.split-range span { min-width: 5.5em; }
.split-range span:last-child { text-align: right; }
.split-range input { min-width: 0; margin: 0; min-height: 32px; accent-color: var(--accent); }
.splitmenu .seg { margin: 10px 0 0; }
.splitmenu .seg span { padding: 0 8px; font-size: 0.8125rem; }
.splitmenu .meta { margin: 10px 0 12px; color: var(--ink-soft); font-size: 0.8125rem; line-height: 1.4; }
.split-acts { display: flex; align-items: center; gap: 16px; margin: 0; }
/* on a phone, the menu as wide as the page's head, under it; the plan in the summary left
   to the marked button */
@media (max-width: 600px) {
  #view-backlog .shelf-head { position: relative; }
  .filter.splitmenu { position: static; }
  .splitmenu .filter-menu { left: 0; right: 0; width: auto; }
  .split-fig { display: none; }
}
#backlogDone h2 .n { color: var(--ink-soft); font-weight: 400; font-size: 0.9375rem; margin-left: 6px; }
/* Collections and read lists: the Collections page's two lists, under their headings, and
   its form for a new one; a list's page in Edit mode: its search to add to it (what it
   finds in a box under it), and its name and Delete under its rows. */
.lhead { margin: 32px 0 4px; font-size: 1rem; }
.bl-head h2 { margin-bottom: 8px; }
.lnew { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 24px; padding: 16px; border: 1px solid var(--rule); border-radius: 8px; }
.lnew > input { flex: 1 1 14rem; }
.lnew .meta { flex: 1 1 100%; margin: 0; color: var(--ink-soft); font-size: 0.8125rem; }
.lnew .meta:empty { display: none; }
.lrow { display: flex; gap: 8px; }
.lnew input, .lfind input, .lmanage input, .lpick input {
  min-width: 0; min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); border-radius: var(--r); background: transparent; color: inherit; font: inherit; font-size: 1rem;
}
.lfind .kl, .lmanage .kl { display: block; margin-bottom: 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.lfind input { width: 100%; }
/* The search to add to a list: floating over the list, where it adds (under its head, at
   the end; at the top of the row it adds before), not pushing it down. */
.lfloat { position: relative; z-index: 5; height: 0; }
.books li.bl.at { position: relative; z-index: 5; }
.books li.bl.at > .lfloat { position: absolute; left: 0; right: 0; top: 0; }
.lfind {
  position: absolute; left: 0; right: 0; top: 0; padding: 10px 14px 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper); box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  max-height: min(70dvh, 34rem); overflow-y: auto; overscroll-behavior: contain;
}
.lfind-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lfind-head .kl { margin: 0; }
.lfind-head .at { color: var(--ink); }
.lfind input { margin-top: 6px; }
/* on a phone, the search a sheet over the whole page, above the keyboard (--vvh, js/popups.js):
   its name and field at the top, what it finds scrolling under them; the page behind kept still */
@media (max-width: 600px) {
  .lfloat:not(.static), .books li.bl.at { z-index: auto; }
  .lfloat:not(.static) .lfind {
    position: fixed; z-index: 35; inset: var(--vvt, 0) 0 auto; height: var(--vvh, 100dvh); max-height: none;
    display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; box-shadow: none;
    padding: max(12px, env(safe-area-inset-top)) var(--gutter) max(12px, env(safe-area-inset-bottom));
  }
  .lfloat:not(.static) .lfind-head { min-height: 44px; }
  .lfloat:not(.static) .lfind-head .kl { font-size: 0.9375rem; }
  .lfloat:not(.static) .books.found { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  html:has(.lfloat:not(.static) .lfind) { overflow: hidden; }
}
.bl-head .lrow { display: flex; gap: 8px; }
/* A list's, collection's or series' Export menu: copy its books, or save them; "Copied."
   a moment under it */
.xmenu { position: relative; display: flex; }
.xmenu summary { gap: 6px; }
.xmenu summary .ico { width: 18px; height: 18px; flex: none; }
.xmenu .filter-menu { padding: 4px 0; }
.xmenu .item { display: block; width: 100%; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; font-size: 0.9375rem; text-align: left; cursor: pointer; }
.xmenu .item:hover, .xmenu .item:focus-visible { background: color-mix(in srgb, var(--ink) 8%, transparent); }
/* between a list's own exports and its books' files (downloads.js) */
.xmenu .sep { display: block; margin: 4px 0; border-top: 1px solid var(--rule); }
@media (max-width: 600px) {
  /* a page's head of its books: its buttons under its heading when they don't fit beside it */
  .bl-head { flex-wrap: wrap; row-gap: 0; }
  /* and all on one line under it, a list's Edit too, closer together than elsewhere (on
     a phone too narrow even so, they wrap) */
  .bl-head .lrow { flex-wrap: wrap; gap: 4px; }
  .bl-head .lrow .kbtn { padding: 6px 12px; }
  .bl-head .lrow > .seg:not(.viewpick) span { padding: 0 7px; }
  .xmenu .filter-menu { left: 0; right: auto; }
  .xmenu .xstatus { left: 0; right: auto; }
  .xmenu summary { padding: 6px 26px 6px 9px; }
  .xmenu .xword { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.xstatus { position: absolute; right: 0; top: calc(100% + 4px); font-size: 0.8125rem; color: var(--ink-soft); white-space: nowrap; pointer-events: none; }
/* a new list of Komga's, its search the page's only way on: in the page, not over it */
.lfloat.static { height: auto; margin: 4px 0 16px; }
.lfloat.static .lfind { position: static; box-shadow: none; max-height: none; }
.books.found:not(:empty) { margin-top: 8px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 8px; }
.books.found li:first-child { border-top: 0; }
.books.found li.empty { padding: 12px 0; font-size: 0.875rem; }
.books.editing + .lmanage, .books + .lmanage { margin-top: 24px; }
.lmanage { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--rule); }
.lmanage .lrow input { flex: 1 1 16rem; }
.lrename { flex: 1 1 22rem; min-width: 0; max-width: 32rem; }
.kbtn.danger { color: #a33a2c; }
.kbtn.danger:hover:not(:disabled) { border-color: currentColor; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"], [data-theme="sepia"]) .kbtn.danger { color: #e58d82; } }
:root[data-theme="dark"] .kbtn.danger { color: #e58d82; }
/* On a book's or series' page, the read lists and collections it is in, each a chip with
   a button to take it off, then a menu to add it to another; a new one's name under it. */
.lsets { margin-top: 20px; }
.lfield { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.lfield .kl { margin-bottom: 0; }
/* after the chips, a + (in none yet, saying what it adds to): the menu to add to one,
   unseen over it */
.lfield .kl { flex: 1 1 100%; }
.chips li.add { padding: 0; border: 0; }
.lplus { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 9px; border: 1px dashed var(--g2); border-radius: 18px; color: var(--ink-soft); font-size: 0.875rem; }
.lplus svg { width: 16px; height: 16px; flex: none; }
.cta .lplus { padding: 0 14px 0 10px; }
.lplus:hover:not(:has(:disabled)) { color: var(--ink); border-color: var(--ink-soft); }
.lplus:has(:disabled) { opacity: 0.35; }
.lplus:has(select:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.ksets .lplus select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 1rem; }
.chips { display: contents; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 4px 0 12px; border: 1px solid var(--edge); border-radius: 18px; font-size: 0.875rem; background: var(--surface); }
.chips li.add { background: none; }
.chips li:not(:has(button)) { padding-right: 12px; }
.chips a { color: inherit; text-decoration: none; }
/* Literata's ascender room puts its letters ~0.07em (capitals) to ~0.17em (lower case)
   below the middle of their line, so a chip's name sits low; lifted to look centred. */
.chips a, .lplus > span { position: relative; top: -0.1em; }
.chips a:hover { text-decoration: underline; }
.chips .via { color: var(--ink-soft); }
.chip-x { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); cursor: pointer; }
.chip-x svg { width: 14px; height: 14px; }
.chip-x:hover:not(:disabled) { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.chip-x:disabled { opacity: 0.35; cursor: default; }
.lpick { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.lpick input { flex: 1 1 14rem; }

/* The sign-in page: one card in the middle of the window, the app's mark over it. */
.login { display: grid; place-items: center; min-height: calc(100svh - 120px); }
.login-card {
  width: 100%; max-width: 25rem; padding: 32px 32px 28px; text-align: center;
  border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 24px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.login-brand img { width: 40px; height: 40px; flex: none; border-radius: 9px; box-shadow: 0 0 0 1px var(--rule); }
.login h1 { font-size: 1.5rem; font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; text-wrap: balance; }
.login-lede { color: var(--ink-soft); margin: 0 0 24px; font-size: 0.9375rem; text-wrap: pretty; }
.login .error { text-align: left; margin: 0 0 16px; }
.login .signin { text-align: left; }
.login label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.login input { display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid var(--edge); background: var(--paper); border-radius: var(--r); }
.login input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.login .signin .error { margin: -4px 0 16px; }
.login button { display: block; width: 100%; min-height: 46px; margin-top: 8px; padding: 10px 20px; border: 1px solid var(--accent); border-radius: var(--r); cursor: pointer; transition: background-color 0.15s, transform 0.08s; }
.login-hint { margin: 20px 0 0; color: var(--ink-soft); font-size: 0.8125rem; line-height: 1.5; text-wrap: pretty; }
.error { color: #a3352b; margin-top: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"], [data-theme="sepia"]) .error { color: #e58d82; } }
:root[data-theme="dark"] .error { color: #e58d82; }

.most { color: var(--ink-soft); font-size: 0.9375rem; margin: 16px 0 0; max-width: 70ch; }
.most a { color: var(--ink); font-weight: 500; text-decoration: none; }
.most a:hover { text-decoration: underline; }
.nw { white-space: nowrap; }
:root { --view-top: 48px; }
/* Every view starts the same way under the header: --view-top below it, whatever it is
   (one rule for all, so a new view can't forget it) */
#app > [data-view] { margin-top: var(--view-top); }
/* A book's or series' title links to its page. */
a.t { color: inherit; text-decoration: none; }
a.t:hover { text-decoration: underline; }
.books .s a, .rlist .s a { color: inherit; }
.books span.t a { color: inherit; text-decoration: none; }
.together { list-style: none; margin: 0; padding: 0; }
.together li { padding: 6px 0; line-height: 1.5; }
.together a { color: inherit; }
.books span.t a:hover { text-decoration: underline; }
.qbook .more { margin: -12px 0 24px 58px; font-size: 0.875rem; }
.qbook .more a { color: var(--ink-soft); }
@media (max-width: 520px) { .qbook .more { margin-left: 0; } }
/* Covers of a series' first books, fanned out. */
/* The fan fits in the box one cover takes, so a stack lines up with a lone cover: the
   front one shrinks by a step (--fan) per cover behind it, which steps up and right. */
.stack { --fan: 5px; --k: 2; display: grid; width: var(--w, 44px); aspect-ratio: 2 / 3; isolation: isolate; }
.stack:has(> .cover:nth-of-type(2):last-of-type) { --k: 1; }
.stack:has(> .cover:only-of-type) { --k: 0; }
.stack .cover { grid-area: 1 / 1; align-self: end; width: calc(100% - var(--k) * var(--fan)); box-shadow: 0 0 0 1px var(--paper), var(--shadow-1); }
.stack .cover:nth-of-type(2) { transform: translate(var(--fan), calc(-1.5 * var(--fan))); z-index: -1; opacity: 0.8; }
.stack .cover:nth-of-type(3) { transform: translate(calc(2 * var(--fan)), calc(-3 * var(--fan))); z-index: -2; opacity: 0.6; }
/* In a list, how far read along the front cover's foot, teal on a book finished;
   a lighter grey, ending in a notch, where a book was left unfinished. */
.stack > .strip {
  grid-area: 1 / 1; align-self: end; z-index: 1; display: flex; overflow: hidden;
  width: calc(100% - var(--k) * var(--fan)); height: max(3px, calc(var(--w, 44px) / 16)); border-radius: 0 0 2px 2px;
  background: var(--g1);
}
.stack > .strip.stopped span { background: var(--g2); box-shadow: inset -2px 0 var(--ink-soft); }
/* A book's cover (its --w wide: 44px in a list, more on its page), and below it its
   rating: five stars, from the cover's left edge to its right, filled grey to the rating
   and lighter after, as the strip is; the gap and the stars grow with the cover. */
.bk { display: grid; align-content: start; gap: calc(var(--w, 44px) / 11); width: var(--w, 44px); }
.stars { display: block; width: 100%; aspect-ratio: 100 / 16.3; }
.stars .on { fill: var(--accent); }
.stars .off { fill: var(--g1); }
/* In a list, a row is centred on the cover, the stars below it in the row's foot: a list
   with any rated book gives every row that much more room, half above and half below,
   so its rows stay alike and an unrated cover still sits in the middle of its row. */
.books .bk > .stars { margin-bottom: calc(-1 * var(--w, 44px) * (1 / 11 + 0.163)); }
.books:has(.stars) > li { padding-block: calc(12px + 22px * (1 / 11 + 0.163)); }

/* A book's or a series' page. */
/* its head: a large cover, on a wash of the cover's own colour (--tint, from its picture: tintFrom() in js/components.js) */
.bhead {
  --w: 168px; display: grid; grid-template-columns: var(--w) minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 28px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--tint, var(--ink)) 12%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint, var(--ink)) 20%, var(--paper)), color-mix(in srgb, var(--tint, var(--ink)) 5%, var(--paper)) 70%);
  transition: background 0.4s, border-color 0.4s;
}
.bhead .cover { box-shadow: var(--shadow-2); }
/* the figures under it: the head is their rule */
.bhead + .facts { margin-top: 8px; border-top: 0; }
.bhead .stack .cover:not(:first-of-type) { box-shadow: var(--shadow-1); }
.bhead > .cover { width: var(--w); }
.bhead .cover { border-radius: 3px 5px 5px 3px; }
.bhead .stack > .strip { border-radius: 0 0 3px 3px; }
.bhead .stack { --fan: 12px; }
.bhead .view-title { overflow-wrap: anywhere; }
.readrow { position: relative; margin: 20px 0 0; display: flex; align-items: stretch; }
.readbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
/* Read and its menu, one button in two: square where they meet, a fine line between them,
   and neither half moving apart from the other when pressed (.kbtn's corners and press
   come after this, hence .readrow) */
.readrow .readbtn { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.readrow .kbtn:active:not(:disabled) { transform: none; }
.readbtn .ico { width: 18px; height: 18px; }
/* beside Read, its menu: Read incognito */
.readmore { display: flex; }
.readmore summary {
  display: flex; align-items: center; width: 40px; height: 100%; padding: 0; list-style: none;
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  border-left: 1px solid color-mix(in srgb, var(--on-accent) 35%, var(--accent));
  background-image: linear-gradient(45deg, transparent 50%, var(--on-accent) 50%), linear-gradient(135deg, var(--on-accent) 50%, transparent 50%);
  background-position: calc(50% - 2.5px) 55%, calc(50% + 2.5px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.readmore summary::-webkit-details-marker { display: none; }
.readmore .filter-menu { left: 0; right: auto; padding: 4px 0; width: 18rem; }
.readmore :is(a, button).item { display: block; width: 100%; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.readmore :is(a, button).item:hover b { text-decoration: underline; }
.readmore :is(a, button).item span { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-soft); }
.crumb { margin: 0 0 8px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-soft); }
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.by { margin: 10px 0 0; color: var(--ink-soft); font-size: 1.0625rem; }
.by:empty { display: none; }
/* On a book's page, what it is in Komga: its kind and its mark, each a choice. */
.ksets { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.ksets .kl { display: block; margin-bottom: 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.ksets .seg { display: inline-flex; max-width: 100%; }
.ksets .seg input:disabled, .ksets select:disabled { cursor: progress; }
/* the backlog's button, as tall as Kind's choice beside it */
.kbtn, .more-btn, .backups button {
  min-height: var(--ctl); padding: 6px 16px; border: 1px solid var(--edge); border-radius: var(--r); background: none; color: var(--ink); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s, transform 0.08s;
}
.kbtn:hover:not(:disabled), .more-btn:hover, .backups button:hover:not(:disabled) { border-color: var(--ink-soft); background-color: color-mix(in srgb, var(--ink) 4%, transparent); }
:is(.kbtn, .more-btn, .backups button, .icon-btn, .login button):active:not(:disabled) { transform: translateY(1px); }
.kbtn:disabled { cursor: progress; }
/* the mark, a menu as tall as Kind's choice beside it */
.ksets select { min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); border-radius: var(--r); background-color: transparent; color: inherit; font: inherit; font-size: 0.875rem; }
.ksec .meta { margin: 12px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.ksec .meta:empty { display: none; }
/* A folder or Google Drive book's details (folder-books.js): a small pencil at the head's
   top right, in line with the crumb, and in its dialog, title and authors side by side, then series, its number and
   the kind. */
.bhead-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bhead-top .crumb { margin: 0; min-width: 0; }
/* as tall as the crumb's line, its 32px reaching above and below it */
.bhead-top .editdetails { flex: none; width: 32px; height: 32px; margin-block: -8px; margin-right: -6px; }
.editdetails svg { width: 16px; height: 16px; }
.editdetails:not(:hover, :focus-visible) { border-color: transparent; }
.dfields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 16px; margin: 16px 0 4px; }
.dfields .ef input, .dfields .ef select { width: 100%; }
.dfields .d-title, .dfields .d-authors, .dfields .d-series { grid-column: span 3; }
.dfields .d-number { grid-column: span 1; }
.dfields .d-kind { grid-column: span 2; }
.dfields .d-mark { grid-column: span 3; }
.dfields .d-noseries { grid-column: 1 / -1; display: flex; flex-direction: row; gap: 8px; align-items: center; font-size: 0.875rem; }
.dfields .d-noseries input { width: auto; }
.dfields .d-from { grid-column: 1 / -1; margin: -4px 0 0; }
#seriesForm .s-name { display: block; margin: 12px 0; }
#seriesForm .s-name input { width: 100%; }
.sbooks { margin: 0 0 12px; padding: 0; list-style: none; max-height: 50dvh; overflow-y: auto; border-block: 1px solid var(--rule); }
.sbook { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem auto auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--rule); }
.sbook:first-child { border-top: 0; }
.sbook .s-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbook.out .s-title { color: var(--ink-soft); text-decoration: line-through; }
.sbook .s-num input { width: 100%; }
.sbook .s-moves { display: flex; gap: 4px; }
.sbook .s-out { display: flex; gap: 6px; align-items: center; font-size: 0.875rem; white-space: nowrap; }
@media (max-width: 560px) {
  .sbook { grid-template-columns: minmax(0, 1fr) 4rem auto; }
  .sbook .s-out { grid-column: 1 / -1; }
}
.dfields .ef select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.dfields :is(input, select):hover:not(:disabled) { border-color: var(--ink-soft); }
.dfields :is(input, select):disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 600px) {
  .dfields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dfields .d-title, .dfields .d-authors, .dfields .d-series, .dfields .d-mark { grid-column: 1 / -1; }
  .dfields .d-kind { grid-column: span 2; }
  .bhead-top .editdetails { width: 40px; height: 40px; margin-block: -12px; }
}
/* its authors: in ink, underlined softly, whether visited or not */
.by a { color: var(--ink); text-decoration-color: var(--g2); text-underline-offset: 0.15em; }
.by a:hover { text-decoration-color: currentColor; }
.bookpage > .warn { margin-top: 12px; }
/* its link (a book's file missing: to Missing books), in ink, as the page's others */
.warn a { color: var(--ink); text-decoration-color: var(--g2); text-underline-offset: 0.15em; }
.warn a:hover { text-decoration-color: currentColor; }
.bsec { margin-top: 40px; }
.bsec h2 .n { color: var(--ink-soft); font-weight: 400; font-size: 0.9375rem; margin-left: 6px; }
.bsec .rv { margin: 0; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.bsec .rv b { font-weight: 500; font-style: italic; font-size: 1.1875rem; display: block; margin-bottom: 4px; }
.bsec .meta { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.bsec h2 + .meta { margin: -8px 0 16px; }
.bsec .qlist { padding-left: 0; }
.entries.log li { grid-template-columns: 5rem minmax(0, 1fr) auto; }
/* a book's sessions: a line each, cut short rather than wrapped */
.entries .p.one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .entries .p.one { white-space: normal; }
  .entries .p.one > span { white-space: nowrap; }
}
.rlist { list-style: none; margin: 0; padding: 0; }
.rlist li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule); align-items: start; }
.rlist .t { font-weight: 500; line-height: 1.3; }
.rlist .s { color: var(--ink-soft); font-size: 0.8125rem; }
.rlist .s .d { white-space: nowrap; }
.rlist .s .stars { display: inline-block; width: 82px; margin-right: 10px; vertical-align: -1px; }
/* how many books have each number of stars: a bar each, a button that picks those books out */
.rdist { display: grid; gap: 2px; margin: 0 0 20px; }
.rdist button { display: grid; grid-template-columns: 2.25rem 1fr 2rem; align-items: center; gap: 10px; padding: 4px 8px; margin-inline: -8px; border: 0; border-radius: var(--r); background: none; color: var(--ink-soft); font: inherit; font-size: 0.8125rem; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; }
.rdist button:hover:not(:disabled), .rdist button[aria-pressed="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.rdist button:disabled { cursor: default; opacity: 0.6; }
.rdist button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rdist .rd-k { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.rdist .rd-k svg { width: 12px; height: 12px; fill: var(--accent); }
.rdist .rd-b { display: block; height: 8px; border-radius: 4px; background: var(--g1); overflow: hidden; }
.rdist .rd-b span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.rdist:has([aria-pressed="true"]) button[aria-pressed="false"] .rd-b span { background: var(--g2); }
.rdist .rd-c { text-align: right; }
.rlist .rv { margin: 10px 0 0; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; max-width: 70ch; }
.rlist .rv b { font-weight: 500; font-style: italic; font-size: 1.125rem; display: block; margin-bottom: 4px; }
.quotes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.quotes-head input[type="search"] { flex: 0 1 16rem; min-width: 0; min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); background: transparent; border-radius: var(--r); font-size: 0.9375rem; }
.quotes-head input[type="search"]:hover, .shelf-tools select:hover, .filter summary:hover, .ksets select:hover:not(:disabled), .stats-head select:hover { border-color: var(--ink-soft); }
:is(.quotes-head, .lnew, .lfind, .lmanage, .lpick, .rvedit, .ef, .pp-form, .pp-link, .msearch) :is(input, textarea, select):focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.qsum { color: var(--ink-soft); font-size: 0.9375rem; margin: 0 0 16px; }
.more-row { margin: 8px 0 24px; text-align: center; }
/* Read, Unread, Collections and Authors: the summary beside the tools, on their left, not on a line
   of its own; under them where the two don't fit (the row runs from the right, the tools first) */
.shelf-head { display: flex; flex-flow: row-reverse wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.shelf-head .quotes-head { display: contents; }
.shelf-head .shelf-tools { flex: 0 1 auto; }
.shelf-head .shelf-tools input[type="search"] { flex: 0 1 11rem; }
.shelf-head .qsum { flex: 1 1 12rem; min-width: 0; margin: 0; }
/* too narrow for that, with Add a book (New), or the Backlog's Edit (.side-btn): the tools a row of their own (laid out in .shelf-head's,
   the search filling it), and the summary under them beside the button, not on a line of its own */
@media (min-width: 601px) and (max-width: 820px) {
  .shelf-head:has(.add-book, .side-btn) { flex-flow: row wrap; gap: 8px; }
  .shelf-head:has(.add-book, .side-btn) .shelf-tools { display: contents; }
  /* on the row after sort, Filter and the list/covers toggle: the search, the summary and Add a book */
  .shelf-head:has(.add-book, .side-btn) .shelf-tools input[type="search"] { flex: 1 1 calc(100% - 24rem); }
  /* the Backlog's: Filter, the list/covers toggle and the plan, narrower than a sort and Filter */
  .shelf-head:has(.side-btn) .shelf-tools input[type="search"] { flex-basis: calc(100% - 16rem); }
  .shelf-head:has(.add-book, .side-btn) .qsum { flex-basis: 12rem; }
  .shelf-head:has(.add-book, .side-btn) .qsum { order: 1; flex-basis: 8rem; }
  .shelf-head :is(.add-book, .side-btn) { order: 2; }
}
.shelf-tools { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 40rem; min-width: 0; justify-content: flex-end; margin-left: auto; }
.shelf-tools input[type="search"] { flex: 1 1 12rem; min-width: 10rem; }
.shelf-tools select { flex: 0 0 auto; min-width: 0; min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); background-color: transparent; color: inherit; border-radius: var(--r); font: inherit; font-size: 0.9375rem; }
/* The Filter menu of the Books, Authors and Unread pages: a choice of each kind, side by
   side, under a button that says how many are on. */
.filter { position: relative; flex: 0 0 auto; }
.filter summary {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: var(--ctl); padding: 6px 12px;
  border: 1px solid var(--edge); border-radius: var(--r); cursor: pointer; list-style: none; white-space: nowrap; font-size: 0.9375rem;
}
.filter summary::-webkit-details-marker { display: none; }
/* the sort's select, the Filter button and a book's mark: the same chevron, drawn here, in either theme */
.shelf-tools select, .filter summary, .ksets select, .stats-head select, .dbbar select {
  appearance: none; padding-right: 30px; justify-content: flex-start;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.filter[open] summary { border-color: var(--ink-soft); }
.filter summary .n {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: 0.75rem; font-weight: 600;
}
.filter-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  padding: 12px 16px 4px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  /* moved in from an edge it would run past, and scrolling if taller than the room under it (js/popups.js) */
  translate: var(--fit-x, 0) 0; overflow-y: auto; overscroll-behavior: contain;
}
@media (prefers-reduced-motion: no-preference) {
  .filter[open] .filter-menu, .search-results:not([hidden]), .period-picker:not([hidden]), .acct-menu:popover-open, .tip:not([hidden]) { animation: pop-in 0.16s var(--ease); }
  .kdialog[open] { animation: dialog-in 0.22s var(--ease); }
  .kdialog[open]::backdrop { animation: fade-in 0.22s ease-out; }
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.filter fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.filter legend { padding: 0; margin-bottom: 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.seg { display: flex; padding: 2px; border: 1px solid var(--edge); border-radius: var(--r); }
.seg label { flex: 1 1 0; position: relative; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: calc(var(--ctl) - 6px); padding: 0 12px; border-radius: calc(var(--r) - 2px); font-size: 0.875rem; color: var(--ink-soft); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.seg svg { width: 18px; height: 18px; flex: none; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { color: var(--ink); background: color-mix(in srgb, var(--ink) 11%, transparent); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.tabs { display: flex; gap: 24px; margin: 0 0 20px; border-bottom: 1px solid var(--rule); }
.tabs a { padding: 6px 0 10px; margin-bottom: -1px; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; font-size: 1.0625rem; transition: color 0.15s, border-color 0.15s; }
.tabs a:hover { color: inherit; }
.tabs a[aria-current="page"] { color: inherit; font-weight: 500; border-bottom-color: var(--accent); }
.books li.unread .cover, .books li.unread .stack { opacity: 0.55; }
.qbook { border-top: 1px solid var(--rule); }
.qbook summary { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 12px 0; align-items: center; cursor: pointer; list-style: none; }
.qbook summary::-webkit-details-marker { display: none; }
.qbook summary .t { font-weight: 500; line-height: 1.3; }
.qbook summary .s { color: var(--ink-soft); font-size: 0.8125rem; }
.qbook summary .w { min-width: 0; }
/* a taste of what is in it, while it is closed: its first words, on a line */
.qbook summary .x { display: block; margin-top: 4px; color: var(--ink-soft); font-style: italic; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 68ch; }
.qbook[open] summary .x { display: none; }
.qbook summary .n { color: var(--ink-soft); font-size: 0.875rem; white-space: nowrap; }
.qbook summary .n::after { content: "›"; display: inline-block; margin: 0 4px 0 8px; transition: transform 0.15s; }
.qbook[open] summary .n::after { transform: rotate(90deg); }
.qlist { list-style: none; margin: 0 0 24px; padding: 0 0 0 58px; }
@media (max-width: 520px) { .qlist { padding-left: 0; } }
.qlist li { padding: 10px 0 10px 20px; border-left: 3px solid var(--g1); border-radius: 2px; margin: 0 0 16px; }
.qlist li[data-c="0"] { border-left-color: var(--hl-0); }
.qlist li[data-c="1"] { border-left-color: var(--hl-1); }
.qlist li[data-c="2"] { border-left-color: var(--hl-2); }
.qlist li[data-c="3"] { border-left-color: var(--hl-3); }
.qlist blockquote { margin: 0; font-size: 1.125rem; font-style: italic; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; max-width: 68ch; }
.qlist .note { margin: 8px 0 0; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.qlist .meta { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.qlist .meta a { color: inherit; }
.qlist li.bm { border-left-color: var(--g2); }
.qlist .qcopy { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.qlist .qcopy:hover, .qlist .meta a:hover { color: var(--ink); }
/* the latest first, not under their books: each says its book, its cover small beside it */
.qfeed { padding-left: 0; margin-top: 8px; }
.qfeed li { margin-bottom: 28px; }
.qfeed .src { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 0.875rem; line-height: 1.35; }
.qfeed .src .cover { flex: none; width: 26px; }
.qfeed .src a { color: inherit; font-weight: 500; text-decoration: none; }
.qfeed .src a:hover { text-decoration: underline; }
.qfeed .src .s { color: var(--ink-soft); font-size: 0.8125rem; }
.qlist .page { display: block; margin: 0 0 8px; }
.qlist .page img { display: block; max-width: min(100%, 24rem); max-height: 70vh; border: 1px solid var(--rule); border-radius: 3px; background: var(--g0); }
mark { background: color-mix(in srgb, var(--hl-0) 45%, transparent); color: inherit; border-radius: 2px; }
.istatus a, .qsum a { color: inherit; }
.drop {
  display: block; border: 1.5px dashed var(--g2); border-radius: 6px; padding: 28px 20px; text-align: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.drop:hover, .drop.over { border-color: var(--ink); background: color-mix(in srgb, var(--g0) 60%, transparent); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop b { font-weight: 600; }
.drop .hint { display: block; color: var(--ink-soft); font-size: 0.875rem; margin-top: 4px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.busy { cursor: progress; opacity: 0.7; }
.opt { display: flex; gap: 8px; align-items: baseline; margin: 12px 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.opt input { accent-color: var(--accent); }
.istatus { margin: 12px 0 0; font-size: 0.9375rem; }
progress { width: 100%; height: 4px; margin-top: 12px; accent-color: var(--accent); }
.backups { margin-top: 40px; }
.backups h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.backups .sub { margin: 4px 0 12px; color: var(--ink-soft); font-size: 0.875rem; max-width: 62ch; }
.backups ul { list-style: none; margin: 0; padding: 0; }
.backups li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--rule); }
.backups .what { flex: 1 1 16rem; min-width: 0; }
.backups .meta { display: block; color: var(--ink-soft); font-size: 0.8125rem; }
.backups .acts { display: flex; gap: 8px; }
.backups button:disabled { opacity: 0.5; cursor: progress; }
/* The Missing books page's layout (js/missing.js). */
.moves { margin-top: 48px; }
.moves .intro { color: var(--ink-soft); margin: 8px 0 20px; max-width: 62ch; }
.mstatus { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 0.9375rem; }
.mstatus p { margin: 0; flex: 1 1 20rem; }
.mstatus .mnotice { flex-basis: 100%; font-weight: 600; }
.msnap { padding-left: 22px; position: relative; }
.msnap::before { content: ''; position: absolute; left: 4px; top: 0.45em; width: 9px; height: 9px; border-radius: 50%; background: #b5621a; }
.msnap.done::before { background: var(--finish); }
.msec { margin-top: 36px; }
.msec h3 { display: inline; font-size: 1rem; font-weight: 600; margin: 0; }
.msec > h3 { display: block; }
.msec summary { cursor: pointer; }
.msec .sub { margin: 4px 0 12px; color: var(--ink-soft); font-size: 0.875rem; max-width: 62ch; }
.mtools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.mbulk { display: flex; flex-wrap: wrap; gap: 8px; }
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--rule); }
.mlist > .sub { padding: 14px 0; border-top: 1px solid var(--rule); }
.mpair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.mpair:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.mfrom, .mto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.marrow { color: var(--ink-soft); padding-top: 1px; }
.mbook { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.mbook b { font-weight: 600; }
.mbook.gone b { color: var(--ink-soft); font-weight: 500; }
.mseries, .mmeta, .mfile { color: var(--ink-soft); font-size: 0.8125rem; }
.mfile { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.macts { display: flex; flex-wrap: wrap; gap: 8px; }
.macts:empty { display: none; }
.macts .kbtn { min-height: 34px; padding: 4px 12px; }
.mmatch .mlist { max-height: 50vh; overflow-y: auto; margin: 12px 0; }
@media (max-width: 600px) {
  .moves { margin-top: 28px; }
  .mpair { grid-template-columns: minmax(0, 1fr); }
  .marrow { transform: rotate(90deg); width: max-content; }
  .macts .kbtn { min-height: 44px; }
}
/* the one thing to do here: filled, in the accent */
.kbtn.primary, .login button { border-color: var(--accent); background-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.kbtn.primary:hover:not(:disabled), .login button:hover { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.kbtn:disabled { opacity: 0.5; }
/* The Stats page (js/analytics.js) and its charts (js/charts.js). */
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; }
.stats-head h2 { flex: none; }
.stats-head .period { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: -8px; }
.stats-head .year { min-width: 0; }
.stats-head .year .pk-open { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-head .pk-open .sm { display: none; }
/* a phone: all on one row, the period shorter */
@media (max-width: 600px) {
  .stats-head { gap: 8px; }
  .stats-head .period { gap: 2px; margin-right: -4px; }
  .stats-head select { min-height: 36px; padding: 2px 24px 2px 8px; background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; font-size: 0.875rem; }
  .stats-head .year { gap: 0; }
  .stats-head .year > button.yb { min-width: 34px; width: 34px; }
  /* a long period on two lines, rather than cut short */
  .stats-head .year .pk-open { padding: 2px 4px; font-size: 0.875rem; line-height: 1.2; white-space: normal; text-align: center; text-wrap: balance; }
  .stats-head .pk-open .lg { display: none; }
  .stats-head .pk-open .sm { display: inline; }
  .period-picker { right: 0; }
}
.stats-head .year { margin: 0; align-items: center; }
.stats-head .year .pk-open {
  border-radius: var(--r); padding: 4px 10px; font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink);
}
.stats-head .year .pk-open:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.stats-head .year .pk-open:disabled { opacity: 1; cursor: default; }
.stats-head .year .pk-open[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 10%, transparent); }
/* the period's picker (js/period-picker.js) */
.period-picker {
  position: absolute; top: calc(100% + 8px); right: 8px; z-index: 30; width: 18.5rem; max-width: calc(100vw - 2 * var(--gutter));
  padding: 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}
.period-picker[hidden] { display: none; }
.period-picker button { font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; cursor: pointer; position: relative; }
.period-picker button:disabled { opacity: 0.3; cursor: default; }
.period-picker button:not(:disabled):hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.period-picker p.pk-title { margin: 0 0 8px; font-size: 0.875rem; color: var(--ink-soft); }
.pk-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pk-nav button { width: 40px; height: 40px; font-size: 1.25rem; }
.pk-nav .pk-title { font-weight: 600; }
.pk-hint { margin: 0 0 6px; text-align: center; font-size: 0.8125rem; color: var(--ink-soft); }
.pk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pk-grid > button { min-height: 44px; }
.period-picker button[aria-pressed="true"], .period-picker button[aria-pressed="true"]:not(:disabled):hover { background: var(--accent); color: var(--on-accent); }
.period-picker [aria-pressed="true"] .pk-out { color: inherit; opacity: 0.7; }
.pk-days, .pk-week, .pk-grid7 { display: grid; grid-template-columns: repeat(7, 1fr); }
.pk-days span { text-align: center; font-size: 0.75rem; color: var(--ink-soft); padding: 2px 0 4px; }
.pk-cal { display: grid; gap: 2px; }
.pk-week { width: 100%; padding: 0; }
.pk-d, .pk-day { display: flex; align-items: center; justify-content: center; height: 38px; font-size: 0.875rem; font-variant-numeric: tabular-nums; position: relative; }
.pk-out { color: var(--ink-soft); }
.pk-week .pk-out { opacity: 0.55; }
.pk-day.pk-in { background: color-mix(in srgb, var(--finish) 18%, transparent); border-radius: 0; }
.pk-day.pk-a { border-radius: 6px 0 0 6px; }
.pk-day.pk-b { border-radius: 0 6px 6px 0; }
.pk-day.pk-a.pk-b { border-radius: 6px; }
.period-picker .pk-day.pk-in:not(:disabled):hover { background: color-mix(in srgb, var(--finish) 30%, transparent); }
.period-picker .pk-day.pk-a, .period-picker .pk-day.pk-b, .period-picker .pk-day.pk-a:not(:disabled):hover, .period-picker .pk-day.pk-b:not(:disabled):hover { background: var(--accent); color: var(--on-accent); }
.pk-dot { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--t3); }
.period-picker [aria-pressed="true"] .pk-dot, .pk-a .pk-dot, .pk-b .pk-dot { background: currentColor; }
.pk-grid > button .pk-dot { bottom: 6px; }
.stats-head select { min-height: var(--ctl); padding: 4px 12px; border: 1px solid var(--edge); border-radius: var(--r); background-color: transparent; color: inherit; font: inherit; font-size: 0.9375rem; }
.stats-head select { padding-right: 30px; }
.ssec > .books { margin-top: 16px; }
.ssec > .more-row { margin-top: 16px; }
.analytics > #statsBody > .facts { margin-top: 24px; }
.facts .delta { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 400; color: var(--ink-soft); }
.ssec { margin-top: 56px; }
.ssec > h2 { font-size: 1.5rem; font-weight: 450; letter-spacing: -0.012em; margin: 0; }
/* each chart on a card, raised off the page; analytics.js draws it as wide as the card is inside --card-pad */
.chart { margin: 24px 0 0; min-width: 0; padding: var(--card-pad, 20px); border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.ssec > .sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.chart h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.chart .sub { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.875rem; max-width: 70ch; }
.chart .note { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.8125rem; max-width: 70ch; }
.chart .facts.tight, .ssec > .facts.tight { margin-top: 12px; padding: 16px 0; }
/* in rows: the general figures, then books' and comics' */
@media (min-width: 601px) {
  .facts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* the headline, with comics: one row of five */
  .facts.five, .facts.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* the year's figures, then a row for books and one for comics */
  .facts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* five or six in a row only where there is room for them (else rows of three) */
@media (min-width: 861px) {
  .facts.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .facts.six { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 16px; }
  /* six or more in a row: a size smaller, so a date ("Aug 14 – Sep 25") stays on its line */
  .facts:not(.four, .three):has(> div:nth-child(6)) { column-gap: 16px; }
  .facts:not(.four, .three):has(> div:nth-child(6)) dd { font-size: 1.25rem; }
}
.multiples { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
.multiples.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.keys { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; font-size: 0.8125rem; color: var(--ink-soft); }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys .key { width: 10px; height: 10px; border-radius: 2px; }
.keys .key-line { width: 14px; height: 2px; border-radius: 1px; }
.keys .s-book { background: var(--s-book); }
.keys .s-comic { background: var(--s-comic); }
.keys .last { background: var(--g2); }
.plot { margin-top: 12px; }
.plot svg { display: block; overflow: visible; font-variant-numeric: tabular-nums; }
.plot text { font-size: 11px; fill: var(--ink-soft); }
.plot text.val { fill: var(--ink); font-weight: 600; font-size: 12px; }
.plot .grid { stroke: var(--rule); stroke-width: 1; }
.plot .axis, .plot .tick { stroke: var(--g2); stroke-width: 1; }
.plot path.s-book, .plot rect.s-book, .plot circle.s-book { fill: var(--s-book); }
.plot path.s-comic, .plot rect.s-comic, .plot circle.s-comic { fill: var(--s-comic); }
.plot .mk { stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.plot path.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot path.ln.s-book { stroke: var(--s-book); }
.plot path.ln.s-comic { stroke: var(--s-comic); }
.plot path.ln.last { stroke: var(--g2); }
.plot .dot { stroke: var(--paper); stroke-width: 2; }
.plot .dot.dim { opacity: 0.35; }
.plot .hit, .plot .hitdot { fill: transparent; }
.plot g.on .hit { fill: color-mix(in srgb, var(--ink) 7%, transparent); }
.plot a.on .dot { opacity: 1; stroke: var(--ink); }
.plot .hcell { fill: var(--g0); }
.plot .hcell.h1 { fill: var(--t1); }
.plot .hcell.h2 { fill: var(--t2); }
.plot .hcell.h3 { fill: var(--t3); }
.plot .hcell.h4 { fill: var(--t4); }
.plot g.on .hcell { stroke: var(--ink); stroke-width: 1.5; }
.tview { margin-top: 6px; font-size: 0.8125rem; }
.tview summary { color: var(--ink-soft); cursor: pointer; width: max-content; padding: 4px 0; }
.tscroll { overflow-x: auto; }
.tview table { border-collapse: collapse; margin: 6px 0 4px; }
.tview th, .tview td { padding: 3px 16px 3px 0; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); font-weight: 400; }
.tview th[scope="row"], .tview thead th:first-child { text-align: left; }
.tview thead th { color: var(--ink-soft); }
.tip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 18rem; padding: 6px 9px; border-radius: 4px;
  background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.45; white-space: pre-line;
}
/* a time left: tapped, clicked or hovered, it says when it would be read (#leftTip) */
.left-tip {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help;
  text-decoration: underline dotted transparent; text-underline-offset: 3px; transition: text-decoration-color 0.15s;
}
/* a figure that says more when pointed at looks like any other until it is: a page of them
   underlined was noise. Under a finger, with no pointing, a faint line stays */
.left-tip:hover, .left-tip:focus-visible, .left-tip[aria-expanded="true"] { text-decoration-color: var(--ink-soft); }
@media (hover: none) { .left-tip { text-decoration-color: var(--g1); } }
#leftTip { z-index: 30; }
/* a tooltip of several lines: its first says what it comes to (when it would be read) */
#leftTip.lines::first-line { font-weight: 600; }
.foot { margin-top: 56px; color: var(--ink-soft); font-size: 0.8125rem; max-width: 70ch; }

/* Phones: a compact header, a tab bar at the bottom, and larger touch targets. */
@media (max-width: 600px) {
  main { padding-top: 8px; }
  /* two columns: an odd number of a page's facts puts the first on a row of its own, so none is left alone at the end */
  .facts:not(.now .facts, .three, .tight) > div:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; }
  .brand { display: contents; }
  /* the search where the name is: the name is for screen readers only */
  .top h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .search { grid-row: 1; grid-column: 1; min-width: 0; margin: 0; }
  .search-results { right: auto; left: 0; }
  .search input { min-height: 40px; font-size: 1rem; }
  .search-results { max-height: calc(100dvh - var(--head, 64px) - 80px - env(safe-area-inset-bottom)); }
  .acct { grid-row: 1; grid-column: 2; margin: 0 -6px 0 0; }
  .no-popover .who { grid-row: 1; grid-column: 2; max-width: 62vw; }
  /* The sections as a tab bar at the bottom, in reach of a thumb. */
  main { padding-bottom: calc(env(safe-area-inset-bottom) + 96px); }
  .top nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: color-mix(in srgb, var(--paper) 78%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .nav { gap: 0; font-size: 0.75rem; }
  .nav li { flex: 1 1 0; }
  .nav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-height: 56px; padding: 6px 0 4px; border: 0; white-space: nowrap;
  }
  .nav .ico { display: block; width: 52px; height: 28px; padding: 2px 14px; border-radius: 14px; transition: background-color 0.2s; }
  .nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .nav a[aria-current="page"] .ico { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .year { margin: 24px 0 4px -12px; }
  /* the year is in the month's name, stepped month by month */
  #view-activity .year { display: none; }
  /* the cover beside its title; how far, and what to do, across the whole card under them */
  .hero {
    --w: 84px; gap: 0 16px; padding: 16px; align-items: start;
    grid-template-columns: var(--w) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto auto auto;
    grid-template-areas: "eyebrow eyebrow" "c title" "c by" "c ." "bar bar" "meta meta" "acts acts";
  }
  .hero-body { display: contents; }
  .hero > .c { grid-area: c; margin-top: 2px; }
  .hero .eyebrow { grid-area: eyebrow; margin-bottom: 10px; }
  .hero-title { grid-area: title; margin-top: 0; font-size: 1.5rem; }
  .hero .by { grid-area: by; }
  .hero .bar { grid-area: bar; margin-top: 16px; }
  .hero-meta { grid-area: meta; }
  .hero-acts { grid-area: acts; flex-wrap: nowrap; margin-top: 14px; }
  .hero-acts .readbtn { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
  /* the day last read, not the day it would be finished by */
  .hero-meta .when, .now .facts .spark { display: none; }

  /* the figures under the hero, each on one line: their columns as wide as they need (today
     with its ring needs more than the streak), the room left over between them */
  .now .facts { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .now .facts dd { white-space: nowrap; }
  .now .facts .ring { width: 22px; height: 22px; }
  .facts dd:has(> .ring) { gap: 8px; }
  .rings { gap: 20px 24px; }
  .rings li { grid-template-columns: 68px auto; gap: 12px; }
  .rings .ring { width: 68px; height: 68px; }
  .rings .pct { font-size: 1rem; }
  .shelves { margin-top: 28px; }
  .mcal { margin-top: 36px; }
  .legend i[data-l] { border-radius: 50%; }
  /* a book finished, as in the months: a dot at the foot of a day's disc (a day of much
     reading, as most such days are: the dot in paper) */
  .legend .fin { width: 14px; height: 14px; border-radius: 50%; background: var(--t4); }
  .legend .fin::after { background: var(--paper); top: auto; right: auto; bottom: 2px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; clip-path: none; }
  .facts { gap: 20px 16px; margin-top: 28px; }
  .facts dd { font-size: 1.25rem; }
  .lower { margin-top: 32px; }
  :root { --view-top: 28px; }
  .ssec { margin-top: 44px; }
  .bhead { --w: 96px; gap: 18px; padding: 16px; border-radius: 14px; align-items: start; }
  /* Continue reading, on one line beside the cover */
  .bhead .readbtn { padding-inline: 12px; font-size: 0.9375rem; white-space: nowrap; }
  .bhead .readbtn .ico { display: none; }
  .bhead .stack { --fan: 8px; }
  .by { font-size: 1rem; }
  .quotes-head input[type="search"] { flex: 1 1 100%; }
  #quoteTools .seg, #reviewTools .seg { flex: 1 1 auto; }
  .shelf-tools { flex: 1 1 100%; }
  .shelf-tools input[type="search"], .shelf-head .shelf-tools input[type="search"] { flex: 1 1 100%; }
  .shelf-tools select, .shelf-tools .filter { flex: 1 1 0; }
  /* Read, Unread and Collections: Add a book (New), and the Backlog's Edit, beside the summary, not on a line of its own (the tools
     laid out in .shelf-head's own row, so the button can follow the summary) */
  .shelf-head { flex-flow: row wrap; gap: 8px; }
  .shelf-head .shelf-tools { display: contents; }
  .shelf-head .qsum { order: 1; flex-basis: 0; }
  .shelf-head :is(.add-book, .side-btn) { order: 2; }
  .seg span { min-height: 40px; }
  /* as tall as Kind's choice beside it; at 16px, so a phone doesn't zoom in on it */
  :root { --ctl: 46px; }
  .ksets select, .kbtn { font-size: 1rem; }
  /* Books' five tabs: wider than a phone, they scroll on their own, not the page */
  .tabs { gap: 20px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 12px 0; white-space: nowrap; flex: none; }
  /* more tabs past an edge: that edge fades (dashboard.js sets the classes as they scroll) */
  .tabs.more-r { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabs.more-l { mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  .tabs.more-l.more-r { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
  .chips li { min-height: 44px; border-radius: 22px; font-size: 1rem; }
  .ksets .lplus select { min-height: 0; }
  .lpick input { flex: 1 1 100%; }
  .lpick .kbtn { flex: 1 1 0; }
  .lnew .seg, .lnew > input, .lnew .lrow, .lnew .lrow .kbtn { flex: 1 1 100%; }
  .lnew .lrow .kbtn { flex: 1 1 0; }
  .lmanage, .lmanage > * { flex: 1 1 100%; }
  .lmanage > .lrow .kbtn { flex: 1 1 0; }
  .books.found:not(:empty) { padding: 0 10px; }
  /* a backlog book's place goes, for the title's width */
  .books li.bl { grid-template-columns: 44px 1fr auto; }
  .books li.bl .pos { display: none; }
  .login { place-items: start stretch; min-height: 0; margin-top: 16px; }
  .login-card { padding: 24px 20px; }
  .entries li { grid-template-columns: 4rem 1fr auto; gap: 10px; }
}
/* Fingers: 44px targets, and calendar days large enough to hit. */
@media (pointer: coarse) {
  .cal { min-width: 940px; }
  .year button { min-width: 44px; min-height: 44px; font-size: 1.375rem; }
  .who button { min-height: 44px; }
  .nav a { min-height: 44px; }
  .opt { padding: 8px 0; }
  .backups button { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .chip-x { width: 36px; height: 36px; }
  .lplus { min-width: 44px; height: 44px; border-radius: 22px; }
  .lplus svg { width: 18px; height: 18px; }
  .opt input { width: 20px; height: 20px; flex: none; }
  .qbook summary { min-height: 56px; }
  /* links set in text: a taller target than their line, without moving it */
  .sec-head a, #statsReview, .rv-goal-edit, .crumb a, .bhead .by a { display: inline-block; padding-block: 11px; margin-block: -11px; }
  .rvstar { width: 44px; height: 44px; }
}
[hidden] { display: none !important; }

/* a book's review, changed from its page */
.rvbtn { margin: 12px 0 0; }
.rvedit { display: flex; flex-direction: column; gap: 4px; max-width: 70ch; }
.rvedit .kl { font-size: 0.8125rem; color: var(--ink-soft); }
.rvedit .kl + * { margin-bottom: 8px; }
.rvedit input, .rvedit textarea {
  min-width: 0; min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); border-radius: var(--r); background: transparent; color: inherit; font: inherit; font-size: 1rem; line-height: 1.6;
}
.rvedit textarea { resize: vertical; }
.rvedit .rvrow { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.rvedit .rvrow > span { display: flex; flex-direction: column; gap: 4px; }
.rvedit .rvrow .meta { margin: 0; font-size: 0.8125rem; }
.rvedit .rvrow .kl + * { margin-bottom: 0; }
.rvedit #reviewRating { width: 6em; }
.rvedit .rvstars { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rvpick { display: inline-flex; }
.rvstar { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--g2); cursor: pointer; }
.rvstar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.rvstar[aria-pressed="true"] { color: var(--accent); }
.rvstar[aria-pressed="true"] svg { fill: currentColor; }
.rvstar:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.rvedit .lrow { margin-top: 8px; }
.rvedit .knote:empty { display: none; }
@media (max-width: 600px) {
  .rvedit .lrow .kbtn { flex: 1 1 0; }
}

/* Changing the reading by hand, and books of one's own: a dialog over the page (entries.js,
   own-books.js), its fields in rows that wrap. */
.kdialog { width: min(44rem, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); }
.kdialog::backdrop { background: rgb(0 0 0 / 0.4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.kdialog h2 { margin: 0 0 8px; font-size: 1.25rem; }
.eform .meta { margin: 0 0 12px; color: var(--ink-soft); font-size: 0.8125rem; }
.eform .meta:empty { display: none; }
.erows { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.erow { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; min-inline-size: 0; margin: 0; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; }
.erow .icon-btn { margin-left: auto; }
.ef { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ef.wide { flex: 1 1 100%; }
/* a select is as wide as its longest option: a long title would push the dialog sideways */
.ef.wide select { width: 100%; }
.ef .kl, .ecover .kl, .share-parts .kl { font-size: 0.8125rem; color: var(--ink-soft); }
.ef input, .ef select {
  min-width: 0; min-height: var(--ctl); padding: 6px 12px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); color: inherit; font: inherit; font-size: 1rem;
}
.erow .ef input[type="number"] { width: 6.5em; }
.erow .ef input[type="date"] { width: 10.5em; }
.erow .ef input[type="time"] { width: 8.5em; }
.ef.opt, .opt { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: var(--ctl); font-size: 0.9375rem; }
.eform .lrow { flex-wrap: wrap; margin: 12px 0 0; }
.eform .knote:empty { display: none; }
.efields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 12px; margin: 12px 0; }
.efields .ef.wide { grid-column: 1 / -1; }
.efields .ef input, .efields .ef select { width: 100%; }
.isbnrow { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.isbnrow .ef { flex: 1 1 12rem; }
.ecover { display: flex; flex-direction: column; gap: 6px; }
.ecover-row { display: flex; gap: 16px; align-items: start; }
.ecover-row .cover { --w: 72px; display: block; width: 72px; aspect-ratio: 2 / 3; border-radius: 3px; background: var(--g0); overflow: hidden; flex: none; }
.ecover-row .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ecover-row .cover kolophon-cover { display: block; width: 100%; height: 100%; }
.ecover-opts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ecover-opts input[type="file"] { max-width: 100%; font-size: 0.875rem; }
.ecover-opts .lrow { margin: 0; }

/* A cover chosen (cover-picker.js): searched for, uploaded, then cropped */
.cdialog { width: min(52rem, calc(100vw - 2 * var(--gutter))); }
.cpick { display: flex; flex-direction: column; gap: 12px; }
.cpick h2 { margin: 0; }
.cpick > .lrow { margin: 4px 0 0; flex-wrap: wrap; }
.cpick .lrow .kbtn { white-space: nowrap; }
.cpick .meta { margin: 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.4; }
.dfields + .d-cover { margin: 12px 0 16px; }
.cp-search { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cp-search .kbtn { min-height: var(--ctl); }
.cpick #coverNote { margin: 0; min-height: 1.2em; }
.cp-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 12px; max-height: min(52vh, 30rem); overflow: auto; }
.cp-results:empty { display: none; }
.cp-result { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.cp-thumb { display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 4px; background: var(--g0); overflow: hidden; box-shadow: var(--shadow-1); transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-result:hover .cp-thumb, .cp-result:focus-visible .cp-thumb { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.cp-result:focus-visible { outline: none; }
.cp-result:focus-visible .cp-thumb { outline: 2px solid var(--focus); outline-offset: 2px; }
.cp-src { font-size: 0.75rem; color: var(--ink-soft); line-height: 1.3; }
.cp-own { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--rule); }
.cp-upload { position: relative; cursor: pointer; }
.cp-upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.cp-upload:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.cp-shapes { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-shapes .kbtn[aria-checked="true"], .cp-shapes .kbtn[aria-checked="true"]:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.crop-stage { position: relative; align-self: center; max-width: calc(100% - 24px); margin: 10px 12px; touch-action: none; user-select: none; -webkit-user-select: none; line-height: 0; }
.crop-clip { position: relative; overflow: hidden; border-radius: 2px; background: repeating-conic-gradient(var(--g0) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; }
.crop-clip > img { display: block; max-width: 100%; max-height: min(56vh, 34rem); width: auto; height: auto; }
.crop-shade { position: absolute; box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.55); pointer-events: none; }
.crop-box { position: absolute; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5); cursor: move; outline: none; }
.crop-box:focus-visible { border-color: var(--focus); }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 33.333% 0; border-block: 1px solid rgb(255 255 255 / 0.45); pointer-events: none; }
.crop-box::after { inset: 0 33.333%; border-block: 0; border-inline: 1px solid rgb(255 255 255 / 0.45); }
.crop-h { position: absolute; width: 18px; height: 18px; background: #fff; border: 1px solid rgb(0 0 0 / 0.4); border-radius: 50%; transform: translate(-50%, -50%); z-index: 1; }
.crop-nw { left: 0; top: 0; cursor: nwse-resize; } .crop-se { left: 100%; top: 100%; cursor: nwse-resize; }
.crop-ne { left: 100%; top: 0; cursor: nesw-resize; } .crop-sw { left: 0; top: 100%; cursor: nesw-resize; }
.crop-n { left: 50%; top: 0; cursor: ns-resize; } .crop-s { left: 50%; top: 100%; cursor: ns-resize; }
.crop-e { left: 100%; top: 50%; cursor: ew-resize; } .crop-w { left: 0; top: 50%; cursor: ew-resize; }
.crop-n, .crop-s, .crop-e, .crop-w { border-radius: 4px; width: 14px; height: 14px; }
@media (pointer: coarse) { .crop-h { width: 26px; height: 26px; } }
.cpick #cropSize { margin: 0; text-align: center; }
.cp-address { display: flex; gap: 10px; align-items: end; }
.cp-address .ef { flex: 1 1 auto; }
.cp-address input { width: 100%; }
.cp-typed { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--ink-soft); }
.cp-typed input, .cp-size input { width: 5.5rem; min-height: 36px; padding: 4px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; font-size: 0.875rem; }
.cp-typed input { width: 4.75rem; }
.cp-typed input:focus-visible, .cp-size input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.cp-size { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; font-size: 0.875rem; }
.cp-size label { color: var(--ink-soft); }
.cp-size .kbtn { min-height: 34px; padding: 4px 12px; }
@media (max-width: 640px) {
  .cp-search { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cp-search .cp-title { grid-column: 1 / -1; }
  .cp-search .kbtn { grid-column: 1 / -1; }
  .cp-results { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); max-height: 44vh; }
  .cp-shapes { gap: 6px; }
  .cp-shapes .kbtn { min-height: 34px; padding: 4px 10px; font-size: 0.875rem; }
}
/* each entry of a day or a book: its button to change it, last */
.entries li.ed { grid-template-columns: 4.5rem 1fr auto auto; }
.entries.log li.ed { grid-template-columns: 5rem minmax(0, 1fr) auto auto; }
.entries .edit-read { width: 32px; height: 32px; align-self: center; }
.entries .edit-read svg { width: 16px; height: 16px; }
:is(.add-book, .side-btn) { flex: none; }
.own-tag { margin: 8px 0 0; }
.own-tag > span { display: inline-block; padding: 2px 10px; border: 1px solid var(--rule); border-radius: 12px; color: var(--ink-soft); font-size: 0.8125rem; }
/* where the book is (book.js placesTag()): the tag a small menu, each place its file is,
   or was, with its path */
.places { display: inline-block; }
.filter.places summary {
  min-height: 0; height: auto; padding: 2px 24px 2px 10px; border-color: var(--edge); border-radius: 12px; color: var(--ink-soft); font-size: 0.8125rem;
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
}
.places .filter-menu { left: 0; right: auto; padding: 4px 0; width: 22rem; }
.places .item { margin: 0; padding: 8px 16px; font-size: 0.9375rem; }
.places .item span { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-soft); }
.places .item .ppath { overflow-wrap: anywhere; font-size: 0.75rem; }
.places .item.gone b { text-decoration: line-through; text-decoration-color: var(--ink-soft); }

/* A year's reading goals, on Activity, over the year's books: "Goals for 2026" with an
   Edit beside it, each goal on a line with its ring and how it stands; a year without
   goals, a quiet line to set some */
.goals { margin: 0 0 40px; }
#daySection + .goals { margin: 48px 0 0; }
@media (max-width: 760px) { #daySection + .goals { margin-top: 40px; } }
.goals .sec-head { margin-bottom: 14px; }
.glink {
  padding: 0; border: 0; background: none; color: var(--ink-soft); font: inherit; font-size: 0.875rem; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em;
}
.glink:hover { color: var(--ink); text-decoration-color: currentColor; }
.gnone { margin: 0; color: var(--ink-soft); font-size: 0.875rem; }
.gnone .glink { margin-left: 4px; min-height: 32px; }
/* each goal on a line, its ring, what it is of, how far and how it stands in columns
   shared by all of them (a subgrid), the standing at the line's end */
.glist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 18px max-content minmax(0, 1fr) max-content; gap: 8px 12px; font-size: 0.9375rem; }
.glist li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.glist .ring { width: 18px; height: 18px; }
.glist .ring circle { stroke-width: 6; }
.glist .gnum { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.glist .gnum b { color: var(--ink); font-weight: 600; }
.glist .gstat { justify-self: end; color: var(--ink-soft); font-size: 0.8125rem; }
.glist .late .gstat { color: var(--s-comic); }
.glist .met .gstat { color: var(--accent); }
.gform h2 { margin: 0 0 4px; }
.gform > .meta { margin: 0; color: var(--ink-soft); font-size: 0.8125rem; }
.gform .gsets { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 12px 0 8px; }
.gform .gfields { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; border: 0; min-width: 0; }
.gform .gfields legend { padding: 0; margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.gform .ef input { width: 9em; }
.gform .ef .meta { font-size: 0.75rem; color: var(--ink-soft); }
.gform .lrow { flex-wrap: wrap; }

/* A year in review */
.review .stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.review .year { display: inline-flex; align-items: center; gap: 4px; }
.review .yb { display: grid; place-items: center; min-width: 36px; height: 36px; color: inherit; text-decoration: none; font-size: 1.25rem; }
.review .yl { font-variant-numeric: tabular-nums; }
.review > .meta { color: var(--ink-soft); margin: 4px 0 0; }
.review > .facts { margin-top: 24px; }
.rv-goal { margin: 16px 0 0; }
.rv-goal.meta { color: var(--ink-soft); }
.rv-goal .rv-goal-edit { margin-left: 4px; color: var(--ink-soft); font-size: 0.875rem; }
.rv-goal .rv-goal-edit:hover { color: var(--ink); }
.finds { margin: 16px 0 0; padding-left: 1.2em; line-height: 1.7; }
/* its figures, set large: the number, and its unit small after it */
.facts.big { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); padding: 32px 0; }
.facts.big dd { margin-top: 8px; font-size: 0.9375rem; font-weight: 400; line-height: 1.05; letter-spacing: 0; color: var(--ink-soft); }
.facts.big .fig { color: var(--ink); font-size: clamp(2.25rem, 5.2vw, 3.5rem); font-weight: 300; letter-spacing: -0.035em; }
/* its goals: a ring each, closed as far as the goal was met, how far in its middle */
.rings { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px 44px; }
.rings li { display: grid; grid-template-columns: 84px auto; align-items: center; gap: 14px; }
.rings .ring { grid-area: 1 / 1; width: 84px; height: 84px; }
.rings .ring circle { stroke-width: 3.5; }
/* lifted a little: the font's line leaves more room over its digits than under them, so a
   line centred on the ring has its digits low in it */
.rings .pct { grid-area: 1 / 1; place-self: center; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; transform: translateY(-0.083em); }
.rings .what { max-width: 13ch; font-size: 0.9375rem; line-height: 1.35; color: var(--ink-soft); }
.rv-goals .sec-head { margin-bottom: 20px; }
/* its finds: a card each, with the book's cover (or the month's bars, the author's initial) */
.find-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.find-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.find-card .c { display: block; }
.find-card .cover { width: 64px; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.find-art { display: grid; place-items: center; width: 64px; aspect-ratio: 2 / 3; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.find-art.letter { font-size: 2.25rem; font-style: italic; }
.find-art .spark { width: 46px; height: auto; }
.find-art .spark rect:not(.now) { fill: color-mix(in srgb, var(--accent) 30%, transparent); }
.find-card p { margin: 0; }
.find-main { margin-top: 4px; font-size: 1.0625rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.find-card .find-main { margin-top: 4px; }
.find-main a { color: inherit; text-decoration: none; }
.find-main a:hover { text-decoration: underline; }
.find-sub { font-size: 0.875rem; color: var(--ink-soft); }
.find-card .find-sub { margin-top: 2px; }
.find-sub .stars { width: 76px; margin-top: 4px; }
.rv-covers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 20px 16px; }
.rv-covers li { display: flex; flex-direction: column; gap: 4px; }
.rv-covers a { display: block; transition: transform 0.25s var(--ease); }
.rv-covers .cover { display: block; width: 100%; aspect-ratio: 2 / 3; }
/* its picture: what is in it and its shape picked on the left, each a chip that is on or
   off, and the picture as it would be on the right, drawn again as they change */
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); align-items: start; gap: 24px 40px; }
@media (max-width: 760px) { .share-grid { grid-template-columns: minmax(0, 1fr); } }
.share-parts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.share-parts legend { margin-bottom: 8px; }
.share-pick > .kl { display: block; margin: 20px 0 8px; font-size: 0.8125rem; color: var(--ink-soft); }
.share-parts .opt {
  position: relative; min-height: 36px; margin: 0; padding: 0 14px; border: 1px solid var(--edge); border-radius: 18px;
  font-size: 0.875rem; color: var(--ink-soft); transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.share-parts .opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.share-parts .opt span::before {
  content: ''; display: inline-block; width: 0; height: 12px; margin-right: 0; vertical-align: -1px; background: currentColor; transition: width 0.15s, margin 0.15s;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M1.5 6.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 12px no-repeat;
}
.share-parts .opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.share-parts .opt:has(input:checked) span::before { width: 14px; margin-right: 6px; color: var(--accent); }
.share-parts .opt:hover { border-color: var(--ink-soft); }
.share-parts .opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.share-shapes { margin: 0; }
.share-shapes .kbtn[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); }
.share-out { color: var(--ink-soft); font-size: 0.9375rem; }
.share-out .lrow { margin: 14px 0 0; flex-wrap: wrap; }
.share-out .kbtn { display: inline-flex; align-items: center; text-decoration: none; }
.share-out[aria-busy] .share-img { opacity: 0.5; }
.share-img { display: block; max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-2); transition: opacity 0.2s; }
.review-row { margin: 4px 0 0; font-size: 0.875rem; }
.review-row a { color: var(--ink-soft); text-decoration-color: var(--g2); text-underline-offset: 0.15em; }
.review-row a:hover { color: var(--ink); }
@media (max-width: 600px) {
  .kdialog { padding: 16px; }
  .entries li.ed { grid-template-columns: 4rem 1fr auto auto; }
  .eform .lrow .kbtn { flex: 1 1 0; }
}
.finds a, .rv-goal a { color: var(--ink); text-decoration-color: var(--g2); text-underline-offset: 0.15em; }
.finds a:hover { text-decoration-color: currentColor; }

/* The database console (js/database.js): tables beside the SQL and what it answered. */
.dbstatus { margin: 0 0 16px; font-size: 0.9375rem; }
.dbstatus:empty { display: none; }
.dbmode { display: inline-block; margin-right: 8px; padding: 1px 8px; border: 1px solid var(--rule); border-radius: 999px; font-size: 0.8125rem; }
.dbmode.write { border-color: #b5621a; color: #b5621a; }
.dbmain { display: grid; grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr); gap: 24px; align-items: start; }
.dbtables h3, .dbcopies h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.dbtables ul { list-style: none; margin: 8px 0 0; padding: 0; }
.dbtables li { border-top: 1px solid var(--rule); }
.dbtables details summary { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; cursor: pointer; list-style: none; }
.dbtables details summary::-webkit-details-marker { display: none; }
.dbtables summary b { font-weight: 600; overflow-wrap: anywhere; }
.dbtables summary span, .dbtables .dbcols { color: var(--ink-soft); font-size: 0.8125rem; }
.dbtables .dbcols { margin: 0 0 8px; padding: 0; list-style: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dbtables .dbcols li { border: 0; padding: 1px 0; }
.dbtables .dbcols i { font-style: normal; opacity: 0.75; }
.dbtables .dbpick { min-height: 30px; margin: 0 0 10px; padding: 2px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: none; color: var(--ink-soft); font-size: 0.8125rem; cursor: pointer; }
.dbtables .dbpick:hover { color: var(--ink); border-color: var(--ink-soft); }
.dbwork, .dbtables { min-width: 0; }
.dbwork textarea {
  display: block; width: 100%; min-height: 9rem; resize: vertical; padding: 10px 12px; border: 1px solid var(--g2); border-radius: 6px;
  background: color-mix(in srgb, var(--g0) 50%, transparent); color: inherit; font: 0.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2;
}
.dbwork textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.dbbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0 0; }
.dbhint { flex: 1 1 14rem; color: var(--ink-soft); font-size: 0.8125rem; }
.dbbar select { min-height: var(--ctl); padding: 6px 30px 6px 12px; border: 1px solid var(--edge); border-radius: var(--r); background-color: transparent; color: inherit; font: inherit; font-size: 0.875rem; }
.dberror { margin: 16px 0 0; padding: 10px 14px; border-left: 3px solid #a33a2c; background: color-mix(in srgb, #a33a2c 8%, transparent); font-size: 0.9375rem; }
.dberror p { margin: 0; }
.dberror ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.8125rem; }
.dberror code, .dbres code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }
.dbres { margin: 20px 0 0; }
.dbres header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; }
.dbres header code { flex: 1 1 20rem; min-width: 0; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbres header span { color: var(--ink-soft); font-size: 0.8125rem; white-space: nowrap; }
.dbscroll { overflow: auto; max-height: 32rem; border: 1px solid var(--rule); border-radius: 6px; }
.dbres table { border-collapse: collapse; font: 0.8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 100%; }
.dbres th, .dbres td { padding: 5px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.dbres th { position: sticky; top: 0; background: var(--paper); font-weight: 600; white-space: nowrap; }
.dbres td { max-width: 28rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.dbres td.open { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 40rem; cursor: zoom-out; }
.dbres td.num { text-align: right; }
.dbres td.null, .dbres td.blob { color: var(--ink-soft); font-style: italic; }
.dbres tbody tr:last-child td { border-bottom: 0; }
.dbres .dbmore { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.dbcopies .sec-head { flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; }
.dbcopies code { font-size: 0.8125rem; }
.dbcopies .sec-head button { flex: none; }
@media (max-width: 760px) {
  .dbmain { grid-template-columns: minmax(0, 1fr); }
  .dbtables { order: 2; }
  .dbtables .dbpick, .dbbar select { min-height: 44px; }
}

/* Tools → Server (js/server.js): what is running, and a restart. */
/* Tools' Lite pages: the name and passphrase to sign in to /lite with (js/lite.js) */
.lite .intro a { color: inherit; }
.liteform { display: flex; flex-direction: column; gap: 12px; max-width: 24rem; }
.liteform .sub { margin: 0; color: var(--ink-soft); font-size: 0.875rem; }
.liteform .istatus { margin: 0; }
.liteform .istatus:empty { display: none; }
.serverfacts { margin: 0; }
.serverfacts .sub { display: block; margin-top: 2px; font-size: 0.8125rem; font-weight: 400; color: var(--ink-soft); }

/* A public page (public/profile.html, js/profile.js): a user's reading as they shared it,
   no covers, no header. And, on a year in review, the form that shares it. */
.shared-page { max-width: 760px; }
.shared-page .view-title { margin-top: 12px; }
.pp-books li { grid-template-columns: 1fr auto; }
.pp-books .r { display: flex; align-items: center; gap: 10px; }
.pp-books progress { width: 96px; height: 6px; accent-color: var(--t4); }
.pp-stars { color: var(--accent); letter-spacing: 1px; }
.shared-page h3 { margin: 32px 0 8px; font-size: 1.0625rem; font-weight: 600; }
.shared-page h3 .n { color: var(--ink-soft); font-weight: 400; font-size: 0.9375rem; margin-left: 6px; }
.pp-foot { margin-top: 48px; color: var(--ink-soft); font-size: 0.8125rem; }
.share h3 { margin: 40px 0 0; font-size: 1.0625rem; font-weight: 600; }
.pp-form { margin-top: 4px; }
.pp-form .opt { margin-top: 8px; }
.pp-form .kl { display: block; margin: 16px 0 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.pp-form input[type="text"] { width: 100%; max-width: 20rem; padding: 6px 8px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); }
.pp-form .lrow { margin: 16px 0 0; flex-wrap: wrap; }
.pp-link { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pp-link input { flex: 1 1 18rem; min-width: 0; padding: 6px 8px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); font-size: 0.875rem; }
.pp-status { color: var(--ink-soft); font-size: 0.8125rem; margin: 8px 0 0; }
.pp-link a.kbtn { display: inline-flex; align-items: center; text-decoration: none; }
.pp-status:empty { display: none; }

/* The Books tabs' lists as covers (the view picked beside the sort): each row a card, its cover
   as wide as its column (a container, so the cover's parts, sized from --w, follow it),
   its title and where it stands under it; what a row has on its right, small under those. */
.viewpick { flex: none; }
.viewpick span { padding: 0 9px; }
/* its radios lie over their icons: not sized as the tools' search is */
.shelf-tools .viewpick input, .shelf-tools .seg input { min-width: 0; }
.books.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 36px 24px; padding-top: 24px; border-top: 1px solid var(--rule); }
.books.tiles > li { --w: 100cqw; container-type: inline-size; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 0; border: 0; }
.books.tiles > li.empty { grid-column: 1 / -1; }
.books.tiles .bk { gap: 8px; }
.books.tiles :is(.stack, .bk > .stars, .idx) { transition: transform 0.25s var(--ease); }
.books.tiles .cover { border-radius: 3px 5px 5px 3px; }
.books.tiles .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.9375rem; }
.books.tiles li > span > br, .books.tiles .bar.inline, .books.tiles .warn, .books.tiles .r .w { display: none; }
/* As covers, a card says one thing under its title (.g: the time left, when it was
   finished, the time read, as the page is ordered), not the row's line (.s) nor its time
   read and when (.r): the cover's strip says how far it is read, the stars on it its rating. */
.books .g, .books .cnt, .books .idx { display: none; }
.books.tiles .s, .books.tiles .r .m { display: none; }
.books.tiles .g { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; color: var(--ink-soft); font-size: 0.75rem; }
.books.tiles .g:empty { display: none; }
.books.tiles .g > span { white-space: nowrap; }
.books.tiles .r { margin-top: -6px; text-align: left; font-size: 0.75rem; color: var(--ink-soft); }
.books.tiles .r:not(:has(button)) { display: none; }
.books.tiles .r.with-bl { display: contents; }
.books.tiles .r.with-bl > span { display: none; }
/* A card's stars in its cover's strip, not under it (so the titles of a row line up), as
   tall as the strip, small. The strip has parts (a series': its books finished, green, those
   being read, grey, the rest; a book's: how far read), so the stars are drawn three times,
   each cut to one part (--a and --b, where they end: components.js) and in a colour that
   shows on it: on the green or a dark grey, the page's; on the rest, or a book stopped, ink. */
.strip > .in, .stack > .strip.none { display: none; }
.books.tiles .bk > .stars { display: none; }
.books.tiles .stack > .strip { position: relative; }
.books.tiles .stack > .strip.none { display: flex; }
.books.tiles .strip > .in { display: block; position: absolute; inset: 0.6cqw 0; height: auto; background: none; box-shadow: none; }
.books.tiles .strip > .in > .stars { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; margin: 0; }
.books.tiles .strip > .in > .stars:nth-child(1) { --star: var(--paper); clip-path: inset(0 calc(100% - var(--a, 0%)) 0 0); }
.books.tiles .strip > .in > .stars:nth-child(2) { --star: var(--paper); clip-path: inset(0 calc(100% - var(--b, 0%)) 0 var(--a, 0%)); }
.books.tiles .strip > .in > .stars:nth-child(3) { --star: var(--ink); clip-path: inset(0 0 0 var(--b, 0%)); }
.books.tiles .strip.fin > .in > .stars:nth-child(1) { --star: var(--on-accent); }
.books.tiles .strip.stopped > .in > .stars:nth-child(1) { --star: var(--ink); }
.books.tiles .strip > .in .on { fill: var(--star); }
.books.tiles .strip > .in .off { fill: color-mix(in srgb, var(--star) 38%, transparent); }
/* on a stack, how many of its books are finished ("6/8"), on the front cover's corner
   (as far down as the covers behind it step up), teal once all are */
.books.tiles .cnt {
  position: absolute; top: calc(1.5 * 5px + 6px); left: 6px; z-index: 2; display: grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-1);
}
.books.tiles li:has(.stack > .cover:nth-of-type(3)) .cnt { top: calc(3 * 5px + 6px); }
.books.tiles .cnt.fin { background: var(--accent); color: var(--paper); }
/* the backlog's button, a round chip on the front cover's foot, right (above its strip,
   left of the covers behind it), so the title and caption keep the card's width; teal with
   a tick once the book is in the backlog, so the covers show what is. Drawn 28px, it takes
   taps 8px around. */
.books.tiles li .with-bl .icon-btn {
  --chip: 28px; position: absolute; top: calc(150cqw - max(3px, 100cqw / 16) - 6px - var(--chip)); right: 6px; z-index: 2;
  width: var(--chip); height: var(--chip); border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
  transition: transform 0.25s var(--ease);
}
.books.tiles li .with-bl .icon-btn::before { content: ''; position: absolute; inset: -8px; }
.books.tiles li .with-bl .icon-btn svg { width: 16px; height: 16px; }
.books.tiles li .with-bl .icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--paper); box-shadow: 0 0 0 2px var(--surface), var(--shadow-1); }
.books.tiles li:has(.stack > .cover:nth-of-type(2)) .with-bl .icon-btn { right: calc(5px + 6px); }
.books.tiles li:has(.stack > .cover:nth-of-type(3)) .with-bl .icon-btn { right: calc(2 * 5px + 6px); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .books.tiles li:hover :is(.stack, .bk > .stars, .with-bl .icon-btn, .idx) { transform: translateY(-4px); }
  .books.tiles li:hover .stack .cover:first-of-type { box-shadow: var(--shadow-2); }
}
/* on a phone, three to a row: the title a little smaller, so two lines hold it */
@media (max-width: 600px) {
  .books.tiles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 28px 16px; }
  .books.tiles .t { font-size: 0.875rem; }
}
/* a book not started, as a cover: fainter, but not as faint as in a row */
.books.tiles li.unread .cover, .books.tiles li.unread .stack { opacity: 0.75; }
/* the backlog as covers: a book's place on its cover's corner */
.books.tiles li.bl .pos {
  position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 0.75rem; font-weight: 600; box-shadow: var(--shadow-1);
}
/* on a series' page as covers: a book's number in the series on its cover's corner, as
   the backlog's place is (a long one, "Annual 2", cut short) */
.books.tiles .idx {
  position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; min-width: 24px; max-width: calc(100% - 12px); height: 24px; padding: 0 6px;
  border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-1);
}
.books.tiles .idx > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* (how far read is on its cover's foot, as on every card) */
.books.tiles li.bl .bar { display: none; }

/* A small moment (js/moments.js): a book finished, the streak at a milestone, said once at
   the foot of the page, over the tab bar on a phone. */
.toast {
  position: fixed; z-index: 40; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px)); translate: -50% 0;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(28rem, calc(100vw - 2 * var(--gutter)));
  padding: 14px 10px 14px 16px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
}
.toast p { margin: 0; }
.toast-body { min-width: 0; }
.toast-main { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.toast-main a { color: inherit; text-decoration-color: var(--g2); text-underline-offset: 0.15em; }
.toast-sub { font-size: 0.8125rem; color: var(--ink-soft); }
.toast-mark { flex: none; width: 40px; height: 40px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.toast-mark circle { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke-dasharray: 107; }
.toast-mark path { stroke-dasharray: 26; }
@media (max-width: 600px) { .toast { bottom: calc(env(safe-area-inset-bottom) + 76px); } }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.5s var(--ease); }
  .toast-mark circle { animation: draw-ring 0.7s 0.15s var(--ease) backwards; }
  .toast-mark path { animation: draw-tick 0.35s 0.65s var(--ease) backwards; }
}
@keyframes toast-in { from { opacity: 0; translate: -50% 24px; } }
@keyframes draw-ring { from { stroke-dashoffset: 107; } }
@keyframes draw-tick { from { stroke-dashoffset: 26; } }

/* From a page to the next (js/motion.js): the one fades into the other, quickly, and the
   cover pressed moves to its place on the new page. */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }
  ::view-transition-group(cover) { animation-duration: 0.36s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
  ::view-transition-old(cover), ::view-transition-new(cover) { height: 100%; object-fit: cover; }
}

/* Shared links (shares.js): each link, what it shares and how long it works, its buttons
   beside it, or under it on a phone; ended ones quieter. The count of working links in the
   account menu. The link in the share dialog (downloads.js), with its Copy button. */
[data-shares-item] .n:not([hidden]) { display: inline-grid; place-items: center; min-width: 1.4em; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.75rem; text-decoration: none; }
.share-list { list-style: none; margin: 0; padding: 0; }
.share-list .slink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.share-list .slink:last-child { border-bottom: 1px solid var(--rule); }
.share-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 16rem; }
.share-what .t { font-weight: 600; color: inherit; overflow-wrap: anywhere; }
.share-what .meta { color: var(--ink-soft); font-size: 0.8125rem; }
.share-list .lrow { flex-wrap: wrap; gap: 8px; }
.share-list .ended .share-what { opacity: 0.7; }
.linkrow { display: flex; gap: 8px; min-width: 0; }
.linkrow input { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) {
  .share-list .lrow { width: 100%; }
}

/* A download link's page (download.html, js/download-page.js): its books, each to download */
.dl-page a.kbtn, .kdialog a.kbtn { display: inline-flex; align-items: center; text-decoration: none; }
.dl-page .dl-all { margin: 16px 0 24px; }
.dl-books { list-style: none; margin: 0; padding: 0; }
.dl-books li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.dl-books li:last-child { border-bottom: 1px solid var(--rule); }
.dl-books .t { display: block; overflow-wrap: anywhere; }
.dl-books .meta { color: var(--ink-soft); font-size: 0.8125rem; overflow-wrap: anywhere; }
[data-shares-item][hidden], [data-admin][hidden] { display: none; }

/* Signing in with Google (the login page), and the divider after it. */
.glogin { margin: 0 0 20px; }
.glogin[hidden] { display: none; }
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 10px 20px; border: 1px solid var(--edge); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none;
  width: 100%; box-sizing: border-box;
}
.gbtn:hover { border-color: var(--ink-soft); }
.gbtn svg { width: 18px; height: 18px; flex: none; }
.ordiv { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.ordiv::before, .ordiv::after { content: ''; flex: 1 1 0; height: 1px; background: var(--rule); }

/* A view's few words under its title (Tools', Admin's, Account) */
[data-view] > .intro { color: var(--ink-soft); margin: 8px 0 24px; max-width: 64ch; }

/* Cards: Account's, Admin's and Tools' parts, each on a card of --surface, one under the
   other (or side by side in .panel-grid) */
.acct-card, .panel { padding: 18px 20px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.tools > .panel + .panel, .tools > .panel-grid + .panel, .tools > .dbmain + .panel, .tools > .panel + .dbmain { margin-top: 20px; }
.acct-card > h3, .panel > h3, .panel-head h3, .panel .sec-head h3 { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 600; }
.acct-card > .meta, .panel > .meta { margin: 0 0 12px; color: var(--ink-soft); font-size: 0.875rem; }
.acct-card > :last-child, .panel > :last-child { margin-bottom: 0; }
:is(.acct-card, .panel) .acct-list:last-child li:last-child, .panel.backups li:last-child { border-bottom: 0; padding-bottom: 0; }
.dbstatus + .dbmain.panel { margin-top: 12px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head h3 { margin: 0; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 20px; }
.panel.backups { margin-top: 20px; }
.panel.backups li:first-child { border-top: 0; }
.panel .sec-head { margin-bottom: 4px; }
/* Export's cards: what each is, and its button at the foot */
.export-card { display: flex; flex-direction: column; align-items: flex-start; }
.export-card .sub { flex: 1 1 auto; margin: 0 0 16px; color: var(--ink-soft); font-size: 0.875rem; }
/* Import's drop zone, inside its card */
.import .panel .drop { margin: 0; }
/* the Server's facts on a card: no rules of their own */
.facts.panel { margin: 0; border: 1px solid var(--rule); padding: 18px 20px; }
.facts.panel + .panel { margin-top: 20px; }
/* Lite pages' form on its card */
.liteform.panel { max-width: none; }
.liteform.panel > :not(.lrow) { max-width: 28rem; }

/* The Account page (/account, js/account.js), and Admin's Users (js/users.js). */
.acct-grid { display: grid; gap: 20px; }
.acct-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.acct-head h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.acct-head .meta { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.875rem; }
.acct-state { padding: 3px 10px; border: 1px solid var(--edge); border-radius: 6px; font-size: 0.8125rem; color: var(--ink-soft); }
.acct-state.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.acct-list { list-style: none; margin: 0 0 12px; padding: 0; }
.acct-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 0; border-top: 1px solid var(--rule); }
.acct-list li:last-child { border-bottom: 1px solid var(--rule); }
.acct-item-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; }
.acct-item-main .meta { color: var(--ink-soft); font-size: 0.8125rem; }
.acct-badge { display: inline-block; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 4px; font-size: 0.75rem; color: var(--ink-soft); }
.acct-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px 24px; margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.acct-kv dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.acct-kv dd { margin: 4px 0 0; font-size: 0.9375rem; }
.acct-kv dd .meta { color: var(--ink-soft); font-size: 0.8125rem; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acct-subform { margin-top: 14px; }
.acct-subform h4 { margin: 0 0 8px; font-size: 0.9375rem; font-weight: 600; }
.acct-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.acct-row .ef { flex: 1 1 13rem; min-width: 0; }
.acct-row .ef input, .drive-modal input { width: 100%; min-height: var(--ctl); padding: 6px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; font-size: 0.9375rem; }
.acct-secret { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.acct-secret p { margin: 0 0 8px; font-size: 0.875rem; }
.acct-secret input { min-height: var(--ctl); padding: 6px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); font: 0.875rem ui-monospace, SFMono-Regular, Menlo, monospace; }
:is(.acct-card, .panel) .istatus { margin: 10px 0 0; font-size: 0.875rem; }
:is(.acct-card, .panel) .istatus:empty { display: none; }
.acct-badge.on { border-color: var(--accent); color: var(--accent); }
/* a user on Admin's Users: who they are, how they sign in, and Edit */
.user-list li { align-items: flex-start; }
.user-main { flex: 1 1 20rem; min-width: 0; }
.user-main > .meta { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.8125rem; }
.user-main .acct-cache { margin-top: 10px; }
#userDialog .opt { display: flex; margin-top: 8px; }

/* Google Drive folder picker & upload confirmation dialogs. */
.drive-modal { min-width: min(32rem, calc(100vw - 3rem)); max-width: 36rem; }
/* the Drive folder picker's page (js/drive-picker.js): the ways a folder can be chosen */
.drive-ways { padding-left: 1.25rem; }
.drive-ways li { margin: 0 0 16px; }
.drive-ways .meta { display: block; margin-top: 4px; }
.drive-email { margin-top: 6px; align-items: center; }
.drive-email input { flex: 1 1 18rem; min-width: 0; min-height: var(--ctl); padding: 6px 10px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; font-size: 0.9375rem; }
.drive-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 12px; font-size: 0.875rem; }
.drive-folders, .drive-upload-list { list-style: none; margin: 8px 0 12px; padding: 0; max-height: 15rem; overflow-y: auto; border: 1px solid var(--rule); border-radius: var(--r); }
.drive-folders li, .drive-upload-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--rule); }
.drive-folders li:first-child, .drive-upload-list li:first-child { border-top: 0; }
.drive-folder-open { background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; font: inherit; font-weight: 500; color: var(--ink); flex: 1 1 auto; }
.drive-folder-open:hover { color: var(--accent); }
.drive-upload-list .u-path { font-size: 0.875rem; overflow-wrap: anywhere; }
.drive-conflict-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.drive-conflict-box p { margin: 0 0 6px; font-size: 0.875rem; }
.drive-conflict-box .opt { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 0.875rem; }
.drive-modal progress { width: 100%; margin: 8px 0; }

/* Files (js/files.js): a folder's crumbs and buttons, its table of folders and files, what
   Kolophon can't change said once, files dropped on it; and the uploads' tray (js/uploads.js) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.files .intro { max-width: 46rem; }
.fhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 20px 0 12px; }
.fcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 1.0625rem; }
.fcrumbs a { color: var(--ink-soft); text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.fcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.fcrumbs .here { font-weight: 600; padding: 2px 4px; border-radius: 6px; overflow-wrap: anywhere; }
.fcrumbs .sep { color: var(--ink-soft); }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fbar .kbtn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.fbar .kbtn .ico { width: 17px; height: 17px; flex: none; }
.fbar.picking { padding: 4px 4px 4px 12px; border: 1px solid var(--accent); border-radius: calc(var(--r) + 4px); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.fcount { font-size: 0.875rem; font-weight: 600; margin-right: 4px; }
.fupload summary.kbtn { min-height: var(--ctl); padding: 6px 16px; background-image: none; border-color: var(--accent); }
.fupload summary[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.fupload .filter-menu { left: 0; right: auto; padding: 4px 0; min-width: 12rem; }
.fupload .item, .fmenu .item { position: relative; display: block; width: 100%; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; font-size: 0.9375rem; text-align: left; text-decoration: none; cursor: pointer; }
.fupload .item:hover, .fmenu .item:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.fupload .item input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fmenu { position: relative; }
.fmenu summary { list-style: none; }
.fmenu summary::-webkit-details-marker { display: none; }
.fmenu summary .ico { width: 18px; height: 18px; }
.fmenu .filter-menu { right: 0; padding: 4px 0; min-width: 13rem; }
.fmenu .item:disabled { color: var(--ink-soft); opacity: 0.55; cursor: not-allowed; }
.fmenu .item.danger:not(:disabled) { color: #a33a2c; }
.fmenu .sep { display: block; margin: 4px 0; border-top: 1px solid var(--rule); }
.fmenu .mlabel { display: block; padding: 6px 16px 2px; text-align: left; font-size: 0.8125rem; color: var(--ink-soft); }
.fmenu .item.treat { padding-left: 34px; }
.fmenu .item.treat[aria-pressed="true"]::before { content: "✓"; position: absolute; left: 14px; }
.fnote { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--g2); border-radius: 0 var(--r) var(--r) 0; background: color-mix(in srgb, var(--ink) 4%, transparent); font-size: 0.875rem; color: var(--ink-soft); }
.fnote a { color: var(--ink); }
.fdrop { position: relative; border-radius: 12px; transition: box-shadow 0.15s, background-color 0.15s; }
.fdrop.drop-on { box-shadow: 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ftable { width: 100%; border-collapse: collapse; font-size: 0.9375rem; transition: opacity 0.2s; }
.fprogress { height: 3px; margin: -8px 0 9px; overflow: hidden; border-radius: 2px; }
.fprogress span { display: block; width: 30%; height: 100%; border-radius: inherit; background: var(--accent); opacity: 0; }
.waiting .fprogress span { opacity: 1; animation: fprogress 1.1s ease-in-out infinite; }
@keyframes fprogress { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .waiting .fprogress span { width: 100%; animation: none; opacity: 0.5; } }
:is(.fmove, .fchoose) .fprogress { margin: 4px 0 8px; }
/* a folder being asked for: the one shown kept as it is, off (inert) and dimmed, the crumbs live */
.waiting :is(.fbar, .fdrop, .fnote, .ffoot), :is(.fmove, .fchoose).waiting :is(.drive-folders, [data-new-folder]) { opacity: 0.55; transition: opacity 0.12s; }
.ftable th { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.ftable td { padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.fsort { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.fsort:hover { color: var(--ink); }
.ftable .fpick { width: 2rem; padding-right: 0; }
.ftable .fpick input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.ftable .fsize, .ftable .fdate { width: 1%; white-space: nowrap; color: var(--ink-soft); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.ftable .fmore { width: 1%; text-align: right; }
.frow { outline: none; }
.frow:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.frow:focus-visible td { box-shadow: inset 0 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
.frow:focus-visible td:first-child { box-shadow: inset 2px 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
.frow:focus-visible td:last-child { box-shadow: inset -2px 2px 0 var(--focus), inset 0 -2px 0 var(--focus); }
.frow.picked td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.frow.drop-on td { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.frow[draggable="true"] { cursor: grab; }
.fname { min-width: 0; }
.fcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fname-link { color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.fname-link:hover { text-decoration: underline; }
.fname-text { overflow-wrap: anywhere; }
.k-book .fname-text { font-size: 0.8125rem; color: var(--ink-soft); order: 2; }
.fbook { color: var(--ink); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.fbook:hover { text-decoration: underline; }
.fkind { font-size: 0.8125rem; color: var(--ink-soft); }
.fsub { display: none; font-size: 0.8125rem; color: var(--ink-soft); order: 3; }
.ficon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; color: var(--ink-soft); }
.ficon .ico { width: 22px; height: 22px; }
.ficon.folder { color: var(--accent); }
.ficon.folder .ico { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.fcover.cover { flex: none; width: 30px; border-radius: 2px 3px 3px 2px; box-shadow: var(--shadow-1); }
.k-other td { color: var(--ink-soft); }
.k-other .ficon { opacity: 0.7; }
.frename { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.frename input { flex: 1 1 14rem; min-width: 0; min-height: 36px; padding: 4px 10px; border: 1px solid var(--focus); border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; box-shadow: 0 0 0 1px var(--focus); }
.frename .kbtn { min-height: 36px; }
.ferr { flex-basis: 100%; font-size: 0.8125rem; color: #a33a2c; }
.ferr:empty { display: none; }
.fempty { padding: 48px 16px; border: 1px dashed var(--g2); border-radius: 12px; text-align: center; }
.fempty p { margin: 0 0 8px; }
.fempty .kbtn { display: inline-flex; text-decoration: none; }
.ffoot { margin: 10px 0 0; font-size: 0.8125rem; color: var(--ink-soft); }
.kbtn.danger-fill { border-color: #a33a2c; background-color: #a33a2c; color: #fff; }
.kbtn.danger-fill:hover:not(:disabled) { border-color: #8c2f23; background-color: #8c2f23; }
.drive-modal input:is([type="radio"], [type="checkbox"]) { width: auto; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); }
/* a dialog of Files' (and the Drive's) as wide as the dialog, never wider than the screen */
.kdialog > .drive-modal { min-width: 0; max-width: none; }
#filesDialog { width: min(36rem, calc(100vw - 2 * var(--gutter))); }
.drive-modal .kbtn { white-space: nowrap; }
.drive-folders .drive-folder-open { overflow-wrap: anywhere; }
/* a book's file name under its title: one line, cut short */
.k-book .fname-text { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fmove .opt { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 0.875rem; }
.fmove-new { margin: 0 0 8px; flex-wrap: nowrap; align-items: center; }
.fmove-new input { flex: 1 1 auto; width: auto; min-width: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"], [data-theme="sepia"]) :is(.fmenu .item.danger:not(:disabled), .ferr) { color: #e58d82; } }
:root[data-theme="dark"] :is(.fmenu .item.danger:not(:disabled), .ferr) { color: #e58d82; }
@media (max-width: 600px) {
  .fhead { align-items: stretch; }
  .fbar .kbtn span, .fupload summary span { display: none; }
  .fbar .kbtn, .fupload summary.kbtn { padding: 6px 12px; min-height: 44px; }
  .fbar.picking .kbtn { flex: 1 1 0; justify-content: center; }
  .ftable .fsize, .ftable .fdate, .ftable thead .fsize, .ftable thead .fdate { display: none; }
  .fsub { display: block; }
  .ftable td { padding: 10px 6px; }
  .fmenu summary.icon-btn { width: 44px; height: 44px; }
  /* boxes big enough for a thumb; long titles kept to two lines */
  .ftable .fpick { width: 2.25rem; }
  .ftable .fpick input { width: 22px; height: 22px; }
  .ftable td.fpick { padding-left: 2px; }
  .fcell { gap: 10px; }
  .fbook, .fname-link { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fcrumbs { flex: 1 1 100%; font-size: 1rem; }
  .fnote { font-size: 0.8125rem; }
  .fmove-new { flex-wrap: wrap; }
  .fmove-new .kbtn { flex: 1 1 100%; }
  .fempty { padding: 32px 16px; }
}

.utray {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30;
  width: min(24rem, calc(100vw - 32px)); max-height: min(60vh, 28rem); display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
.utray-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 8px; }
.utray-head h2 { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.utray-head .kbtn { min-height: 32px; padding: 4px 12px; }
.utray-head .icon-btn { width: 32px; height: 32px; }
.utray-sum { margin: 0 14px 8px; font-size: 0.8125rem; color: var(--ink-soft); }
.utray-sum:empty { display: none; }
.utray-list { list-style: none; margin: 0; padding: 0 14px 12px; overflow-y: auto; }
.utray-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 0.8125rem; }
.utray-list .u-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utray-list .u-state { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.utray-list progress { grid-column: 1 / -1; width: 100%; height: 4px; accent-color: var(--accent); }
.utray-list .u-done .u-state { color: var(--accent); }
.utray-list .u-failed .u-state { grid-column: 1 / -1; color: #a33a2c; white-space: normal; }
.utray-list .glink { justify-self: start; }
/* (on a phone, above the tabs at the foot of the screen) */
@media (max-width: 600px) {
  .utray { left: var(--gutter); right: var(--gutter); width: auto; bottom: calc(env(safe-area-inset-bottom) + 84px); max-height: 45vh; }
}
/* Account's way to Files, among the Drive card's buttons */
.acct-actions a.kbtn { display: inline-flex; align-items: center; text-decoration: none; }

/* Connections (js/connections.js): where your books are and what you read on, a row each with
   its state, its line and its buttons; the dialog of the kinds and of a kind's steps */
.conn-groups { display: grid; gap: 28px; }
.conn-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 10px; }
.conn-head h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.conn-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.conn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 14px 16px; border-top: 1px solid var(--rule); }
.conn-row:first-child { border-top: 0; }
.conn-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.conn-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-soft); flex: none; }
.conn-icon .ico { width: 22px; height: 22px; }
.conn-main { min-width: 0; }
.conn-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.conn-name { overflow-wrap: anywhere; }
.conn-state { margin-left: auto; font-size: 0.75rem; padding: 1px 8px; }
.conn-state.warn { border-color: #b8742a; color: #8f5714; background: color-mix(in srgb, #b8742a 10%, transparent); }
.conn-state.busy { border-color: var(--accent); color: var(--accent); }
.conn-line { margin: 4px 0 0; font-size: 0.875rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.s-attention .conn-line { color: var(--ink); }
.conn-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.conn-actions .kbtn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.conn-actions .kbtn .ico { width: 17px; height: 17px; flex: none; }
.conn-empty { padding: 28px 16px; border: 1px dashed var(--g2); border-radius: 12px; text-align: center; }
.conn-empty p { max-width: 34rem; margin: 0 auto 12px; }
.conn-kinds { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 8px; }
.conn-kind { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--edge); border-radius: 10px; background: var(--paper); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.conn-kind:hover:not(:disabled) { border-color: var(--accent); }
.conn-kind:disabled { opacity: 0.6; cursor: default; }
.conn-kind-text { display: grid; gap: 2px; min-width: 0; }
.conn-kind-text .meta { font-size: 0.8125rem; color: var(--ink-soft); }
.conn-steps { margin: 12px 0; padding-left: 1.4rem; font-size: 0.9375rem; }
.conn-steps li { margin: 4px 0; }
.conn-wait.on { color: var(--accent); font-weight: 600; }
.conn-step .error:empty { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"], [data-theme="sepia"]) .conn-state.warn { color: #e2a35c; } }
:root[data-theme="dark"] .conn-state.warn { color: #e2a35c; }
@media (max-width: 600px) {
  .conn-row { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .conn-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .conn-actions .kbtn .ico + span { display: none; }
  .conn-actions .kbtn { min-height: 44px; padding: 6px 12px; }
  .conn-actions .fmenu { margin-left: auto; }
  .conn-actions .fmenu summary.icon-btn { width: 44px; height: 44px; }
}

/* Setting up (js/setup.js): a new user's first page, three steps in place of the welcome,
   and the line to finish setting up above the dashboard */
.setup { max-width: 44rem; margin: 40px auto 8px; }
.setup .view-title { margin: 0 0 6px; }
.setup-admin { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 0.9375rem; }
.setup-steps { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.setup-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 16px 18px; border-top: 1px solid var(--rule); }
.setup-step:first-child { border-top: 0; }
.setup-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--edge); border-radius: 50%; font-weight: 600; color: var(--ink-soft); }
.setup-step.done .setup-n { border-color: var(--accent); background: var(--accent); color: var(--paper); }
.setup-text h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.setup-text p { margin: 4px 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.setup-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.setup-act .kbtn { display: inline-flex; text-decoration: none; }
.setup:not([hidden]) ~ .now .facts { display: none; }
.setup:not([hidden]) ~ .now { margin-top: 32px; }
.finish-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; padding: 10px 12px 10px 16px; border: 1px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 0.9375rem; }
.finish-setup[hidden] { display: none; }
.finish-setup span { flex: 1 1 12rem; }
@media (max-width: 600px) {
  .setup { margin-top: 24px; }
  .setup-step { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .setup-act { grid-column: 2; justify-content: flex-start; }
}
.conn-hint { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.conn-http { margin: 8px 0 0; color: #8f5714; }
