/* ================================================================ tokens */
:root {
  /* warm parchment, espresso ink, antique gold */
  --bg:            #efeae0;
  --bg-2:          #f8f5ee;
  --panel:         #fdfbf6;
  --ink:           #1b1712;
  --ink-2:         #5a5146;
  --ink-3:         #948a7c;
  --line:          #e0d8c8;
  --line-2:        #cec2ab;
  --gold:          #9a7a38;
  --gold-soft:     #d8c48c;
  --accent:        #7a2f26;
  --accent-soft:   #efe3dd;
  --seal-ink:      #fdfbf6;

  --shadow-sm:  0 1px 1px rgba(58,44,24,.05), 0 2px 4px rgba(58,44,24,.05);
  --shadow:     0 1px 2px rgba(58,44,24,.06), 0 6px 16px rgba(58,44,24,.07), 0 18px 40px rgba(58,44,24,.05);
  --shadow-lift:0 2px 4px rgba(58,44,24,.08), 0 12px 28px rgba(58,44,24,.13), 0 32px 64px rgba(58,44,24,.11);

  --radius:  11px;
  --radius-sm: 7px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  /* book-jacket depth */
  --sat: 31%;
  --lum: 29%;

  --noise-op: .035;
}

[data-theme="dark"] {
  --bg:            #100e0b;
  --bg-2:          #171410;
  --panel:         #1a1713;
  --ink:           #f0e9dc;
  --ink-2:         #a79d8d;
  --ink-3:         #7a7164;
  --line:          #2a251e;
  --line-2:        #3b342a;
  --gold:          #c9a25a;
  --gold-soft:     #7a6335;
  --accent:        #d9906f;
  --accent-soft:   #2c211b;
  --seal-ink:      #17130e;

  --shadow-sm:  0 1px 1px rgba(0,0,0,.5);
  --shadow:     0 1px 2px rgba(0,0,0,.5), 0 6px 16px rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.35);
  --shadow-lift:0 2px 4px rgba(0,0,0,.6), 0 12px 28px rgba(0,0,0,.55), 0 32px 64px rgba(0,0,0,.5);

  --sat: 28%;
  --lum: 26%;
  --noise-op: .05;
}

* { box-sizing: border-box; }

/* Class-level `display` rules below would otherwise beat the UA stylesheet. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* fine linen grain over everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--noise-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

::selection { background: var(--gold-soft); color: var(--ink); }

/* gold hairline used all over */
.flourish {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 18px auto; max-width: 320px; color: var(--gold);
}
.flourish span {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 30%, var(--gold) 100%);
}
.flourish span:last-of-type { background: linear-gradient(270deg, transparent, var(--gold-soft) 30%, var(--gold) 100%); }
.flourish i { font-style: normal; font-size: 13px; opacity: .9; }
.flourish.sm { max-width: 200px; margin: 0 auto 20px; }

