:root{color-scheme:light;--paper:#faf9f6;--ink:#193d43;--body:#29494f;--green:#125a46;--blue:#164f78;--ochre:#785519;--line:#d8e0d8}

*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{font-family:"Microsoft JhengHei","Noto Sans TC",sans-serif;background:#d9dfd8;color:var(--ink)}button,input,select{font:inherit}button,select{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #d7a83d;outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ==========================================================================
   Dual-Mode Navigation Bar (SOTA v2026.11)
   ========================================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #11141d;
  border-bottom: 1.5px solid #262c3e;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nav-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand span { color: #e5c58b; }

.nav-topic-badge {
  background: rgba(229, 197, 139, 0.12);
  border: 1px solid #e5c58b;
  color: #e5c58b;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-myth-title {
  font-size: 15px;
  margin: 0;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.nav-modes {
  display: flex;
  align-items: center;
  background: #181d2a;
  border: 1px solid #262c3e;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.mode-btn {
  background: transparent;
  border: none;
  color: #9aa1a9;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.mode-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.mode-btn.active {
  background: #e5c58b;
  color: #0b0d14;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(229,197,139,0.3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-action-btn {
  background: #1c2233;
  color: #f0f3ef;
  border: 1px solid #262c3e;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-action-btn:hover {
  border-color: #e5c58b;
  color: #e5c58b;
}
.nav-action-btn.pdf-btn {
  background: rgba(166,227,161,0.12);
  border-color: #a6e3a1;
  color: #a6e3a1;
}
.nav-action-btn.pdf-btn:hover {
  background: #a6e3a1;
  color: #0b0d14;
}

/* ==========================================================================
   Deck Mode Layout & SOTA Stage
   ========================================================================== */
body[data-view="deck"] {
  overflow: hidden;
}
body[data-view="deck"] #canvas-area { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
body[data-view="deck"] .progress { top: 0; }
body[data-view="deck"] #view-handout {
  display: none !important;
}

#canvas-area { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#frame{position:relative;overflow:hidden;box-shadow:0 12px 50px #34443b25}
#stage{position:absolute;left:0;top:0;width:1600px;height:900px;transform-origin:top left;background:var(--paper);overflow:hidden}

.topline{position:absolute;left:64px;right:64px;top:45px;height:32px;display:flex;align-items:center;justify-content:space-between;font-size:23px;letter-spacing:1px;font-weight:700}.topline .section{color:#176453;font-weight:600}.topline .section:before{content:"";display:inline-block;height:28px;width:1px;background:#d0d9d0;margin:0 22px;vertical-align:middle}.topline .stage-label{font-size:21px;color:#315b56}

.stage-track{display:flex;align-items:center;gap:15px;font-size:21px;color:#687e76}.stage-track .active{color:#176453;font-weight:800}.stage-separator{color:#91a39b;font-weight:400}

.slide-title{position:absolute;left:64px;top:90px;width:1472px;margin:0;font-size:56px;line-height:1.2;letter-spacing:.3px;font-weight:700;color:var(--ink)}

.split{position:absolute;left:64px;right:64px;top:195px;height:614px;display:grid;grid-template-columns:625px 1fr;gap:61px}.figure{position:relative;margin:29px 0 0;width:625px;height:585px;overflow:hidden;border-radius:8px;background:#f1eadc}.figure img{display:block;width:100%;height:100%;object-fit:contain}.figure figcaption{position:absolute;left:10px;bottom:10px;right:10px;padding:5px 9px;border-radius:5px;background:#faf9f6ed;color:#315b56;font-size:20px;line-height:1.25;text-align:center}.copy{min-width:0;padding-top:28px;color:var(--body);align-self:start}.copy .lead{font-size:32px;line-height:1.38;color:#52706b;margin:0 0 27px}.copy .story{font-size:36px;line-height:1.6;font-weight:450;margin:0 0 30px}.copy .story.primary{font-size:42px;line-height:1.46;color:var(--ink);margin-bottom:30px}.rule{height:1px;background:var(--line);margin:28px 0 25px}

.copy .story{text-wrap:pretty}.card p{text-wrap:balance}.no-break{white-space:nowrap}.em{font-weight:850;color:var(--green);font-size:1.04em}.em.short{white-space:nowrap}.em.blue{color:var(--blue)}.em.ochre{color:var(--ochre)}body[data-emphasis="off"] .em{font-weight:inherit!important;color:inherit!important;font-size:inherit!important}

.evidence-intro{position:absolute;left:64px;top:184px;margin:0;color:#596d63;font-size:34px;line-height:1.35}.cards{position:absolute;left:64px;right:64px;top:245px;height:475px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.card{min-width:0;border:1px solid #d6dfd3;border-top:5px solid #67937f;border-radius:10px;background:#f4f5ef;padding:14px 22px 17px;text-align:center;color:var(--body)}.card:nth-child(2){border-top-color:#6487a1;background:#f2f5f5}.card:nth-child(3){border-top-color:#ab8d57;background:#f7f5ee}.card-label{font-size:30px;line-height:1.25;color:#315d55;font-weight:700;margin:0 0 9px}.card img{display:block;width:172px;height:172px;object-fit:contain;margin:0 auto 10px;border-radius:6px}.card p{font-size:33px;line-height:1.36;font-weight:450;text-align:left;margin:9px 0 0}.evidence-foot{position:absolute;left:64px;right:64px;top:738px;margin:0;color:var(--body);font-size:29px;line-height:1.4}

.punch-copy{padding-top:12px;align-self:start}.punch-eyebrow{color:#596d63;font-size:24px;margin:0 0 12px}.punch-title{font-size:54px;line-height:1.2;letter-spacing:.2px;font-weight:700;color:var(--ink);margin:0 0 16px}.punch-copy .lead{font-size:30px;line-height:1.35;color:#46635d;margin:0 0 14px}.punch-copy .story{font-size:28px;line-height:1.4;margin:0 0 14px}

.retest-copy{padding-top:10px;align-self:start}.retest-lead{font-size:30px;line-height:1.35;color:#52706b;margin:0 0 14px}.retest-results{display:grid;gap:8px}.retest-line{font-size:27px;line-height:1.35;margin:0;padding-left:14px;border-left:4px solid #87ac97;text-wrap:pretty}.retest-line.outcome-1{border-color:#7197ad}.retest-line.outcome-2{border-color:#b08855}.retest-line.outcome-3{border-color:#a0aca4}.retest-closing{font-size:25px;line-height:1.35;font-weight:700;color:#315b56;border-top:1px solid var(--line);padding-top:10px;margin:12px 0 0}

.boundary{position:absolute;left:64px;right:64px;bottom:50px;padding:9px 0 0 17px;margin:0;border-top:1px solid #ced9d0;color:#315b56;font-size:22px;line-height:1.35;font-weight:600}.boundary:before{content:"";position:absolute;left:0;top:11px;width:4px;height:24px;border-radius:3px;background:#987442}

.slide-bottom{position:absolute;left:64px;right:64px;bottom:16px;display:flex;justify-content:space-between;color:#56736d;font-size:19px;line-height:1.2}

.progress{position:fixed;z-index:30;top:48px;left:0;width:100%;height:8px;margin:0;appearance:none;background:linear-gradient(90deg,#176453 var(--progress,0%),#d1d8d1 var(--progress,0%));cursor:pointer}.progress::-webkit-slider-thumb{appearance:none;width:12px;height:12px;border-radius:50%;background:#176453}.progress:focus-visible{height:14px}

.dock{position:fixed;z-index:30;left:50%;bottom:0;transform:translateX(-50%) scale(var(--control-scale,1));transform-origin:bottom center;display:flex;align-items:center;gap:6px;max-width:calc(100vw - 20px);padding:4px 10px;border:1px solid #ffffff3d;border-radius:999px;background:rgba(25,61,67,.97);box-shadow:0 10px 28px #17272f40;color:white;white-space:nowrap}.dock button,.dock select{display:inline-flex;align-items:center;justify-content:center;min-height:35px;padding:5px 11px;border:1px solid #ffffff30;border-radius:999px;background:#ffffff14;color:#f7faf7;font-size:13px;font-weight:700}.dock select option{color:#193d43;background:#faf9f6}.dock button:hover,.dock select:hover{background:#2b655d}.dock button[aria-pressed="true"]{background:#176453;border-color:#a9e3c9}.dock button:disabled{opacity:.35;cursor:default}.dock .arrow{font-size:20px;width:38px;padding:0}.dock-range{appearance:none;width:92px;height:6px;border-radius:999px;background:linear-gradient(90deg,#8dd2b0 var(--progress,0%),#ffffff4d var(--progress,0%));cursor:pointer}.dock-range::-webkit-slider-thumb{appearance:none;width:15px;height:15px;border-radius:50%;background:#f7faf7;border:2px solid #6bbd9a}.dock .page{color:#fde3ab;min-width:58px;font-size:13px;text-align:center}.dock .divider{height:22px;width:1px;background:#ffffff35;margin:0 2px}

dialog{width:min(800px,calc(100vw - 36px));max-height:80vh;padding:26px 30px;border:1px solid #bdcbc0;border-radius:16px;background:#faf9f6;color:var(--ink);box-shadow:0 20px 60px #0005}dialog::backdrop{background:#14262ca8}dialog header{display:flex;align-items:center;justify-content:space-between;gap:18px}dialog h2{margin:0;font-size:27px}dialog h3{font-size:19px;margin:22px 0 4px;color:#176453}dialog p,dialog li{font-size:20px;line-height:1.8}dialog .close{width:38px;height:38px;border:1px solid #b9c7bb;border-radius:50%;background:white;color:var(--ink);font-size:22px}dialog a{color:#164f78;text-underline-offset:3px}dialog .note-meta,.dialog-hint{font-size:15px;color:#536f65}.source-scope{display:block;color:#425f5b;font-size:16px}.jump-group{margin:18px 0}.jump-group h3{margin:0 0 8px}.jump-buttons{display:flex;flex-wrap:wrap;gap:8px}.jump-buttons button{padding:9px 12px;border:1px solid #c9d7cc;border-radius:8px;background:#eef3ec;color:#193d43;text-align:left;font-size:16px}.jump-buttons button[aria-current="step"]{background:#d2e9dc;border-color:#176453;font-weight:700}.script-section{padding:18px 0;border-top:1px solid #d8e0d8}.script-section p{margin:10px 0 0}.script-jump{border:0;background:transparent;padding:0;text-align:left;color:#125a46;font-weight:700;font-size:20px}.script-jump span{display:block;color:#536f65;font-size:14px;margin-bottom:4px}

/* Fork & Portal Navigation Enhancements (Golden SOP 1600x900) */
.fork-intro { position: absolute; left: 64px; right: 64px; top: 182px; font-size: 32px; line-height: 1.35; color: #52706b; margin: 0; }
.fork-cards { position: absolute; left: 64px; right: 64px; top: 228px; height: 480px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.fork-card { min-width: 0; display: flex; flex-direction: column; padding: 14px 18px 16px; border-radius: 12px; background: #f4f5ef; border: 1px solid #d6dfd3; border-top: 5px solid #176453; box-shadow: 0 4px 16px rgba(25, 61, 67, 0.05); transition: transform .2s, border-color .2s; }
.fork-card:hover { transform: translateY(-3px); border-color: #176453; }
.fork-card-r2 { border-top-color: #2a668e; background: #f2f5f5; }
.fork-card-r2:hover { border-color: #2a668e; }
.fork-card-r3 { border-top-color: #9e782f; background: #f7f5ee; }
.fork-card-r3:hover { border-color: #9e782f; }
.fork-card.is-seen { border-color: #2ea387; background: #f0f7f3; }
.fork-card-badge { font-size: 26px; font-weight: 750; color: #176453; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.fork-card-r2 .fork-card-badge { color: #2a668e; }
.fork-card-r3 .fork-card-badge { color: #9e782f; }
.fork-num { display: inline-block; padding: 2px 9px; border-radius: 999px; background: rgba(23,100,83,0.12); font-size: 18px; font-weight: 700; }
.fork-card-r2 .fork-num { background: rgba(42,102,142,0.12); }
.fork-card-r3 .fork-num { background: rgba(158,120,47,0.12); }
.fork-seen-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #2ea387; color: #fff; font-size: 15px; font-weight: 700; }
.fork-card-figure { width: 100%; height: 150px; border-radius: 8px; background: #faf9f6; border: 1px solid #e5ebe4; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.fork-card-img { width: 100%; height: 100%; object-fit: contain; }
.fork-card-cue { font-size: 21px; line-height: 1.4; color: var(--body); margin: 0 0 6px; text-align: left; }
.fork-card-test { font-size: 19px; line-height: 1.38; color: #596d63; margin: 0 0 10px; text-align: left; }
.fork-field { color: var(--ink); font-weight: 700; }
.fork-card-btn { margin-top: auto; width: 100%; min-height: 44px; padding: 7px 12px; border: none; border-radius: 8px; background: #176453; color: #fff; font-size: 19px; font-weight: 750; cursor: pointer; transition: background .2s; }
.fork-card-btn:hover { background: #0e4639; }
.fork-card-r2 .fork-card-btn { background: #2a668e; }
.fork-card-r2 .fork-card-btn:hover { background: #1d4c6d; }
.fork-card-r3 .fork-card-btn { background: #9e782f; }
.fork-card-r3 .fork-card-btn:hover { background: #795a20; }
.fork-bottom-bar { position: absolute; left: 64px; right: 64px; top: 765px; height: 44px; display: flex; justify-content: space-between; align-items: center; }
.fork-all-btn { padding: 8px 22px; border: 1.5px solid #176453; border-radius: 8px; background: #eef6f1; color: #176453; font-size: 19px; font-weight: 700; cursor: pointer; transition: background .2s; }
.fork-all-btn:hover { background: #d7ecdf; }
.fork-close-btn { padding: 8px 24px; border: 1px solid #238972; border-radius: 8px; background: linear-gradient(135deg, #176453, #0f4b3e); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(23,100,83,0.2); transition: transform .2s, box-shadow .2s; }
.fork-close-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(23,100,83,0.3); }

/* Retest Action to Fork */
.retest-actions { margin-top: 14px; display: flex; gap: 14px; }
.retest-fork-btn { padding: 7px 18px; border: 1.5px solid #176453; border-radius: 8px; background: #eef6f1; color: #176453; font-size: 19px; font-weight: 750; cursor: pointer; transition: background .2s; }
.retest-fork-btn:hover { background: #d7ecdf; }

/* Punch to Portal CTA */
.punch-portal-action { margin-top: 16px; }
.punch-portal-cta { display: inline-flex; align-items: center; padding: 10px 22px; border-radius: 10px; background: linear-gradient(135deg,#176453,#0d4a3c); color: #fff; font-size: 21px; font-weight: 750; text-decoration: none; box-shadow: 0 6px 18px rgba(23,100,83,0.25); border: 1px solid #238972; transition: transform .2s, box-shadow .2s; }
.punch-portal-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23,100,83,0.35); color: #fff; }

/* Dock Elements */
.dock-portal-btn { display: inline-flex; align-items: center; gap: 4px; color: #fde3ab; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 4px 10px; font-size: 12px; font-weight: 600; text-decoration: none; }
.dock-portal-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
#return-fork { background: #3d6e5d; color: #fff; border-color: #5ca88f; font-weight: 700; }
#return-fork:hover { background: #2a5446; }
#next.next-portal { width: auto !important; min-width: 105px; background: #d7a83d; color: #1a2822; font-weight: 750; padding: 4px 14px; white-space: nowrap; }
#next.next-portal:hover { background: #eec25d; }

/* ==========================================================================
   Handout Mode View Styles
   ========================================================================== */
body[data-view="handout"] {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #0f131c !important;
  color: #edf1f6 !important;
}
body[data-view="handout"] #canvas-area,
body[data-view="handout"] .dock,
body[data-view="handout"] #top-progress {
  display: none !important;
}

#view-handout { margin-top: 0;
  padding: 36px 24px 80px;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
}

.handout-hero {
  text-align: center;
  margin-bottom: 36px;
  border-bottom: 1px solid #262c3e;
  padding-bottom: 24px;
}
.handout-topic-tag {
  display: inline-block;
  background: rgba(229,197,139,0.12);
  border: 1px solid #e5c58b;
  color: #e5c58b;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
}
.handout-hero-title {
  font-family: 'Noto Serif TC', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 42px);
  color: #fff;
  margin: 0 0 10px;
}
.handout-hero-desc {
  color: #9aa1a9;
  font-size: 15px;
  max-width: 750px;
  margin: 0 auto 20px;
  line-height: 1.6;
}
.handout-hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.handout-action-btn {
  background: #181d2a;
  color: #e5c58b;
  border: 1.5px solid #e5c58b;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.handout-action-btn:hover {
  background: #e5c58b;
  color: #0b0d14;
}
.handout-action-btn.handout-action-mint {
  color: #a6e3a1;
  border-color: #a6e3a1;
}
.handout-action-btn.handout-action-mint:hover {
  background: #a6e3a1;
  color: #0b0d14;
}
.handout-action-btn.handout-action-subtle {
  color: #9aa1a9;
  border-color: #3b4252;
}
.handout-action-btn.handout-action-subtle:hover {
  color: #fff;
  border-color: #fff;
}

/* Handout Cards List */
.handout-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.handout-row {
  background: #161a25;
  border: 1.5px solid #262c3e;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  transition: border-color 0.2s;
}
.handout-row:hover {
  border-color: #38425d;
}

.handout-card-head {
  background: #1c2232;
  padding: 12px 20px;
  border-bottom: 1px solid #262c3e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.handout-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.handout-pill {
  background: #e5c58b;
  color: #090a10;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}
.handout-chapter {
  color: #9aa1a9;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.handout-title {
  color: #fff;
  font-size: 18px;
  margin: 0;
  font-weight: 700;
}
.handout-jump-btn {
  background: rgba(229,197,139,0.12);
  color: #e5c58b;
  border: 1px solid #e5c58b;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.handout-jump-btn:hover {
  background: #e5c58b;
  color: #0b0d14;
}

.handout-card-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
  padding: 20px;
}
@media (max-width: 950px) {
  .handout-card-body {
    grid-template-columns: 1fr;
  }
}

/* Handout Slide Preview Card */
.handout-preview {
  background: #faf9f6;
  color: #193d43;
  border-radius: 10px;
  border: 1px solid #d8e0d8;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.03);
}
.handout-preview-fig {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #f1eadc;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.handout-preview-fig img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.handout-preview-caption {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  background: rgba(250,249,246,0.92);
  color: #315b56;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  text-align: center;
}
.handout-preview-lead {
  font-size: 15px;
  font-weight: 700;
  color: #176453;
  margin: 0 0 8px;
  line-height: 1.4;
}
.handout-preview-stories {
  font-size: 14px;
  line-height: 1.6;
  color: #29494f;
  margin-bottom: 10px;
}
.handout-preview-stories p {
  margin: 4px 0;
}
.handout-preview-boundary {
  font-size: 11px;
  color: #56736d;
  border-top: 1px solid #d8e0d8;
  padding-top: 6px;
  margin: 0;
}

/* Handout Notes Pane */
.handout-notes-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.65;
}

.handout-box {
  border-radius: 8px;
  padding: 10px 14px;
}
.handout-box-title {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.handout-lead-box {
  background: rgba(137,180,250,0.08);
  border-left: 3.5px solid #89b4fa;
  color: #dbe5f7;
}
.handout-lead-box .handout-box-title { color: #89b4fa; }

.handout-speech-box {
  background: rgba(166,227,161,0.08);
  border-left: 3.5px solid #a6e3a1;
  color: #edf5ed;
}
.handout-speech-box .handout-box-title { color: #a6e3a1; }
.handout-speech-box p { margin: 0; }

.handout-why-box {
  background: rgba(229,197,139,0.08);
  border-left: 3.5px solid #e5c58b;
  color: #f7eee1;
}
.handout-why-box .handout-box-title { color: #e5c58b; }
.handout-why-box p { margin: 0; }

.handout-sources-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid #262c3e;
  border-radius: 8px;
  padding: 10px 14px;
  color: #c4cfdd;
  font-size: 12.5px;
}
.handout-sources-box .handout-box-title { color: #9aa1a9; }
.handout-sources-box ul { margin: 4px 0 0; padding-left: 18px; }
.handout-sources-box li { margin-bottom: 6px; }
.handout-sources-box a { color: #89b4fa; text-decoration: none; font-weight: 600; }
.handout-sources-box a:hover { text-decoration: underline; }
.handout-source-scope { display: block; color: #8993a2; font-size: 11.5px; }

/* Responsive adjustments for Top Nav */
@media (max-width: 820px) {
  .nav-myth-title { display: none; }
  .top-nav { padding: 0 10px; }
  .mode-btn { padding: 4px 8px; font-size: 12px; }
  .nav-action-btn { padding: 4px 8px; font-size: 11px; }
}

/* ==========================================================================
   SOTA Mobile Thumb Ergonomics & Touch Gestures (ADR-0144 / v2026.11)
   ========================================================================== */
.mobile-dock-btn {
  display: none !important;
}

.touch-edge-hint {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 64px;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.touch-hint-left { left: 10px; }
.touch-hint-right { right: 10px; }
.touch-edge-hint.active {
  display: flex !important;
  opacity: 0.95 !important;
  transform: translateY(-50%) scale(1.1) !important;
}

.handout-mobile-dock {
  display: none;
}

@media (max-width: 850px) {
  .mobile-dock-btn {
    display: inline-flex !important;
  }

  /* Secondary desktop buttons hidden from main pill on mobile */
  .dock #play-mode,
  .dock #return-fork,
  .dock #overview-portal,
  .dock #jump-open,
  .dock #emphasis,
  .dock #speaker,
  .dock #full-script,
  .dock #sources,
  .dock #fullscreen,
  .dock .dock-range,
  .dock .divider {
    display: none !important;
  }

  /* Ergonomic Floating Bottom Capsule Dock within thumb reach */
  .dock {
    position: fixed !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: rgba(17, 23, 30, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.7) !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    z-index: 50 !important;
  }
  .dock button {
    min-height: 36px !important;
    padding: 4px 9px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
  }
  .dock .arrow {
    width: 36px !important;
    font-size: 18px !important;
  }
  .dock .page {
    font-size: 12px !important;
    min-width: 52px !important;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
  }
  .dock .page:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  /* Stage & Canvas on mobile: centered, dock cleared */
  #canvas-area {
    padding-bottom: 60px;
  }

  /* Bottom sheet dialog styling on mobile */
  dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 82vh !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.6) !important;
    animation: bottomSheetSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes bottomSheetSlide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* Mobile Sheet Content Styling */
  .mobile-sheet-group {
    margin-bottom: 16px;
  }
  .mobile-sheet-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #176453;
    margin-bottom: 8px;
  }
  .mobile-routes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .mobile-route-item {
    background: #eef3ec;
    border: 1.5px solid #c9d7cc;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #193d43;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
  }
  .mobile-route-item.active {
    background: #176453;
    color: #fff;
    border-color: #176453;
    font-weight: 700;
  }
  .mobile-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #f4f7f3;
    border: 1px solid #d8e2d7;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #193d43;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
  }
  .mobile-action-btn:active {
    background: #e2ece1;
  }
  .m-act-icon {
    margin-right: 8px;
  }
  .m-act-arrow {
    color: #7b948c;
    font-size: 16px;
    font-weight: 700;
  }

  /* Handout Mobile Dock */
  .handout-mobile-dock {
    display: flex;
    position: fixed;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    gap: 8px;
    z-index: 50;
  }
  .handout-dock-btn {
    background: #238636;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    transition: transform 0.15s;
  }
  .handout-dock-btn:active {
    transform: scale(0.96);
  }
  .handout-dock-top {
    background: rgba(22, 27, 34, 0.9);
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  }
  
  /* Handout layout adjustments */
  #view-handout {
    padding: 16px 12px 76px;
  }
  .handout-hero {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  .handout-hero-title {
    font-size: 24px;
  }
  .handout-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .handout-jump-btn {
    align-self: flex-start;
  }
}

@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Print Styles */
@media print {
  .top-nav, .dock, .progress, dialog {
    display: none !important;
  }
  body[data-view="deck"] #canvas-area { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
  body[data-view="deck"] #frame,
  body[data-view="deck"] #stage {
    transform: none !important;
    width: 100% !important;
    height: auto !important;
  }
  body[data-view="handout"] #view-handout {
    margin-top: 0 !important;
    padding: 0 !important;
  }
  .handout-hero-actions, .handout-jump-btn {
    display: none !important;
  }
  .handout-row {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    margin-bottom: 24px !important;
  }
}

/* Standalone Bar (Only shown when not in iframe) */
.standalone-bar {
  display: none !important;
}
body.is-standalone .standalone-bar {
  display: flex !important;
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  background: rgba(21, 27, 34, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.standalone-btn {
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
}
.standalone-btn:hover {
  color: #e5c58b;
}
.standalone-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
}
.standalone-mode-capsule {
  display: inline-flex;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 999px;
  padding: 2px;
}
.standalone-mode-btn {
  border: none;
  background: transparent;
  color: #8b949e;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.standalone-mode-btn.active {
  background: #238636;
  color: #fff;
}

/* =========================================================================
   SOTA Mobile Slide Polish & Fluid Swiping Protocol (ADR-0148)
   Scoped STRICTLY to mobile (max-width: 850px) - ZERO Desktop Interference
   ========================================================================= */
@media (max-width: 850px) {
  html, body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
  }
  #stage {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(100vh - 46px) !important;
    transform: none !important;
    padding: 10px 16px 84px !important;
    box-sizing: border-box !important;
    will-change: transform, opacity;
  }
  #stage.slide-swipe-next {
    animation: slideInFromRight 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  }
  #stage.slide-swipe-prev {
    animation: slideInFromLeft 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  }
  @keyframes slideInFromRight {
    from { opacity: 0.35; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes slideInFromLeft {
    from { opacity: 0.35; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
  }

  /* Slide Typography Tuning */
  .slide-title, .punch-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
    margin: 6px 0 10px !important;
  }
  .split {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  .figure {
    width: 100% !important;
    max-height: min(230px, 30vh) !important;
    aspect-ratio: auto !important;
    margin: 0 auto !important;
  }
  .figure img {
    max-height: min(230px, 30vh) !important;
    width: auto !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
  }
  .copy {
    padding: 4px 0 0 !important;
  }
  .copy .lead {
    font-size: 15px !important;
    margin: 0 0 8px !important;
    line-height: 1.45 !important;
  }
  .copy .story, .copy .story.primary {
    font-size: 15px !important;
    line-height: 1.45 !important;
    margin: 0 0 8px !important;
  }

  /* Fork Slide (Slide 08) Compact Single-Screen Split-Card Layout */
  .fork-intro {
    font-size: 13px !important;
    margin: 0 0 6px !important;
    color: #56736d !important;
  }
  .fork-cards,
  .fork-cards.opt-b {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
  }
  .fork-cards .fork-card,
  .fork-cards.opt-b .fork-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1.5px solid #d6dfd3 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important;
    display: grid !important;
    grid-template-columns: 88px 1fr !important;
    grid-template-areas:
      "fig head"
      "fig kw"
      "fig cue"
      "fig btn" !important;
    column-gap: 12px !important;
    row-gap: 2px !important;
    align-items: center !important;
    min-height: 0 !important;
    height: auto !important;
    flex: 0 0 auto !important;
  }
  .fork-cards .fork-card-figure,
  .fork-cards.opt-b .fork-card-figure {
    grid-area: fig !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 88px !important;
    height: 88px !important;
    background: #f4f7f4 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid #e1e9df !important;
    margin: 0 !important;
  }
  .fork-cards .fork-card-img,
  .fork-cards.opt-b .fork-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .fork-cards .fork-card-header,
  .fork-cards.opt-b .fork-card-header {
    grid-area: head !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
  }
  .fork-badge-solid {
    font-size: 11px !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
  }
  .fork-card-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #56736d !important;
  }
  .fork-card-kw {
    grid-area: kw !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #176453 !important;
    margin: 2px 0 0 !important;
    line-height: 1.2 !important;
  }
  .fork-cards .fork-card-cue,
  .fork-cards.opt-b .fork-card-cue {
    grid-area: cue !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    color: #3b524c !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 2px 0 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-weight: 500 !important;
  }
  .fork-cards .fork-card-slogan,
  .fork-cards.opt-b .fork-card-slogan {
    display: none !important;
  }
  .fork-cards .fork-card-btn,
  .fork-cards.opt-b .fork-card-btn {
    grid-area: btn !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    padding: 5px 12px !important;
    border-radius: 999px !important;
    background: #176453 !important;
    color: #fff !important;
    border: none !important;
    width: fit-content !important;
    min-height: 28px !important;
    height: auto !important;
    margin: 0 !important;
  }
  .fork-bottom-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin: 6px 0 !important;
  }
  .fork-bottom-bar button {
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 8px 10px !important;
    border-radius: 8px !important;
    min-height: 36px !important;
  }
  .fork-all-btn {
    background: #eef5f1 !important;
    color: #176453 !important;
    border: 1.5px solid #176453 !important;
  }
  .fork-close-btn {
    background: #fafaf7 !important;
    color: #56736d !important;
    border: 1.5px solid #d6dfd3 !important;
  }

  /* Retest Typography Tuning */
  .copy.retest-copy .retest-lead {
    font-size: 16px !important;
    margin: 0 0 8px !important;
    line-height: 1.4 !important;
  }
  .retest-line {
    font-size: 15.5px !important;
    line-height: 1.45 !important;
    padding: 8px 12px !important;
    margin: 6px 0 !important;
  }

  /* Bottom Dock Button Text on Last Slide */
  .dock button.next-portal {
    font-size: 12px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
  }
}
