/* Fate Tutor — "Celestial" look, from the Stitch design guide (DESIGN.md).
   Dark indigo ground, gold for tradition and primary actions, jade and cyan as
   quiet signals. Fine lines, small corner radius, no heavy shadows. */

:root {
  --surface: #0b1326;
  --surface-lowest: #060e20;
  --surface-low: #131b2e;
  --surface-mid: #171f33;
  --surface-high: #222a3d;
  --surface-highest: #2d3449;
  --text: #dae2fd;
  --text-soft: #d0c5af;
  --text-dim: #99907c;
  --line: rgba(212, 175, 55, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --gold: #f2ca50;
  --gold-deep: #d4af37;
  --on-gold: #3c2f00;
  --jade: #44e2cd;
  --cyan: #93d7ff;
  --amber: #f59e0b;
  --error: #ffb4ab;
  --wood: #5fd4a0;
  --fire: #ff8a6b;
  --earth: #e9c349;
  --metal: #cbd5e1;
  --water: #7bd0ff;
  --font-head: "Playfair Display", "Noto Serif SC", "Noto Serif TC", "Songti SC", "PMingLiU", serif;
  --font-body: "Plus Jakarta Sans", "Noto Sans SC", "Noto Sans TC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-data: "Space Grotesk", "Plus Jakarta Sans", ui-monospace, monospace;
  --font-han: "Noto Serif SC", "Noto Serif TC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "PMingLiU", serif;
  --radius: 4px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5.4vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--font-data); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 10px;
}
.eyebrow.jade { color: var(--jade); }
.soft { color: var(--text-soft); }
.band { padding: 72px 0; }
.band.low { background: var(--surface-low); }
.band.lowest { background: var(--surface-lowest); }
.head { display: grid; gap: 12px; max-width: 62ch; margin-bottom: 36px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(11, 19, 38, 0.92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; flex-direction: column; text-decoration: none; }
.brand b { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: 0.04em; color: var(--gold); line-height: 1.1; }
.brand span { font-family: var(--font-data); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-soft); }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a {
  color: var(--text-soft); text-decoration: none; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 8px 10px; border-radius: var(--radius);
}
.topnav a:hover { color: var(--text); }
.lang {
  background: var(--surface-high); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 7px 10px; font-family: var(--font-data); font-size: 0.82rem; color: var(--text); cursor: pointer;
}
@media (max-width: 720px) { .topnav a { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--gold-deep); color: #070a11; border: 0; border-radius: var(--radius);
  padding: 13px 26px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; transition: box-shadow 0.2s, background 0.2s;
}
.btn:hover { background: var(--gold); box-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
.btn[disabled] { opacity: 0.55; cursor: progress; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid rgba(212, 175, 55, 0.35); }
.btn.ghost:hover { background: rgba(212, 175, 55, 0.06); border-color: var(--gold); box-shadow: none; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 520px at 70% -10%, rgba(212, 175, 55, 0.10), transparent 60%), var(--surface-lowest); padding: 84px 0 64px; }
.hero h1 em { display: block; font-style: italic; font-weight: 500; color: var(--gold); font-size: 0.62em; margin-top: 10px; letter-spacing: 0; }
.hero .lead { font-family: var(--font-head); font-size: 1.3rem; color: var(--text); margin-top: 22px; }
.hero .body { color: var(--text-soft); max-width: 60ch; margin-top: 12px; }
.hero .btn { margin-top: 30px; }
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.promise { background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.promise h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; color: var(--gold); margin-bottom: 6px; }
.promise p { color: var(--text-soft); font-size: 0.92rem; }
@media (max-width: 820px) { .promises { grid-template-columns: 1fr; } }

