/* Shadowlands theme.
   Edit the tokens in :root to retheme the whole site. Covenant colours (accent-*) mark sections. */
:root {
  --void: #07060d;
  --abyss: #0d0a18;
  --panel: #130f23;
  --raise: #1c1633;
  --line: rgba(201, 164, 92, .30);
  --line-soft: rgba(201, 164, 92, .14);
  --gold: #c9a45c;
  --gold-hi: #f0d58a;
  --text: #e7dec6;
  --muted: #a99f8c;

  --kyrian: #7fb7e6;
  --venthyr: #e0586b;
  --necrolord: #8cc76f;
  --nightfae: #ab92f2;

  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #3dff2a; --q-rare: #4aa3ff;
  --q-epic: #c577ff; --q-legendary: #ff8a1a; --q-artifact: #e6cc80; --q-currency: #f2d36b;

  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "Alegreya", Georgia, "Times New Roman", serif;
  --accent: var(--gold);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 400 1.075rem/1.6 var(--body); color: var(--text);
  background:
    radial-gradient(1100px 560px at 50% -8%, #2b1d54 0%, transparent 62%),
    radial-gradient(760px 480px at 100% 100%, #1b1031 0%, transparent 58%),
    var(--void);
}
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
a { color: var(--gold-hi); text-underline-offset: .2em; }
a:hover { color: #fff; }
code { font-size: .88em; color: var(--gold-hi); background: rgba(0,0,0,.35); padding: .05em .35em; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--gold-hi); line-height: 1.2; margin: 0 0 .5em; letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--gold); color: #000; padding: .4rem .8rem; z-index: 20; }
.skip:focus { left: .5rem; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem 1.25rem; background: rgba(8, 6, 16, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.6), 0 2px 0 var(--line-soft);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-sigil { width: 20px; height: 20px; transform: rotate(45deg); border: 2px solid var(--gold); background: radial-gradient(circle, var(--gold-hi) 0 22%, transparent 24%); }
.brand-name { font: 700 1.1rem var(--display); color: var(--gold-hi); letter-spacing: .06em; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { padding: .4rem .85rem; text-decoration: none; color: var(--text); font-family: var(--display); font-size: .88rem; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--gold-hi); }
.topbar nav a[aria-current] { color: var(--gold-hi); border-bottom-color: var(--gold); }

/* ---- panel: dark slab with a double gold keyline and a covenant-coloured top edge ---- */
.panel {
  position: relative; background: linear-gradient(180deg, var(--raise), var(--panel) 140px);
  border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 3px;
  padding: 1.1rem 1.3rem; margin-bottom: 1.1rem;
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--line-soft), 0 8px 24px rgba(0,0,0,.35);
}
.panel > :last-child { margin-bottom: 0; }
.panel.narrow { max-width: 640px; margin: 3rem auto; }
.accent-kyrian { --accent: var(--kyrian); }
.accent-venthyr { --accent: var(--venthyr); }
.accent-necrolord { --accent: var(--necrolord); }
.accent-nightfae { --accent: var(--nightfae); }

.page-head { margin: .5rem 0 1.4rem; max-width: 70ch; }
.page-head p { color: var(--muted); margin: 0; }

/* ---- home ---- */
.hero { position: relative; text-align: center; padding: 3.2rem 1rem 2.4rem; overflow: hidden; }
.hero h1 { position: relative; margin: 0; display: grid; gap: .4rem; }
.hero-name {
  font-size: clamp(2.6rem, 8vw, 5.2rem); font-weight: 900; letter-spacing: .05em;
  background: linear-gradient(180deg, #fff3c9 8%, var(--gold-hi) 40%, #a67c2e 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px rgba(171, 146, 242, .35));
  animation: rise 1.1s ease-out both;
}
.hero-sub { font: 500 clamp(1rem, 2.2vw, 1.35rem) var(--display); color: var(--nightfae); letter-spacing: .18em; }
.hero-lede { position: relative; max-width: 52ch; margin: 1.1rem auto 0; font-size: 1.2rem; color: var(--text); }
.hero-rune {
  position: absolute; left: 50%; top: 50%; width: min(620px, 120vw); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; opacity: .55;
  background: repeating-conic-gradient(var(--gold) 0 .6deg, transparent .6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 61.4% 63%, transparent 63.4%);
          mask: radial-gradient(circle, transparent 61%, #000 61.4% 63%, transparent 63.4%);
  animation: turn 180s linear infinite;
}
@keyframes turn { to { rotate: 360deg; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

.widgets { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: 1.1rem; }
.widget h2 { margin-bottom: .3rem; }
.road ol { list-style: none; display: flex; margin: 1rem 0 .6rem; padding: 0; overflow-x: auto; }
.road li { position: relative; flex: 1 0 118px; padding: 16px 8px 4px 0; border-top: 2px solid var(--line); display: grid; gap: .1rem; align-content: start; }
.road li::before { content: ""; position: absolute; top: -7px; left: 0; width: 11px; height: 11px; rotate: 45deg; background: var(--necrolord); }
.road li strong { font: 700 .88rem var(--display); color: var(--text); }
.road li span { color: var(--muted); font-size: .92rem; }
.road .more { font-family: var(--display); font-size: .85rem; }

.portals { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.portal { display: block; text-decoration: none; color: var(--text); background: linear-gradient(180deg, var(--raise), var(--panel)); border: 1px solid var(--line); padding: 1.4rem 1.5rem; border-radius: 3px; box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--line-soft); }
.portal:hover { border-color: var(--gold); color: var(--text); }
.portal h2 { font-size: 1.4rem; margin-bottom: .3rem; }
.portal p { margin: 0; color: var(--muted); }

/* ---- guide layout ---- */
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.6rem; align-items: start; }
.side { position: sticky; top: 4.2rem; max-height: calc(100vh - 5.2rem); overflow-y: auto; padding-right: .4rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-search input { width: 100%; padding: .55rem .75rem; margin-bottom: 1rem; background: var(--abyss); color: var(--text); border: 1px solid var(--line); border-radius: 3px; font: inherit; }
.side-group { margin-bottom: 1.1rem; }
.side-group h2 { font-size: .95rem; padding-left: .6rem; border-left: 3px solid var(--accent); color: var(--accent); margin-bottom: .35rem; }
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group a { display: block; padding: .28rem .6rem; font-size: .98rem; color: var(--text); text-decoration: none; border-radius: 2px; }
.side-group a:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-group a[aria-current] { background: rgba(201,164,92,.14); color: var(--gold-hi); box-shadow: inset 2px 0 0 var(--accent); }

.cat-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cat-grid .panel { margin: 0; }
.toc { margin: .6rem 0 0; padding-left: 1.2rem; }
.toc li { margin: .15rem 0; }

.crumb { margin: 0 0 .4rem; color: var(--muted); font-size: .95rem; }
.article-title { font-size: clamp(1.5rem, 3vw, 2.1rem); padding-bottom: .6rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.prose { max-width: 70ch; font-size: 1.12rem; line-height: 1.7; }
.prose p { margin: 0 0 1rem; }
.prose .label { margin: 1.5rem 0 .4rem; font: 700 1rem var(--display); color: var(--accent); }
.prose ul { margin: 0 0 1rem; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 1.3rem; margin: .3rem 0; }
.prose li::before { content: ""; position: absolute; left: .15rem; top: .68em; width: 7px; height: 7px; rotate: 45deg; background: var(--accent); }

.ref-icon { display: inline-block; width: .8em; height: .8em; margin: 0 .35em 0 .1em; vertical-align: -.05em; rotate: 45deg; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 30%, #000); cursor: help; }
img.ref-icon { width: 1.15em; height: 1.15em; rotate: 0; object-fit: cover; border-radius: 2px; vertical-align: -.2em; background: #000; }
.ref { font-weight: 500; cursor: help; white-space: normal; border-bottom: 1px dotted currentColor; }
.q-poor { color: var(--q-poor); } .q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); }
.q-rare { color: var(--q-rare); } .q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }
.q-artifact { color: var(--q-artifact); } .q-currency { color: var(--q-currency); }

.shot { margin: 1.2rem 0; width: fit-content; max-width: 100%; border: 1px solid var(--line); padding: 4px; background: #000; box-shadow: 0 0 0 1px var(--line-soft), 0 6px 18px rgba(0,0,0,.5); }
.shot img { display: block; max-width: min(100%, 460px); max-height: 420px; height: auto; width: auto; }
.shot-missing { width: min(100%, 460px, calc(420px * var(--ratio, 1))); aspect-ratio: var(--ratio, 1); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .9rem; background: repeating-linear-gradient(135deg, #0a0816 0 10px, #0e0b1c 10px 20px); border-style: dashed; }
.shot-missing figcaption { padding: .5rem; }

.refs { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.refs h2 { font-size: .98rem; color: var(--muted); }
.refs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.pager a { display: block; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; color: var(--text); background: var(--abyss); }
.pager a:hover { border-color: var(--gold); }
.pager small { display: block; color: var(--muted); font-size: .85rem; }
.pager .next { text-align: right; grid-column: 2; }
.updated { font-size: .88rem; margin: 1rem 0 0; }

.results { list-style: none; margin: 0; padding: 0; }
.results a { font: 700 1.05rem var(--display); }
.results p { margin: .3rem 0 0; color: var(--muted); }

/* ---- progress ---- */
.controls { border-top-color: var(--gold); }
.path-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.path-tab { text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: .7rem 1rem; background: var(--abyss); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 3px; display: grid; gap: .15rem; }
.path-tab strong { font: 700 1.05rem var(--display); color: var(--accent); }
.path-tab span { color: var(--muted); font-size: .95rem; }
.path-tab[aria-selected="true"] { background: var(--raise); border-color: var(--accent); box-shadow: 0 0 18px -6px var(--accent); }
.control-row { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: end; }
.ilvl { display: grid; gap: .25rem; font-size: .95rem; color: var(--muted); }
.ilvl input { width: 11rem; padding: .5rem .7rem; font: 600 1.1rem var(--body); color: var(--gold-hi); background: var(--abyss); border: 1px solid var(--line); border-radius: 3px; }
.meter { flex: 1 1 240px; display: grid; gap: .3rem; }
.meter-bar { height: 10px; background: var(--abyss); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6a28, var(--gold-hi)); transition: width .3s ease; }
#meter-text { font-size: .92rem; color: var(--muted); }
.btn { font: 600 .9rem var(--display); padding: .5rem 1rem; color: var(--gold-hi); background: transparent; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.btn:hover { border-color: var(--gold); background: rgba(201,164,92,.08); }

.progress-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.4rem; align-items: start; }
.next-card { border-top-color: var(--gold-hi); }
.next-card #next-text { font-size: 1.25rem; margin: 0 0 .3rem; color: #fff; }
.next-card #next-where { margin: 0; color: var(--muted); }
.rec-list, .tip-list, .plain { list-style: none; margin: 0; padding: 0; }
.rec-list li, .tip-list li, .plain li { padding: .45rem 0; border-top: 1px solid var(--line-soft); }
.rec-list li:first-child, .tip-list li:first-child, .plain li:first-child { border-top: 0; }
.band { display: inline-block; margin-right: .4rem; font: 700 .8rem var(--display); color: var(--gold-hi); }
.path-desc { color: var(--muted); font-style: italic; margin: .2rem 0 1rem; max-width: 70ch; }
.tier h3 small { font: 400 .9rem var(--body); color: var(--muted); margin-left: .6rem; }

.steps { list-style: none; margin: 0; padding: 0; }
.step { border-top: 1px solid var(--line-soft); }
.step:first-child { border-top: 0; }
.step label { display: grid; grid-template-columns: auto 1fr; gap: .75rem; padding: .55rem .4rem; cursor: pointer; align-items: start; }
.step input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick { width: 20px; height: 20px; margin-top: .15rem; border: 1px solid var(--gold); background: var(--abyss); rotate: 45deg; scale: .85; display: grid; place-items: center; }
.step input:checked + .tick { background: var(--gold); box-shadow: 0 0 10px rgba(240, 213, 138, .5); }
.step input:checked + .tick::after { content: ""; width: 7px; height: 4px; border-left: 2px solid #1a1200; border-bottom: 2px solid #1a1200; rotate: -45deg; translate: 0 -1px; }
.step input:focus-visible + .tick { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.step input:checked ~ .step-text { opacity: .55; }
.step.is-next label { background: linear-gradient(90deg, rgba(201,164,92,.16), transparent 70%); box-shadow: inset 3px 0 0 var(--gold-hi); }
.step-text { display: block; }
.step-text strong { color: #fff; }
.reward { font-size: .9rem; color: var(--gold-hi); }
.substeps { margin: 0 .4rem .6rem 2.4rem; color: var(--muted); }
.substeps summary { cursor: pointer; font: 700 .82rem var(--display); color: var(--gold-hi); }
.substeps ol { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.chapter-list { list-style: none; padding: 0; display: grid; gap: .2rem; }
.part { margin-left: .5rem; font-size: .88rem; color: var(--muted); }
.step-meta { display: flex; flex-wrap: wrap; gap: .3rem .6rem; margin-top: .2rem; align-items: center; }
.quest-id { font-size: .8rem; color: var(--muted); }
.req { font-size: .8rem; padding: .02rem .5rem; border: 1px solid var(--venthyr); color: #f3a0ab; border-radius: 2px; }
.tele { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .02rem .5rem; border: 1px solid var(--line); border-radius: 2px; color: var(--gold-hi); white-space: nowrap; }
.tele svg { width: 8px; height: 8px; fill: var(--gold); }
.steps.compact .step label { padding: .45rem .2rem; }
.materials li { display: grid; gap: .15rem; }
.col-side h2 { font-size: 1.05rem; }

.footer { border-top: 1px solid var(--line); padding: 1.2rem; text-align: center; color: var(--muted); font-size: .88rem; }
.footer p { margin: 0; }

@media (max-width: 880px) {
  .shell, .progress-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: 16rem; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-rune, .hero-name { animation: none; }
  .meter-bar i { transition: none; }
}

/* ---- forms, submit-a-change, review ---- */
.cta { text-align: center; margin: 2.4rem 0 0; }
.cta p { color: var(--muted); margin: 0 0 .8rem; }
.btn { text-decoration: none; display: inline-block; }
.btn.big { font-size: 1.05rem; padding: .7rem 1.8rem; border-color: var(--gold); box-shadow: 0 0 22px -8px var(--gold); }
.btn.primary { background: linear-gradient(180deg, #5a4318, #3a2a0e); border-color: var(--gold); color: var(--gold-hi); }
.btn.primary:hover { background: linear-gradient(180deg, #70531d, #46330f); }
.btn.danger { border-color: var(--venthyr); color: #f3a0ab; }
.btn.danger:hover { background: rgba(224, 88, 107, .12); border-color: var(--venthyr); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }

.form { max-width: 760px; }
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .3rem; font: 600 .9rem var(--display); color: var(--gold-hi); }
.field label small { font: 400 .85rem var(--body); color: var(--muted); }
.field input[type="text"], .field input[type="number"], .field input[type="password"], .field select, .field textarea {
  width: 100%; padding: .55rem .7rem; font: inherit; color: var(--text); background: var(--abyss);
  border: 1px solid var(--line); border-radius: 3px;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px rgba(201,164,92,.25); }
.help { margin: .3rem 0 0; font-size: .9rem; color: var(--muted); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--venthyr); }
.error { margin: .3rem 0 0; color: #f3a0ab; font-size: .95rem; }
.error.banner, .notice { padding: .6rem .9rem; border: 1px solid var(--venthyr); background: rgba(224,88,107,.1); border-radius: 3px; }
.notice.ok { border-color: var(--necrolord); background: rgba(140,199,111,.1); color: #c7e8b8; }
.notice.bad { color: #f3a0ab; }
.editing { margin: 0 0 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line-soft); }
.form hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.2rem 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.review-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; max-width: none; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem 1rem; text-decoration: none; color: var(--text); font-family: var(--display); font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--gold-hi); border-bottom-color: var(--gold); }
.tabs span { color: var(--muted); margin-left: .25rem; }
.review-card header h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.review-card header p { margin: 0; font-size: .92rem; }
.badge { display: inline-block; font: 700 .7rem var(--display); padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 2px; vertical-align: .1em; margin-right: .3rem; }
.badge.modify { color: var(--kyrian); border-color: var(--kyrian); }
.badge.add { color: var(--necrolord); border-color: var(--necrolord); }
.note { margin: .8rem 0; padding: .5rem .9rem; border-left: 3px solid var(--nightfae); background: rgba(171,146,242,.08); font-style: italic; }
.rv-row { padding: .7rem 0; border-top: 1px solid var(--line-soft); }
.rv-row h3 { margin-bottom: .4rem; color: var(--text); font-size: .92rem; }
.rv-row.changed h3::after { content: "changed"; margin-left: .6rem; font: 700 .65rem var(--display); color: var(--gold-hi); border: 1px solid var(--gold); padding: .05rem .4rem; border-radius: 2px; }
.rv-cols.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rv-current, .rv-proposed { min-width: 0; }
.rv-tag { display: block; margin-bottom: .25rem; font-size: .78rem; color: var(--muted); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: .5rem .7rem; background: var(--abyss); border: 1px solid var(--line-soft); border-radius: 3px; max-height: 24rem; overflow: auto; font-size: .98rem; }
.rv-proposed .field { margin: 0; }
@media (max-width: 880px) { .rv-cols.two { grid-template-columns: 1fr; } .review-head { flex-direction: column; } }

/* ---- search pop-up ---- */
.topbar nav .search-btn { display: inline-flex; align-items: center; padding: .4rem .55rem; margin-left: -.35rem; border-bottom: 2px solid transparent; }
.search-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.topbar nav .search-btn:hover { color: var(--gold-hi); }

.search-dialog { width: min(660px, 92vw); max-height: 78vh; margin: 11vh auto auto; padding: 0; color: var(--text);
  background: linear-gradient(180deg, var(--raise), var(--panel) 120px); border: 1px solid var(--gold); border-top: 2px solid var(--gold-hi); border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--line-soft), 0 20px 60px rgba(0,0,0,.7); overflow: hidden; }
.search-dialog::backdrop { background: rgba(5, 4, 12, .75); backdrop-filter: blur(2px); }
.search-dialog[open] { animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
.search-box { padding: 1.1rem 1.2rem 1rem; display: flex; flex-direction: column; max-height: 78vh; }
.search-form { display: flex; gap: .6rem; }
.search-form input { flex: 1; min-width: 0; padding: .7rem .9rem; font: 500 1.15rem var(--body); color: var(--gold-hi); background: var(--abyss); border: 1px solid var(--line); border-radius: 3px; }
.search-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,164,92,.25); }
.search-close { font: 600 .75rem var(--display); color: var(--muted); background: transparent; border: 1px solid var(--line-soft); border-radius: 3px; padding: 0 .7rem; cursor: pointer; }
.search-close:hover { color: var(--gold-hi); border-color: var(--line); }
.search-status { margin: .7rem 0 .4rem; font-size: .95rem; color: var(--muted); }
.search-results { list-style: none; margin: 0; padding: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.search-results li { border-top: 1px solid var(--line-soft); }
.search-results a { display: grid; gap: .1rem; padding: .6rem .5rem; text-decoration: none; color: var(--text); border-radius: 2px; }
.search-results a:hover, .search-results a:focus-visible { background: rgba(201,164,92,.1); outline: none; box-shadow: inset 3px 0 0 var(--gold); }
.sr-title { font: 700 1rem var(--display); color: var(--gold-hi); }
.sr-cat { font-size: .82rem; color: var(--muted); }
.sr-snippet { font-size: .96rem; color: var(--text); overflow-wrap: anywhere; }
.search-results mark { background: rgba(240, 213, 138, .26); color: #fff; padding: 0 .1em; border-radius: 2px; }
.sr-more a { font-family: var(--display); font-size: .85rem; color: var(--gold-hi); }
@media (prefers-reduced-motion: reduce) { .search-dialog[open] { animation: none; } }
