/* LesWatanabe.com — design system */
:root {
  --bg: #faf8f5; --surface: #ffffff; --surface-2: #f3efe9; --surface-3: #ebe5dc;
  --ink: #17141d; --ink-2: #463f50; --muted: #756d80; --line: #e6e0d6; --line-2: #d8d0c4;
  --accent: #c92a62; --accent-2: #a61e4d; --accent-soft: #fce8ef; --on-accent: #fff;
  --gold: #e8590c; --gold-soft: #fff0e3; --teal: #0b7285; --teal-soft: #e3f6f8;
  --violet: #6741d9; --violet-soft: #efeaff; --green: #2b8a3e; --green-soft: #e9f7ec;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23,20,29,.05), 0 10px 30px -12px rgba(23,20,29,.12);
  --shadow-lg: 0 2px 4px rgba(23,20,29,.06), 0 24px 48px -16px rgba(23,20,29,.22);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111015; --surface: #19171f; --surface-2: #211e28; --surface-3: #2a2632;
    --ink: #f4f1f7; --ink-2: #d2cbdb; --muted: #9c94a8; --line: #2d2935; --line-2: #3a3544;
    --accent: #ff5c8d; --accent-2: #ff7aa3; --accent-soft: #3b1626; --on-accent: #1a0710;
    --gold: #ff922b; --gold-soft: #3a2310; --teal: #3bc9db; --teal-soft: #0f2d33;
    --violet: #9775fa; --violet-soft: #241c3d; --green: #51cf66; --green-soft: #12301a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.5);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 24px 48px -16px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111015; --surface: #19171f; --surface-2: #211e28; --surface-3: #2a2632;
  --ink: #f4f1f7; --ink-2: #d2cbdb; --muted: #9c94a8; --line: #2d2935; --line-2: #3a3544;
  --accent: #ff5c8d; --accent-2: #ff7aa3; --accent-soft: #3b1626; --on-accent: #1a0710;
  --gold: #ff922b; --gold-soft: #3a2310; --teal: #3bc9db; --teal-soft: #0f2d33;
  --violet: #9775fa; --violet-soft: #241c3d; --green: #51cf66; --green-soft: #12301a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 24px 48px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16.5px/1.65 var(--sans);
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em;
  margin: 0 0 .5em; font-optical-sizing: auto; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.35rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); margin-top: 1.8em; }
h3 { font-size: 1.22rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin: .2em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.logo svg { width: 34px; height: 34px; }
.logo b { font-family: var(--serif); font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
.logo span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-top: -2px; }
@media (max-width: 520px) { .logo span { display: none; } .header-row { gap: 8px; } .header-actions { gap: 4px; } .icon-btn { width: 38px; height: 38px; } }
.main-nav { display: none; gap: 2px; margin-left: auto; }
.main-nav a { color: var(--ink-2); text-decoration: none; font-size: .93rem; font-weight: 500; padding: 8px 11px; border-radius: 999px; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current] { background: var(--surface-2); color: var(--ink); }
.header-actions { display: flex; gap: 6px; margin-left: auto; }
@media (min-width: 1080px) { .main-nav { display: flex; } .header-actions { margin-left: 8px; } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.mobile-nav { position: relative; }
.mobile-nav summary { list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav[open] .mobile-menu { display: grid; }
.mobile-menu { display: none; position: absolute; right: 0; top: 48px; width: min(320px, calc(100vw - 32px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; gap: 2px; }
.mobile-menu a { padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.mobile-menu a:hover { background: var(--surface-2); }
@media (min-width: 1080px) { .mobile-nav { display: none; } }

/* ---------- breadcrumbs & page head ---------- */
.crumbs { font-size: .84rem; color: var(--muted); padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: .5; }
.page-head { padding: 22px 0 8px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.page-head .lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.22rem); color: var(--ink-2); max-width: 760px; }
.page-head .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.updated { font-size: .82rem; color: var(--muted); }

/* ---------- layout ---------- */
main { min-height: 60vh; }
.layout { display: grid; gap: 40px; padding: 10px 0 60px; }
@media (min-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } .layout.wide-aside { grid-template-columns: minmax(0,1fr) 340px; } }
.content { min-width: 0; }
.content > h2:first-child { margin-top: .4em; }
.prose { max-width: 760px; }
.prose p, .prose li { color: var(--ink-2); }
.prose table { width: 100%; }
aside .sticky { position: sticky; top: 84px; display: grid; gap: 18px; }
.section { padding: 26px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; font-size: .92rem; text-decoration: none; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.tight { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s; min-width: 0; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); color: var(--ink); }
.card h3 { margin: 0; font-size: 1.06rem; line-height: 1.3; }
.card .kicker { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.card .card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; font-size: .82rem; color: var(--muted); }
.card.media { padding: 0; overflow: hidden; }
.card.media .thumb { aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.card.media .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card.media .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ph { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--serif); font-size: 2.4rem; color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, hsl(var(--h,330) 65% 52%), hsl(calc(var(--h,330) + 40) 70% 42%)); }
.card.feature { background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%); }
.card .arrow { position: absolute; right: 16px; top: 16px; color: var(--muted); transition: transform .15s; }
a.card:hover .arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; font-weight: 500; text-decoration: none; line-height: 1.4; }
a.chip:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.chip.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); color: var(--ink-2); vertical-align: middle; }
.badge.win { background: var(--gold-soft); color: var(--gold); }

