/* ==========================================================================
   交界地手记 · 主样式
   纯 CSS，无外部字体 / 图片依赖。深色魂系、金色微光、移动端优先响应式。
   ========================================================================== */

:root {
  --bg: #080a09;
  --bg-deep: #050706;
  --bg-soft: #0d110e;
  --panel: #111611;
  --panel-2: #151b15;
  --panel-3: #1b221b;
  --line: #2a3026;
  --line-soft: #20261f;
  --line-gold: rgba(200, 168, 105, 0.32);
  --gold: #c8a869;
  --gold-bright: #e7cf9a;
  --gold-dim: #806b46;
  --text: #e9e4d7;
  --text-soft: #c8c2b0;
  --muted: #918f82;
  --muted-2: #6e7067;
  --green: #8ea88e;
  --danger: #b9695d;
  --danger-soft: #d18b7d;
  --blue: #8dafb6;
  --violet: #aaa6c7;
  --radius: 3px;
  --radius-lg: 6px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar: 272px;
  --topbar: 70px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #3a3d31 #0a0d0a; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 84% -10%, rgba(91, 77, 44, 0.17), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(39, 58, 43, 0.18), transparent 60%),
    linear-gradient(145deg, #080a09 0%, #090c0a 52%, #060807 100%);
  background-attachment: fixed;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; letter-spacing: .045em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: #f4e4bc; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(200, 168, 105, 0.28); color: #fff8e7; }
:focus-visible { outline: 1px solid var(--gold-bright); outline-offset: 3px; }
[hidden] { display: none !important; }

/* 细微纸纹与暗角：全部用 CSS 渐变，避免额外网络资源 */
.page-grain,
.page-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 88;
}
.page-grain {
  opacity: .24;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255,255,255,.012) 3px, rgba(255,255,255,.012) 4px),
    repeating-linear-gradient(90deg, transparent 0, transparent 5px, rgba(0,0,0,.08) 5px, rgba(0,0,0,.08) 6px);
  mix-blend-mode: soft-light;
}
.page-vignette {
  z-index: 89;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.46) 100%);
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--gold);
  color: #10140f;
  border-radius: var(--radius);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: #10140f; }

/* ---------- shell / sidebar ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  border-right: 1px solid var(--line-soft);
  background:
    linear-gradient(180deg, rgba(15, 20, 15, .96), rgba(7, 10, 8, .98)),
    radial-gradient(400px 300px at 50% 0%, rgba(200,168,105,.1), transparent);
  z-index: 50;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 8px 22px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__sigil {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(200,168,105,.18));
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: .16em;
  font-weight: 600;
  white-space: nowrap;
}
.brand__text small {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .19em;
}
.nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 2px 14px;
  scrollbar-width: thin;
  scrollbar-color: #343a2e transparent;
}
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: #343a2e; }
.nav__group { margin-bottom: 18px; }
.nav__label {
  padding: 0 12px;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 13.5px;
  letter-spacing: .025em;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav__link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: transparent;
  transition: background .18s var(--ease);
}
.nav__link:hover {
  color: var(--gold-bright);
  background: rgba(200,168,105,.055);
  border-color: rgba(200,168,105,.1);
}
.nav__link.is-active {
  color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(200,168,105,.13), rgba(200,168,105,.025));
  border-color: rgba(200,168,105,.18);
}
.nav__link.is-active::before { background: var(--gold); }
.nav__index {
  width: 18px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .05em;
}
.nav__link.is-active .nav__index { color: var(--gold); }
.sidebar__foot {
  flex: 0 0 auto;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 11px;
}
.sidebar__foot p { margin-top: 8px; }
.sidebar__disclaimer { line-height: 1.55; font-size: 10px; color: #5f6259; }
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(142,168,142,.55);
  vertical-align: middle;
}
.install-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(200,168,105,.27);
  border-radius: var(--radius);
  color: var(--gold-bright);
  background: rgba(200,168,105,.06);
  font-size: 12px;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.install-mini:hover { background: rgba(200,168,105,.12); border-color: rgba(200,168,105,.5); }
.install-mini__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
}
.install-mini span:nth-child(2) { flex: 1; text-align: left; }
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(3,5,4,.72);
  backdrop-filter: blur(2px);
}

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar);
  padding: 0 clamp(18px, 3.4vw, 42px);
  border-bottom: 1px solid rgba(42,48,38,.72);
  background: rgba(8, 11, 9, .79);
  backdrop-filter: blur(16px) saturate(125%);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.crumbs strong {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-overflow: ellipsis;
}
.crumbs__slash { color: var(--gold-dim); }
.offline-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .13em;
}
.icon-btn.menu-btn { display: none; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  transition: border-color .18s, color .18s, background .18s;
}
.icon-btn:hover { border-color: var(--line-gold); color: var(--gold-bright); background: rgba(200,168,105,.05); }
.menu-btn { flex-direction: column; gap: 4px; }
.menu-btn span { width: 16px; height: 1px; background: currentColor; transition: transform .2s var(--ease), opacity .2s; }
.menu-btn.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.main {
  flex: 1;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(18px, 3.4vw, 46px) 0;
  min-height: calc(100dvh - var(--topbar));
  outline: none;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(50px, 8vw, 96px);
  padding: 22px 0 32px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.7;
}
.site-footer p:last-child { max-width: 720px; text-align: right; }

/* ---------- typography / shared ---------- */
.eyebrow {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .24em;
  line-height: 1.5;
  text-transform: uppercase;
}
.page {
  animation: page-in .4s var(--ease) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 6px 0 clamp(24px, 3vw, 34px);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: clamp(22px, 3vw, 32px);
}
.page-head__copy { max-width: 760px; }
.page-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.15;
}
.page-head__lead { max-width: 660px; color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.page-head__aside { flex: 0 0 auto; text-align: right; }
.page-head__aside .page-count {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
}
.page-head__aside p { color: var(--muted-2); font-size: 11px; margin-top: 4px; }
.divider { height: 1px; background: linear-gradient(90deg, var(--line-gold), transparent); border: 0; }
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(21, 27, 21, .92), rgba(11, 15, 12, .96));
  box-shadow: var(--shadow);
}
.panel--flush { box-shadow: none; }
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.panel__head h2, .panel__head h3 { font-size: 18px; }
.panel__head p { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.panel__body { padding: 20px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 38px 0 16px;
}
.section-head h2 { font-size: clamp(21px, 2.3vw, 28px); font-weight: 500; }
.section-head p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.section-head__link { flex: 0 0 auto; color: var(--gold); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; }
.section-head__link:hover { color: var(--gold-bright); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 11.5px; }
.mono { font-family: var(--font-mono); }
.gold { color: var(--gold); }
.danger { color: var(--danger-soft); }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.stack { display: grid; gap: 14px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

/* ---------- buttons / chips / forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12.5px;
  letter-spacing: .04em;
  line-height: 1.2;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--gold {
  color: #10140e;
  background: linear-gradient(180deg, #d9bd82, #b69557);
  border-color: #e5cf9d;
  box-shadow: 0 6px 22px rgba(200,168,105,.14);
  font-weight: 600;
}
.btn--gold:hover { color: #070907; background: linear-gradient(180deg, #ebd39b, #c4a263); }
.btn--ghost { color: var(--text-soft); background: transparent; border-color: var(--line); }
.btn--ghost:hover { color: var(--gold-bright); border-color: var(--line-gold); background: rgba(200,168,105,.05); }
.btn--outline { color: var(--gold-bright); background: rgba(200,168,105,.045); border-color: rgba(200,168,105,.32); }
.btn--outline:hover { background: rgba(200,168,105,.1); border-color: rgba(200,168,105,.55); }
.btn--danger { color: var(--danger-soft); background: rgba(185,105,93,.07); border-color: rgba(185,105,93,.3); }
.btn--danger:hover { background: rgba(185,105,93,.13); }
.btn--small { min-height: 34px; padding: 6px 12px; font-size: 11px; }
.btn[disabled], .btn.is-disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255,255,255,.012);
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .03em;
  line-height: 1.3;
  transition: border-color .16s, color .16s, background .16s;
}
button.chip:hover { color: var(--text); border-color: var(--line-gold); }
.chip.is-active { color: var(--gold-bright); border-color: rgba(200,168,105,.42); background: rgba(200,168,105,.1); }
.chip--static { cursor: default; }
.chip__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(200,168,105,.18);
  border-radius: 2px;
  background: rgba(200,168,105,.04);
  color: #aaa184;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .05em;
}
.tag--danger { color: var(--danger-soft); border-color: rgba(185,105,93,.22); background: rgba(185,105,93,.05); }
.tag--green { color: var(--green); border-color: rgba(142,168,142,.22); background: rgba(142,168,142,.05); }
.field { display: grid; gap: 7px; }
.field > label, .field-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: rgba(5, 8, 6, .58);
  color: var(--text);
  font-size: 13px;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.input::placeholder, .textarea::placeholder { color: #5f645a; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(200,168,105,.55);
  background: rgba(9, 13, 9, .85);
  box-shadow: 0 0 0 3px rgba(200,168,105,.07);
}
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 15px) 19px, calc(100% - 10px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.75; }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 36px; }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-65%);
  pointer-events: none;
}
.search-wrap::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 5px;
  height: 1px;
  background: var(--muted);
  transform: rotate(45deg) translateY(3px);
  pointer-events: none;
}

/* ---------- states / feedback ---------- */
.boot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 54vh;
  text-align: center;
  padding: 40px 20px;
}
.boot-card h1 { margin: 12px 0 8px; font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
.boot-card > p { color: var(--muted); font-size: 12px; }
.boot-hint { margin-top: 18px; color: var(--muted-2) !important; font-size: 10.5px !important; }
.boot-sigil { position: relative; width: 64px; height: 64px; margin-bottom: 18px; }
.boot-sigil span { position: absolute; inset: 0; border: 1px solid rgba(200,168,105,.4); border-radius: 50%; }
.boot-sigil span:nth-child(1) { animation: sigil-spin 9s linear infinite; border-style: dashed; }
.boot-sigil span:nth-child(2) { inset: 10px; border-color: rgba(200,168,105,.65); animation: sigil-spin 6s linear infinite reverse; }
.boot-sigil span:nth-child(3) { inset: 25px; background: var(--gold); border: 0; box-shadow: 0 0 20px var(--gold); animation: sigil-pulse 2s ease-in-out infinite; }
@keyframes sigil-spin { to { transform: rotate(360deg); } }
@keyframes sigil-pulse { 50% { opacity: .45; } }
.state-panel {
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(21,27,21,.95), rgba(10,14,11,.98));
  text-align: left;
}
.state-panel h1, .state-panel h2 { margin: 8px 0 10px; font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
.state-panel > p { max-width: 650px; color: var(--muted); font-size: 13px; }
.state-panel--error { border-color: rgba(185,105,93,.3); }
.state-panel--error .eyebrow { color: var(--danger-soft); }
.state-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.state-hint { margin-top: 18px; color: var(--muted-2); font-size: 10.5px; }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; margin-bottom: 7px; color: var(--text-soft); font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.empty-state p { max-width: 440px; font-size: 12px; }
.empty-state .btn { margin-top: 18px; }
.notice {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(200,168,105,.2);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(200,168,105,.045);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.75;
}
.notice--danger { border-color: rgba(185,105,93,.26); border-left-color: var(--danger); background: rgba(185,105,93,.05); }
.notice--danger strong { color: var(--danger-soft); }
.notice__mark { color: var(--gold); font-family: var(--font-serif); font-size: 17px; line-height: 1.3; }
.notice--danger .notice__mark { color: var(--danger-soft); }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.info-tile { padding: 15px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(0,0,0,.12); }
.info-tile span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .13em; }
.info-tile strong { display: block; margin-top: 4px; color: var(--text-soft); font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.meter { height: 4px; background: #1d231b; border-radius: 99px; overflow: hidden; }
.meter__fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); border-radius: inherit; transition: width .35s var(--ease); }
.meter--danger .meter__fill { background: linear-gradient(90deg, #754237, var(--danger)); }
.relative { position: relative; }
.divider-dot { color: var(--muted-2); }

/* ---------- modal / toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 5, 4, .78);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86dvh, 900px);
  overflow: auto;
  border: 1px solid rgba(200,168,105,.26);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #141a14, #0b0f0c 70%);
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
  transform: translateY(12px) scale(.99);
  opacity: 0;
  transition: transform .24s var(--ease), opacity .24s var(--ease);
  scrollbar-width: thin;
  scrollbar-color: #3a3d31 transparent;
}
.modal-backdrop.is-open .modal { transform: none; opacity: 1; }
.modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(17, 22, 17, .96);
  backdrop-filter: blur(10px);
}
.modal__head h2 { margin-top: 4px; font-size: clamp(22px, 3vw, 30px); font-weight: 500; }
.modal__eyebrow { color: var(--gold); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; }
.modal__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: color .16s, border-color .16s;
}
.modal__close:hover { color: var(--gold-bright); border-color: var(--line-gold); }
.modal__body { padding: 22px 24px 26px; }
.modal__body p { color: var(--text-soft); font-size: 13px; line-height: 1.85; margin-bottom: 12px; }
.modal__body p:last-child { margin-bottom: 0; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid rgba(200,168,105,.3);
  border-radius: var(--radius);
  background: rgba(19, 24, 18, .97);
  color: var(--text-soft);
  box-shadow: 0 14px 40px rgba(0,0,0,.4);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in .25s var(--ease);
  pointer-events: auto;
}
.toast--error { border-color: rgba(185,105,93,.4); color: var(--danger-soft); }
.toast--success { border-color: rgba(142,168,142,.4); }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.noscript-note {
  position: fixed;
  inset: 20px;
  z-index: 300;
  padding: 32px;
  border: 1px solid var(--gold-dim);
  background: var(--bg-soft);
}
.noscript-note h2 { margin-bottom: 10px; }

/* ---------- home ---------- */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, .68fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: min(640px, 72vh);
  padding: clamp(34px, 5vw, 68px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(620px 460px at 80% 38%, rgba(200,168,105,.095), transparent 65%),
    radial-gradient(500px 500px at 100% 110%, rgba(69, 86, 62, .14), transparent 60%),
    linear-gradient(140deg, rgba(20,26,20,.95), rgba(8,12,9,.98));
  box-shadow: var(--shadow);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(200,168,105,.08);
  pointer-events: none;
}
.home-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -130px;
  width: 480px;
  height: 480px;
  border: 1px solid rgba(200,168,105,.08);
  border-radius: 50%;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 720px; }
.hero-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(44px, 6.8vw, 92px);
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.03;
  text-shadow: 0 5px 34px rgba(0,0,0,.4);
}
.hero-copy h1 span { display: block; }
.hero-copy h1 em {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.2vw, 14px);
  font-style: normal;
  letter-spacing: .34em;
  line-height: 1.4;
}
.hero-copy > p {
  max-width: 600px;
  margin-top: 24px;
  color: var(--text-soft);
  font-size: clamp(13px, 1.3vw, 15px);
  line-height: 2;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.hero-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
}
.hero-note .status-dot { box-shadow: 0 0 7px rgba(142,168,142,.4); }
.hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.hero-rune {
  width: min(100%, 380px);
  color: var(--gold);
  opacity: .92;
  filter: drop-shadow(0 0 34px rgba(200,168,105,.16));
}
.hero-rune__ring { transform-origin: 200px 200px; animation: slow-spin 52s linear infinite; }
.hero-rune__ring--reverse { animation-direction: reverse; animation-duration: 74s; }
.hero-rune__mote { animation: mote 5s ease-in-out infinite; }
.hero-rune__mote:nth-of-type(2) { animation-delay: 1.2s; }
.hero-rune__mote:nth-of-type(3) { animation-delay: 2.5s; }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes mote { 50% { opacity: .25; } }
.hero-oath {
  position: absolute;
  left: 0;
  bottom: -48px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .2em;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}
