/* hallmark: v2.0.0 | theme: EJU+ locked DESIGN.md (Calm Exam Desk) | genre: editorial | signature: interactive EJU study desk workbenches */
/* critique: Elevated motion choreography, dual-CTA PC parity (Mock Exam + APK, zero PC PWA), ported Flutter Stats & School Compare workbenches, and AI-SEO FAQ */

@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("assets/fonts/figtree-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EditorialSerif";
  src: url("assets/fonts/editorial-serif-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F8F8F8;
  --sand: #EFECE6;
  --night: #0F1E33;
  --lavender: #EAE6F7;
  --paper: #FFFFFF;
  --obsidian: #131620;

  --ink: #18181C;
  --ink-2: #3E3E48;
  --ink-3: #565662;
  --fill-1: #F2F3F7;
  --fill-2: #E5E7EF;
  --fill-3: #C9CCD6;
  --rule: rgba(24, 24, 28, 0.10);

  --jp: #DF4034;
  --jp-fill: #C8352B;
  --jp-hover: #B42C22;
  --jp-text: #B6281F;
  --ai-accent: #554BBD;
  --crest-waseda: #8E1728;
  --crest-todai: #1464A5;
  --crest-nagoya: #0E5A3E;

  --ok: #167943;
  --ok-bg: #E8F6EE;
  --amber-ink: #845205;
  --insight: #FAF4E6;
  --insight-ink: #665327;
  --manuscript: #FDFCF8;
  --grid-line: #DCE3EB;

  --shadow-plate: 0 2px 6px rgba(18, 20, 28, 0.04), 0 22px 48px -16px rgba(18, 20, 28, 0.12);
  --shadow-island: 0 2px 6px rgba(16, 18, 26, 0.08), 0 12px 28px -12px rgba(16, 18, 26, 0.18);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "EditorialSerif", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-ja: "Figtree", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-3) var(--bg);
  overflow-x: clip;
}
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 90;
  background: var(--jp);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes eju-scroll-bar {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .scroll-progress {
      animation: eju-scroll-bar auto linear both;
      animation-timeline: scroll(root block);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--fill-3); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.6 var(--sans);
  caret-color: var(--jp);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
[lang="ja"] { font-family: var(--font-ja); }
.tnum { font-variant-numeric: tabular-nums; }
::selection { background: rgba(200, 53, 43, 0.16); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
:is(.eju-topbar, .hero-frame, .room-exam, .closing-frame) :focus-visible { outline-color: #FFFFFF; }

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip {
  position: absolute; left: -999px; top: 12px; z-index: 120;
  background: var(--ink); color: #FFFFFF; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip:focus { left: 16px; }

/* ═══════════ EJU+ Three-Island Architectural Split Header ═══════════ */
.eju-topbar-wrap {
  position: fixed;
  top: 22px;
  inset-inline: 0;
  z-index: 60;
  padding-inline: 28px;
  pointer-events: none;
}
.eju-topbar {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.topbar-brand { justify-self: start; }
.topbar-tabs { justify-self: center; }
.topbar-actions { justify-self: end; }
.topbar-brand,
.topbar-tabs,
.topbar-actions {
  pointer-events: auto;
}

/* Island 1: Crisp White Brand Plaque */
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 15px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.08), var(--shadow-island);
  transition: transform 0.2s var(--ease);
}
.topbar-brand:hover { transform: translateY(-1px); }
.topbar-brand svg { display: block; }
.brand-sep {
  width: 1px;
  height: 14px;
  background: rgba(24, 24, 28, 0.16);
}
.brand-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

/* Island 2: Segmented Section Index */
.topbar-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 44px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(17, 22, 32, 0.88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10), var(--shadow-island);
}
.topbar-tabs a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  transition: background-color 0.18s, color 0.18s;
}
.topbar-tabs a:hover {
  background: rgba(255, 255, 255, 0.13);
}
.topbar-tabs a[data-active="true"] {
  background: #FFFFFF;
  color: var(--ink);
}

/* Island 3: Web Login + Vermilion Exam Launch */
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topbar-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 15px;
  border-radius: 12px;
  background: rgba(17, 22, 32, 0.88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow-island);
  transition: transform 0.2s var(--ease), background-color 0.18s;
}
.topbar-login:hover {
  transform: translateY(-1px);
  background: rgba(26, 33, 48, 0.94);
}
.topbar-login.is-authed {
  padding-inline: 8px 13px;
  gap: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.12), var(--shadow-island);
}
.topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  overflow: clip;
  flex: none;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.08);
}
.topbar-avatar[hidden] { display: none !important; }
.topbar-avatar svg, .topbar-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.topbar-launch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--jp-fill);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-island);
  transition: transform 0.2s var(--ease), background-color 0.18s;
}
.topbar-launch svg { display: block; }
.topbar-launch:hover {
  transform: translateY(-1px);
  background: var(--jp-hover);
}

/* ═══════════════════════════════════════════════════════════════════
   ACT 1: Zero-Portrait Campus Sky Stage — Natural 1:1 Architectural Scroll
   ═══════════════════════════════════════════════════════════════════ */
.hero-track {
  position: relative;
  height: 100svh;
  min-height: 580px;
  background: var(--bg);
}
.hero-pin {
  position: relative;
  height: 100%;
  padding: 12px;
  overflow: clip;
}
.hero-frame {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 24px;
  border-radius: 22px;
  overflow: clip;
  background: #13468E;
  isolation: isolate;
}

.sky {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  will-change: transform;
}
.sky img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 42, 108, 0.82) 0%, rgba(15, 58, 138, 0.56) 46%, rgba(20, 62, 128, 0.22) 72%, rgba(10, 18, 34, 0.14) 100%);
  pointer-events: none;
}

.sky-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  filter: blur(5px);
  mix-blend-mode: screen;
  opacity: 0.78;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 88%);
}

