:root {
  --you: #F26B1D;
  --bg: #f3eee6;
  --bg-elev: #fffdf9;
  --bg-page: #efe7dc;
  --border: #e2d6c8;
  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #7a7268;
  --accent: #1d4ed8;
  --fill: #f4efe8;
  --fill-2: #ebe4d8;
  --danger-bg: #fdecea;
  --shadow: 0 2px 14px rgba(28, 25, 23, 0.06);
  --header: rgba(243, 238, 230, 0.92);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #161311;
  --bg-elev: #211c18;
  --bg-page: #100e0c;
  --border: #3f3832;
  --text: #f5efe8;
  --text-2: #c4b8ae;
  --text-3: #8a8078;
  --accent: #93c5fd;
  --fill: #2a241f;
  --fill-2: #342e28;
  --danger-bg: #3a1c1a;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --header: rgba(22, 19, 17, 0.92);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  line-height: 1.5;
}
.skip {
  position: absolute; left: -999px; top: 8px;
}
.skip:focus { left: 8px; background: var(--bg-elev); padding: 8px 12px; z-index: 20; color: var(--text); }
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
}
.site-header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 10px; flex: 1; min-width: 0; }
.toc a {
  color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600;
  padding: 6px 4px; white-space: nowrap;
}
.toc a:hover { color: var(--you); }
.theme-btn, .copy-btn {
  appearance: none; border: 1.5px solid var(--border); background: var(--bg-elev);
  color: var(--text); border-radius: 999px; padding: 6px 12px; font-weight: 700;
  font-size: 12px; cursor: pointer;
}
.theme-btn:hover, .copy-btn:hover { border-color: var(--you); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 16px 20px 80px; }
.loading, .error { text-align: center; padding: 48px 16px; color: var(--text-2); }
.error { color: #D93025; }

.act-header { text-align: center; padding: 22px 8px 10px; }
.act-pill {
  display: inline-block; background: var(--you); color: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px;
  box-shadow: 0 0 18px #F26B1D88;
}
.act-title { font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; margin: 8px 0 0; line-height: 1.2; }
.act-sub { font-size: 14px; color: var(--text-2); margin-top: 4px; }

.pill {
  display: inline-block; color: #fff; border-radius: 999px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
}
.badge {
  display: inline-block; border: 1.5px solid; border-radius: 8px; padding: 2px 8px;
  font-size: 12px; font-weight: 700;
}
.num {
  width: 24px; height: 24px; border-radius: 12px; background: var(--text); color: var(--bg-elev);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 24px;
}
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.card-title { font-weight: 700; font-size: 16px; line-height: 1.3; display: flex; gap: 8px; align-items: center; }
.card-note { font-size: 13px; line-height: 1.45; color: var(--text-2); }
.row-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs img, .thumb-img {
  width: 62px; border-radius: 8px; display: block; aspect-ratio: 9/16; object-fit: cover;
}
.card-links { display: flex; flex-wrap: wrap; gap: 12px; }
.card-links a, .watch-link, a.inline {
  color: var(--accent); text-decoration: underline; font-size: 13px; padding: 6px 0; display: inline-block;
}
.watch-link { font-size: 14px; padding: 8px 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 14px; background: var(--fill-2); color: var(--text);
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px;
}
.dead {
  margin-left: 18px; display: flex; gap: 6px; align-items: flex-start;
}
.dead-arrow { color: #D93025; font-weight: 700; font-size: 16px; }
.dead-box {
  border: 1.5px dashed #D93025; border-radius: 10px; padding: 8px 10px;
  background: var(--danger-bg); flex: 1;
}
.dead-title { font-weight: 700; font-size: 13px; margin-top: 4px; }
.dead-note { font-size: 12px; color: var(--text-2); line-height: 1.4; }

.board { display: flex; flex-direction: column; }
.board-row { display: flex; align-items: flex-start; gap: 4px; }
.board-row.reverse { flex-direction: row-reverse; }
.board-cell { flex: 1 1 0; min-width: 0; }
.board-stack { display: flex; flex-direction: column; align-items: stretch; }
.arrow-slot { padding-top: 40px; display: flex; align-items: flex-start; justify-content: center; }
.arrow-down-wrap { display: flex; padding: 4px 60px; }
.arrow { display: flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; }
.hidden { visibility: hidden; }

.callout {
  background: var(--bg-elev); border: 1px solid var(--border); border-left: 4px solid var(--you);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14px; color: var(--text-2);
}
.callout.danger { border-left-color: #D93025; background: var(--danger-bg); }
.callout b, .callout .lead { color: var(--text); font-weight: 800; display: block; margin-bottom: 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }
.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
.soft-img { border-radius: 14px; overflow: hidden; }
.soft-img img { width: 100%; display: block; height: auto; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-track { grid-column: 1 / -1; }
  .site-header-inner { align-items: flex-start; }
  .brand { flex: 1 1 100%; }
  .toc { flex: 1 1 100%; }
  .wrap { padding: 12px 14px 64px; }
  .hero h1, .act-title, .panel, .card, .callout { overflow-wrap: break-word; }
}
body { overflow-wrap: break-word; }

.bar-label { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.bar-meta { display: block; font-size: 11px; color: var(--text-3); }
.bar-track { height: 10px; border-radius: 5px; background: var(--fill-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--you); }
.bar-val { font-size: 12px; font-weight: 800; white-space: nowrap; }

.cols { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 8px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.col-bar { width: 100%; max-width: 42px; border-radius: 8px 8px 2px 2px; background: var(--fill-2); }
.col.emph .col-bar { background: var(--you); }
.col-val { font-size: 12px; font-weight: 800; }
.col-lab { font-size: 10px; color: var(--text-3); text-align: center; line-height: 1.25; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
@media (max-width: 800px) { .metrics { grid-template-columns: 1fr 1fr; } }
.metric { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.metric-val { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--you); }
.metric-lab { font-weight: 700; margin-top: 4px; }
.metric-det { font-size: 12px; color: var(--text-3); }

.hero {
  border: 1px solid var(--border); border-radius: 18px; padding: 20px;
  background: var(--bg-elev); display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
}
.hero-copy { flex: 1 1 320px; min-width: 0; }
.hero h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; line-height: 1.1; margin: 0; }
.hero p { font-size: 15px; color: var(--text-2); margin: 8px 0 0; line-height: 1.5; }
.hero-mosaic { flex: 1 1 260px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; min-width: 0; }
.hero-mosaic img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; display: block; }
.hero-mosaic .t0 { transform: rotate(-2deg); }
.hero-mosaic .t1 { transform: rotate(2deg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0 14px; }
.chip {
  cursor: pointer; min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid; background: var(--bg-elev); color: var(--text);
  font-weight: 700; font-size: 13px;
}
.chip.on { color: #fff; }

.vid { padding: 12px; }
.vid-main { display: flex; gap: 10px; }
.vid-thumb { width: 72px; flex: 0 0 72px; border-radius: 8px; overflow: hidden; background: var(--fill); }
.vid-thumb img, .vid-fallback {
  width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block;
}
.vid-fallback { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.vid-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.vid-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.vid-note { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.4; }
.vera-box {
  border-left: 3px solid var(--you); background: var(--fill); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; line-height: 1.45;
}
.vid-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; font-size: 12px; color: var(--text-2); }
.vid-views { font-weight: 800; color: var(--text); font-size: 15px; }
.src-line { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.frames-strip {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.frames-title { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; color: var(--text-2); }
.frames-row { display: flex; flex-wrap: wrap; gap: 10px; }
.frame-tile {
  flex: 1 1 88px; max-width: 120px; min-width: 72px; position: relative;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: transparent;
}
.frame-tile.on { border: 2px solid var(--you); }
.frame-pick {
  display: block; width: 100%; margin: 0; background: transparent; border: none;
  padding: 0; cursor: pointer; text-align: left; color: inherit;
}
.frame-pick img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; display: block; }
.frame-label { font-size: 11px; color: var(--text-2); margin-top: 6px; line-height: 1.3; }

.dl-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 32px; height: 32px; min-width: 32px; min-height: 32px;
  border-radius: 16px; border: none; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 17, 17, 0.78); color: #fff; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35); text-decoration: none;
}
.dl-btn:hover, .dl-btn:focus { background: #111; color: #fff; outline: 2px solid #fff; outline-offset: 1px; }
.script-photo { flex: 1 1 140px; max-width: 200px; min-width: 120px; position: relative; }
.script-photo img { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; display: block; }
.script-cap { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.script-body { flex: 2 1 240px; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.script-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cover { font-size: 22px; font-weight: 800; }
.model { font-size: 13px; color: var(--text-3); }
.caption-chip {
  background: #111; color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 13px;
}
.tiny { font-size: 12px; color: var(--text-3); }

.code-wrap { position: relative; }
.code-wrap .copy-btn { position: absolute; top: 8px; right: 8px; z-index: 1; }
pre.code {
  background: #111; color: #f5efe8; border-radius: 10px; padding: 14px 16px;
  font-size: 13px; line-height: 1.5; overflow: auto; max-height: 260px;
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week {
  display: grid; min-width: 720px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg-elev);
}
.week-head, .week-row { display: contents; }
.week .cell {
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 4px 6px; font-size: 11px; position: relative; min-height: 28px;
}
.week .hd { background: var(--fill); font-weight: 800; text-align: center; position: sticky; top: 0; }
.week .hd.today { background: #F26B1D22; color: var(--you); }
.week .time { color: var(--text-3); text-align: right; background: var(--fill); font-variant-numeric: tabular-nums; }
.week-event {
  position: absolute; inset: 2px 3px; background: #F26B1D22; border-left: 3px solid var(--you);
  border-radius: 6px; padding: 3px 5px; font-size: 11px; font-weight: 700; line-height: 1.25;
  color: var(--text); overflow: hidden;
}

.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step-body { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; flex: 1; }
.step-title { font-weight: 800; }
.step-det { font-size: 13px; color: var(--text-2); }

.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.link-card {
  display: block; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; color: var(--text);
}
.link-card:hover { border-color: var(--you); }
.link-card .t { font-weight: 700; }
.link-card .s { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.section-head { font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: 0.4px; margin: 28px 0 8px; text-transform: uppercase; }
.footer-note { font-size: 13px; color: var(--text-2); margin-top: 10px; line-height: 1.5; }
body.ready #app { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
