/*
 * AIGC library: the cinematic shell shared by the home page, the two tools and (through cinema-knowledge.css)
 * the knowledge page. Dark, warm ivory type, one gold accent, hairline borders, film grain. No images: every
 * visual is CSS / inline SVG so the site stays light and works offline.
 */
:root {
  color-scheme: dark;
  --bg: #08080a;
  --bg-2: #0d0d10;
  --panel: #121216;
  --panel-2: #18181d;
  --raise: #1e1e25;
  --ink: #efe9dd;
  --ink-2: #c8c2b5;
  --muted: #8d8880;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --gold: #d6ac5f;
  --gold-2: #f1d08f;
  --gold-dim: rgba(214, 172, 95, 0.13);
  --gold-line: rgba(214, 172, 95, 0.38);
  --teal: #5cb3ae;
  --teal-dim: rgba(92, 179, 174, 0.13);
  --rose: #ea7a6d;
  --rose-dim: rgba(234, 122, 109, 0.12);
  --radius: 4px;
  --radius-lg: 8px;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.2 0 0 0 -.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.05;
  mix-blend-mode: screen;
}
svg { width: 16px; height: 16px; flex: none; }
a { color: var(--gold-2); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
button, select, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-dim); color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.lib-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ header */
.lib-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 12px 32px; background: rgba(8, 8, 10, 0.78); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.lib-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.lib-logo { width: 28px; height: 28px; color: var(--gold); }
.lib-brand-name { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.12em; white-space: nowrap; }
.lib-brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.28em; color: var(--muted); white-space: nowrap; }
.lib-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: 12px; }
.lib-nav a { position: relative; padding: 6px 14px; color: var(--muted); text-decoration: none; letter-spacing: 0.06em; transition: color 0.2s; }
.lib-nav a:hover { color: var(--ink); }
.lib-nav a[aria-current="page"] { color: var(--ink); }
.lib-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--gold); }
.lib-header-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ layout */
.lib-main { max-width: 1320px; margin: 0 auto; padding: 8px 32px 80px; }
.lib-grid { display: grid; grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.lib-card { position: relative; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; }
.lib-card::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); }
.lib-card + .lib-card { margin-top: 20px; }
.lib-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: 0.06em; }
.lib-card h3 { margin: 18px 0 4px; font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: 0.22em; }
.lib-hint { color: var(--muted); font-size: 12px; margin: 4px 0; }
.lib-empty { color: var(--muted); padding: 40px 12px; text-align: center; }

/* page title band on the tool pages */
.cn-pagehead { padding: 56px 0 30px; max-width: 760px; }
.cn-kicker { margin: 0 0 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.32em; color: var(--gold); text-transform: uppercase; }
.cn-pagehead h1 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.12; letter-spacing: 0.05em; }
.cn-pagehead p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 640px; }

/* ------------------------------------------------------------------ controls */
.lib-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.02); cursor: pointer; text-decoration: none; color: var(--ink); line-height: 1.4; letter-spacing: 0.04em; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.lib-btn:hover:not([disabled]) { border-color: var(--gold); color: var(--gold-2); background: var(--gold-dim); }
.lib-btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #17110a; font-weight: 600; }
.lib-btn.primary:hover:not([disabled]) { background: linear-gradient(180deg, #f8dda4, var(--gold-2)); color: #17110a; }
.lib-btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.lib-btn.ghost:hover:not([disabled]) { color: var(--ink); background: rgba(255, 255, 255, 0.04); border-color: transparent; }
.lib-btn.small { padding: 3px 10px; font-size: 12px; }
.lib-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; align-items: center; }
.lib-field { display: grid; gap: 6px; margin: 14px 0 0; }
.lib-field > span { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.lib-field input, .lib-field select, .lib-field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.025); color: var(--ink); transition: border-color 0.2s, background 0.2s; }
.lib-field input::placeholder, .lib-field textarea::placeholder { color: #5d5951; }
.lib-field input:focus, .lib-field select:focus, .lib-field textarea:focus { outline: none; border-color: var(--gold); background: rgba(214, 172, 95, 0.04); box-shadow: 0 0 0 3px var(--gold-dim); }
.lib-field select option { background: var(--panel-2); color: var(--ink); }
.lib-field textarea { resize: vertical; line-height: 1.7; }
.lib-field input[type="checkbox"] { width: auto; }
.lib-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lib-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.lib-seg button { padding: 6px 14px; border: 0; background: transparent; cursor: pointer; color: var(--muted); transition: background 0.2s, color 0.2s; }
.lib-seg button + button { border-left: 1px solid var(--line-strong); }
.lib-seg button:hover:not([disabled]) { color: var(--ink); }
.lib-seg button[aria-pressed="true"] { background: var(--gold-dim); color: var(--gold-2); }
.lib-seg button[disabled] { opacity: 0.4; cursor: not-allowed; }
details.lib-more { margin-top: 14px; }
details.lib-more summary { cursor: pointer; color: var(--muted); letter-spacing: 0.04em; }
details.lib-more summary:hover { color: var(--ink); }
pre.cn-pre { margin: 10px 0 0; padding: 12px 14px; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.35); color: var(--ink-2); font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }

/* chips and badges */
.lib-chip { display: inline-block; padding: 1px 11px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); font-size: 12px; text-decoration: none; transition: border-color 0.2s, color 0.2s, background 0.2s; }
a.lib-chip:hover { border-color: var(--gold); color: var(--gold-2); background: var(--gold-dim); }
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.lib-badge { display: inline-block; padding: 1px 9px; line-height: 1.5; border-radius: 999px; font-size: 11px; letter-spacing: 0.04em; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.lib-badge.ok { border-color: rgba(92, 179, 174, 0.5); background: var(--teal-dim); color: var(--teal); }
.lib-badge.warn { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold-2); }
.lib-badge.bad { border-color: rgba(234, 122, 109, 0.5); background: var(--rose-dim); color: var(--rose); }

/* ------------------------------------------------------------------ cinematic buttons and links (home) */
.cn-btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 26px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--ink); text-decoration: none; letter-spacing: 0.14em; font-size: 14px; transition: all 0.25s; background: rgba(255, 255, 255, 0.02); }
.cn-btn:hover { border-color: var(--gold); color: var(--gold-2); background: var(--gold-dim); }
.cn-btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #17110a; font-weight: 600; box-shadow: 0 10px 40px -12px rgba(214, 172, 95, 0.55); }
.cn-btn.gold:hover { background: linear-gradient(180deg, #f8dda4, var(--gold-2)); color: #17110a; transform: translateY(-1px); }
.cn-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-2); text-decoration: none; letter-spacing: 0.12em; border-bottom: 1px solid var(--gold-line); padding-bottom: 3px; }
.cn-link:hover { color: var(--gold); border-color: var(--gold); }