.sky-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.12;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Stage 1: Headline + Direct Entry & Download Controls on Screen 1 */
.hero-stage-1 {
  position: absolute;
  top: 42%;
  left: 50%;
  translate: -50% -50%;
  width: min(92%, 920px);
  z-index: 4;
  text-align: center;
  color: #FFFFFF;
  will-change: opacity, filter;
}
.sky-h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.15rem, 4.4vw, 3.85rem);
  line-height: 1.24;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-shadow: 0 2px 22px rgba(10, 24, 56, 0.32);
}
.h1-line {
  display: block;
}
.h1-end {
  display: inline-block;
  width: 0.45em;
  text-align: left;
}
.sky-proof {
  list-style: none;
  margin: 20px auto 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 0;
  font-size: clamp(0.88rem, 1.1vw, 0.98rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(10, 24, 56, 0.36);
}
.sky-proof li {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.sky-proof li + li::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin: 0 14px;
  background: rgba(255, 255, 255, 0.36);
}

.hero-entry-bar {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(10, 18, 36, 0.16), 0 14px 30px -12px rgba(10, 18, 36, 0.34);
  transition: transform 0.2s var(--ease), background-color 0.18s;
}
.btn-hero svg { display: block; flex: none; }
.btn-hero:hover { transform: translateY(-2px); }

.btn-hero-vermilion {
  background: var(--jp-fill);
  color: #FFFFFF;
}
.btn-hero-vermilion:hover { background: var(--jp-hover); }

.btn-hero-paper {
  background: var(--paper);
  color: var(--ink);
}
.btn-hero-paper:hover { background: #F2F4F8; }

/* 3-OS Platform Differentiation (PC / Android / iOS) — Always Dual Horizontal CTAs, Zero PC PWA */
html:not([data-os="android"]):not([data-os="ios"]) .cta-pwa,
html[data-os="pc"] .cta-pwa,
html:not([data-os="ios"]) .cta-ios-guide {
  display: none !important;
}
html[data-os="android"] .cta-mock-pc,
html[data-os="ios"] .cta-mock-pc,
html[data-os="ios"] .cta-apk {
  display: none !important;
}
/* On PC: Mock Exam is Vermilion Primary, APK Download is Crisp White Secondary */
html[data-os="pc"] .btn-hero.cta-apk,
html:not([data-os="android"]):not([data-os="ios"]) .btn-hero.cta-apk {
  background: var(--paper);
  color: var(--ink);
}
html[data-os="pc"] .btn-hero.cta-apk:hover,
html:not([data-os="android"]):not([data-os="ios"]) .btn-hero.cta-apk:hover {
  background: var(--fill-1);
}
html[data-os="pc"] .btn.cta-apk,
html:not([data-os="android"]):not([data-os="ios"]) .btn.cta-apk {
  background: var(--paper);
  color: var(--ink);
}
html[data-os="pc"] .btn.cta-apk:hover,
html:not([data-os="android"]):not([data-os="ios"]) .btn.cta-apk:hover {
  background: var(--fill-1);
}
/* On iOS: Mobile Web App is Vermilion Primary, Home Screen Guide is White Secondary */
html[data-os="ios"] .btn-hero.cta-pwa,
html[data-os="ios"] .btn.cta-pwa {
  background: var(--jp-fill);
  color: var(--paper);
}
html[data-os="ios"] .btn-hero.cta-pwa:hover,
html[data-os="ios"] .btn.cta-pwa:hover {
  background: var(--jp-hover);
}
.btn-hero {
  min-width: 192px;
  min-height: 52px;
  padding: 0 28px;
  font-size: 15.5px;
}
.btn-hero:active, .btn:active, .pt:active, .rt:active, .seg button:active {
  transform: scale(0.98);
}

/* Staggered Hero Entrance (Visible by default; animates only under no-preference) */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hero-rise {
    from { opacity: 0; transform: translate3d(0, 18px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  .hero-anim-1 { animation: hero-rise 0.65s var(--ease) both; }
  .hero-anim-2 { animation: hero-rise 0.65s var(--ease) 0.08s both; }
  .hero-anim-3 { animation: hero-rise 0.65s var(--ease) 0.16s both; }
}

.hero-bottom-bar {
  position: absolute;
  bottom: 24px;
  inset-inline: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  will-change: opacity;
}
.down-pill, .trails-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(15, 22, 36, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s;
}
.down-pill:hover, .trails-btn:hover {
  background: rgba(22, 32, 52, 0.94);
}

/* ═══════════════════════════════════════════════════════════════════
   Calm Motion System: 1:1 Natural Scroll + One-Shot Quiet Plate Settle
   Zero sticky stacking, zero continuous scroll-scrub scaling (zero dizziness).
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .js-calm-reveal .room .stage-plate {
    opacity: 0.72;
    transform: translate3d(0, 14px, 0);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  }
  .js-calm-reveal .room.is-settled .stage-plate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky-trails, .trails-btn { display: none !important; }
  .hero-stage-1 { opacity: 1 !important; transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   ACTS 2, 3, 4: Framed Architectural Sheets on Calm #F8F8F8 Desk Ground
   ═══════════════════════════════════════════════════════════════════ */
.room {
  position: relative;
  min-height: calc(100svh - 24px);
  margin: 0 12px 12px;
  border-radius: 22px;
  padding: 82px 28px 74px;
  display: flex;
  align-items: center;
  scroll-margin-top: 12px;
  overflow: clip;
}
.room-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  view-transition-scope: all;
}

/* Room 1: Warm Sand Stone (#word) */
.room-word {
  --r-ink: #191816;
  --r-ink-2: #4A463F;
  background: var(--sand);
  color: var(--r-ink);
}

/* Room 2: Deep Midnight Sapphire (#exam) */
.room-exam {
  --r-ink: #F8FAFC;
  --r-ink-2: #C4D9EE;
  --rt-hover: rgba(255, 255, 255, 0.07);
  --rt-active-bg: #FFFFFF;
  --rt-active-fg: #102033;
  --rt-active-sub: #384E66;
  background: var(--night);
  color: var(--r-ink);
}

/* Room 3: Soft Lavender Stone (#ai) */
.room-ai {
  --r-ink: #1C172E;
  --r-ink-2: #443B63;
  --rt-hover: rgba(28, 23, 46, 0.05);
  --rt-active-bg: #1F1936;
  --rt-active-fg: #FFFFFF;
  --rt-active-sub: rgba(242, 240, 255, 0.84);
  background: var(--lavender);
  color: var(--r-ink);
}

.room-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 3.4vw, 2.95rem);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.room-sub {
  margin: 8px 0 0;
  font-size: 15.5px;
  line-height: 1.56;
  color: var(--r-ink-2);
  text-wrap: pretty;
}
.room-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--r-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  vertical-align: baseline;
}
.room-guide-link svg {
  transition: transform 0.18s var(--ease);
}
.room-guide-link:hover svg {
  transform: translateX(3px);
}
.room-guide-link:hover {
  opacity: 0.82;
}

/* Shared Segmented Controls */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 3px;
  background: var(--fill-1); border-radius: 14px; padding: 4px;
}
.seg button {
  min-height: 36px; padding: 4px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: background-color 0.18s var(--ease), color 0.18s;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; }

