/* ============================================================
   Silicon Photonics · Visual Companion — design system
   Dark, Apple-inspired ("liquid glass"): #000 canvas, elevated
   #1C1C1E surfaces, frosted materials, radius 14, no hard borders.
   Figures share the same tokens (scripts/house_style.py) and
   embed Inter, so page and diagrams read as one surface.
   ============================================================ */

@font-face { font-family: 'Inter'; src: url('../fonts/inter-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/inter-400-italic.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-500.woff2') format('woff2'); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-elev: #1c1c1e;
  --bg-group: #2c2c2e;
  --surface: rgba(28, 28, 30, 0.62);
  --surface-hi: rgba(44, 44, 46, 0.72);
  --fig: #0e0e10;
  --hair: rgba(255, 255, 255, 0.08);
  --hair-2: rgba(255, 255, 255, 0.12);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --blue: #0a84ff;
  --blue-hi: #409cff;
  --blue-dim: rgba(10, 132, 255, 0.16);
  --pink: #ff8fd0;
  --peach: #ffb9a3;
  --violet: #bf5af2;
  --green: #30d158;
  --orange: #ff9f0a;
  --amber: #ffd60a;
  --red: #ff453a;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --bar-h: 56px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.55;
  letter-spacing: -0.011em; font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh; overflow-x: hidden;
}
::selection { background: rgba(10, 132, 255, 0.35); }
a { color: var(--blue-hi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---- ambient gradient field ---- */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(110px); }
.ambient .b1 { width: 920px; height: 920px; top: -400px; right: -240px; opacity: 0.21; background: radial-gradient(closest-side, var(--pink), transparent 70%); }
.ambient .b2 { width: 820px; height: 820px; top: 16%; left: -360px; opacity: 0.15; background: radial-gradient(closest-side, var(--peach), transparent 70%); }
.ambient .b3 { width: 1020px; height: 1020px; bottom: -440px; right: -120px; opacity: 0.14; background: radial-gradient(closest-side, var(--violet), transparent 70%); }
.ambient .b4 { width: 760px; height: 760px; top: -300px; left: 30%; opacity: 0.09; background: radial-gradient(closest-side, #ff9f6e, transparent 70%); }
.ambient.dim .b1 { opacity: 0.1; } .ambient.dim .b3 { opacity: 0.08; }

/* ---- neutral card material (no saturate(): it amplified orb tint on cards) ---- */
.card-mat, .stats .st, .feat, .chcard, .pager a, .srcbox {
  background: var(--surface);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

/* ---- top navigation (landing) ---- */
nav.top {
  position: sticky; top: 0; z-index: 60; height: 56px;
  display: flex; align-items: center; gap: 20px; padding: 0 max(20px, env(safe-area-inset-left));
  background: rgba(8, 8, 10, 0.72);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(from 210deg, var(--blue), var(--violet), var(--pink), var(--blue)); }
nav.top .links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
nav.top .links a:not(.btn) { color: var(--text-2); font-size: 13.5px; font-weight: 500; }
nav.top .links a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 980px; padding: 12px 22px; border: 0;
  font-family: var(--font); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease); white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn-primary, .btn-primary:visited { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2690ff; transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(10, 132, 255, 0.7); }
.btn-glass { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.btn-glass:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.btn-glass .rs { font-family: var(--mono); font-size: 13px; color: var(--blue-hi); }
.btn-plain { background: transparent; color: var(--blue-hi); padding: 12px 4px; }
.btn-plain:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---- layout ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
h1.display { font-size: clamp(44px, 7vw, 92px); font-weight: 800; letter-spacing: -0.05em; line-height: 1.0; margin: 22px 0 0; }
h2.sect { font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; margin: 8px 0 0; }
.grad { background: linear-gradient(92deg, var(--blue) 0%, var(--violet) 52%, var(--pink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--text-2); line-height: 1.5; letter-spacing: -0.015em; }
.sec { padding: 96px 0 8px; scroll-margin-top: 40px; }

/* ---- hero ---- */
.hero { padding: 88px 24px 24px; }
.hero .grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.badgepill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 980px;
  background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.badgepill .bp-ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(from 210deg, var(--blue), var(--violet), var(--pink), var(--blue)); }
.badgepill .bp-ic svg { width: 13px; height: 13px; color: #fff; }
.badgepill b { color: var(--text); font-weight: 600; }
.hero .lede { max-width: 560px; margin: 24px 0 0; }
.hero .lede b { color: var(--text); font-weight: 500; }
.hero .cta { display: flex; gap: 12px 16px; align-items: center; margin-top: 34px; flex-wrap: wrap; }
.hero .mini { margin-top: 22px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 9px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(48, 209, 88, 0.16); flex-shrink: 0; }
.hero .visual { position: relative; display: block; }
.hero .visual:hover { text-decoration: none; }
.hero .figfloat { border-radius: 22px; padding: 10px; background: var(--fig);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 44px 96px -32px rgba(10, 132, 255, 0.32), 0 34px 80px -24px rgba(0, 0, 0, 0.8);
  transform: rotate(-1.6deg); transition: transform 0.6s var(--ease-out); }
.hero .visual:hover .figfloat { transform: rotate(0deg) scale(1.015); }
.hero .figfloat img { display: block; width: 100%; height: auto; border-radius: 14px; }
.hero .pill { position: absolute; padding: 7px 13px; border-radius: 980px; font-size: 12px; font-weight: 500;
  color: var(--text); background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 24px -8px rgba(0, 0, 0, 0.6); white-space: nowrap; }
.hero .pill b { color: var(--blue-hi); font-weight: 600; }
.hero .p1 { top: -14px; left: -14px; } .hero .p2 { top: 38%; right: -18px; } .hero .p3 { bottom: -14px; left: 8%; }

/* ---- stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 64px; }
.stats .st { padding: 20px 22px 17px; border-radius: var(--r); }
.stats .st b { display: block; font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .st span { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.stats .st.hl b { color: var(--blue-hi); }

/* ---- features ---- */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.feat { padding: 24px 24px 22px; border-radius: var(--r); transition: transform 0.35s var(--ease), background 0.35s var(--ease); }
.feat:hover { transform: translateY(-3px); background: var(--surface-hi); }
.feat .ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-dim); color: var(--blue-hi); margin-bottom: 16px; }
.feat .ic svg { width: 18px; height: 18px; }
.feat h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.feat p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ---- chapters ---- */
.chgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 40px; }
.chcard { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 20px 22px 18px; border-radius: var(--r); color: var(--text);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease); }
.chcard:hover { transform: translateY(-3px); background: var(--surface-hi); text-decoration: none; }
.chcard .num { font-size: 32px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; color: var(--text-3); font-variant-numeric: tabular-nums; padding-top: 1px; }
.chcard:hover .num { color: var(--text-2); }
.chcard .num.ico { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.chcard .num.ico svg { width: 18px; height: 18px; }
.chcard .name { font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.chcard .meta { margin: 5px 0 12px; font-size: 13px; color: var(--text-3); }
.chcard .bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.chcard .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.chcard .foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.chcard .live.full { color: var(--green); }
.chcard .mine { color: var(--blue-hi); }

/* ---- showcase ---- */
.show { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 40px; }
.shot { display: block; border-radius: var(--r); overflow: hidden; background: var(--bg-elev); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); transition: transform 0.35s var(--ease); }
.shot:hover { transform: translateY(-3px); text-decoration: none; }
.shot .im { background: var(--fig); padding: 8px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
.shot .cap { padding: 13px 16px 16px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.shot .cap b { color: var(--text); font-weight: 600; }

footer { margin-top: 110px; border-top: 1px solid var(--hair); padding: 34px 0 44px; }
footer .row { display: flex; gap: 20px 26px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
footer a { color: var(--text-2); }
footer .sp { margin-left: auto; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero .grid { grid-template-columns: 1fr; gap: 44px; }
  .feats, .show { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hide-sm, .bt2 { display: none; }
  .hero { padding-top: 48px; }
  .hero .pill { display: none; }
  .hero .figfloat { transform: none; }
  .feats, .show, .chgrid { grid-template-columns: 1fr; }
  .sec { padding-top: 72px; }
  .stats { margin-top: 44px; gap: 10px; }
  .stats .st { padding: 16px 16px 14px; } .stats .st b { font-size: 28px; }
  footer .sp { margin-left: 0; }
}
@media (max-width: 400px) { .hide-xs { display: none; } }

/* ============================================================
   COMPANION (app.html)
   ============================================================ */
body.app { font-size: 16px; }
.appbar {
  position: sticky; top: 0; z-index: 70; height: var(--bar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: rgba(8, 8, 10, 0.78);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.appbar .brand { font-size: 14px; }
.iconbtn { width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer; flex-shrink: 0;
  background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; }
.iconbtn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.iconbtn svg { width: 19px; height: 19px; }
.menubtn, .searchbtn { display: none; }
.crumb { min-width: 0; flex: 0 1 auto; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-left: 14px; border-left: 1px solid var(--hair-2); }
.crumb span { color: var(--text-3); margin-right: 7px; }
.searchwrap { flex: 0 1 380px; margin-left: auto; position: relative; }
.searchwrap input {
  width: 100%; height: 36px; padding: 0 36px 0 36px; border-radius: 10px; border: 0;
  background: rgba(255, 255, 255, 0.07); color: var(--text); font-family: var(--font); font-size: 14px; outline: none;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.searchwrap input::-webkit-search-cancel-button { filter: invert(0.6); }
.searchwrap input:focus { background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.35); }
.searchwrap input::placeholder { color: var(--text-3); }
.searchwrap .sicon { position: absolute; left: 12px; top: 10.5px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.searchwrap .kbd { position: absolute; right: 9px; top: 8.5px; pointer-events: none; transition: opacity 0.2s; }
.prog { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
.prog b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ring .rt { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 2.6; }
.ring .rf { fill: none; stroke: var(--green); stroke-width: 2.6; stroke-linecap: round; transition: stroke-dasharray 0.5s var(--ease); }

.shell { display: grid; grid-template-columns: 316px minmax(0, 1fr); align-items: start; }

/* ---- sidebar ---- */
.side {
  position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); height: calc(100dvh - var(--bar-h));
  overflow-y: auto; overscroll-behavior: contain; padding: 12px 10px 60px;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 4px; }
.chap { border-radius: 12px; margin-bottom: 2px; }
.chap.current { background: rgba(255, 255, 255, 0.03); }
.chhead { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center;
  padding: 10px 10px 8px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; border-radius: 12px; }
.chhead:hover { background: rgba(255, 255, 255, 0.05); }
.cnum { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.chap.current .cnum { color: var(--blue-hi); }
.cname { font-size: 13.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; }
.cname small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1px; }
.ccount { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chhead .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform 0.25s var(--ease); }
.chap.open .chhead .chev { transform: rotate(90deg); }
.cbar { height: 2px; margin: 0 12px 6px 50px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--green); border-radius: 2px; transition: width 0.4s var(--ease); }
.chap .items { display: none; padding: 0 0 8px; }
.chap.open .items { display: block; }
a.item { display: grid; grid-template-columns: 48px minmax(0, 1fr) 14px; gap: 6px; align-items: baseline;
  padding: 7px 10px 7px 8px; border-radius: 9px; color: var(--text-2); font-size: 13px; line-height: 1.38;
  transition: background 0.15s var(--ease), color 0.15s var(--ease); }
a.item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); text-decoration: none; }
a.item.active { background: var(--blue-dim); color: var(--text); }
a.item.active .iid { color: var(--blue-hi); }
a.item .iid { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); text-align: right; }
a.item.src .it { font-style: italic; color: var(--text-3); }
a.item .st { width: 14px; font-size: 11px; color: var(--green); text-align: center; }
a.item .st.pd::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--orange); opacity: 0.8; }
.rhead { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; font-size: 12.5px; color: var(--text-2); }
.rhead b { color: var(--text); font-weight: 600; }
.rhead .clear { margin-left: auto; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); border-radius: 980px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.rch { padding: 10px 10px 2px 64px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.snip { display: block; margin-top: 3px; font-size: 12px; color: var(--text-3); line-height: 1.45; }
mark { background: rgba(255, 214, 10, 0.22); color: var(--text); border-radius: 3px; padding: 0 1px; }
.scrim { display: none; }

/* ---- main column ---- */
.main { min-width: 0; padding: 40px 48px 110px; }
.main .inner { max-width: 1000px; margin: 0 auto; }
.kick { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.stitle { margin: 8px 0 0; font-size: clamp(26px, 3.2vw, 38px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 980px; border: 0;
  font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, 0.08); color: var(--text-2); white-space: nowrap; }
.chip.id { font-family: var(--mono); font-weight: 500; color: var(--text); }
.chip.blue { background: var(--blue-dim); color: var(--blue-hi); }
.chip.amber { background: rgba(255, 214, 10, 0.13); color: var(--amber); }
.chip.warn { background: rgba(255, 159, 10, 0.14); color: var(--orange); }
.chip.plain { background: transparent; box-shadow: inset 0 0 0 1px var(--hair-2); font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.toggle { cursor: pointer; margin-left: auto; transition: background 0.2s, color 0.2s; }
.chip.toggle svg { width: 13px; height: 13px; opacity: 0.5; }
.chip.toggle:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }
.chip.toggle.on { background: rgba(48, 209, 88, 0.15); color: var(--green); }
.chip.toggle.on svg { opacity: 1; }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex-shrink: 0; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* figure */
.figcard { margin: 26px 0 0; border-radius: var(--r-lg); background: var(--fig); padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 80px -40px rgba(0, 0, 0, 0.9); }
.figbtn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--fig); border-radius: 12px;
  cursor: zoom-in; overflow: hidden; }
.figbtn img { display: block; width: 100%; height: auto; }
.figbtn .expand { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 980px; font-size: 12.5px; font-weight: 600; color: var(--text);
  background: rgba(28, 28, 30, 0.78); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); opacity: 0; transform: translateY(4px); transition: opacity 0.25s, transform 0.25s; }
.figbtn .expand svg { width: 13px; height: 13px; }
.figbtn:hover .expand, .figbtn:focus-visible .expand { opacity: 1; transform: none; }
@media (hover: none) { .figbtn .expand { opacity: 1; transform: none; } }
.figcard figcaption { display: flex; gap: 14px; align-items: baseline; justify-content: space-between; padding: 11px 6px 3px; font-size: 12.5px; color: var(--text-3); }
.figcard figcaption a { color: var(--text-2); white-space: nowrap; }
.figcard.pending { padding: 18px; display: grid; gap: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.sk { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; height: 96px; }
.sk i { border-radius: 10px; background: linear-gradient(110deg, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.085) 50%, rgba(255,255,255,0.04) 70%);
  background-size: 220% 100%; animation: shimmer 2.4s linear infinite; }
.sk i:nth-child(2) { animation-delay: 0.2s; } .sk i:nth-child(3) { animation-delay: 0.4s; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -90% 0; } }
.pmsg { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.pmsg b { color: var(--text); font-weight: 600; margin-right: 5px; }

/* source text */
.srcbox { margin-top: 22px; border-radius: var(--r-lg); }
.srchead { width: 100%; display: flex; align-items: baseline; gap: 12px; padding: 18px 24px; border: 0; background: none;
  color: var(--text); cursor: pointer; text-align: left; border-radius: var(--r-lg); }
.srchead .t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.srchead .lbl { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.srchead .sub { font-size: 12.5px; color: var(--text-3); }
.srchead .chev { width: 15px; height: 15px; color: var(--text-3); margin-left: auto; align-self: center; transition: transform 0.25s var(--ease); }
.srcbox:not(.open) .srchead .chev { transform: rotate(-90deg); }
.srcbox:not(.open) .body { display: none; }
.prose { padding: 4px 32px 30px; border-top: 1px solid var(--hair); max-width: none; }
.prose > * { max-width: 72ch; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); letter-spacing: -0.02em; line-height: 1.25; }
.prose h1 { font-size: 22px; margin: 26px 0 8px; } .prose h2 { font-size: 19px; margin: 26px 0 8px; }
.prose h3 { font-size: 16.5px; margin: 22px 0 7px; } .prose h4 { font-size: 15px; margin: 20px 0 6px; color: var(--text-2); }
.prose p, .prose li { font-size: 16px; line-height: 1.72; color: #dcdce1; letter-spacing: -0.006em; }
.prose a { word-break: break-word; }
.prose code { font-family: var(--mono); font-size: 13px; background: rgba(255, 255, 255, 0.07); padding: 1.5px 6px; border-radius: 6px; color: #e8e8ee; }
.prose pre { background: #0b0b0d; border-radius: var(--r-sm); padding: 16px 18px; overflow-x: auto; max-width: 100%; box-shadow: inset 0 0 0 1px var(--hair); }
.prose pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.6; }
.prose blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid rgba(10, 132, 255, 0.6); color: var(--text-2); }
.prose table { border-collapse: collapse; margin: 16px 0; font-size: 14px; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--hair); }
.prose th { color: var(--text-2); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 24px 0; }
.prose img { display: none; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border-radius: var(--r); color: var(--text-2); font-size: 12.5px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease); min-width: 0; }
.pager a:hover { background: var(--surface-hi); text-decoration: none; transform: translateY(-2px); }
.pager a span { font-weight: 600; color: var(--blue-hi); }
.pager a b { color: var(--text); font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pager a.nxt { text-align: right; align-items: flex-end; grid-column: 2; }
.keyhint { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--text-3); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: fadein 0.2s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
body.lb-open { overflow: hidden; }
.lb-stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.lb-stage.grabbing { cursor: grabbing; }
.lb-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px;
  background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); pointer-events: none; }