/* ---------- facts / stats ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 18px 0 26px; }
.facts > div { padding: 14px 16px; min-width: 0; box-shadow: 1px 1px 0 var(--line); }
.facts dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .v { font-family: var(--serif); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); font-weight: 600; line-height: 1.1; color: var(--ink); }
.stat .l { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.stat.accent { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--violet))); border: 0; }
.stat.accent .v, .stat.accent .l { color: #fff; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.dots i.on { background: var(--accent); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 14px 0 22px;
  -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { position: sticky; top: 0; background: var(--surface-2); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 650; white-space: nowrap; }
table.data th[data-sort] { cursor: pointer; user-select: none; }
table.data th[data-sort]::after { content: " ↕"; opacity: .35; }
table.data th.asc::after { content: " ↑"; opacity: .9; } table.data th.desc::after { content: " ↓"; opacity: .9; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data a { text-decoration: none; font-weight: 550; }
table.data a:hover { text-decoration: underline; }
.prose table { border-collapse: collapse; font-size: .93rem; margin: 14px 0 22px; display: block; overflow-x: auto; }
.prose table th, .prose table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose table th { background: var(--surface-2); }

/* ---------- boxes ---------- */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.box h3, .box h2 { margin-top: 0; font-size: 1.08rem; }
.box.tint { background: var(--surface-2); border-color: transparent; }
.box.accent { background: var(--accent-soft); border-color: transparent; }
.box ul { margin: 0; padding-left: 1.1em; }
.toc { font-size: .92rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--accent); }
.source-note { font-size: .84rem; color: var(--muted); border-left: 3px solid var(--line-2); padding: 4px 0 4px 12px; margin: 18px 0; }
.source-note a { color: var(--muted); }
.wiki-quote { position: relative; border-left: 3px solid var(--teal); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 18px 0; }
.wiki-quote p { color: var(--ink-2); }
.wiki-quote .from { font-size: .8rem; color: var(--muted); }
.callout { display: flex; gap: 14px; align-items: flex-start; background: var(--gold-soft); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; }
.callout svg { flex-shrink: 0; color: var(--gold); width: 22px; height: 22px; margin-top: 2px; }
.callout p:last-child { margin: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; margin: 14px 0 26px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 14px; color: var(--ink-2); }