/* View Transitions Scoping */
#scope-word .pt[aria-selected="true"] { view-transition-name: vt-tab-word; }
#scope-exam .rt[aria-selected="true"] { view-transition-name: vt-tab-exam; }
#scope-ai .rt[aria-selected="true"]   { view-transition-name: vt-tab-ai; }

::view-transition-group(vt-tab-word),
::view-transition-group(vt-tab-exam),
::view-transition-group(vt-tab-ai) {
  animation-duration: 250ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ═══════════ Room 1 (#word) Layout: Top Header + Horizontal Pills + Wide Stage ═══════════ */
.word-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.word-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}
.pill-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(25, 24, 22, 0.07);
}
.pill-tabs::-webkit-scrollbar { display: none; }
.pt {
  position: relative;
  flex: none;
  min-height: 38px;
  padding: 7px 17px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--r-ink-2);
  transition: color 0.18s, background-color 0.18s;
}
.pt:hover { color: var(--r-ink); }
.pt[aria-selected="true"] {
  background: var(--ink);
  color: #FFFFFF;
}

/* Primary Elevated Stage Plate (26px Radius matching DESIGN.md, Zero Nested Cards) */
.stage-plate {
  background: var(--paper);
  color: var(--ink);
  border-radius: 26px;
  padding: 26px 30px;
  min-height: 472px;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.06), var(--shadow-plate);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wide-plate {
  min-height: 446px;
}
.sp, .ep, .ap { margin: 0; padding: 0; border: 0; background: none; }
.sp:focus, .ep:focus, .ap:focus { outline: none; }
.kj-ssr-fallback { grid-column: 1 / -1; margin: 0; padding: 14px; font-size: 14px; line-height: 1.8; }
.flap-num { display: inline-block; will-change: transform, opacity; }