/* ---------- foundation ---------- */
.root-card {
  background: var(--surface-high); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: var(--radius);
  padding: 22px 24px; text-align: center; box-shadow: 0 0 24px -4px rgba(212, 175, 55, 0.12);
}
.root-card b { display: block; font-family: var(--font-head); font-size: 1.5rem; color: var(--gold); }
.root-card span { color: var(--text-soft); font-size: 0.9rem; }
.stem-line { width: 1px; height: 28px; background: rgba(212, 175, 55, 0.4); margin: 0 auto; }
.branches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.branch { background: var(--surface-mid); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; display: grid; gap: 6px; align-content: start; }
.branch h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; }
.branch p { color: var(--text-soft); font-size: 0.9rem; font-style: italic; }
.pill {
  justify-self: start; font-family: var(--font-data); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--text-dim);
}
.pill.live { color: var(--jade); border-color: rgba(68, 226, 205, 0.35); }
@media (max-width: 820px) { .branches { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .branches { grid-template-columns: 1fr; } }

/* ---------- tradition (lesson) pages ---------- */
.topnav a.here { color: var(--gold); }
.panel-more { display: inline-block; margin-top: 8px; font-family: var(--font-data); font-size: 0.82rem; color: var(--gold); text-decoration: none; }
.panel-more:hover { text-decoration: underline; }
.lhero { padding: 34px 0 26px; border-bottom: 1px solid var(--line); }
.crumbs { font-family: var(--font-data); font-size: 0.78rem; color: var(--text-dim); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.lhero-row { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.badge { width: 92px; height: 92px; border-radius: var(--radius); background: linear-gradient(160deg, var(--gold-deep), #8a6d12); color: var(--on-gold); display: grid; place-items: center; align-content: center; gap: 2px; box-shadow: 0 10px 30px -12px rgba(212, 175, 55, 0.6); }
.badge-han { font-family: var(--font-han); font-size: 1.05rem; font-weight: 700; }
.badge b { font-family: var(--font-data); font-size: 2.1rem; line-height: 1; }
.lhero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 6px 0 10px; }
.lhero .lead { max-width: 760px; color: var(--text-soft); }
.birth-band { padding: 26px 0; }
.birth-panel { background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 14px; position: relative; }
.bp-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; }
.bp-live { color: var(--jade); font-size: 0.85rem; }
.bp-hint { color: var(--text-dim); font-size: 0.85rem; }
.bp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; align-items: start; }
.bp-fields .field { position: relative; }
.bp-privacy { color: var(--jade); font-size: 0.84rem; }
.bp-keep { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.linkbtn { background: none; border: 0; color: var(--text-dim); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.86rem; padding: 0; }
.linkbtn:hover { color: var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile { background: var(--surface-mid); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 4px; }
.tile small { font-family: var(--font-data); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.tile b { font-family: var(--font-head); font-size: 1.5rem; color: var(--gold); line-height: 1.2; }
.tile span { color: var(--text-soft); font-size: 0.85rem; }
.cards-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }
.cards-head h2 { margin: 4px 0; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lcard { position: relative; text-align: left; font: inherit; color: var(--text); background: var(--surface-mid); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 12px 14px; display: grid; gap: 3px; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.lcard:hover, .lcard:focus-visible { border-color: rgba(242, 202, 80, 0.6); transform: translateY(-2px); outline: none; }
.lcard.on { border-color: var(--gold); background: var(--surface-high); box-shadow: 0 0 0 1px var(--gold) inset; }
.lcard .num { font-family: var(--font-data); font-size: 0.72rem; color: var(--text-dim); }
.lcard .glyph { font-family: var(--font-han); font-size: 1.9rem; line-height: 1.1; color: var(--gold); }
.lcard .glyph.small { font-size: 1.35rem; }
.lcard .kicker { font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-dim); }
.lcard b { font-size: 0.98rem; }
.lcard small { color: var(--text-soft); font-size: 0.76rem; }
.lcard .yours { position: absolute; top: 8px; right: 8px; font-family: var(--font-data); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-gold); background: var(--gold); border-radius: 999px; padding: 2px 7px; }
.lcard.mine { border-color: rgba(68, 226, 205, 0.55); }
.lcard .tick { position: absolute; bottom: 8px; right: 10px; color: var(--jade); font-weight: 700; }
.inspector { position: sticky; top: 76px; background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 14px; max-height: calc(100vh - 96px); overflow: auto; }
.i-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.i-num { font-family: var(--font-data); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.i-head h3 { font-size: 1.35rem; margin-top: 2px; }
.i-head .kicker { font-family: var(--font-data); font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.04em; }
.yours-note { display: inline-block; margin-top: 6px; color: var(--jade); font-size: 0.84rem; }
.inspector h4 { font-size: 0.95rem; margin-top: 4px; }
.inspector .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.han { font-family: var(--font-han); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ychip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-soft); border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 10px; }
.ychip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ychip.mine { border-color: var(--gold); color: var(--gold); }
.small { font-size: 0.84rem; }
.i-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.i-actions .btn.on { background: var(--jade); color: #003731; }
.i-nav { margin-left: auto; display: flex; gap: 6px; }
.ghost { font: inherit; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; }
.ghost:hover, .ghost.on { border-color: var(--gold); color: var(--gold); }
.demo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stage { background: radial-gradient(circle at 30% 45%, #1b2440 0%, var(--surface-lowest) 70%); border: 1px solid var(--line); border-radius: var(--radius); min-height: 320px; overflow: hidden; }
.demo-svg { width: 100%; height: auto; display: block; }
.demo-side { display: grid; gap: 14px; }
.player { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.speeds { display: inline-flex; gap: 4px; margin-left: auto; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: none; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); color: var(--text-dim); font-size: 0.88rem; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.steps li b { font-family: var(--font-data); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.74rem; border: 1px solid var(--line); }
.steps li.done { color: var(--text-soft); }
.steps li.on { color: var(--text); border-color: var(--gold); background: rgba(212, 175, 55, 0.07); }
.steps li.on b { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.about-cols { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 28px; }
/* SVG demo pieces (shared by every tradition page) */
.demo-svg text { fill: var(--text); font-family: var(--font-body); }
.demo-svg .sector { fill: rgba(255, 255, 255, 0.025); stroke: rgba(212, 175, 55, 0.22); stroke-width: 1; transition: fill 0.3s; }
.demo-svg .sector.lit { fill: rgba(242, 202, 80, 0.16); stroke: var(--gold); }
.demo-svg .w-glyph { font-family: var(--font-han); font-size: 26px; fill: var(--gold); }
.demo-svg .w-branch { font-family: var(--font-han); font-size: 15px; fill: var(--text-dim); }
.demo-svg .hub { fill: var(--surface-lowest); stroke: rgba(212, 175, 55, 0.4); }
.demo-svg .hub-small { font-family: var(--font-data); font-size: 11px; fill: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.demo-svg .hub-big { font-family: var(--font-data); font-size: 30px; fill: var(--gold); }
.demo-svg .pointer line { stroke: var(--jade); stroke-width: 2; }
.demo-svg .pointer path { fill: var(--jade); }
.demo-svg .w-head { font-family: var(--font-data); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--jade); }
.demo-svg .w-line { font-size: 15px; fill: var(--text-soft); }
.demo-svg .w-result { font-family: var(--font-head); font-size: 26px; fill: var(--gold); }
.demo-svg .chip-t { font-family: var(--font-han); font-size: 15px; fill: #111827; }
@media (max-width: 900px) {
  .lesson-grid, .demo, .about-cols { grid-template-columns: 1fr; }
  .inspector { position: static; max-height: none; }
  .lhero-row { grid-template-columns: 1fr; }
  .badge { width: 72px; height: 72px; }
}

/* ---------- traditions ---------- */
.trads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.trad { background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; align-content: start; }
.trad h3 { font-size: 1.12rem; }
.trad p { color: var(--text-soft); font-size: 0.9rem; }
a.trad.open { color: inherit; text-decoration: none; cursor: pointer; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
a.trad.open:hover, a.trad.open:focus-visible { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 22px -8px rgba(212, 175, 55, 0.45); outline: none; }
.trad .go { margin-top: 4px; font-family: var(--font-data); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--gold); }
a.trad.open:hover .go { text-decoration: underline; }
.chosen-trad { color: var(--gold); border: 1px solid rgba(212, 175, 55, 0.45); background: rgba(212, 175, 55, 0.07); border-radius: var(--radius); padding: 10px 14px; font-size: 0.92rem; }
.jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.jump span { font-family: var(--font-data); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-right: 4px; }
.jump button { font: inherit; font-size: 0.86rem; color: var(--text); background: var(--surface-mid); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.jump button:hover, .jump button.on { border-color: var(--gold); color: var(--gold); }
.panel { scroll-margin-top: 84px; }
.panel.flash { animation: ft-flash 1.6s ease-out; }
@keyframes ft-flash { 0% { box-shadow: 0 0 0 2px var(--gold), 0 0 30px -4px rgba(212, 175, 55, 0.6); } 100% { box-shadow: 0 0 0 0 transparent; } }
.trad.next { border-color: var(--line-soft); background: transparent; }
.trad.next h3 { color: var(--text-soft); font-weight: 500; }
@media (max-width: 900px) { .trads { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .trads { grid-template-columns: 1fr; } }

/* ---------- form ---------- */
.form-card { background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 22px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; color: var(--jade); font-size: 0.9rem; background: rgba(68, 226, 205, 0.06); border: 1px solid rgba(68, 226, 205, 0.25); border-radius: var(--radius); padding: 10px 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 680px) { .grid2 { grid-template-columns: 1fr; } .form-card { padding: 20px; } }
.field { display: grid; gap: 6px; align-content: start; position: relative; }
.field > label, .field > .legend { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text); }
.hint { font-size: 0.8rem; color: var(--text-dim); }
.input {
  width: 100%; background: #070a11; border: 1px solid #334155; border-radius: var(--radius);
  padding: 11px 12px; color: var(--text); color-scheme: dark; transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #64748b; }
.input:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18); }
.input:disabled { opacity: 0.45; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.88rem; color: var(--text-soft); cursor: pointer; }
.check input, .radio input { accent-color: var(--gold-deep); width: 16px; height: 16px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radio { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; cursor: pointer; }
.places {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin: 4px 0 0; padding: 4px; list-style: none;
  background: #1e293b; border: 1px solid var(--line); border-radius: var(--radius); max-height: 280px; overflow: auto;
  backdrop-filter: blur(12px);
}
.places li { padding: 9px 10px; border-radius: 3px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; }
.places li small { color: var(--text-dim); font-family: var(--font-data); white-space: nowrap; }
.places li[aria-selected="true"], .places li:hover { background: rgba(212, 175, 55, 0.12); }
.chosen { font-family: var(--font-data); font-size: 0.78rem; color: var(--jade); }
details.settings { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 16px; }
details.settings summary { cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--text-soft); }
details.settings[open] summary { margin-bottom: 14px; }
.form-error { color: var(--error); font-size: 0.9rem; min-height: 1.4em; }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ---------- results ---------- */
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 28px; }
.switch { display: inline-flex; background: var(--surface-mid); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 3px; }
.switch button { background: transparent; border: 0; padding: 7px 14px; border-radius: 3px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--gold-deep); color: #070a11; }
body:not(.expert) .expert-only { display: none !important; }

.panel { background: var(--surface-mid); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.panel > header { display: grid; gap: 8px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.panel > header p { color: var(--text-soft); font-size: 0.94rem; max-width: 70ch; }
.panel h4 { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-soft); margin: 26px 0 12px; }
@media (max-width: 560px) { .panel { padding: 18px; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fact { background: var(--surface-low); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px; display: grid; gap: 2px; align-content: start; }
.fact small { font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.fact b { font-family: var(--font-data); font-weight: 500; font-size: 1.02rem; color: var(--text); overflow-wrap: anywhere; }
.fact span { font-size: 0.8rem; color: var(--text-soft); }
.notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.notes li { border-left: 2px solid var(--amber); background: rgba(245, 158, 11, 0.06); padding: 9px 14px; font-size: 0.9rem; color: var(--text-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.plain { color: var(--text-soft); font-size: 0.94rem; max-width: 72ch; }
.plain + .plain { margin-top: 8px; }

/* pillars */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillar { background: var(--surface-lowest); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 10px; text-align: center; display: grid; gap: 8px; align-content: start; }
.pillar.day { border-color: rgba(212, 175, 55, 0.5); background: var(--surface-high); }
.pillar .which { font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.pillar.day .which { color: var(--gold); }
.pillar .role { font-size: 0.76rem; color: var(--text-soft); min-height: 2.4em; display: grid; place-items: center; }
.pillar.day .role { color: var(--gold); font-weight: 600; }
.han { font-family: var(--font-han); font-size: clamp(2rem, 7vw, 2.9rem); line-height: 1.1; font-weight: 600; }
.el-wood { color: var(--wood); } .el-fire { color: var(--fire); } .el-earth { color: var(--earth); } .el-metal { color: var(--metal); } .el-water { color: var(--water); }
.pillar .sub { font-size: 0.74rem; color: var(--text-soft); }
.pillar .hidden-list { border-top: 1px solid var(--line-soft); padding-top: 8px; display: grid; gap: 3px; font-size: 0.74rem; color: var(--text-soft); }
.pillar .hidden-list b { font-family: var(--font-han); font-size: 1rem; }
.pillar.unknown { display: grid; place-items: center; color: var(--text-dim); font-size: 0.86rem; border-style: dashed; }
@media (max-width: 520px) { .pillars { gap: 6px; } .pillar { padding: 10px 4px; } }

/* element bar */
.elbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-lowest); }
.elbar span { height: 100%; }
.bg-wood { background: var(--wood); } .bg-fire { background: var(--fire); } .bg-earth { background: var(--earth); } .bg-metal { background: var(--metal); } .bg-water { background: var(--water); }
.ellegend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-family: var(--font-data); font-size: 0.82rem; }
.ellegend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* statements */
.statements { display: grid; gap: 12px; }
.statement { background: var(--surface-low); border: 1px solid var(--line); border-left: 3px solid var(--gold-deep); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; }
.statement .text { font-size: 1rem; color: var(--text); max-width: 74ch; }
.statement .text b { color: var(--gold); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font-family: var(--font-data); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid; cursor: default; }
.tag.tradition { color: var(--gold); border-color: rgba(212, 175, 55, 0.5); }
.tag.review { color: var(--amber); border-color: rgba(245, 158, 11, 0.45); }
.tag.theme { color: var(--cyan); border-color: rgba(147, 215, 255, 0.35); }
.source { font-size: 0.8rem; color: var(--text-dim); }
.source q { font-family: var(--font-han); color: var(--text-soft); font-size: 0.95rem; quotes: "「" "」"; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th { text-align: left; font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl td.han-cell { font-family: var(--font-han); font-size: 1.3rem; color: var(--gold); }
.tbl td.num { font-family: var(--font-data); }
.tbl-wrap { overflow-x: auto; }

/* big values */
.big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.big b { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 3rem); color: var(--gold); line-height: 1.1; }
.big span { font-family: var(--font-data); color: var(--text-soft); font-size: 0.9rem; }
.rows { display: grid; gap: 0; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.94rem; }
.row span { color: var(--text-soft); }
.row b { font-family: var(--font-data); font-weight: 500; }
.dates { display: flex; flex-wrap: wrap; gap: 8px; }
.dates span { font-family: var(--font-data); font-size: 0.88rem; background: var(--surface-low); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 6px 12px; }

/* legal + footer */
.legal { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; }
.legal p { color: var(--text-soft); font-size: 0.92rem; }
@media (max-width: 720px) { .legal { grid-template-columns: 1fr; } }
footer { background: var(--surface-lowest); border-top: 1px solid var(--line); padding: 28px 0 40px; }
footer p { font-family: var(--font-data); font-size: 0.76rem; color: var(--text-dim); }
footer p + p { margin-top: 6px; }
[hidden] { display: none !important; }