/* =============================================================== topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); opacity: .55;
}
.topbar-inner {
  max-width: 1380px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 11px 28px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; flex-shrink: 0; }
.monogram {
  width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 19px; line-height: 1; padding-bottom: 2px;
  color: var(--gold);
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 16%, var(--panel)), var(--panel));
  border: 1px solid var(--gold-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), var(--shadow-sm);
}
[data-theme="dark"] .monogram { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--shadow-sm); }
.brand-text {
  font-family: var(--serif); font-size: 17px; font-weight: 600;
  letter-spacing: .005em; white-space: nowrap;
}
.brand-text em { font-style: italic; font-weight: 400; color: var(--ink-2); }

.search-wrap { position: relative; flex: 1; max-width: 600px; }
.search-wrap .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
#search {
  width: 100%; padding: 9px 62px 9px 39px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 999px;
  outline: none; font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(58,44,24,.05);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
[data-theme="dark"] #search { box-shadow: inset 0 1px 2px rgba(0,0,0,.35); }
#search::placeholder { color: var(--ink-3); }
#search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent);
}
#search::-webkit-search-cancel-button { display: none; }
.clear-search {
  position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  padding: 3px 6px; border-radius: 50%; font-size: 11px;
}
.clear-search:hover { background: var(--line); color: var(--ink); }
.slash-hint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--sans); font-size: 10.5px; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px;
  pointer-events: none;
}
#search:focus ~ .slash-hint { opacity: 0; }

.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line-2);
  text-decoration: none; color: var(--ink); font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, background .18s, transform .1s, color .18s;
  white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--gold); color: var(--ink); }
.ghost-btn:active { transform: scale(.975); }
.ghost-btn.is-on {
  background: linear-gradient(170deg, color-mix(in srgb, var(--gold) 22%, var(--panel)), var(--panel));
  border-color: var(--gold); color: var(--ink);
}
.icon-only { padding: 7px 11px; font-size: 14px; }

.ribbon-ico {
  width: 9px; height: 13px; display: inline-block;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.count-pill {
  background: var(--line); color: var(--ink-2);
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  min-width: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.ghost-btn.is-on .count-pill { background: var(--gold); color: var(--seal-ink); }

/* ============================================================= masthead */
.masthead {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto; padding: 52px 28px 8px; text-align: center;
}
.eyebrow {
  margin: 0; font-size: 10px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
}
.wordmark {
  margin: 14px 0 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 6.4vw, 62px); line-height: 1.02; letter-spacing: -.022em;
}
.masthead-sub {
  margin: 0 auto; max-width: 60ch; color: var(--ink-2); font-size: 14.5px; line-height: 1.7;
}
.masthead-sub b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* =============================================================== layout */
.layout {
  position: relative; z-index: 2;
  max-width: 1380px; margin: 0 auto; padding: 34px 28px 72px;
  display: grid; grid-template-columns: 262px 1fr; gap: 38px;
  align-items: start;
}

.sidebar { position: sticky; top: 82px; display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 16px; box-shadow: var(--shadow);
  position: relative;
}
.panel::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
[data-theme="dark"] .panel::before { box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }

.panel-title {
  margin: 0 0 13px; font-size: 10px; font-weight: 700;
  letter-spacing: .19em; text-transform: uppercase; color: var(--gold);
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}

.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.cat-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border: 0; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font-size: 13.5px;
  transition: background .14s, color .14s;
}
.cat-btn:hover { background: var(--bg); }
.cat-btn.is-on {
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 15%, transparent), transparent);
  color: var(--ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--gold);
}
.cat-btn .cat-icon { font-size: 14px; width: 19px; text-align: center; flex-shrink: 0; opacity: .9; }
.cat-btn .cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-btn .cat-n {
  font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  font-family: var(--serif);
}
.cat-btn.is-on .cat-n { color: var(--gold); }

.filter-group { margin-bottom: 17px; }
.filter-group:last-of-type { margin-bottom: 15px; }
.filter-label {
  display: block; font-size: 10px; font-weight: 700; color: var(--ink-3);
  letter-spacing: .13em; text-transform: uppercase; margin-bottom: 8px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); font-size: 12.5px;
  transition: all .14s;
}
.chip:hover { border-color: var(--gold); }
.chip.is-on {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

.select {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line-2); cursor: pointer; font-size: 13.5px;
}
.select:focus { outline: none; border-color: var(--gold); }
.reset-btn {
  width: 100%; padding: 7px; border: 0; background: transparent;
  color: var(--ink-3); cursor: pointer; font-size: 12.5px; border-radius: var(--radius-sm);
  letter-spacing: .02em;
}
.reset-btn:hover { color: var(--accent); background: var(--bg); }

.dice-panel { text-align: center; }
.dice-mark { color: var(--gold); font-size: 15px; display: block; margin-bottom: 6px; }
.dice-panel .panel-title { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; }
.dice-copy { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.primary-btn {
  width: 100%; padding: 9px 16px; border: 1px solid var(--ink); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  box-shadow: var(--shadow-sm);
  transition: filter .18s, transform .1s;
}
.primary-btn:hover { filter: brightness(1.22); }
.primary-btn:active { transform: scale(.985); }

/* ============================================================== content */
.content-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line);
}
.content-head h2 {
  margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -.018em;
}
.view-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; max-width: 64ch; }
.result-count {
  color: var(--ink-3); font-size: 11px; white-space: nowrap; padding-bottom: 5px;
  letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
}