/* Wide High-Frequency Curve Grid */
.hf-wide-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 36px;
  align-items: center;
}
.hf-big-metric {
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.hf-big-metric b { font-size: 32px; color: var(--ink); letter-spacing: -0.02em; }
.hf-big-metric em { font-style: normal; font-size: 32px; color: var(--jp-text); font-weight: 700; letter-spacing: -0.02em; }
.panel-note { margin: 0 0 16px; font-size: 13.5px; line-height: 1.58; color: var(--ink-3); }

.hf-words-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hfw {
  text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--fill-1);
  transition: background-color 0.18s, transform 0.18s var(--ease);
}
.hfw:hover { background: #EAECEF; transform: translateY(-1.5px); }
.hfw.speaking { background: #FDECE9; color: var(--jp-text); }
.hfw strong { display: flex; align-items: center; justify-content: space-between; font-size: 14.5px; font-weight: 700; }
.hfw strong svg { color: var(--ink-3); }
.hfw.speaking strong svg { color: var(--jp-fill); }
.hfw-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }

.cv-svg { width: 100%; height: auto; display: block; overflow: visible; }
.cv-axis { stroke: var(--fill-3); stroke-width: 1.2; }
.cv-dash { stroke: var(--fill-3); stroke-width: 1.2; stroke-dasharray: 4 4; }
.cv-lbl { font: 600 12.5px var(--sans); fill: var(--ink-3); }
.cv-area { fill: rgba(200, 53, 43, 0.09); }
.cv-line {
  fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 660; stroke-dashoffset: 0;
}
.cv-vline { stroke: var(--jp-fill); stroke-width: 1.6; stroke-dasharray: 3 3; }
.cv-dot { fill: var(--jp-fill); stroke: #FFFFFF; stroke-width: 2.5; }
.cv-ring { fill: none; stroke: var(--jp-fill); stroke-width: 1.5; opacity: 0.32; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse-ring {
    0%, 100% { transform: scale(0.85); opacity: 0.42; }
    50% { transform: scale(1.25); opacity: 0.10; }
  }
  .cv-ring {
    transform-box: fill-box; transform-origin: center;
    animation: pulse-ring 2.4s ease-in-out infinite;
  }
}

/* Wide Tap-Lookup Grid */
.lk-wide-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: center;
}
.lk-hint { font-size: 13.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 12px; }
.lk-sentence {
  margin: 0; padding: 20px 22px; border-radius: 14px; background: var(--fill-1);
  font-size: 17.5px; line-height: 2.05; color: var(--ink);
}
.lk-w {
  font: inherit; font-weight: 700; padding: 2px 6px; margin: 0 1px; border-radius: 8px;
  border-bottom: 2px dashed var(--ink-3);
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.lk-w:hover, .lk-w[aria-pressed="true"] {
  background: var(--jp-fill); color: #FFFFFF; border-bottom-color: transparent;
}
.lk-dict-col {
  padding: 14px 14px 14px 28px;
  border-left: 1px solid var(--rule);
}
.v2-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.v2-pop-word { font-size: 20px; font-weight: 700; }
.v2-pop-kana { font-size: 13px; color: var(--ink-3); margin-left: 6px; }
.v2-fav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px; background: var(--fill-1);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.v2-fav-btn.saved { background: #FFF2D9; color: var(--amber-ink); }
.lk-zh { margin: 12px 0 6px; font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.56; }
.lk-ja { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* Wide Concept Grid */
.cc-wide-grid {
  display: grid;
  grid-template-columns: minmax(270px, 360px) 1fr;
  gap: 32px;
  align-items: center;
}
.vc-header-box { margin-top: 18px; }
.vc-kana-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vc-pitch { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.vc-kind { padding: 3px 9px; border-radius: 999px; background: var(--insight); color: var(--insight-ink); font-size: 12px; font-weight: 700; }
.vc-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.vc-word { margin: 0; font-size: clamp(1.3rem, 2vw, 1.65rem); font-weight: 700; letter-spacing: -0.02em; }
.vc-speak {
  width: 38px; height: 38px; border-radius: 50%; background: var(--fill-1);
  display: grid; place-items: center; color: var(--ink); flex: none;
  transition: background-color 0.18s, color 0.18s;
}
.vc-speak:hover { background: var(--jp-fill); color: #FFFFFF; }
.vc-zh { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.vc-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.vc-tag-red { padding: 3px 9px; border-radius: 6px; background: rgba(200, 53, 43, 0.10); color: var(--jp-text); font-size: 12px; font-weight: 700; }
.vc-tag-gray { padding: 3px 9px; border-radius: 6px; background: var(--fill-1); color: var(--ink-2); font-size: 12px; font-weight: 700; }
.vc-rows { margin: 0; display: flex; flex-direction: column; }
.vc-row {
  display: grid; grid-template-columns: 50px 1fr; gap: 12px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
.vc-row:first-child { border-top: 1px solid var(--rule); }
.vc-pill {
  text-align: center; padding: 2px 7px; border-radius: 6px;
  background: var(--insight); color: var(--insight-ink); font-size: 12px; font-weight: 700;
}
.vc-row dd { margin: 0; font-size: 14px; line-height: 1.58; color: var(--ink-2); }

/* Interactive Life / SPI3 / FE Practical Dictionaries Workbench */
.life-wide-grid {
  display: grid;
  grid-template-columns: minmax(295px, 405px) 1fr;
  gap: 32px;
  align-items: center;
}
.life-book-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  border-radius: 14px;
  background: var(--fill-1);
  transition: background-color 0.18s var(--ease), box-shadow 0.18s;
}
.lb-btn:hover { background: var(--fill-2); }
.lb-btn[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--ink), 0 1px 2px rgba(40, 40, 43, 0.04), 0 8px 20px -12px rgba(40, 40, 43, 0.12);
}
.lb-mini-cover {
  width: 44px;
  height: 64px;
  flex: none;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(24, 24, 28, 0.14);
}
.lb-meta { flex: 1; min-width: 0; }
.lb-title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.lb-title-line strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}
.lb-title-line span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
}
.lb-meta p {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.44;
  color: var(--ink-3);
  text-wrap: pretty;
}
.life-shelf-foot {
  margin: 10px 2px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.life-entry-col {
  padding-inline-start: 28px;
  border-left: 1px solid var(--rule);
}
.life-dl { margin-top: 12px; }
#lw-v3 b {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(200, 53, 43, 0.45);
  text-underline-offset: 3px;
}
.lw-ex-cn {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ═══════════ Rooms 2 & 3 Split Layouts (#exam & #ai) ═══════════ */
.split-lr, .split-rl {
  display: grid;
  gap: 38px;
  align-items: center;
}
.split-lr { grid-template-columns: minmax(300px, 412px) 1fr; }
.split-rl { grid-template-columns: 1fr minmax(300px, 412px); }
.split-rl > .stage-plate { grid-column: 1; grid-row: 1; }
.split-rl > .rail-col { grid-column: 2; grid-row: 1; }

.sec-head { margin-bottom: 18px; }
.rail-tabs { display: flex; flex-direction: column; gap: 6px; }
.rt {
  text-align: left;
  padding: 13px 16px;
  border-radius: 14px;
  transition: background-color 0.2s var(--ease), color 0.2s;
}
.rt strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--r-ink);
}
.rt span {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--r-ink-2);
  text-wrap: pretty;
}
.rt:hover { background: var(--rt-hover); }
.rt[aria-selected="true"] {
  background: var(--rt-active-bg);
  color: var(--rt-active-fg);
}
.rt[aria-selected="true"] strong { color: var(--rt-active-fg); }
.rt[aria-selected="true"] span { color: var(--rt-active-sub); }

/* Exam Internals + Sleek Modern Audio Waveform Player */
.ep-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.ep-hint { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.ep-pill-tag {
  padding: 5px 12px; border-radius: 999px; background: var(--ok-bg); color: var(--ok);
  font-size: 13px; font-weight: 700;
}
.shot-viewport {
  height: 374px; border-radius: 14px; overflow: clip;
  background: #F3F4F8;
  display: flex; justify-content: center; align-items: flex-start;
}
.shot-viewport.align-bottom { align-items: flex-end; }
.shot-viewport img { width: 318px; max-width: 100%; height: auto; }

.listen-modern { display: flex; flex-direction: column; gap: 18px; }
.lm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lm-meta { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.lm-player-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: 14px; background: var(--fill-1);
}
.lp-play {
  width: 46px; height: 46px; border-radius: 50%; background: var(--jp-fill); color: #FFFFFF;
  display: grid; place-items: center; flex: none;
  transition: transform 0.18s var(--ease), background-color 0.18s;
}
.lp-play:hover { transform: scale(1.05); background: var(--jp-text); }
.lm-track-info { flex: 1; min-width: 190px; }
.lm-track-info strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.lm-waveform {
  margin-top: 8px; height: 22px;
  display: flex; align-items: center; gap: 4px;
}
.lm-waveform i {
  flex: 1; max-width: 6px; height: 8px; border-radius: 99px; background: var(--fill-3);
  transition: background-color 0.2s;
}
.lm-waveform i:nth-child(3n) { height: 15px; }
.lm-waveform i:nth-child(4n+1) { height: 19px; }
.lm-waveform i:nth-child(2n) { height: 11px; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes wave-pulse {
    0%, 100% { transform: scaleY(0.45); }
    50% { transform: scaleY(1.35); }
  }
  .lm-waveform.playing i {
    background: var(--jp-fill);
    animation: wave-pulse 0.75s ease-in-out infinite;
  }
  .lm-waveform.playing i:nth-child(2n) { animation-delay: 0.14s; }
  .lm-waveform.playing i:nth-child(3n) { animation-delay: 0.26s; }
  .lm-waveform.playing i:nth-child(5n) { animation-delay: 0.08s; }
}
.lm-controls { display: flex; align-items: center; gap: 10px; }
.lm-timer { font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.lp-speed-btn {
  min-height: 36px; min-width: 54px; padding: 4px 12px; border-radius: 8px;
  background: var(--paper); color: var(--ink); font-size: 12.5px; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color 0.18s, color 0.18s;
}
.lp-speed-btn:hover { background: var(--fill-2); }

.lp-script { padding-top: 14px; border-top: 1px solid var(--rule); }
.lp-script-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.lp-reveal-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px; background: var(--fill-1);
  font-size: 12px; font-weight: 700; color: var(--ink);
  transition: background-color 0.18s, color 0.18s;
}
.lp-reveal-btn:hover { background: var(--ink); color: #FFFFFF; }
.lp-blur {
  padding: 12px 14px; border-radius: 12px; background: var(--fill-1);
  filter: blur(5px); user-select: none; transition: filter 0.3s var(--ease);
}
.lp-script.revealed .lp-blur { filter: blur(0); user-select: auto; }
.lp-blur p { margin: 0; font-size: 13.5px; line-height: 1.62; color: var(--ink); font-weight: 600; }
.lp-blur .lp-tr { margin-top: 4px; color: var(--ink-3); font-weight: 500; }

/* AI Internals */
.kj-top-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.kj-score { display: flex; align-items: center; gap: 6px; }
.kj-score strong { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.kj-score.is-revised strong { color: var(--ok); }
.kj-score span { font-size: 13.5px; color: var(--ink-3); font-weight: 700; }
.kj-status-pill {
  font-style: normal; padding: 4px 10px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); font-size: 12px; font-weight: 700;
}
.kj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kjc {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 33px; padding: 4px 11px; border-radius: 999px;
  background: var(--fill-1); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background-color 0.18s, box-shadow 0.18s;
}
.kjc i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.kjc[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }

.kj-sheet-wrap { position: relative; }
.kj-grid {
  display: grid; grid-template-columns: repeat(16, 1fr);
  background: var(--manuscript);
  border-top: 1px solid var(--grid-line); border-left: 1px solid var(--grid-line);
}
.kj-cell {
  position: relative; aspect-ratio: 1;
  border-right: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line);
  display: grid; place-items: center; font-size: 13.5px; font-weight: 600; color: var(--ink);
  cursor: default;
}
.kj-cell[data-k] { cursor: pointer; background: var(--kbg); }
.kj-cell[data-k]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 2.5px;
  background: var(--kc); transform-origin: left center; transform: scaleX(0.35); opacity: 0.45;
  transition: transform 0.24s var(--ease) var(--d, 0ms), opacity 0.2s;
}
.kj-cell[data-k].on { color: var(--kc); font-weight: 700; }
.kj-cell[data-k].on::after { transform: scaleX(1); opacity: 1; }
.kj-cell.is-fixed { background: rgba(22, 121, 67, 0.12); color: var(--ok); font-weight: 700; }
.kj-cell.is-fixed::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 2.5px; background: var(--ok);
}
.kj-margin-mark {
  position: absolute; right: 6px; bottom: 4px; font-size: 12px; font-weight: 700;
  color: var(--ok); background: var(--manuscript); padding: 1px 5px; border-radius: 6px;
}

.kj-diff {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.kj-diff-main { flex: 1; min-width: 220px; }
.kj-diff strong { display: block; font-size: 13px; color: var(--ai-accent); }
.kj-diff p { margin: 3px 0 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.kj-apply-btn {
  padding: 9px 16px; border-radius: 12px; background: var(--ink); color: #FFFFFF;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background-color 0.18s, transform 0.18s var(--ease);
}
.kj-apply-btn:hover { background: var(--jp-fill); transform: translateY(-1px); }
.kj-apply-btn.is-on { background: var(--ok); }

/* School Dossier */
.sch-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.st {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 5px 13px 5px 7px; border-radius: 999px;
  background: var(--fill-1); font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  transition: background-color 0.18s, color 0.18s;
}
.st[aria-selected="true"] { background: var(--ink); color: #FFFFFF; }
.crest {
  width: 24px; height: 24px; border-radius: 50%; background: var(--cc); color: #FFFFFF;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.sch-mini-grid { display: grid; grid-template-columns: 204px 1fr; gap: 18px; align-items: stretch; }
.sch-photo {
  margin: 0; position: relative; border-radius: 14px; overflow: clip; min-height: 266px; background: #1E2024;
}
.sch-photo img { width: 100%; height: 100%; object-fit: cover; }
.sch-photo figcaption {
  position: absolute; inset: auto 0 0; padding: 26px 11px 9px;
  background: linear-gradient(transparent, rgba(16, 18, 22, 0.84));
  color: #FFFFFF; font-size: 12px; font-weight: 600;
}
.sch-dossier { display: flex; flex-direction: column; justify-content: space-between; }
.sd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sd-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.sd-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sd-pills span { padding: 2px 8px; border-radius: 6px; background: var(--fill-1); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sd-pills span.ok { background: var(--ok-bg); color: var(--ok); }
.sd-status { padding: 4px 10px; border-radius: 999px; background: var(--fill-1); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.sd-status.ok { background: var(--ok-bg); color: var(--ok); }

.sd-facts { margin: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sd-facts dt { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.sd-facts dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--ink); }

.sd-checklist { background: var(--insight); border-radius: 12px; padding: 10px 12px; }
.sdc-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--insight-ink); }
.sdc-page { padding: 2px 7px; border-radius: 6px; background: var(--paper); color: var(--ink); }
.sd-checklist p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }

/* ═══════════ ACT 5: Framed Encore Closing Window ═══════════ */
.closing-wrap {
  padding: 0 12px 12px;
  background: var(--bg);
}
.closing-frame {
  border-radius: 22px;
  background: var(--obsidian);
  color: #FFFFFF;
  padding: 64px 36px 28px;
}
.closing-main {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 48px;
}
.closing-main h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.0rem, 3.8vw, 3.1rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
.closing-main p {
  margin: 12px 0 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.80);
}
.closing-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  font-size: 14.5px; font-weight: 700; line-height: 1;
  transition: transform 0.2s var(--ease), background-color 0.18s;
}
.btn-vermilion-sq { background: var(--jp-fill); color: #FFFFFF; }
.btn-vermilion-sq:hover { transform: translateY(-2px); background: var(--jp-hover); }
.btn-white-sq { background: #FFFFFF; color: var(--ink); }
.btn-white-sq:hover { transform: translateY(-2px); background: #F2F4F8; }
.btn-glass-sq {
  background: rgba(255, 255, 255, 0.11); color: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.20);
}
.btn-glass-sq:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.18); }

.closing-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.76);
}
.foot-left { display: flex; align-items: center; gap: 12px; }
.foot-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #FFFFFF; }
.foot-link:hover { text-decoration: underline; }

/* ═══════════ Native Top-Layer Web Login Modal (<dialog>) ═══════════ */
.login-dialog:modal {
  overscroll-behavior: contain;
}
.login-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(14, 18, 28, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}

.login-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 26px 26px 22px;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.08), 0 24px 64px -16px rgba(15, 20, 32, 0.34);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  .login-dialog { transform: scale(0.95) translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-dialog, .login-dialog::backdrop { transition-duration: 0.1s; }
}