.lb-top > * { pointer-events: auto; }
.lb-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-title .chip { height: 22px; font-family: var(--mono); font-weight: 500; margin-right: 10px; color: var(--text); }
.lb-top .iconbtn { background: rgba(44, 44, 46, 0.8); color: var(--text); }
.lb-bar { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 980px;
  background: rgba(44, 44, 46, 0.82); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 12px 40px -10px rgba(0, 0, 0, 0.8); }
.lb-bar button { height: 34px; min-width: 34px; padding: 0 10px; border: 0; border-radius: 980px; background: transparent; color: var(--text);
  font-size: 17px; cursor: pointer; }
.lb-bar button.txt { font-size: 13px; font-weight: 600; }
.lb-bar button:hover { background: rgba(255, 255, 255, 0.1); }
.lb-bar #lbpct { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.lb-bar .sep { width: 1px; height: 18px; background: var(--hair-2); margin: 0 4px; }

/* ---- companion responsive ---- */
@media (max-width: 1180px) { .crumb { display: none; } }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .menubtn { display: inline-flex; }
  .side { position: fixed; left: 0; top: var(--bar-h); bottom: 0; height: auto; width: min(340px, 88vw); z-index: 65;
    transform: translateX(-102%); transition: transform 0.32s var(--ease-out);
    background: rgba(14, 14, 16, 0.96); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border-right: 1px solid var(--hair); }
  body.drawer .side { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--bar-h) 0 0 0; z-index: 64; background: rgba(0, 0, 0, 0.5);
    opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  body.drawer .scrim { opacity: 1; pointer-events: auto; }
  .main { padding: 28px 22px 90px; }
}
@media (max-width: 680px) {
  .appbar { gap: 8px; padding: 0 8px; }
  .appbar .brand .bt { display: none; }
  .searchbtn { display: inline-flex; margin-left: auto; }
  .searchwrap { display: none; }
  body.search-open .searchwrap { display: block; position: absolute; left: 8px; right: 8px; top: 10px; margin: 0; z-index: 3; }
  body.search-open .searchwrap .kbd { display: none; }
  .prog span { display: none; }
  .main { padding: 22px 14px 80px; }
  .chip.toggle { margin-left: 0; }
  .figcard { padding: 6px; border-radius: 16px; margin-top: 20px; }
  .figcard figcaption { flex-direction: column; gap: 4px; }
  .prose { padding: 2px 18px 22px; }
  .srchead { padding: 16px 18px; }
  .srchead .t { flex-direction: column; }
  .pager { grid-template-columns: 1fr; }
  .pager a.nxt { grid-column: 1; grid-row: 1; }
  .keyhint { display: none; }
  .sk { height: 72px; }
}