.home-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  background: var(--line-soft);
}
.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  padding: 16px 18px;
  background: rgba(10, 14, 10, .82);
}
.metric span { color: var(--muted-2); font-size: 10.5px; letter-spacing: .05em; }
.metric strong { color: var(--gold-bright); font-family: var(--font-serif); font-size: 25px; font-weight: 500; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(22,28,22,.86), rgba(9,13,10,.92));
  color: var(--text);
  transition: transform .22s var(--ease), border-color .22s, background .22s;
}
.feature-card::after {
  content: attr(data-index);
  position: absolute;
  right: 13px;
  top: 8px;
  color: rgba(200,168,105,.09);
  font-family: var(--font-serif);
  font-size: 54px;
  line-height: 1;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-gold);
  color: var(--text);
  background: linear-gradient(155deg, rgba(28,35,27,.9), rgba(11,15,12,.94));
}
.feature-card__kicker { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .15em; }
.feature-card h3 { position: relative; z-index: 1; margin: 13px 0 8px; font-size: 19px; font-weight: 500; }
.feature-card p { position: relative; z-index: 1; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.feature-card__arrow { margin-top: auto; padding-top: 15px; color: var(--gold); font-family: var(--font-mono); font-size: 10px; }
.home-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 14px; margin-top: 38px; }
.stage-callout {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(420px 260px at 92% 20%, rgba(200,168,105,.09), transparent 65%), linear-gradient(140deg, rgba(21,28,21,.9), rgba(9,13,10,.96));
}
.stage-callout__body { position: relative; z-index: 1; max-width: 580px; }
.stage-callout h2 { margin: 9px 0 10px; font-size: clamp(24px, 3vw, 34px); font-weight: 500; }
.stage-callout p { color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.stage-callout .btn { margin-top: 20px; }
.stage-callout__num {
  position: absolute;
  right: 22px;
  bottom: -28px;
  color: rgba(200,168,105,.055);
  font-family: var(--font-serif);
  font-size: 160px;
  line-height: 1;
}
.quote-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(10,14,10,.55);
}
.quote-card blockquote { font-family: var(--font-serif); font-size: 20px; line-height: 1.8; color: var(--text-soft); }
.quote-card cite { display: block; margin-top: 18px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; font-style: normal; letter-spacing: .12em; }
.quote-card__mark { color: var(--gold-dim); font-family: var(--font-serif); font-size: 42px; line-height: .7; }
.oath-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.oath-item { padding: 20px; border-top: 1px solid var(--line-gold); background: linear-gradient(180deg, rgba(200,168,105,.035), transparent); }
.oath-item h3 { font-size: 16px; font-weight: 500; }
.oath-item p { margin-top: 8px; color: var(--muted); font-size: 11.5px; line-height: 1.85; }
.home-update { margin-top: 28px; padding: 15px 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--muted); font-size: 11px; line-height: 1.8; }
.home-update strong { color: var(--gold); font-weight: 500; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 318px minmax(0, 1fr); gap: 14px; align-items: start; }
.map-side { position: sticky; top: calc(var(--topbar) + 18px); }
.map-side .panel__body { padding: 14px; }
.map-search { margin-bottom: 12px; }
.layer-chips { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.layer-chips .chip { min-height: 26px; padding: 3px 8px; font-size: 9.5px; }
.layer-chips .chip.is-off { opacity: .42; text-decoration: line-through; }
.point-list-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.point-list { display: grid; gap: 3px; max-height: min(50vh, 480px); padding-right: 3px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #343a2e transparent; }
.point-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  transition: background .15s, border-color .15s;
}
.point-row:hover { background: rgba(200,168,105,.05); border-color: var(--line-soft); }
.point-row.is-active { background: rgba(200,168,105,.1); border-color: rgba(200,168,105,.24); }
.point-row__glyph { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--p-color, var(--line)); border-radius: 50%; color: var(--p-color, var(--gold)); font-size: 10px; }
.point-row__text { min-width: 0; }
.point-row__text strong { display: block; overflow: hidden; font-size: 11.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.point-row__text small { display: block; overflow: hidden; color: var(--muted-2); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.map-main { min-width: 0; }
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(15,20,15,.88);
}
.map-toolbar__left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 10.5px; }
.map-toolbar__left strong { color: var(--gold-bright); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.map-toolbar__hint { color: var(--muted-2); font-size: 9.5px; }
.map-stage {
  position: relative;
  aspect-ratio: 1000 / 700;
  min-height: 380px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: #0a0e0b;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.map-stage.is-dragging { cursor: grabbing; }
.map-stage:focus-visible { outline-offset: -3px; }
.map-world {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transition: transform .2s var(--ease);
  will-change: transform;
}
.map-stage.is-dragging .map-world { transition: none; }
.map-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ink-sea { fill: #090d0b; }
.ink-land { fill: #131a14; stroke: #253025; stroke-width: 1.4; }
.ink-highland { fill: #182017; stroke: #2b3528; stroke-width: 1; }
.ink-snow { fill: #1a2320; stroke: #2d3a35; stroke-width: 1; }
.ink-rot { fill: #211513; stroke: #3b2620; stroke-width: 1; }
.ink-water { fill: #0b1515; stroke: #213235; stroke-width: 1; }
.ink-river { fill: none; stroke: #273a3a; stroke-width: 2; opacity: .8; }
.ink-road { fill: none; stroke: #4c4430; stroke-width: 1.4; stroke-dasharray: 3 5; opacity: .6; }
.ink-contour { fill: none; stroke: #394034; stroke-width: .7; opacity: .4; }
.ink-wall { fill: none; stroke: #5c533c; stroke-width: 2; opacity: .55; }
.ink-tree { fill: #66582f; opacity: .28; }
.ink-label { fill: #666b5b; font-family: var(--font-serif); font-size: 15px; letter-spacing: .22em; text-anchor: middle; opacity: .8; }
.ink-label--small { font-size: 10px; letter-spacing: .1em; fill: #53584c; }
.ink-compass { fill: none; stroke: #60553b; stroke-width: 1; opacity: .6; }
.map-marker {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, var(--marker) 68%, #171a15);
  border-radius: 50%;
  background: rgba(10, 14, 10, .88);
  color: var(--marker);
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(0,0,0,.22), 0 0 16px color-mix(in srgb, var(--marker) 20%, transparent);
  transition: transform .16s var(--ease), background .16s, box-shadow .16s, opacity .16s;
}
.map-marker:hover, .map-marker.is-active {
  z-index: 8;
  transform: translate(-50%, -50%) scale(1.28);
  background: var(--marker);
  color: #0b0e0a;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker) 18%, transparent), 0 0 26px color-mix(in srgb, var(--marker) 42%, transparent);
}
.map-marker.is-active::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 1px solid var(--marker);
  border-radius: 50%;
  opacity: .4;
}
.map-marker__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  background: rgba(8, 11, 8, .96);
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .16s, transform .16s;
}
.map-marker:hover .map-marker__tip { opacity: 1; transform: translate(-50%, 0); }
.map-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-controls button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-gold);
  border-radius: 2px;
  background: rgba(8, 12, 9, .87);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  backdrop-filter: blur(6px);
  transition: background .16s, color .16s;
}
.map-controls button:hover { background: rgba(200,168,105,.14); color: var(--gold-bright); }
.map-compass {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 9;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .14em;
  pointer-events: none;
}
.map-compass strong { display: block; color: var(--gold-dim); font-size: 13px; letter-spacing: 0; }
.map-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  max-width: 170px;
  padding: 7px 9px;
  border: 1px solid rgba(200,168,105,.14);
  border-radius: 2px;
  background: rgba(7, 10, 8, .74);
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.65;
  text-align: right;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.map-detail { margin-top: 14px; min-height: 130px; }
.map-detail__empty { padding: 26px; color: var(--muted-2); font-size: 11.5px; text-align: center; }
.map-detail__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 0; }
.map-detail__title { display: flex; align-items: center; gap: 12px; }
.map-detail__glyph { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-gold); border-radius: 50%; color: var(--gold); font-size: 15px; }
.map-detail__title h2 { font-size: 22px; font-weight: 500; }
.map-detail__title p { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.map-detail__body { padding: 12px 20px 20px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.map-detail__body .detail-text { color: var(--text-soft); }
.map-detail__meta { display: flex; flex-wrap: wrap; gap: 8px 15px; padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 10px; }
.map-detail__meta span { display: inline-flex; align-items: center; gap: 5px; }
.danger-pips { display: inline-flex; gap: 2px; }
.danger-pips i { width: 4px; height: 9px; background: #343a30; border-radius: 1px; }
.danger-pips i.on { background: var(--danger); }
.map-quest-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.map-link-mini { font-size: 9.5px; }
.map-result-note { padding: 14px 16px; color: var(--muted-2); font-size: 10.5px; border-top: 1px solid var(--line-soft); }

/* ---------- compendium ---------- */
.filter-panel { padding: 16px; margin-bottom: 18px; }
.filter-top { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.category-tabs { display: flex; gap: 5px; overflow-x: auto; padding-top: 12px; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs .chip { flex: 0 0 auto; }
.filter-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 14px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .05em; }
.compendium-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 196px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(22,28,22,.84), rgba(9,13,10,.94));
  color: var(--text);
  text-align: left;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.entry-card:hover { transform: translateY(-2px); border-color: var(--line-gold); color: var(--text); background: linear-gradient(160deg, rgba(28,34,27,.9), rgba(11,15,12,.96)); }
.entry-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entry-glyph {
  display: grid;
  flex: 0 0 37px;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgba(200,168,105,.28);
  border-radius: 50%;
  background: rgba(200,168,105,.045);
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 14px;
}
.entry-card__cat { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .13em; text-align: right; }
.entry-card h3 { margin: 14px 0 5px; font-size: 19px; font-weight: 500; }
.entry-card p { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.75; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.entry-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: auto; padding-top: 16px; }
.entry-card__stage { margin-left: auto; color: var(--muted-2); font-family: var(--font-mono); font-size: 8.5px; }
.entry-card__line { position: absolute; right: 0; top: 0; width: 1px; height: 42%; background: linear-gradient(var(--gold), transparent); opacity: .32; }
.entry-stats { display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.stat-row { display: grid; grid-template-columns: minmax(90px, .7fr) 1.3fr; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted-2); }
.stat-row strong { color: var(--text-soft); font-weight: 500; }
.detail-block { margin-top: 18px; }
.detail-block h3 { margin-bottom: 6px; color: var(--gold); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.detail-block p { margin: 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.85; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-link-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- quests ---------- */
.quest-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.quest-toolbar .search-wrap { flex: 1 1 260px; max-width: 440px; }
.quest-list { display: grid; gap: 9px; }
.quest-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(21,27,21,.88), rgba(9,13,10,.94));
  transition: border-color .2s, background .2s;
}
.quest-card.is-focus { border-color: rgba(200,168,105,.5); box-shadow: 0 0 0 2px rgba(200,168,105,.06); }
.quest-card[open] { border-color: rgba(200,168,105,.25); }
.quest-card > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px 19px;
  cursor: pointer;
  list-style: none;
}
.quest-card > summary::-webkit-details-marker { display: none; }
.quest-card > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--gold-dim);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  transition: transform .2s var(--ease), color .2s;
}
.quest-card[open] > summary::after { content: "−"; color: var(--gold); }
.quest-card > summary:hover { background: rgba(200,168,105,.035); }
.quest-index { flex: 0 0 auto; color: var(--gold-dim); font-family: var(--font-serif); font-size: 24px; line-height: 1; }
.quest-head-main { min-width: 0; flex: 1; }
.quest-head-main h2 { font-size: 19px; font-weight: 500; }
.quest-head-main p { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.quest-head-meta { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.quest-body { padding: 0 19px 20px; border-top: 1px solid var(--line-soft); }
.quest-body__lead { padding: 16px 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.9; }
.quest-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr); gap: 22px; }
.quest-section { margin-bottom: 18px; }
.quest-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--gold); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.quest-section h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.pre-list, .reward-list, .consequence-list { display: grid; gap: 7px; }
.pre-list li, .reward-list li, .consequence-list li { position: relative; padding-left: 15px; color: var(--text-soft); font-size: 11.5px; line-height: 1.8; }
.pre-list li::before { content: "◇"; position: absolute; left: 0; top: 0; color: var(--gold-dim); font-size: 8px; }
.reward-list li::before { content: "✦"; position: absolute; left: 0; top: 0; color: var(--gold); font-size: 8px; }
.consequence-list li::before { content: "!"; position: absolute; left: 2px; top: 0; color: var(--danger-soft); font-family: var(--font-mono); font-size: 9px; }
.consequence-list li { color: #c6b4a4; }
.steps { counter-reset: step; display: grid; gap: 0; }
.step-item { position: relative; display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 10px; padding-bottom: 15px; }
.step-item:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.step-num { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid rgba(200,168,105,.27); border-radius: 50%; color: var(--gold); font-family: var(--font-mono); font-size: 9px; }
.step-item h4 { padding-top: 1px; font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.step-item p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.quest-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line-soft); }
.quest-complete { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; cursor: pointer; }
.quest-complete input { accent-color: var(--gold); width: 13px; height: 13px; }
.quest-complete.is-done { color: var(--gold); }
.quest-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- guide ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; align-items: start; }
.guide-main { min-width: 0; }
.stage-tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.stage-tabs::-webkit-scrollbar { display: none; }
.stage-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10,14,10,.6);
  color: var(--muted);
  font-size: 10.5px;
  transition: background .16s, color .16s, border-color .16s;
}
.stage-tab span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; }
.stage-tab:hover { color: var(--text); border-color: var(--line-gold); }
.stage-tab.is-active { color: var(--gold-bright); border-color: rgba(200,168,105,.44); background: rgba(200,168,105,.09); }
.stage-tab.is-locked { opacity: .52; }
.stage-tab.is-locked:hover { opacity: .8; }
.mode-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0 14px; }
.mode-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 91px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9,13,9,.65);
  color: var(--text-soft);
  text-align: left;
  transition: background .18s, border-color .18s, transform .18s;
}
.mode-option:hover { border-color: var(--line-gold); transform: translateY(-1px); }
.mode-option.is-active { border-color: rgba(200,168,105,.5); background: linear-gradient(150deg, rgba(200,168,105,.12), rgba(200,168,105,.025)); }
.mode-option strong { font-size: 12.5px; font-weight: 600; }
.mode-option span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.mode-option .meter { margin-top: auto; }
.mode-option.is-active .meter__fill { background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright)); }
.mode-option[data-level="open"] .meter__fill { background: linear-gradient(90deg, #7e4f45, var(--danger)); }
.mode-option[data-level="open"].is-active { border-color: rgba(185,105,93,.42); background: rgba(185,105,93,.055); }
.mode-option[data-level="open"] strong { color: var(--danger-soft); }
.mode-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.mode-caption strong { color: var(--text-soft); font-weight: 500; }
.stage-panel { margin-top: 12px; }
.stage-hero { position: relative; overflow: hidden; padding: 24px; border-bottom: 1px solid var(--line-soft); background: radial-gradient(500px 250px at 95% 0%, rgba(200,168,105,.1), transparent 65%); }
.stage-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; }
.stage-hero h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 500; }
.stage-hero > p { max-width: 690px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.85; }
.stage-goal { margin-top: 16px; padding: 12px 14px; border-left: 2px solid var(--gold); background: rgba(200,168,105,.045); color: var(--text-soft); font-size: 11.5px; line-height: 1.8; }
.stage-content { padding: 20px 24px 24px; }
.tip-levels { display: grid; gap: 12px; }
.tip-level { padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(0,0,0,.13); }
.tip-level--key { border-left: 2px solid var(--gold); }
.tip-level--half { border-left: 2px solid var(--blue); }
.tip-level--open { border-left: 2px solid var(--danger); }
.tip-level__head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tip-level__head h3 { font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.tip-level__head span { margin-left: auto; color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.tip-level ul { display: grid; gap: 7px; }
.tip-level li { position: relative; padding-left: 16px; color: var(--text-soft); font-size: 11.5px; line-height: 1.85; }
.tip-level li::before { content: "·"; position: absolute; left: 4px; top: -2px; color: var(--gold); font-size: 18px; }
.tip-level.is-hidden { opacity: .28; }
.tip-level.is-hidden li { color: var(--muted-2); }
.tip-level--locked { border-style: dashed; border-left-width: 2px; background: rgba(0,0,0,.07); }
.tip-level--locked .tip-level__head { margin-bottom: 0; opacity: .7; }
.tip-level__locked { color: var(--muted-2); font-size: 10px; line-height: 1.7; padding-top: 3px; }
.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 18px; }
.check-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.check-item::before { content: "□"; flex: 0 0 auto; color: var(--gold-dim); font-family: var(--font-mono); }
.stage-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line-soft); }
.stage-foot__note { max-width: 480px; color: var(--muted-2); font-size: 9.5px; line-height: 1.7; }
.guide-aside { position: sticky; top: calc(var(--topbar) + 18px); display: grid; gap: 12px; }
.aside-panel { padding: 18px; }
.aside-panel h3 { margin-bottom: 9px; font-size: 15px; font-weight: 500; }
.aside-panel p { color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.oath-list { display: grid; gap: 11px; margin-top: 12px; }
.oath-list li { color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.oath-list strong { display: block; color: var(--text-soft); font-weight: 500; }
.progress-ring { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.progress-ring__num { color: var(--gold-bright); font-family: var(--font-serif); font-size: 32px; line-height: 1; }
.progress-ring__text { color: var(--muted); font-size: 9.5px; }
.locked-panel { padding: 25px 20px; text-align: center; border: 1px dashed var(--line-gold); border-radius: var(--radius); }
.locked-panel h3 { font-size: 18px; font-weight: 500; }
.locked-panel p { max-width: 440px; margin: 8px auto 16px; color: var(--muted); font-size: 11px; line-height: 1.8; }

/* ---------- planner ---------- */
.planner-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 16px; align-items: start; }
.planner-form { padding: 20px; }
.planner-form h2 { margin-bottom: 4px; font-size: 19px; font-weight: 500; }
.planner-form > p { margin-bottom: 18px; color: var(--muted); font-size: 10.5px; line-height: 1.75; }
.form-stack { display: grid; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.field-note { color: var(--muted-2); font-size: 9.5px; line-height: 1.55; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; }
.segmented .chip { border-radius: 2px; }
.route-style { display: grid; gap: 6px; }
.radio-card { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 2px; cursor: pointer; transition: border-color .16s, background .16s; }
.radio-card:hover { border-color: var(--line-gold); }
.radio-card:has(input:checked) { border-color: rgba(200,168,105,.42); background: rgba(200,168,105,.07); }
.radio-card input { margin-top: 3px; accent-color: var(--gold); }
.radio-card strong { display: block; color: var(--text-soft); font-size: 10.5px; font-weight: 500; }
.radio-card span { display: block; margin-top: 1px; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.planner-output { min-width: 0; display: grid; gap: 14px; }
.route-output { overflow: hidden; }
.route-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.route-stat { padding: 15px 16px; border-right: 1px solid var(--line-soft); }
.route-stat:last-child { border-right: 0; }
.route-stat span { display: block; color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.route-stat strong { display: block; margin-top: 3px; color: var(--gold-bright); font-family: var(--font-serif); font-size: 21px; font-weight: 500; }
.route-visual { position: relative; aspect-ratio: 1000 / 380; min-height: 210px; border-bottom: 1px solid var(--line-soft); background: radial-gradient(500px 260px at 50% 50%, rgba(34,46,35,.4), transparent 70%), #0a0e0b; overflow: hidden; }
.route-visual svg { width: 100%; height: 100%; }
.route-bg { fill: #0d120e; stroke: #20291f; }
.route-line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(200,168,105,.28)); }
.route-line-ghost { fill: none; stroke: rgba(200,168,105,.16); stroke-width: 7; stroke-linecap: round; }
.route-node { fill: #0a0e0a; stroke: var(--gold); stroke-width: 1.5; }
.route-node--start { fill: var(--gold); }
.route-node--end { fill: #f0dca9; }
.route-label { fill: #b4ad97; font-family: var(--font-ui); font-size: 9px; text-anchor: middle; }
.route-optional { fill: #0b110d; stroke: #7b8f78; stroke-width: 1; stroke-dasharray: 2 2; }
.route-optional-label { fill: #899983; font-family: var(--font-ui); font-size: 8px; text-anchor: middle; }
.route-body { padding: 18px 20px 20px; }
.route-timeline { display: grid; gap: 0; margin-top: 5px; }
.route-step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
.route-step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 27px; bottom: 0; width: 1px; background: var(--line); }
.route-step__dot { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(200,168,105,.3); border-radius: 50%; color: var(--gold); font-family: var(--font-mono); font-size: 9px; background: #0c110d; }
.route-step h3 { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.route-step p { margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.75; }
.route-option-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.route-option-list .tag { background: rgba(200,168,105,.04); }
.route-warning { margin-top: 12px; }
.route-empty { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 34px; }
.route-empty__sigil { width: 50px; height: 50px; margin-bottom: 16px; border: 1px solid var(--line-gold); border-radius: 50%; position: relative; }
.route-empty__sigil::before, .route-empty__sigil::after { content: ""; position: absolute; background: var(--gold-dim); }
.route-empty__sigil::before { left: 50%; top: 10px; bottom: 10px; width: 1px; }
.route-empty__sigil::after { top: 50%; left: 10px; right: 10px; height: 1px; }
.route-empty h2 { font-size: 22px; font-weight: 500; }
.route-empty p { max-width: 410px; margin-top: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.route-visual .route-empty { min-height: 100%; padding: 20px; border: 0; }
.route-visual .route-empty__sigil { display: none; }

/* ---------- lore ---------- */
.lore-filter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.lore-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.lore-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(22,28,22,.9), rgba(9,13,10,.95));
  color: var(--text);
  text-align: left;
  transition: border-color .2s, transform .2s var(--ease);
}
.lore-card:hover { border-color: var(--line-gold); transform: translateY(-2px); color: var(--text); }
.lore-card__kicker { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: .16em; }
.lore-card h2 { margin: 10px 0 8px; font-size: 23px; font-weight: 500; }
.lore-card > p { color: var(--muted); font-size: 11.5px; line-height: 1.85; }
.lore-card__node { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--gold); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .06em; }
.lore-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: auto; padding-top: 18px; }
.lore-card__index { position: absolute; right: 18px; top: 12px; color: rgba(200,168,105,.09); font-family: var(--font-serif); font-size: 56px; line-height: 1; }
.lore-block { margin-top: 18px; }
.lore-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--gold); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.lore-block h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.lore-canon, .lore-theory { display: grid; gap: 8px; }
.lore-canon li, .lore-theory li { position: relative; padding-left: 15px; color: var(--text-soft); font-size: 12px; line-height: 1.85; }
.lore-canon li::before { content: "◇"; position: absolute; left: 0; top: 0; color: var(--gold-dim); font-size: 8px; }
.theory { padding: 13px 14px; border: 1px solid var(--line-soft); border-left: 2px solid var(--violet); background: rgba(170,166,199,.035); border-radius: 2px; }
.theory strong { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-soft); font-size: 11.5px; font-weight: 500; }
.theory strong span { color: var(--violet); font-family: var(--font-mono); font-size: 8px; letter-spacing: .07em; }
.theory p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.theory-footnote { color: var(--muted-2); font-size: 9px; line-height: 1.7; margin-top: 10px; }

/* ---------- tree ---------- */
.tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 12px; }
.tree-quest-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.tree-mode-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tree-mode-tab {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(10,14,10,.65);
  color: var(--muted);
  font-size: 10px;
  transition: background .17s, color .17s, border-color .17s;
}
.tree-mode-tab:hover { color: var(--text); border-color: var(--line-gold); }
.tree-mode-tab.is-active { color: var(--gold-bright); border-color: rgba(200,168,105,.45); background: rgba(200,168,105,.09); }
.tree-layout { display: grid; grid-template-columns: minmax(0, 1fr) 326px; gap: 14px; align-items: start; }
.tree-stage-panel { min-width: 0; overflow: hidden; }
.tree-stage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line-soft); }
.tree-stage-head h2 { font-size: 18px; font-weight: 500; }
.tree-stage-head p { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.tree-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 17px 0; }
.tree-breadcrumb button { min-height: 24px; padding: 2px 8px; border: 1px solid var(--line-soft); border-radius: 99px; background: transparent; color: var(--muted-2); font-size: 8.5px; transition: color .16s, border-color .16s; }
.tree-breadcrumb button:hover { color: var(--gold); border-color: var(--line-gold); }
.tree-scroll { max-height: min(66vh, 700px); overflow: auto; scrollbar-width: thin; scrollbar-color: #3a3d31 transparent; }
.tree-scroll-hint { display: none; padding: 9px 16px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 9px; letter-spacing: .03em; text-align: center; }
.tree-canvas { position: relative; min-width: 0; padding: 8px; }
.tree-svg { display: block; width: 100%; height: auto; min-height: 330px; }
.tree-edge { fill: none; stroke: #394235; stroke-width: 1.3; opacity: .7; transition: stroke .2s, opacity .2s; }
.tree-edge.is-active { stroke: var(--gold); opacity: .95; }
.tree-edge.is-consequence { stroke: #9c7568; stroke-dasharray: 4 4; opacity: .85; }
.tree-edge-label { fill: #8b8c7b; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: .03em; paint-order: stroke; stroke: #0b0f0c; stroke-width: 3px; stroke-linejoin: round; }
.tree-node { user-select: none; }
.tree-block h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--gold); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; }
.tree-block h3::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.tree-node { cursor: pointer; outline: none; }
.tree-node__box {
  fill: #121813;
  stroke: #384134;
  stroke-width: 1;
  transition: fill .18s var(--ease), stroke .18s var(--ease), filter .18s var(--ease);
}
.tree-node__bar { fill: #5c543f; transition: fill .18s; }
.tree-node__kind { fill: #818273; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .11em; text-transform: uppercase; }
.tree-node__label { fill: #d8d3c5; font-family: var(--font-ui); font-size: 9.5px; font-weight: 500; }
.tree-node__hint { fill: #767a6d; font-family: var(--font-mono); font-size: 6.5px; }
.tree-node:hover .tree-node__box { fill: #1a221a; stroke: #756844; }
.tree-node:hover .tree-node__bar { fill: var(--gold-dim); }
.tree-node.is-visited .tree-node__box { fill: #171d16; stroke: #59654e; }
.tree-node.is-visited .tree-node__bar { fill: #7f8e70; }
.tree-node.is-current .tree-node__box { fill: #24261a; stroke: var(--gold); stroke-width: 1.6; filter: drop-shadow(0 0 8px rgba(200,168,105,.2)); }
.tree-node.is-current .tree-node__bar { fill: var(--gold); }
.tree-node.is-feasible .tree-node__box { fill: #131a14; stroke: #806f4b; stroke-dasharray: 4 3; }
.tree-node.is-feasible:hover .tree-node__box { stroke: var(--gold-bright); fill: #1e251b; }
.tree-node.is-selected .tree-node__box { stroke: var(--gold-bright); }
.tree-node--ending .tree-node__bar { fill: #8f6a5b; }
.tree-node--battle .tree-node__bar { fill: #7b5149; }
.tree-node--choice .tree-node__bar { fill: #8f7f55; }
.tree-node:focus-visible .tree-node__box { stroke: var(--gold-bright); stroke-width: 2; }
.tree-legend { display: flex; flex-wrap: wrap; gap: 10px; padding: 11px 17px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8.5px; }
.tree-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tree-legend i { width: 8px; height: 8px; border: 1px solid #6a6044; border-radius: 50%; }
.tree-legend i.current { background: var(--gold); border-color: var(--gold); }
.tree-legend i.visited { background: #7f8e70; border-color: #7f8e70; }
.tree-legend i.future { border-style: dashed; }
.tree-side { display: grid; gap: 12px; position: sticky; top: calc(var(--topbar) + 16px); }
.tree-side-panel { padding: 19px; }
.tree-side-panel h3 { margin-bottom: 8px; font-size: 16px; font-weight: 500; }
.tree-side-panel p { color: var(--muted); font-size: 10.5px; line-height: 1.85; }
.tree-detail__kind { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; }
.tree-detail h3 { margin: 7px 0 8px; font-size: 19px; font-weight: 500; }
.tree-detail__summary { color: var(--text-soft); font-size: 11.5px; line-height: 1.85; }
.tree-detail__consequence { margin-top: 13px; padding: 11px 12px; border-left: 2px solid var(--danger); background: rgba(185,105,93,.05); color: #cbb6a6; font-size: 10.5px; line-height: 1.8; }
.tree-detail__hidden { margin-top: 13px; padding: 11px 12px; border: 1px dashed var(--line); color: var(--muted-2); font-size: 10px; line-height: 1.7; }
.tree-detail__actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tree-choice-list { display: grid; gap: 7px; margin-top: 13px; }
.tree-choice { padding: 10px 11px; border: 1px solid var(--line-soft); border-radius: 2px; background: rgba(0,0,0,.12); }
.tree-choice strong { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 10.5px; font-weight: 500; }
.tree-choice p { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.7; }
.tree-choice span { color: var(--danger-soft); font-family: var(--font-mono); font-size: 7.5px; }
.tree-mode-note { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--muted); font-size: 10px; line-height: 1.7; }
.tree-fallback { padding: 28px; }
.tree-empty-card { padding: 30px; border: 1px dashed var(--line-gold); border-radius: var(--radius); text-align: center; }
.tree-empty-card h3 { font-size: 20px; font-weight: 500; }
.tree-empty-card p { max-width: 520px; margin: 8px auto 0; color: var(--muted); font-size: 11.5px; line-height: 1.8; }

/* ---------- builds ---------- */
.build-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.build-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.build-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.build-card { overflow: hidden; }
.build-card__head { padding: 20px 20px 15px; border-bottom: 1px solid var(--line-soft); background: radial-gradient(300px 150px at 100% 0%, rgba(200,168,105,.09), transparent 60%); }
.build-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.build-card h2 { font-size: 22px; font-weight: 500; }
.build-card__summary { margin-top: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.85; }
.build-card__body { padding: 18px 20px 20px; }
.build-gear { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gear-col h3 { margin-bottom: 6px; color: var(--gold); font-family: var(--font-mono); font-size: 8px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.gear-col ul { display: grid; gap: 4px; }
.gear-col li { display: flex; align-items: center; gap: 5px; color: var(--text-soft); font-size: 10.5px; line-height: 1.6; }
.gear-col li::before { content: "·"; color: var(--gold-dim); font-size: 16px; line-height: .8; }
.gear-empty { color: var(--muted-2); font-size: 9.5px; }
.build-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.build-stat { padding: 7px 8px; border: 1px solid var(--line-soft); border-radius: 2px; text-align: center; }
.build-stat span { display: block; color: var(--muted-2); font-size: 8px; }
.build-stat strong { display: block; color: var(--gold-bright); font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.build-notes { display: grid; gap: 7px; margin-top: 15px; }
.build-note { padding: 8px 10px; border-left: 1px solid var(--line-gold); color: var(--muted); font-size: 9.8px; line-height: 1.7; }
.build-note strong { color: var(--text-soft); font-weight: 500; }
.build-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line-soft); }
.build-card__foot .tag:last-child { margin-left: auto; }
.compare-panel { margin-top: 16px; overflow: hidden; }
.compare-body { padding: 20px; }
.compare-selects { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.compare-vs { padding-bottom: 11px; color: var(--gold-dim); font-family: var(--font-serif); font-size: 15px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.compare-card { padding: 15px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(0,0,0,.12); }
.compare-card h3 { margin-bottom: 3px; font-size: 18px; font-weight: 500; }
.compare-card .sub { color: var(--muted-2); font-size: 9px; }
.compare-card .stats { margin-top: 12px; }
.compare-card .stat-row { font-size: 10.5px; }
.compare-empty { grid-column: 1 / -1; padding: 22px; border: 1px dashed var(--line); color: var(--muted-2); text-align: center; font-size: 10.5px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); gap: 12px; margin-top: 16px; }
.preview-panel { padding: 20px; }
.preview-panel h2 { font-size: 18px; font-weight: 500; }
.preview-panel > p { margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.gear-3d {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 240px;
  margin: 16px 0;
  perspective: 700px;
  background: radial-gradient(220px 180px at 50% 50%, rgba(200,168,105,.08), transparent 70%);
  overflow: hidden;
}
.gear-3d__platform {
  position: absolute;
  bottom: 44px;
  width: 150px;
  height: 26px;
  border: 1px solid rgba(200,168,105,.18);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(200,168,105,.1), transparent 70%);
}
.gear-3d__shape {
  position: relative;
  width: 86px;
  height: 152px;
  transform: rotateY(var(--rotate, 24deg)) rotateX(3deg);
  transform-style: preserve-3d;
  transition: transform .6s var(--ease);
}
.gear-3d__shape::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(200,168,105,.35);
  background: linear-gradient(90deg, rgba(200,168,105,.03), rgba(200,168,105,.14), rgba(200,168,105,.03));
  clip-path: polygon(50% 0, 72% 20%, 82% 80%, 50% 100%, 18% 80%, 28% 20%);
  box-shadow: inset 0 0 30px rgba(200,168,105,.08);
}
.gear-3d__shape::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(transparent, rgba(231,207,154,.6), transparent);
}
.gear-3d__label { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.gear-3d__controls { display: flex; justify-content: center; gap: 5px; }
.gear-3d__controls button { min-height: 28px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--muted); font-size: 9px; }
.gear-3d__controls button:hover { color: var(--gold); border-color: var(--line-gold); }
.note-panel { padding: 20px; }
.note-panel h2 { font-size: 18px; font-weight: 500; }
.note-panel > p { margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--muted-2); font-size: 9px; }
.note-saved { color: var(--green); font-family: var(--font-mono); font-size: 8px; letter-spacing: .05em; }
.notes-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.notes-hint { color: var(--muted-2); font-size: 8.5px; }

/* ---------- viewpoints ---------- */
.vista-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.vista-card { overflow: hidden; }
.vista-art { position: relative; height: 148px; overflow: hidden; background: #111712; }
.vista-art::before, .vista-art::after { content: ""; position: absolute; inset: 0; }
.vista-art::before { background: radial-gradient(ellipse at 50% 100%, rgba(200,168,105,.24), transparent 58%); }
.vista-art::after { background: linear-gradient(180deg, transparent 40%, rgba(5,8,6,.65)); }
.vista-art--1 { background: linear-gradient(165deg, #0e1a1c 0%, #1b2e30 48%, #485b55 100%); }
.vista-art--1::before { background: radial-gradient(circle at 64% 28%, rgba(207,221,203,.32), transparent 4%), radial-gradient(ellipse at 50% 100%, rgba(155,190,174,.22), transparent 60%), repeating-linear-gradient(104deg, transparent 0 47px, rgba(170,200,185,.09) 47px 48px); }
.vista-art--2 { background: linear-gradient(170deg, #1b170c, #4b3d1d 55%, #8e6f38 100%); }
.vista-art--2::before { background: radial-gradient(ellipse at 55% 20%, rgba(255,230,169,.48), transparent 38%), radial-gradient(ellipse at 55% 20%, rgba(228,194,119,.2), transparent 65%); }
.vista-art--3 { background: linear-gradient(180deg, #07111b, #0c1c27 55%, #23353b); }
.vista-art--3::before { background-image: radial-gradient(1.5px 1.5px at 20% 24%, rgba(241,236,218,.9), transparent), radial-gradient(1px 1px at 68% 15%, rgba(241,236,218,.75), transparent), radial-gradient(1.2px 1.2px at 44% 40%, rgba(241,236,218,.8), transparent), radial-gradient(1px 1px at 83% 32%, rgba(241,236,218,.7), transparent), radial-gradient(1.5px 1.5px at 13% 50%, rgba(241,236,218,.55), transparent); }
.vista-art--4 { background: linear-gradient(175deg, #071314, #0b2224 50%, #123f41); }
.vista-art--4::before { background: radial-gradient(ellipse at 50% 110%, rgba(115,180,169,.3), transparent 60%), repeating-radial-gradient(ellipse at 50% 100%, transparent 0 16px, rgba(129,183,173,.1) 17px 18px); }
.vista-art--5 { background: linear-gradient(160deg, #141c13, #263524 50%, #6e6d4b); }
.vista-art--5::before { background: radial-gradient(circle at 30% 40%, rgba(244,239,215,.8) 0 1px, transparent 2px), radial-gradient(circle at 62% 30%, rgba(244,239,215,.6) 0 1px, transparent 2px), radial-gradient(circle at 78% 62%, rgba(244,239,215,.7) 0 1px, transparent 2px), radial-gradient(circle at 40% 70%, rgba(185,80,70,.3), transparent 35%); }
.vista-art--6 { background: linear-gradient(170deg, #27100d, #5b2319 50%, #9a4a2f); }
.vista-art--6::before { background: radial-gradient(ellipse at 50% 80%, rgba(232,150,92,.35), transparent 60%), repeating-linear-gradient(8deg, transparent 0 24px, rgba(255,176,112,.06) 25px 26px); }
.vista-art--7 { background: linear-gradient(180deg, #071119, #172739 55%, #42566b); }
.vista-art--7::before { background: radial-gradient(circle at 56% 32%, rgba(220,230,240,.8) 0 1px, rgba(220,230,240,.1) 2px 13px, transparent 14px), radial-gradient(ellipse at 56% 32%, rgba(190,213,231,.24), transparent 45%); }
.vista-art__index { position: absolute; z-index: 2; left: 14px; top: 10px; color: rgba(240,230,204,.38); font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; }
.vista-art__place { position: absolute; z-index: 2; left: 14px; bottom: 11px; color: rgba(244,237,220,.85); font-family: var(--font-serif); font-size: 14px; letter-spacing: .11em; }
.vista-card__body { padding: 16px; }
.vista-card__body h3 { font-size: 18px; font-weight: 500; }
.vista-card__body > p { margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.vista-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.vista-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 9px; }
.visit-btn { color: var(--gold); background: transparent; border: 0; padding: 2px 0; font-size: 9.5px; }
.visit-btn:hover { color: var(--gold-bright); }
.visit-btn.is-visited { color: var(--green); }

/* ---------- memes ---------- */
.meme-filter { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.meme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.meme-card { display: flex; flex-direction: column; min-height: 220px; padding: 20px; transition: border-color .2s, transform .2s var(--ease); }
.meme-card:hover { border-color: var(--line-gold); transform: translateY(-2px); }
.meme-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meme-card__head span { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.meme-quote { margin: 17px 0 10px; color: var(--text); font-family: var(--font-serif); font-size: 19px; line-height: 1.65; letter-spacing: .03em; }
.meme-context { color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.meme-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: auto; padding-top: 16px; }
.meme-react { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--muted-2); font-size: 9px; }
.meme-react:hover, .meme-react.is-liked { color: var(--gold); }
.meme-react.is-liked { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- faces ---------- */
.face-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.face-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.face-card { width: 100%; overflow: hidden; text-align: left; color: var(--text); transition: transform .2s var(--ease), border-color .2s; }
.face-card:hover { transform: translateY(-2px); border-color: var(--line-gold); color: var(--text); }
.face-portrait { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, rgba(200,168,105,.13), transparent 60%), #0b100c; }
.face-portrait svg { width: 100%; height: 100%; }
.face-portrait__scan { position: absolute; left: 12px; right: 12px; bottom: 11px; height: 1px; background: linear-gradient(90deg, transparent, rgba(200,168,105,.4), transparent); }
.face-card__body { padding: 13px 14px 14px; }
.face-card__body h3 { font-size: 16px; font-weight: 500; }
.face-card__body p { margin-top: 2px; color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; letter-spacing: .05em; }
.face-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.face-detail-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.face-preview-large { border: 1px solid var(--line-soft); background: #0b100c; }
.face-sliders { display: grid; gap: 7px; }
.slider-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 30px; gap: 9px; align-items: center; color: var(--muted); font-size: 9.5px; }
.slider-track { height: 3px; background: #242b20; border-radius: 99px; overflow: hidden; }
.slider-track i { display: block; height: 100%; background: var(--gold-dim); }
.slider-row b { color: var(--gold); font-family: var(--font-mono); font-size: 8px; font-weight: 400; text-align: right; }
.param-code { margin-top: 15px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 2px; background: rgba(0,0,0,.2); color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; line-height: 1.7; overflow-wrap: anywhere; }

/* ---------- mods ---------- */
.mod-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; margin-bottom: 12px; }
.mod-toolbar .search-wrap { flex: 1 1 280px; max-width: 480px; }
.mod-categories { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mod-card { padding: 19px; }
.mod-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mod-card h3 { font-size: 19px; font-weight: 500; }
.mod-card__cat { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.mod-card p { margin-top: 7px; color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.keyword-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line-soft); border-radius: 2px; background: rgba(0,0,0,.14); color: var(--text-soft); font-family: var(--font-mono); font-size: 8.5px; cursor: pointer; }
.keyword-chip:hover { border-color: var(--line-gold); color: var(--gold-bright); }
.keyword-chip::after { content: "⌘"; opacity: .35; font-size: 7px; }
.mod-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8.5px; }
.mod-meta b { color: var(--text-soft); font-weight: 400; }

/* ---------- messages ---------- */
.message-layout { display: grid; grid-template-columns: 282px minmax(0, 1fr); gap: 14px; align-items: start; }
.message-side { padding: 16px; position: sticky; top: calc(var(--topbar) + 18px); }
.message-side h2 { margin-bottom: 10px; font-size: 15px; font-weight: 500; }
.location-list { display: grid; gap: 3px; }
.location-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); text-align: left; font-size: 10.5px; transition: background .16s, color .16s, border-color .16s; }
.location-btn::before { content: "◇"; color: var(--gold-dim); font-size: 8px; }
.location-btn:hover { color: var(--text); background: rgba(200,168,105,.04); }
.location-btn.is-active { color: var(--gold-bright); background: rgba(200,168,105,.08); border-color: rgba(200,168,105,.2); }
.message-main { min-width: 0; display: grid; gap: 12px; }
.message-board { position: relative; padding: 22px; overflow: hidden; background: radial-gradient(500px 250px at 50% 0%, rgba(200,168,105,.08), transparent 65%), linear-gradient(160deg, rgba(17,23,18,.94), rgba(8,12,9,.97)); }
.message-board::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(200,168,105,.07); pointer-events: none; }
.message-board__head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.message-board__head h2 { font-size: 20px; font-weight: 500; }
.message-board__head p { margin-top: 3px; color: var(--muted-2); font-size: 9.5px; }
.message-list { position: relative; z-index: 1; display: grid; gap: 0; margin-top: 10px; }
.message-item { display: flex; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.message-item:last-child { border-bottom: 0; }
.message-item.is-local .message-text { color: var(--gold-bright); }
.message-item.is-local .message-mark { border-color: rgba(200,168,105,.55); box-shadow: 0 0 18px rgba(200,168,105,.12); }
.message-mark { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(200,168,105,.23); border-radius: 50%; color: var(--gold); font-family: var(--font-serif); font-size: 15px; }
.message-content { min-width: 0; flex: 1; }
.message-text { color: #dfd5b9; font-family: var(--font-serif); font-size: 15px; line-height: 1.8; letter-spacing: .035em; }
.message-content footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted-2); font-size: 8.5px; }
.message-like { margin-left: auto; border: 0; background: transparent; color: var(--muted-2); font-size: 8.5px; }
.message-like:hover, .message-like.is-liked { color: var(--gold); }
.message-compose { padding: 18px 20px; }
.message-compose h2 { margin-bottom: 4px; font-size: 17px; font-weight: 500; }
.message-compose > p { color: var(--muted); font-size: 10px; line-height: 1.7; }
.message-compose .field { margin-top: 12px; }
.message-compose .btn { margin-top: 10px; }

/* ---------- panorama ---------- */
.pano-layout { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 14px; align-items: start; }
.pano-side { padding: 16px; position: sticky; top: calc(var(--topbar) + 18px); }
.pano-side h2 { margin-bottom: 10px; font-size: 15px; font-weight: 500; }
.pano-list { display: grid; gap: 4px; }
.pano-place { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); text-align: left; transition: background .16s, border-color .16s, color .16s; }
.pano-place:hover { background: rgba(200,168,105,.04); color: var(--text); }
.pano-place.is-active { border-color: rgba(200,168,105,.25); background: rgba(200,168,105,.08); color: var(--gold-bright); }
.pano-place__num { color: var(--gold-dim); font-family: var(--font-mono); font-size: 8px; }
.pano-place__text strong { display: block; font-size: 10.5px; font-weight: 500; }
.pano-place__text span { display: block; color: var(--muted-2); font-size: 8px; }
.pano-main { min-width: 0; }
.pano-stage { position: relative; aspect-ratio: 16 / 9; min-height: 330px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #0a0e0b; display: flex; align-items: center; justify-content: center; }
.pano-scene { position: absolute; inset: 0; transition: background .45s var(--ease); }
.pano-scene--1 { background: radial-gradient(circle at 65% 34%, rgba(188,204,195,.15), transparent 11%), linear-gradient(165deg, #0b1719, #1b3031 52%, #43544f); }
.pano-scene--2 { background: radial-gradient(ellipse at 52% 35%, rgba(255,229,164,.38), transparent 23%), linear-gradient(170deg, #171207, #443417 50%, #8f6c35); }
.pano-scene--3 { background: linear-gradient(180deg, #06101a, #102230 55%, #2a3b41); }
.pano-scene--3::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 18% 20%, #e6dfcb, transparent), radial-gradient(1px 1px at 73% 13%, #e6dfcb, transparent), radial-gradient(1.5px 1.5px at 42% 30%, #e6dfcb, transparent), radial-gradient(1px 1px at 86% 42%, #e6dfcb, transparent); }
.pano-scene--4 { background: radial-gradient(ellipse at 50% 100%, rgba(105,178,162,.25), transparent 60%), linear-gradient(180deg, #071313, #0c2628 50%, #164447); }
.pano-scene--5 { background: radial-gradient(circle at 35% 40%, rgba(240,236,212,.4), transparent 2%), linear-gradient(155deg, #121a12, #293827 55%, #6d6d4a); }
.pano-scene--7 { background: radial-gradient(circle at 55% 30%, rgba(219,231,240,.52) 0 2px, rgba(190,210,227,.12) 3px 18px, transparent 19px), linear-gradient(180deg, #06111a, #172738 55%, #43566a); }
.pano-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 38%, rgba(3,6,5,.62)); }
.pano-overlay { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; }
.pano-overlay__top { display: flex; justify-content: space-between; gap: 12px; color: rgba(235,229,211,.65); font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; }
.pano-center { align-self: center; text-align: center; }
.pano-center__ring { position: relative; width: 92px; height: 92px; margin: 0 auto 18px; border: 1px solid rgba(231,207,154,.45); border-radius: 50%; transition: transform .5s var(--ease); }
.pano-center__ring::before, .pano-center__ring::after { content: ""; position: absolute; border: 1px solid rgba(231,207,154,.23); border-radius: 50%; }
.pano-center__ring::before { inset: 12px; }
.pano-center__ring::after { inset: 30px; background: rgba(231,207,154,.8); box-shadow: 0 0 24px rgba(231,207,154,.5); }
.pano-stage:hover .pano-center__ring { transform: rotate(45deg); }
.pano-center h2 { color: #f2ead8; font-size: clamp(24px, 3vw, 38px); font-weight: 500; letter-spacing: .1em; text-shadow: 0 2px 30px rgba(0,0,0,.6); }
.pano-center p { max-width: 500px; margin: 8px auto 0; color: rgba(235,229,211,.74); font-size: 11px; line-height: 1.8; }
.pano-overlay__bottom { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pano-overlay__bottom p { color: rgba(235,229,211,.52); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.pano-note { margin-top: 12px; }

/* ---------- forum ---------- */
.forum-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.forum-cats { display: flex; flex-wrap: wrap; gap: 5px; }
.forum-layout { display: grid; grid-template-columns: minmax(0, 1fr) 278px; gap: 14px; align-items: start; }
.thread-list { display: grid; gap: 8px; }
.thread-card { display: block; width: 100%; padding: 17px 19px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(21,27,21,.84), rgba(9,13,10,.94)); color: var(--text); text-align: left; transition: border-color .18s, background .18s, transform .18s var(--ease); }
.thread-card:hover { border-color: var(--line-gold); color: var(--text); background: linear-gradient(160deg, rgba(26,33,26,.9), rgba(10,14,11,.96)); transform: translateX(2px); }
.thread-card__top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.thread-card__pin { color: var(--gold); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.thread-card h2 { font-size: 18px; font-weight: 500; line-height: 1.5; }
.thread-card__excerpt { display: -webkit-box; overflow: hidden; margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.75; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thread-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8.5px; }
.thread-card__foot span { display: inline-flex; align-items: center; gap: 4px; }
.thread-author { color: var(--text-soft); }
.thread-avatar { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid var(--line-gold); border-radius: 50%; color: var(--gold); font-family: var(--font-serif); font-size: 10px; }
.thread-card__stats { display: flex; gap: 8px; margin-left: auto; }
.forum-side { display: grid; gap: 12px; position: sticky; top: calc(var(--topbar) + 18px); }
.forum-side-panel { padding: 17px; }
.forum-side-panel h3 { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.forum-side-panel p { color: var(--muted); font-size: 10px; line-height: 1.75; }
.forum-compose { padding: 17px; }
.forum-compose h3 { font-size: 15px; font-weight: 500; }
.forum-compose .textarea { min-height: 82px; margin-top: 9px; font-size: 11px; }
.forum-compose .btn { width: 100%; margin-top: 8px; }
.forum-rules { display: grid; gap: 8px; margin-top: 9px; }
.forum-rules li { position: relative; padding-left: 12px; color: var(--muted); font-size: 9.5px; line-height: 1.7; }
.forum-rules li::before { content: "—"; position: absolute; left: 0; color: var(--gold-dim); }
.forum-start { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.forum-start .search-wrap { flex: 1; }
.forum-start .sort { flex: 0 0 auto; min-height: 42px; width: 110px; }
.forum-replies { display: grid; gap: 10px; margin-top: 18px; }
.forum-reply { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(0,0,0,.12); }
.forum-reply header { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--gold); font-size: 9.5px; }
.forum-reply header span { color: var(--muted-2); font-family: var(--font-mono); font-size: 7.5px; }
.forum-reply p { margin-top: 5px; color: var(--text-soft); font-size: 11px; line-height: 1.8; }
.forum-thread-body { padding: 15px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(0,0,0,.14); color: var(--text-soft); font-size: 12px; line-height: 1.9; }

/* ---------- utility ---------- */
.list-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kicker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.count-pill { display: inline-flex; align-items: center; padding: 2px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-family: var(--font-mono); font-size: 8px; }
.is-dim { opacity: .5; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.full { width: 100%; }
.hidden { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .face-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vista-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: minmax(0, 1.25fr) minmax(230px, .75fr); }
}
@media (max-width: 1040px) {
  :root { --sidebar: 258px; }
  .shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(84vw, 300px);
    transform: translateX(-104%);
    transition: transform .25s var(--ease);
    box-shadow: 22px 0 60px rgba(0,0,0,.55);
    z-index: 60;
  }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim { display: block; }
  .icon-btn.menu-btn { display: inline-flex; }
  .workspace { min-height: 100dvh; }
  .topbar { height: 60px; }
  .main { padding-top: 26px; }
  .map-side, .guide-aside, .tree-side, .message-side, .pano-side, .forum-side { position: static; }
  .map-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .guide-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .planner-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .tree-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .home-hero { min-height: auto; }
  .hero-rune { width: min(100%, 300px); }
  .home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .page-head { display: block; padding-bottom: 20px; }
  .page-head__aside { margin-top: 14px; text-align: left; }
  .home-hero { grid-template-columns: 1fr; gap: 16px; padding: 30px 24px 26px; }
  .hero-art { display: none; }
  .hero-copy h1 { font-size: clamp(42px, 11vw, 68px); }
  .home-lower { grid-template-columns: 1fr; }
  .oath-grid { grid-template-columns: 1fr; }
  .map-layout { display: flex; flex-direction: column; gap: 14px; }
  .map-main { order: 1; width: 100%; }
  .map-side { order: 2; display: block; width: 100%; }
  .point-list { max-height: 300px; }
  .map-stage { min-height: 360px; }
  .map-detail__head { display: block; }
  .map-detail__title { margin-bottom: 4px; }
  .map-detail__meta { padding-top: 8px; }
  .detail-columns { grid-template-columns: 1fr; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-aside { grid-template-columns: 1fr 1fr; }
  .tree-layout { grid-template-columns: 1fr; }
  .tree-side { grid-template-columns: 1fr 1fr; }
  .tree-scroll { max-height: 520px; }
  .planner-layout { grid-template-columns: 1fr; }
  .lore-grid { grid-template-columns: 1fr; }
  .build-grid { grid-template-columns: 1fr; }
  .compare-selects { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .compare-grid { grid-template-columns: 1fr; }
  .tool-layout { grid-template-columns: 1fr; }
  .message-layout { grid-template-columns: 1fr; }
  .location-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pano-layout { grid-template-columns: 1fr; }
  .pano-side { position: static; }
  .pano-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forum-layout { grid-template-columns: 1fr; }
  .forum-side { position: static; grid-template-columns: 1fr 1fr; }
  .mod-grid { grid-template-columns: 1fr; }
  .route-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-stat:nth-child(2) { border-right: 0; }
  .route-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .face-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { max-height: 90dvh; }
  .face-detail-grid { grid-template-columns: 170px minmax(0, 1fr); }
}
@media (max-width: 620px) {
  :root { --topbar: 56px; }
  body { font-size: 14px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar__right { gap: 8px; }
  .offline-mark { display: none; }
  .crumbs { gap: 7px; font-size: 8.5px; }
  .crumbs strong { font-size: 10.5px; max-width: 150px; }
  .topbar .install-btn { display: none; }
  .main { padding: 20px 14px 0; }
  .page-head h1 { font-size: clamp(30px, 9vw, 42px); }
  .page-head__lead { font-size: 12px; }
  .site-footer { display: block; font-size: 9.5px; }
  .site-footer p:last-child { text-align: left; margin-top: 6px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 160px; }
  .home-hero { padding: 28px 18px 24px; margin: 0 -2px; }
  .home-hero::before { inset: 7px; }
  .hero-copy h1 { letter-spacing: .07em; }
  .hero-copy > p { margin-top: 18px; font-size: 12px; }
  .hero-actions { margin-top: 22px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-note { align-items: flex-start; font-size: 8.5px; line-height: 1.6; }
  .home-metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 62px; padding: 12px; }
  .metric strong { font-size: 22px; }
  .section-head { align-items: flex-start; }
  .section-head__link { padding-top: 5px; }
  .stage-callout { padding: 22px 18px; }
  .stage-callout__num { font-size: 110px; }
  .quote-card { padding: 22px 18px; }
  .quote-card blockquote { font-size: 18px; }
  .panel__body { padding: 16px; }
  .filter-panel { padding: 13px; }
  .filter-top { grid-template-columns: 1fr; }
  .compendium-grid { grid-template-columns: 1fr 1fr; }
  .entry-card { min-height: 178px; padding: 14px; }
  .entry-glyph { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
  .entry-card h3 { font-size: 16px; margin-top: 11px; }
  .entry-card p { font-size: 10px; -webkit-line-clamp: 3; }
  .entry-card__foot { padding-top: 10px; }
  .entry-card__stage { display: none; }
  .quest-card > summary { gap: 11px; padding: 14px; }
  .quest-index { font-size: 20px; }
  .quest-head-main h2 { font-size: 17px; }
  .quest-head-meta .tag:nth-child(n+3) { display: none; }
  .quest-body { padding: 0 14px 16px; }
  .quest-columns { grid-template-columns: 1fr; gap: 2px; }
  .quest-actions { align-items: flex-start; flex-direction: column; }
  .stage-tabs { padding-bottom: 8px; }
  .mode-switch { grid-template-columns: 1fr; }
  .mode-option { min-height: auto; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
  .mode-option .meter { grid-column: 1 / -1; }
  .mode-option span { grid-column: 2; grid-row: 1; }
  .stage-content { padding: 16px 14px 18px; }
  .stage-hero { padding: 20px 16px; }
  .stage-foot { padding: 14px 16px; }
  .checklist { grid-template-columns: 1fr; }
  .guide-aside, .tree-side, .forum-side { grid-template-columns: 1fr; }
  .map-stage { min-height: 300px; aspect-ratio: 1 / .84; }
  .map-toolbar { padding: 9px 10px; }
  .map-toolbar__hint { display: none; }
  .map-legend { display: none; }
  .map-marker { width: 25px; height: 25px; font-size: 10px; }
  .map-detail__head { padding: 14px 14px 0; }
  .map-detail__body { padding: 10px 14px 16px; }
  .map-detail__meta { padding: 10px 14px; }
  .map-detail__title h2 { font-size: 19px; }
  .form-row { grid-template-columns: 1fr; }
  .route-summary { grid-template-columns: repeat(2, 1fr); }
  .route-visual { min-height: 180px; }
  .route-body { padding: 15px; }
  .lore-card { min-height: 220px; padding: 19px; }
  .lore-card h2 { font-size: 20px; }
  .tree-toolbar { align-items: flex-start; }
  .tree-mode-tabs { width: 100%; }
  .tree-mode-tab { flex: 1 1 0; font-size: 9px; padding: 5px 6px; }
  .tree-stage-head { padding: 12px 13px; }
  .tree-canvas { min-width: 820px; }
  .tree-scroll { max-height: 460px; }
  .tree-scroll-hint { display: block; }
  .tree-side-panel { padding: 16px; }
  .build-gear { grid-template-columns: 1fr; }
  .build-stats { grid-template-columns: repeat(4, 1fr); }
  .build-card__head, .build-card__body { padding-left: 16px; padding-right: 16px; }
  .compare-body { padding: 14px; }
  .face-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .face-card__body { padding: 10px; }
  .face-card__body h3 { font-size: 14px; }
  .face-card__tags { display: none; }
  .face-detail-grid { grid-template-columns: 1fr; }
  .face-preview-large { max-width: 220px; margin: 0 auto; }
  .vista-grid { grid-template-columns: 1fr; }
  .meme-grid { grid-template-columns: 1fr; }
  .meme-card { min-height: 190px; }
  .location-list { grid-template-columns: 1fr; }
  .message-board { padding: 16px; }
  .message-board::before { inset: 6px; }
  .message-text { font-size: 14px; }
  .message-item { gap: 9px; }
  .message-mark { flex-basis: 27px; width: 27px; height: 27px; font-size: 12px; }
  .message-compose { padding: 15px; }
  .pano-list { grid-template-columns: 1fr; }
  .pano-stage { min-height: 270px; aspect-ratio: 4 / 5; }
  .pano-overlay { padding: 18px; }
  .pano-center p { font-size: 10px; }
  .pano-center__ring { width: 68px; height: 68px; }
  .thread-card { padding: 14px; }
  .thread-card h2 { font-size: 16px; }
  .thread-card__stats { width: 100%; margin-left: 0; }
  .forum-start { flex-wrap: wrap; }
  .forum-start .sort { width: 100%; }
  .forum-side { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; align-items: flex-end; }
  .modal { max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100%; }
  .modal__head { padding: 18px 16px 13px; }
  .modal__body { padding: 16px; }
  .toast-root { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .detail-columns { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 21px; }
  .page { animation-duration: .3s; }
  .list-cols { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .compendium-grid { grid-template-columns: 1fr; }
  .face-grid { grid-template-columns: 1fr 1fr; }
  .metric span { font-size: 9px; }
  .metric strong { font-size: 19px; }
  .crumbs strong { max-width: 118px; }
  .hero-copy h1 { font-size: 39px; }
}

/* ---------- reduced motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
@media print {
  .sidebar, .topbar, .page-grain, .page-vignette, .site-footer, .map-controls, .toast-root { display: none !important; }
  body { background: #fff; color: #111; }
  .shell, .main { display: block; max-width: none; padding: 0; }
  .panel, .state-panel { break-inside: avoid; border-color: #bbb; background: #fff; box-shadow: none; }
}