:is(.login-dialog[open]):where(:not([data-closing])) {
  opacity: 1;
}
@starting-style {
  :is(.login-dialog[open]):where(:not([data-closing])) { opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  :is(.login-dialog[open]):where(:not([data-closing])) {
    transform: scale(1) translateY(0);
  }
  @starting-style {
    :is(.login-dialog[open]):where(:not([data-closing])) {
      transform: scale(0.95) translateY(8px);
    }
  }
}
:is(.login-dialog[open]):where(:not([data-closing]))::backdrop {
  background-color: rgba(14, 18, 28, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
@starting-style {
  :is(.login-dialog[open]):where(:not([data-closing]))::backdrop {
    background-color: rgba(14, 18, 28, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}

.dlg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dlg-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dlg-sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}
.dlg-close-form { margin: 0; flex: none; }
.dlg-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--fill-1);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  transition: background-color 0.18s, color 0.18s;
}
.dlg-close-btn:hover { background: var(--fill-2); color: var(--ink); }

.dlg-mode-seg {
  margin-top: 18px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.dlg-mode-seg button {
  min-height: 38px;
  text-align: center;
}

.dlg-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dlg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dlg-field[hidden] { display: none !important; }
.dlg-field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.dlg-field label span { color: var(--jp-text); }
.pw-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pw-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pw-forgot-btn {
  min-height: 30px;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pw-forgot-btn:hover { color: var(--ink); }
.pw-forgot-btn[hidden] { display: none !important; }
.pw-eye-btn {
  min-height: 30px;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--fill-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.pw-eye-btn:hover { background: var(--fill-2); color: var(--ink); }

.code-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.code-input-row input {
  flex: 1;
  min-width: 0;
}
.btn-send-code {
  flex: none;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--fill-1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color 0.18s;
}
.btn-send-code:hover:not(:disabled) { background: var(--fill-2); }
.btn-send-code:disabled { opacity: 0.6; cursor: not-allowed; }

.field-hint {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.dlg-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid #969AA6;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 1em);
  transition: border-color 0.18s, background-color 0.18s;
}
@media (pointer: coarse) {
  .dlg-field input, .btn-send-code { min-height: 52px; }
}
.dlg-field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-color: var(--ink);
}
.dlg-field input:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--jp-text);
  background-color: #FDECE9;
}
.dlg-field input:user-valid {
  border-color: var(--ok);
}

.field-error {
  display: none;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--jp-text);
}
.field-error span[role="img"] {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-inline-end: 4px;
  border-radius: 50%;
  background: var(--jp-fill);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
}
.dlg-field input:is(:user-invalid, .user-invalid-fallback) + .field-error {
  display: block;
}

.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.domain-chips[hidden] { display: none !important; }
.domain-chips button {
  min-height: 30px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--fill-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.domain-chips button:hover { background: var(--fill-2); color: var(--ink); }

.dlg-status {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.48;
  background: #FDECE9;
  color: var(--jp-text);
}
.dlg-status.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.dlg-status[hidden] { display: none !important; }

/* Signed-In Account Panel + Password Strength + Captcha Row */
.web-authed-panel {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.web-authed-panel[hidden], .dlg-mode-seg[hidden], .dlg-form[hidden], .dlg-foot[hidden] {
  display: none !important;
}
.wap-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fill-1);
}
.wap-avatar {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  overflow: clip;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 28, 0.08);
}
.wap-avatar svg, .wap-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.wap-meta { flex: 1; min-width: 0; }
.wap-meta strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wap-id-line {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.btn-copy-uid {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn-copy-uid:hover { background: var(--ink); color: #FFFFFF; }
.wap-sync-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 700;
}
.wap-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-logout-outline {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  background: var(--fill-1);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.18s, color 0.18s;
}
.btn-logout-outline:hover {
  background: #FDECE9;
  color: var(--jp-text);
}

.pw-strength {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-strength[hidden] { display: none !important; }
.pws-bars {
  display: inline-flex;
  gap: 4px;
}
.pws-bars i {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: var(--fill-2);
  transition: background-color 0.18s;
}
.pw-strength[data-lv="1"] .pws-bars i:nth-child(1) { background: #B45309; }
.pw-strength[data-lv="2"] .pws-bars i:nth-child(-n+2) { background: #1D4ED8; }
.pw-strength[data-lv="3"] .pws-bars i { background: var(--ok); }
.pws-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pw-strength[data-lv="1"] .pws-label { color: #B45309; }
.pw-strength[data-lv="2"] .pws-label { color: #1D4ED8; }
.pw-strength[data-lv="3"] .pws-label { color: var(--ok); }

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 116px;
  gap: 8px;
  align-items: stretch;
}
.captcha-img-btn {
  min-height: 48px;
  border-radius: 12px;
  background: #F5F1EA;
  border: 1.5px solid rgba(24, 24, 28, 0.12);
  overflow: clip;
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color 0.18s;
}
.captcha-img-btn:hover { border-color: var(--ink); }
.captcha-svg-slot {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1;
}
.captcha-svg-slot svg {
  display: block;
  width: 112px;
  height: 40px;
}

.btn-login-submit {
  margin-top: 2px;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--jp-fill);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  transition: background-color 0.18s, transform 0.18s var(--ease);
}
.btn-login-submit:hover:not(:disabled) {
  background: var(--jp-hover);
  transform: translateY(-1px);
}
.btn-login-submit:disabled {
  background: var(--fill-2);
  color: var(--ink-3);
  cursor: not-allowed;
}

.dlg-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.dlg-guest-link {
  font-weight: 700;
  color: var(--ink);
}
.dlg-guest-link:hover { text-decoration: underline; }

/* ═══════════ Exam Panel 4: Live Flutter Stats Chart & Topic Probability ═══════════ */
.stats-workbench {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.stats-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.stats-delta {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 700;
}
.stats-chart-box {
  padding: 14px 14px 8px;
  border-radius: 16px;
  background: var(--fill-1);
}
.st-svg { width: 100%; height: auto; display: block; overflow: visible; }
.st-grid { stroke: var(--fill-2); stroke-width: 1; stroke-dasharray: 3 3; }
.st-lbl { font: 600 11.5px var(--sans); fill: var(--ink-3); }
.st-area { fill: rgba(200, 53, 43, 0.10); }
.st-line {
  fill: none;
  stroke: var(--jp-fill);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 620;
  stroke-dashoffset: 0;
}
.st-dot { fill: var(--paper); stroke: var(--jp-fill); stroke-width: 2.5; }
.st-dot-last { fill: var(--jp-fill); stroke: var(--paper); stroke-width: 2.5; }
.st-xlbl { font: 600 11px var(--sans); fill: var(--ink-3); text-anchor: middle; }
.stats-topics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.stats-topics-head strong { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.stats-topics-head span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.stats-topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--fill-1);
}
.st-t-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-t-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--fill-2);
  overflow: hidden;
}
.st-t-bar i {
  display: block;
  width: var(--w, 70%);
  height: 100%;
  border-radius: 999px;
  background: var(--jp-fill);
  transform-origin: left center;
}
.st-t-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--jp-text);
  white-space: nowrap;
}

/* ═══════════ Dossier Interactive @添加日程 / @生成材料待办 Tools ═══════════ */
.sdc-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.sdc-tool-btn {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color 0.18s, color 0.18s, transform 0.18s var(--ease);
}
.sdc-tool-btn:hover { background: var(--fill-2); }
.sdc-tool-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}
.sdc-tool-out {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.sdc-tool-out strong {
  display: block;
  color: var(--ok);
  margin-bottom: 3px;
}

/* ═══════════ AI Panel 2: Live Flutter School Compare Workbench ═══════════ */
.cmp-workbench {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cmp-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cmp-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--insight);
  color: var(--insight-ink);
  font-size: 12px;
  font-weight: 700;
}
.cmp-verdict {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--insight);
  color: var(--ink);
}
.cmp-verdict strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--insight-ink);
  margin-bottom: 4px;
}
.cmp-verdict p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}
.cmp-table-wrap {
  overflow-x: auto;
}
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.cmp-table th,
.cmp-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.cmp-table thead th {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  border-bottom: 1.5px solid var(--fill-2);
}
.cmp-table tbody th {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.cmp-table tbody td {
  color: var(--ink-2);
  line-height: 1.48;
}
.cmp-risk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cmp-risk,
.cmp-next {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--fill-1);
}
.cmp-risk strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--jp-text);
  margin-bottom: 3px;
}
.cmp-next strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ok);
  margin-bottom: 3px;
}
.cmp-risk p,
.cmp-next p {
  margin: 0;
  font-size: 13px;
  line-height: 1.52;
  color: var(--ink-2);
}