/* ------------------------------------------------------------------ home: hero */
.cn-home .lib-header { position: fixed; left: 0; right: 0; background: linear-gradient(180deg, rgba(8, 8, 10, 0.85), rgba(8, 8, 10, 0)); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.cn-home .lib-header.scrolled { background: rgba(8, 8, 10, 0.82); border-bottom-color: var(--line); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.cn-home .lib-main { max-width: none; padding: 0; }
.cn-hero { position: relative; min-height: min(100svh, 900px); display: grid; align-items: center; overflow: hidden; isolation: isolate; padding: 110px 32px 90px; }
.cn-hero-bg { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(55% 60% at 80% 28%, rgba(214, 172, 95, 0.2), transparent 70%),
  radial-gradient(48% 62% at 6% 96%, rgba(92, 179, 174, 0.16), transparent 70%),
  linear-gradient(180deg, #0b0b0e 0%, #060607 100%); }
.cn-streak { position: absolute; left: 6%; width: 88%; top: 64%; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 232, 186, 0.85) 38%, rgba(255, 232, 186, 0.95) 50%, rgba(255, 232, 186, 0.85) 62%, transparent); filter: blur(0.6px); box-shadow: 0 0 46px 10px rgba(214, 172, 95, 0.28); opacity: 0.75; }
.cn-flare { position: absolute; left: 52%; top: 54%; width: 46vw; height: 11vw; transform: translate(-50%, 0); background: radial-gradient(closest-side, rgba(214, 172, 95, 0.22), transparent); filter: blur(10px); }
.cn-vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.7)); }
.cn-hero::before, .cn-hero::after { content: ""; position: absolute; left: 0; right: 0; height: 5.5vh; background: #000; z-index: 3; }
.cn-hero::before { top: 0; }
.cn-hero::after { bottom: 0; }
.cn-hero-inner { position: relative; z-index: 2; max-width: 1320px; margin: 0 auto; width: 100%; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 56px; align-items: center; }
.cn-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.36em; color: var(--gold); }
.cn-rec { width: 9px; height: 9px; border-radius: 50%; background: #e5493b; box-shadow: 0 0 12px 2px rgba(229, 73, 59, 0.7); }
.cn-hero h1 { margin: 0 0 26px; font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 6.6vw, 96px); line-height: 1.08; letter-spacing: 0.06em; text-shadow: 0 6px 50px rgba(0, 0, 0, 0.6); }
.cn-hero h1 em { font-style: normal; color: var(--gold-2); }
.cn-lede { margin: 0 0 36px; max-width: 520px; color: var(--ink-2); font-size: 16px; line-height: 1.9; }
.cn-lede b { color: var(--ink); font-weight: 500; }
.cn-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.cn-meta { margin: 26px 0 0; color: var(--muted); font-size: 12px; letter-spacing: 0.1em; }
.cn-meta span + span::before { content: "·"; margin: 0 10px; color: #4b4740; }

/* the viewfinder that plays the sample breakdown */
.cn-vf { position: relative; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(20, 20, 25, 0.9), rgba(10, 10, 13, 0.92)); border-radius: 3px; padding: 18px 20px 16px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset; }
.cn-vf::before, .cn-vf::after { content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid var(--gold); opacity: 0.8; }
.cn-vf::before { left: -7px; top: -7px; border-right: 0; border-bottom: 0; }
.cn-vf::after { right: -7px; bottom: -7px; border-left: 0; border-top: 0; }
.cn-vf-top { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.cn-vf-top b { color: var(--ink); font-weight: 500; }
.cn-vf-rec { display: inline-flex; align-items: center; gap: 8px; color: #e5493b; }
.cn-vf-rec i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cn-vf-screen { position: relative; margin: 14px 0; aspect-ratio: 2.39 / 1; display: grid; place-items: center; text-align: center; padding: 0 28px; overflow: hidden; border: 1px solid var(--line); background:
  radial-gradient(70% 90% at 30% 20%, rgba(214, 172, 95, 0.16), transparent 70%),
  radial-gradient(60% 80% at 85% 90%, rgba(92, 179, 174, 0.13), transparent 70%),
  #09090b; }
.cn-vf-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px); pointer-events: none; }
.cn-vf-caption { font-family: var(--font-display); font-size: clamp(15px, 1.5vw, 20px); line-height: 1.7; letter-spacing: 0.06em; color: var(--ink); max-width: 90%; transition: opacity 0.35s; }
.cn-vf-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--gold); }
.cn-vf-meta span { white-space: nowrap; }
.cn-vf-note { margin: 12px 0 0; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.cn-scroll { position: absolute; left: 50%; bottom: calc(5.5vh + 14px); transform: translateX(-50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; text-decoration: none; }
.cn-scroll::after { content: ""; width: 1px; height: 34px; background: linear-gradient(180deg, var(--gold), transparent); }

/* ------------------------------------------------------------------ rhythm: the shot strip and the intensity curve */
.cn-rhythm { margin: 0; }
.cn-strip { display: flex; gap: 3px; height: 54px; }
.cn-seg { position: relative; flex: 1 1 0; min-width: 0; border: 1px solid transparent; border-radius: 2px; padding: 0; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; color: var(--ink); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; transition: filter 0.2s, border-color 0.2s, transform 0.2s; }
.cn-seg b, .cn-seg i { display: block; padding: 0 6px; font-style: normal; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.cn-seg i { color: rgba(239, 233, 221, 0.7); padding-bottom: 4px; }
.cn-seg:hover { filter: brightness(1.25); }
.cn-seg.active { border-color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold-2), 0 0 24px -4px rgba(241, 208, 143, 0.6); }
.cn-seg.long::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--gold-2); }
.cn-seg.i1 { background: linear-gradient(180deg, #17252a, #101b1f); }
.cn-seg.i2 { background: linear-gradient(180deg, #1f3a3d, #14272a); }
.cn-seg.i3 { background: linear-gradient(180deg, #4a4a3a, #2c2c24); }
.cn-seg.i4 { background: linear-gradient(180deg, #8a6a33, #5a4421); }
.cn-seg.i5 { background: linear-gradient(180deg, #d09a45, #8b5f22); color: #1a1208; }
.cn-seg.i5 i { color: rgba(26, 18, 8, 0.7); }
.cn-curve { display: block; width: 100%; height: 76px; margin-top: 8px; overflow: visible; }
.cn-curve .area { fill: url(#cn-curve-fill); }
.cn-curve .line { fill: none; stroke: var(--gold-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cn-curve .grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; vector-effect: non-scaling-stroke; }
.cn-curve .dot { fill: var(--bg); stroke: var(--gold-2); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.cn-axis { display: flex; justify-content: space-between; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.cn-playhead { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--gold-2); box-shadow: 0 0 14px 2px rgba(241, 208, 143, 0.7); pointer-events: none; }
.cn-stage { position: relative; }
.cn-rhythm-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.cn-rhythm-head h2 { margin: 0; }
.cn-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.cn-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 1px; vertical-align: -1px; background: var(--c, #444); }

/* ------------------------------------------------------------------ home: acts, library, how */
.cn-wrap { max-width: 1320px; margin: 0 auto; padding: 0 32px; }
.cn-section { padding: 110px 0 0; }
.cn-section-head { margin-bottom: 56px; max-width: 720px; }
.cn-section-head h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 3.8vw, 50px); line-height: 1.2; letter-spacing: 0.05em; }
.cn-section-head p { margin: 16px 0 0; color: var(--ink-2); font-size: 15px; max-width: 560px; }
.cn-act { display: grid; grid-template-columns: 110px minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: center; padding: 54px 0; border-top: 1px solid var(--line); }
.cn-act:last-child { border-bottom: 1px solid var(--line); }
.cn-act-no { font-family: var(--font-display); font-size: 84px; line-height: 1; font-style: italic; color: transparent; -webkit-text-stroke: 1px var(--gold-line); letter-spacing: 0.02em; }
.cn-act h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 32px; letter-spacing: 0.08em; color: var(--ink); }
.cn-act .cn-lead { margin: 0 0 18px; color: var(--gold-2); font-size: 15px; letter-spacing: 0.06em; }
.cn-act ul { margin: 0 0 26px; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.cn-act li { position: relative; padding-left: 22px; }
.cn-act li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 10px; height: 1px; background: var(--gold); }
.cn-act-art { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: linear-gradient(135deg, #14141a, #0a0a0d); display: grid; place-items: center; }
.cn-act-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at 70% 20%, rgba(214, 172, 95, 0.18), transparent 70%); }
.cn-art-bars { position: relative; width: 82%; display: grid; gap: 10px; }
.cn-art-bars i { display: block; height: 14px; border-radius: 2px; background: linear-gradient(90deg, var(--c1, #2a4b4f), var(--c2, #c99a48)); opacity: 0.9; }
.cn-art-frame { position: relative; width: 76%; aspect-ratio: 2.39 / 1; border: 1px solid var(--gold-line); background: linear-gradient(120deg, #1a2326, #2c2214 55%, #0f0f12); }
.cn-art-frame::before, .cn-art-frame::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--gold); }
.cn-art-frame::before { left: -5px; top: -5px; border-right: 0; border-bottom: 0; }
.cn-art-frame::after { right: -5px; bottom: -5px; border-left: 0; border-top: 0; }
.cn-art-swatches { position: absolute; left: 12%; right: 12%; bottom: 12%; display: flex; gap: 6px; }
.cn-art-swatches i { flex: 1; height: 22px; border-radius: 2px; }
.cn-art-cards { position: relative; width: 70%; height: 70%; }
.cn-art-cards i { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: linear-gradient(160deg, #1b1b22, #101014); }
.cn-art-cards i:nth-child(1) { transform: translate(-7%, 8%) rotate(-5deg); }
.cn-art-cards i:nth-child(2) { transform: translate(0, 0) rotate(1deg); border-color: var(--gold-line); }
.cn-art-cards i:nth-child(3) { transform: translate(7%, -8%) rotate(5deg); }
.cn-art-cards b { position: absolute; left: 12%; bottom: 14%; font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: 0.1em; color: var(--gold-2); }

.cn-posters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cn-poster { position: relative; display: flex; flex-direction: column; min-height: 250px; padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(165deg, hsl(var(--h, 40) 22% 13%), var(--bg-2) 70%); overflow: hidden; transition: border-color 0.3s, transform 0.3s; }
.cn-poster::before { content: ""; position: absolute; right: -40px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, hsl(var(--h, 40) 70% 55% / 0.22), transparent); transition: opacity 0.3s; }
.cn-poster:hover { border-color: var(--gold-line); transform: translateY(-3px); }
.cn-poster-count { position: relative; font-family: var(--font-display); font-size: 54px; line-height: 1; font-style: italic; color: transparent; -webkit-text-stroke: 1px var(--gold-line); }
.cn-poster h3 { position: relative; margin: 18px 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: 0.08em; color: var(--ink); }
.cn-poster p { position: relative; margin: 0 0 14px; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.cn-poster .lib-chips { position: relative; margin-top: auto; }

.cn-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: step; }
.cn-steps > li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.cn-steps > li:first-child { border-top: 0; padding-top: 4px; }
.cn-steps > li > b { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 34px; line-height: 1; color: var(--gold); }
.cn-steps strong { display: block; margin-bottom: 4px; color: var(--ink); letter-spacing: 0.06em; font-weight: 600; }
.cn-steps p { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.cn-steps textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, 0.025); color: var(--ink); resize: vertical; line-height: 1.7; margin: 0 0 10px; }
.cn-steps textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.cn-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 3px; }
.cn-how > div { padding: 30px 28px; border-left: 1px solid var(--line); }
.cn-how > div:first-child { border-left: 0; }
.cn-how b { display: block; margin-bottom: 14px; font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 40px; line-height: 1; color: var(--gold); }
.cn-how h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: 0.08em; font-weight: 600; color: var(--ink); }
.cn-how p { margin: 0; color: var(--ink-2); font-size: 13px; }
.cn-mode-note { margin: 22px 0 0; padding: 16px 20px; border-left: 2px solid var(--gold); background: var(--gold-dim); color: var(--ink-2); font-size: 13px; }
.cn-status-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.cn-footer { margin-top: 120px; padding: 40px 32px 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.cn-footer-inner { max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cn-footer p { margin: 0; max-width: 620px; line-height: 1.9; }
.cn-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.cn-footer nav a { color: var(--ink-2); text-decoration: none; letter-spacing: 0.08em; }
.cn-footer nav a:hover { color: var(--gold-2); }

/* ------------------------------------------------------------------ tool pages: modes, drop zone, results */
.cn-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cn-mode > span { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.cn-manual { margin-top: 16px; }
.cn-manual .lib-hint { margin: 2px 0 0; }

.lib-drop { position: relative; display: grid; place-items: center; gap: 8px; min-height: 190px; margin-top: 4px; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 3px; background: rgba(255, 255, 255, 0.018); text-align: center; cursor: pointer; color: var(--muted); transition: border-color 0.2s, background 0.2s; }
.lib-drop:hover, .lib-drop.over { border-color: var(--gold); background: var(--gold-dim); color: var(--ink-2); }
.lib-drop img { max-width: 100%; max-height: 300px; border-radius: 2px; display: block; }
.lib-drop input { display: none; }
.lib-drop.has-image { border-style: solid; padding: 12px; background: #050506; }
.lib-drop.has-image::before, .lib-drop.has-image::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--gold); pointer-events: none; }
.lib-drop.has-image::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.lib-drop.has-image::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.cn-palette { margin: 14px 0 0; }
.cn-palette-bar { display: flex; height: 38px; border-radius: 2px; overflow: hidden; border: 1px solid var(--line); }
.cn-palette-bar button { flex: 1 1 0; border: 0; padding: 0; cursor: pointer; position: relative; transition: flex-grow 0.25s; }
.cn-palette-bar button:hover { flex-grow: 2; }
.cn-palette-bar button span { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; opacity: 0; transition: opacity 0.2s; mix-blend-mode: difference; color: #fff; }
.cn-palette-bar button:hover span { opacity: 1; }
.cn-palette-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cn-palette-row b { color: var(--ink-2); font-weight: 500; }

.lib-analysis p { margin: 4px 0 8px; color: var(--ink-2); }
.lib-analysis ul { margin: 4px 0 8px; padding-left: 18px; color: var(--ink-2); }
.lib-analysis li { margin: 3px 0; }
.lib-shot { position: relative; border: 1px solid var(--line); border-radius: 3px; margin: 12px 0; background: var(--panel); }
.lib-shot > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.lib-shot > summary::-webkit-details-marker { display: none; }
.lib-shot > summary b { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.06em; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.lib-shot > summary .lib-shot-title { flex: 1; min-width: 160px; color: var(--ink-2); }
.lib-shot[open] > summary { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--gold-dim), transparent 60%); }
.lib-shot[open] { border-left: 2px solid var(--gold); }
.lib-shot.flash { animation: cn-flash 1.2s ease-out; }
.lib-shot dl { display: grid; grid-template-columns: 82px 1fr; gap: 6px 14px; margin: 0; padding: 14px 16px; }
.lib-shot dt { color: var(--muted); font-size: 12px; padding-top: 2px; letter-spacing: 0.06em; }
.lib-shot dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.lib-shot .lib-shot-actions { padding: 0 16px 14px; }
.lib-beat { display: grid; grid-template-columns: 62px 1fr; gap: 8px; }
.lib-beat i { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--gold); font-variant-numeric: tabular-nums; }
.lib-issues { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.lib-issues li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.035); color: var(--ink-2); }
.lib-issues li[data-severity="error"] { background: var(--rose-dim); }
.lib-issues li[data-severity="warning"] { background: var(--gold-dim); }
.lib-progress { color: var(--muted); font-size: 12px; min-height: 18px; margin-top: 10px; }
.lib-banner { padding: 10px 14px; border-left: 2px solid var(--gold); background: var(--gold-dim); color: var(--gold-2); margin-bottom: 14px; font-size: 13px; }
.lib-counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.lib-counter.over { color: var(--rose); }
@keyframes cn-flash { 0% { box-shadow: 0 0 0 2px var(--gold-2), 0 0 30px 2px rgba(241, 208, 143, 0.5); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* dialog and toast */
dialog.lib-dialog { border: 1px solid var(--line-strong); border-radius: 6px; padding: 24px 26px; width: min(480px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); }
dialog.lib-dialog::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(3px); }
.lib-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); padding: 10px 20px; border-radius: 3px; background: var(--ink); color: #14110b; z-index: 60; max-width: 90vw; font-weight: 500; letter-spacing: 0.04em; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); }


/* ------------------------------------------------------------------ structured instruction */
.cn-prompt { margin-top: 12px; display: grid; gap: 10px; }
.cn-group { border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, 0.015); }
.cn-group > summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; list-style: none; }
.cn-group > summary::-webkit-details-marker { display: none; }
.cn-group > summary::before { content: "▸"; color: var(--gold); font-size: 11px; transition: transform 0.2s; }
.cn-group[open] > summary::before { transform: rotate(90deg); }
.cn-group > summary .lib-btn { margin-left: auto; }
.cn-group-title { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; color: var(--ink); }
.cn-group > .lib-hint { margin: 0; padding: 0 12px 8px; }
.cn-size { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cn-secs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cn-sec { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.cn-sec:last-child { border-bottom: 0; }
.cn-sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cn-sec-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--gold-line); border-radius: 50%; color: var(--gold); font-family: var(--font-mono); font-size: 11px; flex: none; }
.cn-sec-head strong { color: var(--ink); font-weight: 600; letter-spacing: 0.04em; }
.cn-sec-hint { flex: 1; min-width: 120px; color: var(--muted); font-size: 12px; }
.cn-sec-links { margin: 6px 0 0 28px; }
.cn-sec .cn-pre { margin-left: 28px; }


/* ------------------------------------------------------------------ home: fix tiles, cases, changelog */
.cn-art-triage { position: relative; width: 70%; display: grid; gap: 18px; }
.cn-art-triage > div { display: flex; align-items: center; gap: 14px; }
.cn-art-triage i { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 16px 2px currentColor; opacity: 0.9; }
.cn-art-triage b { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)); }
.cn-art-triage > div:nth-child(2) b { max-width: 70%; }
.cn-art-triage > div:nth-child(3) b { max-width: 45%; }
.cn-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cn-tile { position: relative; display: grid; gap: 6px; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(165deg, var(--panel), var(--bg-2)); color: var(--ink-2); text-decoration: none; transition: border-color 0.3s, transform 0.3s; }
.cn-tile:hover { border-color: var(--gold-line); transform: translateY(-3px); color: var(--ink-2); }
.cn-tile strong { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: 0.08em; color: var(--ink); }
.cn-tile span:last-child { font-size: 13px; line-height: 1.8; }
.cn-tile-count { font-family: var(--font-display); font-style: italic; font-size: 34px; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--gold-line); }
.cn-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cn-case { display: grid; align-content: start; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(165deg, var(--panel), var(--bg-2)); color: var(--ink-2); text-decoration: none; transition: border-color 0.3s, transform 0.3s; }
.cn-case:hover { border-color: var(--gold-line); transform: translateY(-3px); color: var(--ink-2); }
.cn-case strong { font-family: var(--font-display); font-weight: 500; font-size: 17px; line-height: 1.5; letter-spacing: 0.04em; color: var(--ink); }
.cn-case-meta { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); }
.cn-case-sum { font-size: 13px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cn-kind { padding: 1px 9px; border: 1px solid var(--gold-line); border-radius: 2px; color: var(--gold-2); font-family: var(--font-body); letter-spacing: 0.06em; }
.cn-kind.guide { border-color: rgba(92, 179, 174, 0.5); color: var(--teal); }
.cn-kind.ai-ad { border-color: rgba(234, 122, 109, 0.5); color: var(--rose); }
.cn-log { display: grid; gap: 0; border-top: 1px solid var(--line); }
.cn-log-day { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.cn-log-day time { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--gold); }
.cn-log-day ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.cn-log-kind { display: inline-block; margin-right: 10px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 2px; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

/* ------------------------------------------------------------------ fix-it page */
.cn-triage { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; margin-bottom: 28px; }
.cn-triage h2 { font-size: 22px; }
.cn-triage-steps { margin: 12px 0 8px; padding-left: 20px; display: grid; gap: 10px; color: var(--ink-2); }
.cn-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 8px 0 14px; }
.cn-search { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 42px; border: 1px solid var(--line-strong); border-radius: 4px; background: rgba(255, 255, 255, 0.025); color: var(--muted); }
.cn-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.cn-search input { flex: 1; border: 0; background: transparent; color: var(--ink); outline: none; }
.cn-search input::placeholder { color: #5d5951; }
.cn-examples { align-items: center; margin: 10px 0 4px; }
.cn-check { margin: 0 0 24px; }
.cn-check h2 { margin: 2px 0 6px; font-weight: 400; font-size: 22px; }
.cn-check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 0; }
.cn-check-box { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--muted); font-size: 13px; }
.cn-check-result { margin-top: 14px; }
.cn-hit { padding: 14px 0 6px; border-top: 1px solid var(--line); }
.cn-hit h3 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--gold-2); }
.cn-hit-snips { margin: 0 0 6px; }
.cn-hit-snips code { padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 3px; background: rgba(255, 255, 255, 0.03); font-size: 13px; word-break: break-all; }
.cn-note { color: var(--gold); }
.cn-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cn-catbtn { background: transparent; cursor: pointer; }
.cn-catbtn small { color: var(--muted); margin-left: 4px; }
.cn-catbtn[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-dim); color: var(--gold-2); }
.cn-problems { display: grid; gap: 10px; margin-top: 10px; }
.cn-problem { border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); scroll-margin-top: 90px; }
.cn-problem[open] { border-color: var(--gold-line); }
.cn-problem > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.cn-problem > summary::-webkit-details-marker { display: none; }
.cn-problem > summary strong { font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: 0.04em; color: var(--ink); }
.cn-symptom { grid-column: 2 / 4; color: var(--muted); font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cn-problem[open] .cn-symptom { display: block; -webkit-line-clamp: unset; }
.cn-cat { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.cn-sev { min-width: 64px; text-align: center; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 2px; font-size: 11px; letter-spacing: 0.06em; white-space: nowrap; }
.cn-sev.blocker { border-color: rgba(234, 122, 109, 0.6); background: var(--rose-dim); color: var(--rose); }
.cn-sev.major { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold-2); }
.cn-sev.minor { color: var(--muted); }
.cn-problem-body { display: grid; gap: 14px; padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.cn-pb-part h4 { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.22em; color: var(--gold); }
.cn-pb-part p { margin: 0; color: var(--ink); line-height: 1.85; }
.cn-pb-warn { padding: 10px 14px; border-left: 2px solid var(--rose); background: var(--rose-dim); }
.cn-pb-warn h4 { margin-top: 2px; color: var(--rose); }
.cn-pb-warn ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.cn-problem.flash { animation: cn-flash 1.2s ease-out; }

/* ------------------------------------------------------------------ motion (only when the visitor has not asked for less) */
@media (prefers-reduced-motion: no-preference) {
  .cn-hero::before, .cn-hero::after { animation: cn-letterbox 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .cn-hero::before { transform-origin: top; }
  .cn-hero::after { transform-origin: bottom; }
  @keyframes cn-letterbox { from { height: 26vh; } to { height: 5.5vh; } }
  .cn-streak { animation: cn-streak 9s ease-in-out infinite alternate; }
  @keyframes cn-streak { from { transform: translateX(-3%); opacity: 0.55; } to { transform: translateX(3%); opacity: 0.9; } }
  .cn-flare { animation: cn-flare 12s ease-in-out infinite alternate; }
  @keyframes cn-flare { from { transform: translate(-56%, 0) scale(0.95); } to { transform: translate(-44%, 0) scale(1.08); } }
  .cn-hero-copy > * { animation: cn-rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .cn-hero-copy > *:nth-child(2) { animation-delay: 0.12s; }
  .cn-hero-copy > *:nth-child(3) { animation-delay: 0.24s; }
  .cn-hero-copy > *:nth-child(4) { animation-delay: 0.36s; }
  .cn-hero-copy > *:nth-child(5) { animation-delay: 0.48s; }
  .cn-vf { animation: cn-rise 1.3s 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  @keyframes cn-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  .cn-vf-rec i { animation: cn-blink 1.4s steps(2, jump-none) infinite; }
  .cn-rec { animation: cn-blink 1.4s steps(2, jump-none) infinite; }
  @keyframes cn-blink { 50% { opacity: 0.25; } }
  .js .cn-reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js .cn-reveal.in { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1040px) {
  .lib-grid { grid-template-columns: 1fr; }
  .cn-hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .cn-act { grid-template-columns: 70px minmax(0, 1fr); }
  .cn-act-art { grid-column: 1 / -1; }
  .cn-act-no { font-size: 56px; }
  .cn-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .lib-header { flex-wrap: wrap; padding: 10px 18px; gap: 8px 14px; }
  .lib-brand-sub { display: none; }
  .lib-nav { margin-left: 0; order: 3; width: 100%; }
  .lib-nav a { padding: 5px 10px; }
  .lib-nav a[aria-current="page"]::after { left: 10px; right: 10px; }
  .lib-main { padding: 4px 18px 64px; }
  .cn-wrap { padding: 0 18px; }
  .cn-hero { padding: 128px 18px 96px; }
  .cn-pagehead { padding: 36px 0 22px; }
  .cn-how { grid-template-columns: 1fr; }
  .cn-how > div { border-left: 0; border-top: 1px solid var(--line); }
  .cn-how > div:first-child { border-top: 0; }
  .cn-section { padding-top: 80px; }
  .cn-footer { padding: 32px 18px 48px; margin-top: 80px; }
}
@media (max-width: 600px) {
  .lib-row { grid-template-columns: 1fr; }
  .lib-shot dl { grid-template-columns: 1fr; }
  .lib-shot dt { padding-top: 8px; }
  .cn-posters { grid-template-columns: 1fr; }
  .cn-act { grid-template-columns: 1fr; gap: 14px; padding: 40px 0; }
  .cn-act-no { font-size: 48px; }
  .cn-cta .cn-btn { flex: 1 1 100%; justify-content: center; }
  .lib-card { padding: 18px 16px; }
  .cn-scroll { display: none; }
  .cn-seg b { font-size: 9px; padding: 0 3px; }
  .cn-seg i { display: none; }
}

@media (max-width: 1040px) {
  .cn-tiles, .cn-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cn-triage { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 600px) {
  .cn-tiles, .cn-cases { grid-template-columns: 1fr; }
  .cn-log-day { grid-template-columns: 1fr; gap: 6px; }
  .cn-problem > summary { grid-template-columns: auto minmax(0, 1fr); }
  .cn-cat { display: none; }
  .cn-symptom { grid-column: 1 / -1; }
}
