/* Shelf — a reading log.
 *
 * Two things shape everything below.
 *
 * 1. The Content-Security-Policy has no 'unsafe-inline', so there are no
 *    style="" attributes anywhere in the markup and no <style> blocks. Where a
 *    value has to be computed (a progress width, the goal ring's dash offset,
 *    a placeholder cover's hue) the script sets it through the CSSOM -
 *    element.style.width = '40%' - which CSP allows. setAttribute('style', …)
 *    would not be, so it is never used.
 *
 * 2. Covers are the interface. Everything else is deliberately quiet so that a
 *    grid of book jackets is the loudest thing on the page.
 */

:root {
  --bg: #faf6ef;
  --bg-tint: #f3ede2;
  --surface: #fffdf9;
  --surface-2: #f2ece1;
  --border: #e5dccd;
  --border-strong: #d3c7b2;
  --text: #241f1a;
  --muted: #7b7266;
  --accent: #8a3324;          /* oxblood, the colour of a cloth spine */
  --accent-soft: #f0e0da;
  --accent-text: #fffdf9;
  --gold: #b4832b;            /* stars */
  --good: #43653f;
  --danger: #a33224;

  --radius: 10px;
  --radius-lg: 18px;
  --shadow-book: 0 1px 2px rgba(60, 40, 20, .16), 0 6px 14px rgba(60, 40, 20, .12);
  --shadow-card: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px rgba(60, 40, 20, .06);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151a;
    --bg-tint: #1d1a21;
    --surface: #211d26;
    --surface-2: #2a2531;
    --border: #362f3f;
    --border-strong: #4a4155;
    --text: #ece6dd;
    --muted: #9c9289;
    --accent: #d98b74;
    --accent-soft: #3a2a28;
    --accent-text: #1c1216;
    --gold: #d9ac5a;
    --good: #8fbb84;
    --danger: #e08272;

    --shadow-book: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .4);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

/* The `hidden` attribute is display:none in the UA stylesheet, which any
 * author `display` rule silently beats. .sheet and .lock both set display, so
 * without this they never go away. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); font-size: 14px; }
.spacer { flex: 1; }

/* --------------------------------------------------------------------------
   buttons and fields
   -------------------------------------------------------------------------- */