.active-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.active-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); color: var(--ink-2);
  border: 1px solid var(--line-2); padding: 3px 9px 3px 11px;
  border-radius: 999px; font-size: 12px; cursor: pointer;
}
.active-tag:hover { border-color: var(--accent); color: var(--accent); }
.active-tag b { font-weight: 600; color: var(--gold); }
.active-tag span { opacity: .55; font-size: 10px; }

.grid {
  margin-top: 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 22px;
}

/* ================================================================ cards */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.75,.3,1), box-shadow .22s, border-color .22s;
  animation: rise .4s cubic-bezier(.2,.8,.3,1) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }

/* --- the jacket --- */
.cover {
  position: relative; min-height: 186px; padding: 15px 15px 15px 22px; display: flex;
  background:
    radial-gradient(125% 95% at 12% 0%, rgba(255,255,255,.17), transparent 62%),
    linear-gradient(158deg,
      hsl(var(--h) var(--sat) var(--lum)),
      hsl(calc(var(--h) - 20) calc(var(--sat) - 7%) calc(var(--lum) - 11%)));
  color: #fff;
}
.cover::before { /* spine */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 13px; z-index: 1;
  background:
    linear-gradient(90deg, rgba(0,0,0,.42) 0 3px, rgba(255,255,255,.10) 4px 5px, rgba(0,0,0,.22) 6px, transparent);
}
.cover::after { /* woven cloth + vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.045) 2px 3px),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.05) 2px 3px),
    radial-gradient(120% 100% at 50% 40%, transparent 45%, rgba(0,0,0,.3));
}

.cover-frame {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 15px 15px 14px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16), 0 1px 0 rgba(255,255,255,.06);
}
.cover-cat {
  font-size: 9px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase;
  color: rgba(255,255,255,.72); margin-bottom: 9px;
}
.cover h3 {
  margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 500;
  line-height: 1.24; letter-spacing: -.008em;
  color: #fdf6e6;
  text-shadow: 0 1px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,240,200,.14);
}
.cover .hair {
  height: 1px; margin: 10px 0 8px; width: 34px;
  background: linear-gradient(90deg, rgba(255,255,255,.7), rgba(255,255,255,0));
}
.cover .author {
  margin: 0; font-size: 12px; letter-spacing: .04em; color: rgba(255,255,255,.82);
  font-style: italic; font-family: var(--serif);
}

/* foil-stamped seal */
.seal {
  position: absolute; top: 13px; right: 13px; z-index: 3;
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  color: #241c0c;
  background: linear-gradient(155deg, #f2e0ac, #cba75f 45%, #9b7833 78%, #e0c98f);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 1px 1px rgba(255,255,255,.6);
}

.save-btn {
  position: absolute; top: 0; left: 26px; z-index: 4;
  width: 22px; height: 30px; cursor: pointer; border: 0; padding: 0;
  background: rgba(255,255,255,.18);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
  color: #fff; font-size: 10px; line-height: 1;
  display: grid; place-items: start center; padding-top: 4px;
  opacity: 0; transition: opacity .18s, background .18s, height .18s;
}
.card:hover .save-btn { opacity: 1; }
.save-btn:hover { background: rgba(255,255,255,.34); }
.save-btn.is-on {
  opacity: 1; height: 36px; color: transparent;
  background: linear-gradient(180deg, #e6c883, #b3893c);
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
}

.card-body { padding: 15px 17px 17px; display: flex; flex-direction: column; flex: 1; gap: 11px; }
.blurb { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.58; }
.card-meta {
  margin-top: auto; display: flex; align-items: center; gap: 9px;
  font-size: 10.5px; color: var(--ink-3); padding-top: 10px;
  letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  border-top: 1px solid var(--line);
}
.card-meta .dot { opacity: .45; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer;
  transition: border-color .14s, color .14s;
}
.tag:hover { border-color: var(--gold); color: var(--gold); }

/* ================================================================ empty */
.empty { text-align: center; padding: 86px 20px; color: var(--ink-2); }
.empty-mark { font-size: 26px; display: block; margin-bottom: 12px; color: var(--gold); }
.empty h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 23px; color: var(--ink); }
.empty p { margin: 0 0 20px; }
.empty .primary-btn { width: auto; padding: 9px 24px; }

/* ================================================================ modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 28px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(14,10,4,.62); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(680px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lift);
  border: 1px solid var(--line-2);
  animation: pop .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal-close {
  position: absolute; top: 15px; right: 15px; z-index: 5;
  width: 31px; height: 31px; border-radius: 50%; cursor: pointer; font-size: 12px;
  border: 1px solid rgba(255,255,255,.32); background: rgba(0,0,0,.34); color: #fff;
  backdrop-filter: blur(4px);
}
.modal-close:hover { background: rgba(0,0,0,.5); }

.modal-cover {
  padding: 30px 30px 28px 34px; color: #fff; position: relative;
  background:
    radial-gradient(120% 95% at 12% 0%, rgba(255,255,255,.17), transparent 62%),
    linear-gradient(158deg,
      hsl(var(--h) var(--sat) var(--lum)),
      hsl(calc(var(--h) - 20) calc(var(--sat) - 7%) calc(var(--lum) - 11%)));
}
.modal-cover::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 16px;
  background: linear-gradient(90deg, rgba(0,0,0,.42) 0 4px, rgba(255,255,255,.10) 5px 6px, rgba(0,0,0,.2) 7px, transparent);
}
.modal-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.04) 2px 3px),
    radial-gradient(120% 100% at 50% 35%, transparent 48%, rgba(0,0,0,.28));
}
.modal-cover .inner-frame {
  position: relative; z-index: 2;
  border: 1px solid rgba(255,255,255,.26); border-radius: 3px; padding: 20px 22px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
}
.modal-cover h2 {
  margin: 10px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 500;
  line-height: 1.16; color: #fdf6e6; text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.modal-cover .author {
  margin: 10px 0 0; font-size: 13.5px; font-family: var(--serif); font-style: italic;
  color: rgba(255,255,255,.85);
}
.modal-cover .hair { height: 1px; margin: 12px 0 0; width: 44px; background: linear-gradient(90deg, rgba(255,255,255,.7), transparent); }

.modal-inner { padding: 24px 32px 30px; }
.stat-row {
  display: flex; gap: 26px; padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--serif); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.stat.mark b { color: var(--gold); }

.modal-section { margin-bottom: 20px; }
.modal-section h4 {
  margin: 0 0 7px; font-size: 10px; letter-spacing: .19em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.modal-section p { margin: 0; font-size: 15px; line-height: 1.68; color: var(--ink); font-family: var(--serif); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.modal-actions .ghost-btn, .modal-actions .primary-btn { width: auto; flex: none; }

.similar { display: flex; flex-direction: column; gap: 7px; }
.similar-item {
  display: flex; align-items: baseline; gap: 9px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%;
  transition: border-color .14s, transform .14s;
}
.similar-item:hover { border-color: var(--gold); transform: translateX(2px); }
.similar-item b { font-weight: 600; font-size: 13.5px; font-family: var(--serif); }
.similar-item span { font-size: 11.5px; color: var(--ink-3); }

/* =============================================================== footer */
.footer {
  position: relative; z-index: 2;
  max-width: 760px; margin: 0 auto; padding: 26px 28px 60px;
  color: var(--ink-3); font-size: 12.5px; line-height: 1.72; text-align: center;
  border-top: 1px solid var(--line);
}
.footer p { margin: 0 0 10px; }
.footer strong { color: var(--ink-2); }
.footer em { color: var(--gold); font-style: italic; }
.footer-meta { font-size: 11px; letter-spacing: .05em; }
.footer code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* ================================================================ toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: var(--bg); padding: 10px 20px; border-radius: 999px;
  font-size: 12.5px; letter-spacing: .03em; box-shadow: var(--shadow-lift);
  border: 1px solid var(--gold-soft);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s; z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================== responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { position: static; }
  .cat-list { flex-direction: row; flex-wrap: wrap; }
  .cat-btn { width: auto; border: 1px solid var(--line-2); }
  .cat-btn.is-on { box-shadow: inset 0 0 0 1px var(--gold); border-color: var(--gold); }
  .cat-btn .cat-n { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 18px; gap: 10px; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .slash-hint { display: none; }
  .masthead { padding: 34px 20px 0; }
  .layout { padding: 24px 18px 52px; }
  .content-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .grid { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: end; }
  .modal-card { max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-inner { padding: 22px 22px 26px; }
  .modal-cover { padding: 24px 22px 24px 26px; }
}

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