/* ═══════════ ACT 4.5 (#faq): Compact Scannable FAQ ═══════════ */
.faq-section {
  padding: 68px 28px 72px;
  background: var(--bg);
}
.faq-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.faq-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.faq-sub {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-3);
}
.faq-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}
.faq-list details {
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.faq-list summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--fill-1);
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background-color 0.18s;
}
.faq-list details[open] summary::after {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--paper);
}
.faq-list details p {
  margin: 10px 0 2px;
  max-width: 68ch;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--ink-2);
}

.foot-links-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.foot-link-muted {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.56);
  transition: color 0.18s;
}
.foot-link-muted:hover {
  color: #FFFFFF;
}

@media (max-width: 860px) {
  .faq-inner { grid-template-columns: 1fr; gap: 20px; }
  .cmp-risk-row { grid-template-columns: 1fr; }
  .st-topic-row { grid-template-columns: minmax(0, 1fr) auto; }
  .st-t-bar { display: none; }
}

/* Forced Colors Mode */
@media (forced-colors: active) {
  .stage-plate, .topbar-brand, .topbar-tabs, .topbar-login, .topbar-launch, .btn, .btn-hero, .login-dialog {
    outline: 1px solid CanvasText;
  }
  .pt[aria-selected="true"], .rt[aria-selected="true"], .seg button[aria-pressed="true"], .lb-btn[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .room { min-height: auto; padding: 88px 20px 80px; }
  .hf-wide-grid, .lk-wide-grid, .cc-wide-grid, .life-wide-grid, .split-lr, .split-rl { grid-template-columns: 1fr; gap: 28px; }
  .split-rl > .stage-plate, .split-rl > .rail-col { grid-column: auto; grid-row: auto; }
  .lk-dict-col, .life-entry-col { padding: 20px 14px 14px; border-left: 0; border-top: 1px solid var(--rule); }
}

@media (max-width: 860px) {
  .eju-topbar-wrap { top: 16px; padding-inline: 18px; }
  .eju-topbar { display: flex; justify-content: space-between; }
  .topbar-tabs, .brand-sep, .brand-tag { display: none; }
  .sch-mini-grid { grid-template-columns: 1fr; }
  .sch-photo { min-height: 190px; }
  .kj-grid { grid-template-columns: repeat(11, 1fr); }
}

@media (max-width: 560px) {
  .hero-pin { padding: 8px; }
  .closing-wrap { padding: 0 8px 8px; }
  .hero-frame, .closing-frame { border-radius: 18px; }
  .eju-topbar-wrap { top: 14px; padding-inline: 14px; }
  .topbar-brand, .topbar-login, .topbar-launch { height: 44px; padding-inline: 12px; font-size: 13px; }
  .hero-stage-1 { top: 42%; width: min(94%, 440px); }
  .sky-h1 { font-size: clamp(1.58rem, 6.4vw, 2.02rem); letter-spacing: 0.02em; }
  .sky-proof { font-size: 13px; margin-top: 14px; gap: 6px 0; }
  .sky-proof li + li::before { margin: 0 9px; height: 10px; }
  .hero-entry-bar {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  html[data-os="android"] .hero-entry-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .btn-hero { min-height: 48px; padding: 0 16px; font-size: 14px; border-radius: 13px; }
  html[data-os="ios"] .btn-hero.cta-pwa { min-width: 216px; min-height: 50px; font-size: 15px; }
  .hero-bottom-bar { bottom: 16px; }
  .room { margin: 0 8px 8px; border-radius: 18px; padding: 78px 14px 72px; }
  .stage-plate { padding: 20px 16px; min-height: auto; border-radius: 22px; }
  .hf-words-2x2, .sd-facts { grid-template-columns: 1fr; }
  .closing-actions .btn { width: 100%; }
  .login-dialog { padding: 22px 18px 18px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Hero scroll-away (2026-11-28): as the page scrolls past the hero, the frame
   recedes like a card being set down — it scales back, its corners round off,
   the sky drifts and dims, the headline lifts and softens. Driven by --hp (0→1)
   from home.js, hero-only, transform/opacity/filter only.
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .hero-track { --hp: 0; }
  .hero-frame {
    transform: translate3d(0, calc(var(--hp) * 4vh), 0) scale(calc(1 - var(--hp) * 0.075));
    border-radius: calc(22px + var(--hp) * 18px);
    transform-origin: 50% 0%;
    will-change: transform;
  }
  .sky img {
    transform: translate3d(0, calc(var(--hp) * -6%), 0) scale(calc(1.02 + var(--hp) * 0.1));
    filter: brightness(calc(1 - var(--hp) * 0.28)) saturate(calc(1 + var(--hp) * 0.15));
  }
  .hero-stage-1 {
    opacity: calc(1 - var(--hp) * 1.35);
    transform: translate3d(0, calc(var(--hp) * -56px), 0) scale(calc(1 - var(--hp) * 0.04));
    filter: blur(calc(var(--hp) * 6px));
  }
  .hero-bottom-bar { opacity: calc(1 - var(--hp) * 2.2); }
  .hero-track.is-receding .hero-stage-1 { pointer-events: none; }
  .hero-track.is-receding .hero-stage-1 a { pointer-events: auto; }
  /* The next room rises a little over the receding frame. */
  .room-word { position: relative; z-index: 1; }

  /* Interaction feedback: respond on press, lift on hover (Apple: feedback on pointer-down). */
  .btn-hero, .down-pill, .trails-btn, .seg button, .faq-section summary, .eju-topbar a, .eju-topbar button {
    transition: transform 0.18s cubic-bezier(.2,.8,.2,1), background-color 0.2s, box-shadow 0.2s;
  }
  .btn-hero:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(200, 53, 43, 0.28); }
  .btn-hero:active, .down-pill:active, .trails-btn:active, .seg button:active,
  .eju-topbar a:active, .eju-topbar button:active { transform: scale(0.97); transition-duration: 0.08s; }
  .hfw { transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s; }
  .hfw:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(24, 24, 28, 0.08); }
  .hfw:active { transform: scale(0.985); }

  /* Room plates: a fuller settle (was 14px / 0.72) with a slight scale, once per room. */
  .js-calm-reveal .room .stage-plate {
    opacity: 0.7;
    transform: translate3d(0, 20px, 0) scale(0.99);
    transition: opacity 0.6s var(--ease), transform 0.7s cubic-bezier(.16,1,.3,1);
  }
  .js-calm-reveal .room.is-settled .stage-plate { opacity: 1; transform: none; }
  .js-calm-reveal .room.is-settled .stage-plate:nth-child(2) { transition-delay: 0.08s; }
  .js-calm-reveal .room.is-settled .stage-plate:nth-child(3) { transition-delay: 0.16s; }
}

/* Readability pass: small grey text was too light and too small on the sand ground. */
:root { --ink-3: #4C4C57; }
.panel-note { font-size: 14.5px; line-height: 1.72; }
.hfw-sub { font-size: 13px; }
.lk-hint { font-size: 14.5px; }
.seg button { font-size: 14px; }
.cv-lbl { font-size: 13px; }
.room p { line-height: 1.75; }
.room-title { text-wrap: balance; }
.room p, .faq-section p, .panel-note { text-wrap: pretty; max-width: 68ch; }