.btn {
  font: inherit;
  font-size: 15px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.danger { color: var(--danger); border-color: var(--border-strong); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }

.link-btn {
  font: inherit;
  font-size: 14px;
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-btn {
  font: inherit;
  font-size: 19px;
  line-height: 1;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

input[type="text"], input[type="search"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  font: inherit;
  font-size: 16px;           /* anything smaller and iOS zooms the page on focus */
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 5px; color: var(--text); }

.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   lock screen
   -------------------------------------------------------------------------- */

.lock {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
  z-index: 60;
}
.lock-card {
  width: min(360px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.lock-card h1 { margin: 14px 0 6px; font-size: 30px; }
.lock-card p { margin: 0 0 18px; font-size: 14px; }
.lock-card input { margin-bottom: 12px; text-align: center; }
.lock-card .btn { width: 100%; }
.lock-card .error { margin: 12px 0 0; }

/* A little stack of three spines, drawn rather than shipped as an image. */
.lock-mark {
  width: 56px;
  height: 44px;
  margin: 0 auto;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 100% / 14px 44px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 20px 100% / 14px 34px no-repeat,
    linear-gradient(var(--muted), var(--muted)) 40px 100% / 14px 40px no-repeat;
  border-radius: 2px;
  opacity: .9;
}

/* --------------------------------------------------------------------------
   top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navtab {
  font-family: var(--serif);
  font-size: 20px;
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-right: 10px;
}
.navtab.active { color: var(--text); border-bottom-color: var(--accent); }

.view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 14px 64px;
}

.section-title {
  font-size: 15px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* --------------------------------------------------------------------------
   reading now
   -------------------------------------------------------------------------- */

.reading-now { margin-bottom: 22px; }
.current-list { display: grid; gap: 10px; }

.current {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 13px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}
.current .cover { width: 56px; }
.current-title { font-family: var(--serif); font-size: 17px; line-height: 1.25; }
.current-author { font-size: 13px; color: var(--muted); margin-top: 1px; }

.bar {
  margin-top: 9px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bar-label { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* --------------------------------------------------------------------------
   shelf controls
   -------------------------------------------------------------------------- */

.shelf-controls { display: grid; gap: 10px; margin-bottom: 12px; }

.segmented {
  display: flex;
  gap: 3px;
  background: var(--surface-2);
  border-radius: 11px;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.seg {
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  flex: 1;
  padding: 7px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.seg.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.filter-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.filter-row select { width: auto; }

.shelf-count { font-size: 13px; margin: 0 0 12px; }

.nudge {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 14px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   the shelf itself
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 18px 14px;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 26px 20px; }
}

.book {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: block;
  width: 100%;
}
.book:active .cover { transform: scale(.96); }

/* The jacket. aspect-ratio keeps every slot the same height whether the image
 * has loaded, failed, or was never there - so the grid does not reflow as
 * covers arrive one by one. */
.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 3px 6px 6px 3px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-book);
  transition: transform .12s ease;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A drawn jacket for the many books that have no cover art anywhere. The hue
 * is derived from the title, so the same book is always the same colour and a
 * coverless shelf still looks like a shelf rather than a grid of grey boxes. */
.cover.placeholder {
  background:
    linear-gradient(160deg,
      hsl(var(--hue, 20) 32% 42%),
      hsl(var(--hue, 20) 38% 28%));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10% 11%;
  color: #fdf9f2;
}
.ph-title {
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-rule { height: 1px; background: rgba(255,255,255,.45); margin: 7px 0; }
.ph-author {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* The paper edge: a hairline of "pages" down the fore-edge, and a darker
 * gutter at the spine. Two gradients, no images. */
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,.02) 7%, rgba(0,0,0,0) 12%),
    linear-gradient(270deg, rgba(255,255,255,.22), rgba(255,255,255,0) 4%);
  border-radius: inherit;
}

.book-meta { margin-top: 7px; }
.book-title {
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-author {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.book-stars { font-size: 12px; color: var(--gold); letter-spacing: .5px; margin-top: 2px; }

/* Corner flag for the shelf a book sits on, shown only in the All view. */
.cover .flag {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 20px;
  background: rgba(20, 14, 10, .74);
  color: #fdf9f2;
  letter-spacing: .03em;
}
.cover .flag.reading { background: rgba(138, 51, 36, .92); }

.empty { text-align: center; padding: 48px 20px; }
.empty-title { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; }

/* --------------------------------------------------------------------------
   sheets
   -------------------------------------------------------------------------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(24, 18, 14, .5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 700px) {
  .sheet { align-items: center; padding: 24px; }
}

.sheet-card {
  background: var(--surface);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 18px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-card);
}
.sheet-card.wide { max-width: 680px; }
.sheet-card.narrow { max-width: 400px; }
@media (min-width: 700px) {
  .sheet-card { border-radius: var(--radius-lg); max-height: 86vh; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  position: sticky;
  top: -18px;
  background: var(--surface);
  padding: 4px 0 8px;
  z-index: 2;
}
.sheet-head h2 { margin: 0; font-size: 21px; }

/* --------------------------------------------------------------------------
   search results
   -------------------------------------------------------------------------- */

.search-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.results { display: grid; gap: 4px; margin: 8px 0 14px; }

.result {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 6px;
  border: none;
  background: none;
  border-radius: var(--radius);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.result:hover { background: var(--bg-tint); }
.result .cover { width: 44px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.result-title { font-size: 15px; line-height: 1.3; }
.result-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.result-add { font-size: 22px; color: var(--accent); padding: 0 6px; }
.result.owned { opacity: .55; }
.result.owned .result-add { font-size: 12px; color: var(--muted); }

.manual-form { display: grid; gap: 2px; margin-top: 10px; }

/* --------------------------------------------------------------------------
   book detail
   -------------------------------------------------------------------------- */

.detail-top { display: grid; grid-template-columns: 104px 1fr; gap: 16px; margin-bottom: 18px; }
.detail-top .cover { width: 104px; }
.detail-title { font-family: var(--serif); font-size: 21px; line-height: 1.2; margin: 0 0 3px; }
.detail-author { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.detail-author.strong { font-size: 16px; color: var(--text); margin-top: 2px; }
.detail-facts { font-size: 13px; color: var(--muted); line-height: 1.7; }

.detail-block { margin-bottom: 20px; }
.detail-block > h3 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

/* Shelf switcher: same visual language as the library segmented control, so
 * "which shelf is this on" reads the same in both places. */
.shelf-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  background: var(--surface-2); border-radius: 11px; padding: 3px; }

/* Stars. Each star is two half-width buttons stacked side by side, which is
 * how a half-star rating gets to be tappable on a phone without a slider. */
.stars { display: flex; align-items: center; gap: 2px; }
.star { position: relative; width: 32px; height: 32px; }
.star-half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}
.star-half.left { left: 0; }
.star-half.right { right: 0; }
.star-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: var(--border-strong);
  pointer-events: none;
}
.star-glyph.on { color: var(--gold); }
/* The half state: a gold star clipped down the middle over a grey one. */
.star-glyph.half { color: var(--gold); clip-path: inset(0 50% 0 0); }
.star-clear { margin-left: 10px; }

.progress-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.progress-row input { width: 100%; }

.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
}

.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px;
  padding-top: 16px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   year page
   -------------------------------------------------------------------------- */

.year-head { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.year-head select { width: auto; font-family: var(--serif); font-size: 22px; padding: 4px 10px;
  border: none; background: transparent; }

.goal-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
}
@media (max-width: 460px) {
  .goal-card { grid-template-columns: 108px 1fr; gap: 14px; padding: 16px 14px; }
}

.goal-ring-wrap { position: relative; }
.goal-ring { width: 100%; display: block; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 11;
  stroke-linecap: round;
  /* circumference of r=52; the script moves the offset */
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1);
}
.goal-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.goal-ring-label strong { font-family: var(--serif); font-size: 34px; line-height: 1; }
.goal-ring-label span { font-size: 12px; }

.goal-headline { font-family: var(--serif); font-size: 20px; line-height: 1.25; margin: 0 0 5px; }
.goal-copy p { margin: 0; font-size: 14px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
}
.tile-value { font-family: var(--serif); font-size: 25px; line-height: 1.1; }
.tile-label { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
.tile-note { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 2px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.panel-row { display: grid; gap: 16px; }
@media (min-width: 700px) { .panel-row { grid-template-columns: 1fr 1fr; } }

/* Month by month: a label, a count, and the actual jackets. The covers are the
 * point - a year of reading should look like a year of reading. */
.month-wall { display: grid; gap: 3px; }
.month-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.month-line:last-child { border-bottom: none; }
.month-line.empty-month { opacity: .45; }
.month-name { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.month-covers { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.month-covers .cover { width: 34px; border-radius: 1px 3px 3px 1px; }
.month-covers .cover .ph-title, .month-covers .cover .ph-rule,
.month-covers .cover .ph-author { display: none; }

/* Covers sitting directly in a flex row need two overrides.
 *
 * .cover.placeholder pads itself with percentages, and a percentage padding
 * resolves against the *containing block's* width - which, for a flex item, is
 * the whole strip rather than the 34px jacket. Left alone, a drawn cover in the
 * month wall inflates to several times the width of a real one.
 *
 * min-width: 0 disables the automatic minimum size that would then hold it
 * there, and flex: 0 0 auto stops the row from resizing jackets to fit. */
.month-covers .cover, .cover-strip .cover { flex: 0 0 auto; min-width: 0; }
.month-covers .cover.placeholder { padding: 0; }
.cover-strip .cover.placeholder { padding: 4px 5px; }
.cover-strip .cover .ph-title { font-size: 8.5px; -webkit-line-clamp: 4; }
.cover-strip .cover .ph-rule { margin: 4px 0; }
.cover-strip .cover .ph-author { display: none; }
.month-dash { font-size: 12px; color: var(--muted); }

.hist { display: grid; gap: 5px; }
.hist-row { display: grid; grid-template-columns: 54px 1fr 28px; gap: 9px; align-items: center; font-size: 13px; }
.hist-stars { color: var(--gold); font-size: 12px; text-align: right; }
.hist-bar { height: 15px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hist-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.hist-count { font-size: 12px; color: var(--muted); text-align: right; }

.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rank-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.rank-list .rank-count { color: var(--muted); font-size: 13px; flex-shrink: 0; }

.highlight { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.highlight + .highlight { border-top: 1px solid var(--border); }
.highlight-label { font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; width: 92px; flex-shrink: 0; }
.highlight-body { font-size: 14px; line-height: 1.35; }
.highlight-body em { font-family: var(--serif); font-style: normal; }

.cover-strip { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.cover-strip .cover { width: 48px; }

/* --------------------------------------------------------------------------
   settings
   -------------------------------------------------------------------------- */

.settings-block { padding: 16px 0; border-top: 1px solid var(--border); }
.settings-block:first-of-type { border-top: none; padding-top: 0; }
.settings-block h3 { margin: 0 0 8px; font-size: 17px; }
.settings-block p { margin: 0 0 10px; }
.settings-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

.import-preview {
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  margin: 12px 0;
}
.import-preview h4 { margin: 0 0 6px; font-family: var(--sans); font-size: 14px; }
.import-preview ul { margin: 6px 0 0; padding-left: 18px; }
.import-preview .warn { color: var(--danger); margin-top: 8px; }

.session-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.session-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 14px; padding: 9px 11px;
  background: var(--bg-tint); border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* The "adds it to" mode switch above the search results. */
.add-target { display: grid; gap: 6px; margin: 4px 0 12px; }
.add-target .segmented { font-size: 13px; }