/* ---------- hero (home) ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 60%), var(--bg); }
.hero .wrap { position: relative; padding-top: clamp(40px, 7vw, 92px); padding-bottom: clamp(40px, 6vw, 80px); }
.hero h1 { font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem); max-width: 14ch; line-height: 1.02; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); max-width: 620px; }
.ribbons { position: absolute; right: -60px; top: 20px; width: min(720px, 70vw); opacity: .9; pointer-events: none; }
@media (max-width: 1100px) { .ribbons { opacity: .35; right: -140px; } }
@media (max-width: 760px) { .ribbons { opacity: .18; right: -160px; } }
.hero .wrap > * { position: relative; }
.searchbar { display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 26px 0 16px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.searchbar svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 10px 4px; outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font: 600 .95rem/1 var(--sans); text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--accent-2); color: var(--on-accent); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; margin-top: 30px; max-width: 860px; }
.home-stats div { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.home-stats b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.home-stats span { font-size: .84rem; color: var(--muted); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 170px; padding: 20px; border-radius: var(--radius); text-decoration: none;
  color: #fff; overflow: hidden; background: linear-gradient(150deg, hsl(var(--h) 62% 46%), hsl(calc(var(--h) + 35) 70% 34%)); isolation: isolate; }
.tile::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); z-index: -1; }
.tile h3 { color: #fff; margin: 0; font-size: 1.3rem; }
.tile p { margin: 0; color: rgba(255,255,255,.86); font-size: .93rem; }
.tile .count { margin-top: auto; font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.9); letter-spacing: .04em; }
.tile:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile { transition: transform .15s, box-shadow .15s; }

/* ---------- style page ---------- */
.style-hero { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .style-hero.has-img { grid-template-columns: minmax(0,1fr) 360px; } }
.figure { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.figure img { width: 100%; max-height: 420px; object-fit: cover; }
@media (max-width: 720px) { .figure img { max-height: 300px; } }
.figure figcaption { font-size: .76rem; color: var(--muted); padding: 8px 12px; }
.figure figcaption a { color: var(--muted); }
.tempo-bar { position: relative; height: 34px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 10px 0 4px; overflow: hidden; }
.tempo-bar span { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; }
.tempo-scale { position: relative; height: 18px; font-size: .74rem; color: var(--muted); margin-bottom: 14px; }
.tempo-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tempo-scale span:first-child { transform: none; }
.tempo-scale span:last-child { transform: translateX(-100%); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding: 10px 14px 10px 50px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }

/* ---------- song / bpm ---------- */
.bpm-hero { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; margin: 18px 0; }
.bpm-big { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--violet))); color: #fff; border-radius: var(--radius);
  padding: 18px 26px; min-width: 170px; }
.bpm-big b { display: block; font-family: var(--serif); font-size: 3.2rem; line-height: 1; font-weight: 650; }
.bpm-big span { font-size: .85rem; opacity: .9; letter-spacing: .08em; text-transform: uppercase; }
.bpm-scale { display: flex; flex-wrap: wrap; gap: 6px; }
.bpm-scale a { min-width: 46px; text-align: center; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 20px; }
.az a, .az span { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.az a:hover, .az a[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.az span { opacity: .35; }

/* ---------- lists ---------- */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.list li { margin: 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a, .list .row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; text-decoration: none; color: var(--ink); align-items: baseline; }
.list a:hover { background: var(--surface-2); }
.list .row-title { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.list .row-meta { color: var(--muted); font-size: .86rem; white-space: nowrap; text-align: right; }
.cols { columns: 3 220px; column-gap: 28px; }
.cols a { display: block; padding: 3px 0; break-inside: avoid; text-decoration: none; }
.cols a:hover { text-decoration: underline; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 22px 0; }
.pager a, .pager span { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; background: var(--surface); color: var(--ink); font-weight: 550; }
.pager span.cur { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.quote { margin: 0 0 14px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quote p { font-family: var(--serif); font-size: 1.16rem; line-height: 1.5; color: var(--ink); margin: 0 0 8px; }
.quote footer { font-size: .86rem; color: var(--muted); }
.book { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.book img, .book .ph { width: 64px; height: 92px; object-fit: cover; border-radius: 6px; font-size: 1.4rem; }
.map-embed { width: 100%; height: 300px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.bar-chart { display: grid; gap: 6px; margin: 12px 0 20px; }
.bar-chart .b { display: grid; grid-template-columns: 70px 1fr 110px; gap: 10px; align-items: center; font-size: .86rem; }
.bar-chart .b i { display: block; height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--accent)); min-width: 3px; }
.bar-chart .b span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- tools ---------- */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.tool label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.tool input, .tool select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.tool .row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: 14px; }
.tool output, .tool .out { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.tap-btn { width: 100%; min-height: 180px; border-radius: var(--radius); border: 0; cursor: pointer; font: 700 1.4rem var(--sans); color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--violet)); touch-action: manipulation; }
.tap-btn:active { transform: scale(.99); filter: brightness(1.08); }

/* ---------- search overlay ---------- */
.search-dlg { position: fixed; inset: 0; z-index: 90; display: none; background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(4px); padding: 8vh 16px 16px; }
.search-dlg.open { display: block; }
.search-panel { max-width: 680px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--line); }
.search-panel .searchbar { margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; padding: 10px 14px 10px 18px; max-width: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); }
.search-results .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.search-hint { padding: 14px 18px; color: var(--muted); font-size: .9rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--surface); padding: 46px 0 30px; font-size: .92rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.footer-grid h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.footer-bottom a { color: var(--muted); }
.ad-slot { margin: 26px 0; min-height: 100px; }
@media print { .site-header, .site-footer, aside, .ad-slot { display: none; } }
