  :root {
    /* ===== dark-horror palette (crimson / kagune purple / ash) ===== */
    --bg: #0a0a0f;            /* 最深黒 */
    --bg-deep: #070409;
    --surface: #150d12;       /* panel solid */
    --surface2: #1d1218;
    --surface3: #281a22;
    --panel: rgba(22, 13, 18, 0.62); /* glass */
    --accent: #d11f35;        /* 深紅 (primary interactive) */
    --accent-glow: #ff2a44;   /* 蛍光の赤・カグネ */
    --accent2: #a064d9;       /* 紫 (kagune) */
    --accent2-glow: #c07bff;
    --green: #2fe07a;         /* 蛍光グリーン (プラス・AT) */
    --yellow: #ffb000;        /* amber LCD */
    --red: #ff3b52;           /* blood (マイナス) */
    --blue: #4aa8ff;          /* cold accent (AT間) */
    --text: #ecf0f1;          /* bone white */
    --muted: #8b8590;
    --muted-dim: #5a525c;
    --border: #2c1a22;        /* crimson-tinted hairline */
    --radius: 14px;
    --font-jp: "Noto Sans JP", system-ui, -apple-system, sans-serif;
    --font-en: "Oswald", system-ui, sans-serif;
    --font-mono: "Share Tech Mono", ui-monospace, monospace;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; }

  body {
    background:
      radial-gradient(120% 60% at 50% -10%, rgba(209,31,53,0.16), transparent 60%),
      radial-gradient(90% 50% at 110% 8%, rgba(160,100,217,0.12), transparent 55%),
      var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-jp);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100dvh;
    padding-bottom: 86px;
    -webkit-font-smoothing: antialiased;
  }
  /* atmospheric overlays */
  body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    background:
      repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 3px),
      radial-gradient(130% 100% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%);
    mix-blend-mode: screen;
    opacity: 0.7;
  }
  body::after {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    box-shadow: inset 0 0 160px 30px rgba(0,0,0,0.7);
  }

  /* ===================== HEADER ===================== */
  header {
    position: sticky; top: 0; z-index: 20;
    padding: 16px 18px 15px;
    background:
      linear-gradient(180deg, rgba(28,8,14,0.92), rgba(12,7,11,0.82)),
      repeating-linear-gradient(115deg, transparent 0 22px, rgba(209,31,53,0.05) 22px 23px);
    border-bottom: 1px solid rgba(209,31,53,0.4);
    box-shadow: 0 1px 0 rgba(255,42,68,0.15), 0 14px 30px -16px rgba(209,31,53,0.5);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    overflow: hidden;
  }
  header::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    opacity: 0.7;
  }
  .brand { display: flex; align-items: center; gap: 13px; }
  .brand-glyph {
    width: 30px; height: 30px; flex-shrink: 0;
    transform: rotate(45deg);
    background: linear-gradient(135deg, var(--accent-glow), var(--accent2));
    border-radius: 7px;
    box-shadow: 0 0 18px rgba(255,42,68,0.6), inset 0 0 8px rgba(255,255,255,0.35);
    position: relative;
  }
  .brand-glyph::after {
    content: ""; position: absolute; inset: 7px;
    background: var(--bg-deep); border-radius: 3px;
  }
  .brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .brand-kicker {
    font-family: var(--font-en);
    font-size: 10px; font-weight: 600; letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent-glow);
    text-shadow: 0 0 10px rgba(255,42,68,0.5);
  }
  header h1 {
    font-family: var(--font-jp);
    font-size: 23px; font-weight: 900; letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 0 1px rgba(255,255,255,0.4), 0 0 16px rgba(209,31,53,0.55);
    line-height: 1;
  }
  header .machine-name {
    margin-top: 11px;
    font-family: var(--font-mono);
    font-size: 12px; letter-spacing: 0.04em;
    color: var(--muted);
    display: flex; align-items: center; gap: 8px;
  }
  header .machine-name::before {
    content: "TARGET";
    font-size: 9px; letter-spacing: 0.18em;
    color: var(--accent-glow);
    border: 1px solid rgba(209,31,53,0.45);
    border-radius: 4px; padding: 2px 5px;
    box-shadow: 0 0 10px rgba(209,31,53,0.25) inset;
  }

  /* ===================== BOTTOM NAV ===================== */
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    background: linear-gradient(180deg, rgba(14,8,12,0.86), rgba(8,5,8,0.97));
    border-top: 1px solid rgba(209,31,53,0.32);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    flex: 0 0 25%; position: relative;
    padding: 10px 0 12px;
    border: none; background: transparent;
    color: var(--muted-dim);
    font-family: var(--font-jp);
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    transition: color 0.18s;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .nav-btn .icon { font-size: 19px; filter: grayscale(0.5) brightness(0.8); transition: filter 0.18s; }
  .nav-btn::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px; border-radius: 2px;
    background: var(--accent-glow);
    box-shadow: 0 0 12px var(--accent-glow);
    transition: width 0.22s ease;
  }
  .nav-btn.active { color: #fff; }
  .nav-btn.active .icon { filter: none; }
  .nav-btn.active::before { width: 46px; }

  /* ===================== PAGES ===================== */
  .page { display: none; position: relative; z-index: 1; }
  .page.active { display: block; }
  .container { max-width: 480px; margin: 0 auto; padding: 18px 16px 8px; }

  /* ===================== MACHINE SELECT ===================== */
  .machine-select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-jp);
    font-size: 15px; font-weight: 700;
    padding: 14px 16px;
    border-radius: var(--radius);
    outline: none;
    margin-bottom: 16px;
    box-shadow: 0 0 0 1px rgba(209,31,53,0.12) inset, 0 8px 24px -18px rgba(255,42,68,0.7);
    appearance: none; -webkit-appearance: none;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--accent-glow) 50%),
      linear-gradient(135deg, var(--accent-glow) 50%, transparent 50%);
    background-position: calc(100% - 19px) center, calc(100% - 14px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }

  /* ===================== MODE TOGGLE ===================== */
  .toggle-group {
    display: flex; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
    margin-bottom: 16px;
  }
  .toggle-btn {
    flex: 1; min-height: 48px;
    border: none; background: transparent;
    color: var(--muted);
    font-family: var(--font-jp);
    font-size: 14px; font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s;
  }
  .toggle-btn.active {
    color: #fff;
    background: linear-gradient(180deg, var(--accent), #9a1626);
    box-shadow: 0 0 18px -2px rgba(255,42,68,0.6), inset 0 1px 0 rgba(255,255,255,0.18);
  }

  /* ===================== CARD ===================== */
  .card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin-bottom: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 34px -26px rgba(0,0,0,0.9);
  }
  .card-title {
    font-family: var(--font-en);
    font-size: 12px; font-weight: 600;
    color: var(--accent-glow);
    text-transform: uppercase; letter-spacing: 0.16em;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
  }
  .card-title::before {
    content: ""; width: 3px; height: 13px; border-radius: 2px;
    background: var(--accent-glow);
    box-shadow: 0 0 9px var(--accent-glow);
  }

  /* ===================== G INPUT (big) ===================== */
  .input-row {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: inset 0 0 22px rgba(0,0,0,0.7);
  }
  .input-label {
    font-family: var(--font-jp);
    font-size: 13px; font-weight: 700; color: var(--muted);
    min-width: 78px;
  }
  .num-input {
    flex: 1; min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-en);
    font-size: clamp(40px, 13vw, 58px);
    font-weight: 700; letter-spacing: 0.02em;
    text-align: right;
    padding: 2px 0;
    outline: none;
    text-shadow: 0 0 18px rgba(255,42,68,0.45);
  }
  .num-input::-webkit-outer-spin-button,
  .num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .input-unit {
    font-family: var(--font-en); font-weight: 600;
    font-size: 20px; color: var(--accent-glow);
    align-self: flex-end; padding-bottom: 10px;
  }

  .stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 4px; }
  .step-btn {
    min-height: 56px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text);
    font-family: var(--font-en);
    font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.06s, background 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .step-btn:active {
    transform: translateY(1px) scale(0.97);
    background: linear-gradient(180deg, var(--accent), #9a1626);
    color: #fff;
    box-shadow: 0 0 16px -2px rgba(255,42,68,0.7);
  }

  /* checkbox row */
  .check-row {
    display: flex; align-items: center; gap: 11px;
    font-family: var(--font-jp);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    min-height: 44px;
  }
  .check-row input {
    width: 22px; height: 22px; accent-color: var(--accent);
    flex-shrink: 0;
  }

  /* exchange + thru buttons */
  .exchange-row { display: flex; gap: 8px; }
  .ex-btn {
    flex: 1; min-height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    font-family: var(--font-jp);
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.15s;
  }
  .ex-btn.active {
    border-color: var(--accent);
    color: #fff;
    background: rgba(209,31,53,0.14);
    box-shadow: 0 0 14px -3px rgba(255,42,68,0.6);
  }
  .thru-select { display: flex; gap: 7px; flex-wrap: wrap; }
  .hint-select { width:100%; background:var(--surface2); border:1px solid var(--border); border-radius:8px; color:var(--text); font-size:12px; padding:8px 10px; font-family:var(--font-jp); cursor:pointer; }
  .thru-btn {
    min-height: 44px; padding: 0 16px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    font-family: var(--font-en);
    font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
  }
  .thru-btn.active {
    border-color: transparent; color: #fff;
    background: linear-gradient(180deg, var(--accent), #9a1626);
    box-shadow: 0 0 14px -2px rgba(255,42,68,0.6);
  }

  /* ===================== RESULT CARD (showpiece) ===================== */
  .result-card {
    position: relative; overflow: hidden;
    border-radius: 20px;
    padding: 28px 18px 22px;
    margin-bottom: 16px;
    text-align: center;
    border: 1.5px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s, box-shadow 0.25s;
  }
  .result-card::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    opacity: 0; transition: opacity 0.3s;
  }
  .result-card > * { position: relative; z-index: 1; }

  .result-card.go {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 1px rgba(255,42,68,0.4), 0 0 50px -12px rgba(255,42,68,0.8);
  }
  .result-card.go::before {
    opacity: 1;
    background: radial-gradient(120% 90% at 50% 0%, rgba(255,42,68,0.28), transparent 65%);
    animation: pulseGo 2.4s ease-in-out infinite;
  }
  .result-card.watch {
    border-color: var(--accent2-glow);
    box-shadow: 0 0 0 1px rgba(192,123,255,0.3), 0 0 40px -16px rgba(192,123,255,0.7);
  }
  .result-card.watch::before {
    opacity: 1;
    background: radial-gradient(120% 90% at 50% 0%, rgba(160,100,217,0.22), transparent 65%);
  }
  .result-card.stop {
    border-color: #3a2730;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.6);
    filter: saturate(0.9);
  }
  .result-card.stop::before {
    opacity: 1;
    background: radial-gradient(120% 90% at 50% 0%, rgba(90,40,52,0.25), transparent 70%);
  }
  @keyframes pulseGo {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
  }

  .verdict {
    font-family: var(--font-jp);
    font-size: clamp(34px, 9.5vw, 48px);
    font-weight: 900; letter-spacing: 0.01em; line-height: 1.05;
    margin-bottom: 8px;
  }
  .verdict.go { color: #fff; text-shadow: 0 0 24px rgba(255,42,68,0.85), 0 0 4px rgba(255,42,68,0.6); }
  .verdict.stop { color: #7c6f76; text-shadow: none; }
  .verdict.watch { color: var(--accent2-glow); text-shadow: 0 0 22px rgba(192,123,255,0.7); }

  .ev-display {
    font-family: var(--font-en);
    font-size: clamp(38px, 12vw, 56px);
    font-weight: 700; letter-spacing: 0.01em; line-height: 1;
    margin: 6px 0 4px;
  }
  .ev-display.pos { color: var(--green); text-shadow: 0 0 22px rgba(47,224,122,0.55); }
  .ev-display.neg { color: var(--red); text-shadow: 0 0 22px rgba(255,59,82,0.5); }
  .ev-display.zero { color: var(--yellow); text-shadow: 0 0 22px rgba(255,176,0,0.5); }

  .sub-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; }
  .stat-box {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 10px;
    text-align: center;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.5);
  }
  .stat-label {
    font-family: var(--font-jp);
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--muted); margin-bottom: 6px;
  }
  .stat-val {
    font-family: var(--font-en);
    font-size: 24px; font-weight: 700; color: #fff;
    text-shadow: 0 0 14px rgba(255,42,68,0.4);
  }

  /* やめどき list */
  .stop-list { list-style: none; }
  .stop-list li {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-jp);
    font-size: 14px; line-height: 1.6;
    display: flex; gap: 10px; align-items: flex-start;
    color: var(--text);
  }
  .stop-list li:last-child { border: none; }
  .stop-list li::before {
    content: ""; flex-shrink: 0;
    width: 7px; height: 7px; margin-top: 7px;
    transform: rotate(45deg);
    background: var(--accent-glow);
    box-shadow: 0 0 8px var(--accent-glow);
  }

  .chart-wrap { position: relative; height: 210px; }
  .disclaimer {
    font-family: var(--font-jp);
    font-size: 11px; color: var(--muted-dim);
    text-align: center; padding: 10px 8px 2px; line-height: 1.6;
  }

  /* ========================================================= */
  /* ===================== GUIDE PAGE ======================== */
  /* ========================================================= */
  .guide-section { margin-bottom: 10px; }
  .guide-section-title {
    font-family: var(--font-jp);
    font-size: 15px; font-weight: 900; letter-spacing: 0.02em;
    color: #fff;
    padding: 22px 18px 10px;
    display: flex; align-items: center; gap: 10px;
  }
  .guide-section-title::before {
    content: ""; width: 4px; height: 18px; border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-glow), var(--accent2));
    box-shadow: 0 0 12px rgba(255,42,68,0.6);
  }

  /* step cards */
  .step-list { padding: 0 16px; display: flex; flex-direction: column; gap: 11px; margin-bottom: 8px; }
  .step-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex; gap: 14px; align-items: flex-start;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .step-num {
    background: linear-gradient(160deg, var(--accent), #8c1322);
    color: #fff;
    font-family: var(--font-en);
    font-size: 16px; font-weight: 700;
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px -3px rgba(255,42,68,0.7), inset 0 1px 0 rgba(255,255,255,0.2);
  }
  .step-title { font-family: var(--font-jp); font-size: 15px; font-weight: 700; margin-bottom: 5px; color: #fff; }
  .step-desc { font-family: var(--font-jp); font-size: 13px; color: var(--muted); line-height: 1.7; }
  .step-desc strong { color: var(--text); }

  /* ===== device / LCD frame mock ===== */
  .mock-screen {
    background: linear-gradient(180deg, #2a2228, #151014);
    border: 1px solid #3a2c33;
    border-radius: 14px;
    padding: 12px;
    margin: 14px 0;
    position: relative; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.6) inset, 0 24px 40px -28px rgba(0,0,0,1);
  }
  .mock-screen::before {
    content: "LCD MOCK — 実際の画面は実機を撮影してください";
    display: block;
    font-family: var(--font-mono);
    font-size: 10px; letter-spacing: 0.04em;
    color: var(--muted-dim);
    margin-bottom: 9px;
  }
  .mock-lcd {
    background:
      radial-gradient(120% 100% at 50% 0%, rgba(160,100,217,0.18), transparent 60%),
      linear-gradient(135deg, #160a24 0%, #0b1130 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 13px;
    position: relative;
    min-height: 140px;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.6);
  }
  .mock-char {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface3);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
  }
  .mock-counter {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,176,0,0.25);
    border-radius: 6px;
    padding: 6px 10px;
    display: inline-block;
    box-shadow: inset 0 0 16px rgba(0,0,0,0.6);
  }
  .mock-counter .mc-label {
    font-family: var(--font-jp);
    font-size: 10px; color: #9a8f7a; display: block; margin-bottom: 2px;
  }
  .mock-counter .mc-val {
    font-family: var(--font-mono);
    font-size: 22px; font-weight: 700; color: var(--yellow);
    letter-spacing: 3px;
    text-shadow: 0 0 12px rgba(255,176,0,0.7);
  }
  .mock-highlight { color: var(--yellow); font-weight: 700; }
  .mock-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
  .mock-badge {
    font-family: var(--font-jp);
    background: rgba(160,100,217,0.22);
    border: 1px solid rgba(192,123,255,0.6);
    border-radius: 5px;
    font-size: 11px; font-weight: 700; color: #fff;
    padding: 3px 8px;
    box-shadow: 0 0 12px -3px rgba(192,123,255,0.7);
  }
  .mock-badge.red { background: rgba(255,59,82,0.2); border-color: rgba(255,59,82,0.7); box-shadow: 0 0 12px -3px rgba(255,59,82,0.7); }
  .mock-badge.green { background: rgba(47,224,122,0.18); border-color: rgba(47,224,122,0.6); box-shadow: 0 0 12px -3px rgba(47,224,122,0.6); }
  .mock-badge.yellow { background: rgba(255,176,0,0.18); border-color: rgba(255,176,0,0.6); box-shadow: 0 0 12px -3px rgba(255,176,0,0.6); }
  .mock-label-arrow {
    position: absolute;
    font-family: var(--font-jp);
    font-size: 11px; color: var(--yellow);
    display: flex; align-items: center; gap: 4px;
    background: rgba(0,0,0,0.75);
    padding: 3px 7px; border-radius: 5px;
    white-space: nowrap;
  }

  /* ===== realistic data counter ===== */
  .data-display {
    background: #050608;
    border: 1px solid #2a2228;
    border-radius: 10px;
    padding: 4px 14px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9), 0 0 0 4px #1a1418, 0 0 0 5px #2c2228;
    position: relative; overflow: hidden;
  }
  .data-display::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  }
  .data-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .data-row:last-child { border: none; }
  .data-row > span:first-child {
    font-family: var(--font-jp); font-size: 12px; font-weight: 500; color: #7d8a78;
    line-height: 1.3;
  }
  .data-row .val {
    font-family: var(--font-mono);
    font-size: 19px; font-weight: 700;
    color: var(--yellow);
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255,176,0,0.7);
  }
  .data-row .val.red { color: var(--red); text-shadow: 0 0 10px rgba(255,59,82,0.7); }

  /* flow chart */
  .flow { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0 16px; margin-bottom: 8px; }
  .flow-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 16px;
    font-family: var(--font-jp);
    font-size: 14px; font-weight: 700;
    text-align: center; width: 100%; max-width: 340px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .flow-box.question {
    border-color: rgba(209,31,53,0.5); color: #fff;
    box-shadow: 0 0 22px -8px rgba(255,42,68,0.6);
  }
  .flow-box.answer-a { border-color: rgba(47,224,122,0.5); }
  .flow-box.answer-b { border-color: rgba(74,168,255,0.5); }
  .flow-arrow { font-size: 18px; color: var(--muted-dim); line-height: 1.4; display: flex; gap: 40px; }
  .flow-branch { display: flex; gap: 10px; width: 100%; max-width: 340px; }
  .flow-branch-box {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 11px;
    font-family: var(--font-jp);
    font-size: 13px; text-align: center;
  }
  .flow-branch-box.a { border-color: rgba(47,224,122,0.55); color: var(--green); font-weight: 700; }
  .flow-branch-box.b { border-color: rgba(74,168,255,0.55); color: var(--blue); font-weight: 700; }
  .flow-labels { display: flex; width: 100%; max-width: 340px; gap: 10px; font-size: 11px; color: var(--muted); text-align: center; }
  .flow-labels span { flex: 1; }

  /* glossary */
  .glossary { padding: 0 16px; margin-bottom: 8px; }
  .term-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 9px; overflow: hidden;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .term-card.open {
    border-color: rgba(209,31,53,0.45);
    box-shadow: 0 0 28px -12px rgba(255,42,68,0.6);
  }
  .term-header {
    padding: 15px 16px;
    display: flex; align-items: center; gap: 13px;
    cursor: pointer; user-select: none;
  }
  .term-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: radial-gradient(circle at 35% 25%, rgba(209,31,53,0.35), rgba(160,100,217,0.18));
    border: 1px solid rgba(209,31,53,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; flex-shrink: 0;
    box-shadow: inset 0 0 14px rgba(0,0,0,0.4), 0 0 16px -6px rgba(255,42,68,0.6);
  }
  .term-name { font-family: var(--font-jp); font-size: 15px; font-weight: 700; color: #fff; }
  .term-short { font-family: var(--font-jp); font-size: 12px; color: var(--muted); margin-top: 2px; }
  .term-arrow { margin-left: auto; color: var(--accent-glow); font-size: 11px; transition: transform 0.25s; }
  .term-card.open .term-arrow { transform: rotate(180deg); }
  .term-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--border); }
  .term-card.open .term-body { display: block; }
  .term-body p { font-family: var(--font-jp); font-size: 14px; line-height: 1.8; color: var(--muted); margin-top: 13px; }
  .term-body p strong { color: var(--text); font-weight: 700; }
  .term-body .example {
    background: var(--bg-deep);
    border-left: 3px solid var(--accent-glow);
    border-radius: 0 8px 8px 0;
    padding: 11px 13px;
    font-family: var(--font-jp);
    font-size: 13px; line-height: 1.7;
    margin-top: 11px; color: var(--text);
  }
  .term-body .tip {
    background: rgba(47,224,122,0.07);
    border: 1px solid rgba(47,224,122,0.28);
    border-radius: 8px;
    padding: 11px 13px;
    font-family: var(--font-jp);
    font-size: 13px; line-height: 1.7;
    margin-top: 11px; color: var(--green);
  }

  /* ===== screenshot drop frame (landscape LCD) ===== */
  .photo-placeholder {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1.5px dashed rgba(209,31,53,0.5);
    border-radius: 12px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    text-align: center;
    font-family: var(--font-jp);
    font-size: 12px; color: var(--muted);
    margin: 14px 0; line-height: 1.6;
    background:
      repeating-linear-gradient(45deg, rgba(209,31,53,0.05) 0 10px, transparent 10px 20px),
      var(--bg-deep);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.6), 0 0 24px -14px rgba(255,42,68,0.6);
    overflow: hidden;
  }
  /* corner brackets */
  .photo-placeholder::before,
  .photo-placeholder::after {
    content: ""; position: absolute;
    width: 22px; height: 22px;
    border: 2px solid var(--accent-glow);
    box-shadow: 0 0 10px rgba(255,42,68,0.5);
  }
  .photo-placeholder::before { top: 10px; left: 10px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
  .photo-placeholder::after { bottom: 10px; right: 10px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
  .photo-placeholder .icon {
    font-family: var(--font-en);
    font-size: 13px; font-weight: 600; letter-spacing: 0.2em;
    color: var(--accent-glow);
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255,42,68,0.5);
    margin-bottom: 2px;
  }
  .photo-placeholder .hint-code {
    font-family: var(--font-mono);
    font-size: 11px; color: var(--muted-dim);
    background: rgba(0,0,0,0.4);
    padding: 4px 9px; border-radius: 5px;
    margin-top: 4px;
  }
  /* when a real image is dropped in, let it fill the frame */
  .photo-placeholder img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 10px;
  }

  /* misc inline-styled info boxes inherit vars, just smooth fonts */
  .guide-section p, .guide-section div { font-family: var(--font-jp); }

  /* ===== 実機画像グリッド ===== */
  .screen-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 0 16px;
    margin-bottom: 10px;
  }
  .screen-grid.single { grid-template-columns: 1fr; }
  .screen-item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    position: relative;
  }
  .screen-item img {
    width: 100%; display: block;
    border-radius: 12px 12px 0 0;
  }
  .screen-caption {
    font-family: var(--font-jp);
    font-size: 11px;
    color: var(--muted);
    padding: 7px 9px;
    line-height: 1.4;
    border-top: 1px solid var(--border);
  }
  .screen-caption strong { color: var(--text); }
  .cite-bar {
    font-family: var(--font-jp);
    font-size: 11px;
    color: var(--muted-dim);
    padding: 6px 16px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .cite-bar a { color: var(--muted); text-decoration: underline; }

  /* ===== 機種別タブ ===== */
  .m-chip-wrap {
    position: sticky; top: 0; z-index: 10;
    background: linear-gradient(180deg, rgba(8,5,8,0.98), rgba(8,5,8,0.92));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .m-chip-bar {
    display: flex; gap: 7px; padding: 10px 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .m-chip-bar::-webkit-scrollbar { display: none; }
  .m-chip {
    flex-shrink: 0; padding: 7px 13px; font-size: 12px; font-weight: 700;
    font-family: var(--font-jp); white-space: nowrap;
    border: 1.5px solid var(--border); border-radius: 20px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: all 0.15s;
  }
  .m-chip.active {
    border-color: var(--accent-glow); color: #fff;
    background: rgba(209,0,31,0.25);
    box-shadow: 0 0 8px rgba(209,0,31,0.3);
  }
  /* 詳細ページ */
  .m-detail-wrap { max-width: 480px; margin: 0 auto; }
  .m-hero {
    padding: 18px 18px 8px;
    border-bottom: 1px solid var(--border);
  }
  .m-hero-name {
    font-size: 22px; font-weight: 900; color: var(--text);
    font-family: var(--font-jp); letter-spacing: 0.04em;
  }
  .m-hero-sub {
    font-size: 11px; color: var(--muted); margin-top: 3px;
  }
  .m-section {
    padding: 0 0 4px;
  }
  .m-section-title {
    font-family: var(--font-en); font-size: 10px; font-weight: 700;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--accent-glow);
    padding: 18px 18px 6px;
    display: flex; align-items: center; gap: 10px;
  }
  .m-section-title::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(255,42,68,0.4), transparent);
  }
  .m-item-list { padding: 0 18px 10px; }
  .m-item {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
    font-family: var(--font-jp); font-size: 13px; line-height: 1.6;
  }
  .m-item:last-child { border-bottom: none; }
  .m-item::before {
    content: "▸"; color: var(--accent-glow); font-size: 11px;
    margin-top: 3px; flex-shrink: 0;
  }
  .m-item em { color: var(--accent-glow); font-style: normal; font-weight: 700; }
  .m-warn {
    margin: 0 18px 12px;
    background: rgba(255,176,0,0.08); border: 1px solid rgba(255,176,0,0.25);
    border-radius: 8px; padding: 10px 13px;
    font-size: 12px; color: var(--yellow); font-family: var(--font-jp); line-height: 1.6;
  }
  .m-note-box {
    margin: 0 18px 16px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 13px;
    font-size: 12px; color: var(--muted); font-family: var(--font-jp); line-height: 1.6;
  }
  .m-empty {
    text-align: center; padding: 60px 0; color: var(--muted);
    font-family: var(--font-jp); font-size: 14px;
  }
  /* machine overview */
  .m-overview {
    padding: 12px 18px 4px;
    font-size: 13px; color: var(--muted);
    font-family: var(--font-jp); line-height: 1.7;
  }
  /* mode ladder */
  .m-mode-ladder { padding: 0 18px 14px; display: flex; flex-direction: column; }
  .m-mode-rung {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(209,0,31,0.22); border-radius: 8px;
    background: rgba(255,255,255,0.02);
  }
  .m-mode-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent-glow); flex-shrink: 0;
  }
  .m-mode-info { flex: 1; }
  .m-mode-name { font-size: 13px; font-weight: 700; color: var(--text); }
  .m-mode-zones { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .m-mode-note { font-size: 11px; color: var(--blue); margin-top: 2px; }
  .m-mode-ceil {
    font-size: 11px; color: var(--muted); text-align: right;
    flex-shrink: 0; white-space: nowrap; line-height: 1.4;
  }
  .m-mode-arrow { text-align: center; color: var(--muted); font-size: 11px; padding: 2px 0; }
  /* suggest table */
  .m-table {
    width: 100%; border-collapse: collapse;
    font-size: 13px; font-family: var(--font-jp);
  }
  .m-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
  .m-table td:first-child { color: var(--muted); }
  .m-table td:last-child { color: var(--text); font-weight: 700; text-align: right; }
  .m-table tr:last-child td { border-bottom: none; }
  .m-table em { color: var(--accent-glow); font-style: normal; }
  /* images */
  .m-img-wrap { margin: 0 0 4px; }
  .m-img-caption {
    padding: 5px 18px 2px;
    font-size: 12px; color: var(--muted); font-family: var(--font-jp); line-height: 1.5;
  }
  .m-cite-bar {
    padding: 2px 18px 10px;
    font-size: 10px; color: rgba(255,255,255,0.25); font-family: var(--font-jp);
  }
  /* source footer */
  .m-source-bar {
    padding: 6px 18px 20px;
    font-size: 10px; color: rgba(255,255,255,0.22); font-family: var(--font-jp);
  }
  .m-source-bar a { color: rgba(255,255,255,0.35); text-decoration: none; }
  /* youtube button */
  .m-yt-btn {
    display: inline-flex; align-items: center; gap: 5px;
    margin: 8px 18px 0; padding: 5px 13px;
    background: rgba(255,0,0,0.12); border: 1px solid rgba(255,0,0,0.3);
    border-radius: 20px; color: #ff5555; font-size: 11px; font-weight: 700;
    text-decoration: none; font-family: var(--font-en); letter-spacing: 0.05em;
    transition: background 0.15s;
  }
  .m-yt-btn:hover { background: rgba(255,0,0,0.25); }
  /* chip level sub-label */
  .m-chip-lvs {
    display: block; font-size: 9px; font-weight: 700; letter-spacing: 0;
    opacity: 0.55; margin-top: 1px; font-family: var(--font-en);
  }
  .m-chip.active .m-chip-lvs { opacity: 1; }
  /* hero level badges */
  .m-hero-levels { display: flex; gap: 6px; margin-top: 7px; margin-bottom: 2px; }
  .m-lv-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 9px; border-radius: 12px; font-size: 11px; font-weight: 700;
    font-family: var(--font-en); letter-spacing: 0.05em;
  }
  .m-lv-h { background: rgba(209,0,31,0.18); border: 1px solid rgba(209,0,31,0.38); color: #ff4455; }
  .m-lv-a { background: rgba(255,176,0,0.12); border: 1px solid rgba(255,176,0,0.35); color: #ffb000; }
  .m-lv-me { background: rgba(100,180,255,0.12); border: 1px solid rgba(100,180,255,0.35); color: #64b4ff; }
  .m-lv-me-req { background: rgba(255,80,140,0.12); border: 1px solid rgba(255,80,140,0.35); color: #ff509c; }
  /* diff calc */
  .m-calc-wrap { padding: 0 18px 16px; }
  .m-calc-input-row {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
  }
  .m-calc-input-row label {
    font-size: 12px; color: var(--muted); font-family: var(--font-jp); white-space: nowrap;
  }
  .m-calc-input {
    width: 100px; padding: 7px 10px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 700;
    text-align: center; -moz-appearance: textfield;
  }
  .m-calc-input::-webkit-inner-spin-button,
  .m-calc-input::-webkit-outer-spin-button { -webkit-appearance: none; }
  .m-calc-result {
    font-size: 18px; font-weight: 900; color: var(--accent-glow);
    font-family: var(--font-en);
  }
  .m-calc-result span { font-size: 12px; color: var(--muted); margin-left: 4px; font-family: var(--font-jp); }
  .m-calc-table { width: 100%; border-collapse: collapse; }
  .m-calc-table td {
    padding: 7px 10px; font-size: 12px; font-family: var(--font-jp);
    border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--muted);
  }
  .m-calc-table td:last-child { text-align: right; font-weight: 700; color: var(--text); }
  .m-calc-table tr.dc-active td {
    background: rgba(209,0,31,0.12); color: var(--accent-glow);
  }
  .m-calc-table tr.dc-active td:first-child { border-left: 2px solid var(--accent-glow); }
  .m-calc-shortcut {
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 12px; color: var(--muted); font-family: var(--font-jp); line-height: 2;
  }

  /* machine sub-nav */
  .machine-sub-nav {
    display: flex; gap: 6px;
    padding: 12px 16px 0;
    max-width: 480px; margin: 0 auto;
  }
  .sub-btn {
    flex: 1; padding: 8px 0; font-size: 13px; font-weight: 700;
    font-family: var(--font-jp);
    border: 1.5px solid var(--border); border-radius: 8px;
    background: transparent; color: var(--muted); cursor: pointer;
    transition: all 0.18s;
  }
  .sub-btn.active {
    border-color: var(--accent); color: var(--accent);
    background: rgba(139,0,0,0.15);
  }
  /* ===== 北斗の拳 タブ ===== */
  .hk-hero { position: relative; width: 100%; height: 190px; overflow: hidden; }
  .hk-hero-img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.42); }
  .hk-hero-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px 16px; }
  .hk-hero-title { font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); letter-spacing: 1px; margin-bottom: 6px; }
  .hk-hero-tags { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
  .hk-hero-sub { font-size: 11px; color: rgba(255,255,255,0.62); }
  .hk-section { padding: 14px 14px 4px; }
  .hk-section-title { font-size: 15px; font-weight: 700; color: var(--accent); border-left: 3px solid var(--accent); padding-left: 8px; margin-bottom: 10px; letter-spacing: 0.03em; }
  .hk-subsection-title { font-size: 11px; font-weight: 700; color: var(--muted); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: 0.06em; }
  .hk-term { color: var(--accent); border-bottom: 1px dashed rgba(255,90,0,0.5); cursor: pointer; position: relative; display: inline; }
  .hk-term-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1c1c1c; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 11px; line-height: 1.6; width: 220px; z-index: 200; color: var(--fg); box-shadow: 0 4px 16px rgba(0,0,0,0.8); white-space: normal; font-weight: 400; pointer-events: none; }
  .hk-term.open .hk-term-tip { display: block; }
  .hk-card { background: var(--card); border-radius: 10px; padding: 12px 14px; margin-bottom: 6px; }
  .hk-card p { font-size: 13px; color: var(--fg); margin: 0 0 8px; line-height: 1.6; }
  .hk-callout { background: rgba(100,180,255,0.10); border-left: 3px solid rgba(100,180,255,0.5); border-radius: 0 6px 6px 0; padding: 8px 10px; font-size: 12px; color: var(--fg); margin-bottom: 6px; line-height: 1.5; }
  .hk-callout-warn { background: rgba(255,140,0,0.12); border-left-color: rgba(255,140,0,0.6); }
  .hk-tip { background: rgba(139,0,0,0.12); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; padding: 8px 10px; font-size: 12px; color: var(--fg); margin-top: 8px; line-height: 1.5; }
  .hk-diff-explain { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 6px; }
  .hk-de-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 7px 10px; border-radius: 7px; }
  .hk-de-row.minus { background: rgba(0,180,100,0.12); }
  .hk-de-row.neutral { background: rgba(150,150,150,0.10); }
  .hk-de-row.plus { background: rgba(200,50,50,0.12); }
  .hk-de-val { font-weight: 700; min-width: 76px; font-size: 13px; }
  .hk-de-arrow { color: var(--muted); }
  .hk-de-desc em { color: var(--accent); font-style: normal; font-weight: 600; }
  .hk-calc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
  .hk-calc-row label { font-size: 12px; color: var(--muted); white-space: nowrap; }
  .hk-flow { display: flex; flex-direction: column; gap: 8px; }
  .hk-step { display: flex; gap: 10px; background: var(--card); border-radius: 10px; padding: 12px; }
  .hk-step.warn { border-left: 3px solid #e67e22; }
  .hk-step-num { min-width: 26px; height: 26px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 1px; }
  .hk-step-body { flex: 1; }
  .hk-step-title { font-size: 13px; font-weight: 700; color: var(--fg); margin-bottom: 3px; }
  .hk-step-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }
  .hk-step-desc em { color: var(--accent); font-style: normal; font-weight: 600; }
  .hk-oura { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 0; }
  .hk-oc { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
  .hk-oc.white { background: #ccc; color: #222; }
  .hk-oc.blue { background: #1565c0; color: #fff; }
  .hk-oc.yellow { background: #b8860b; color: #fff; }
  .hk-oc.green { background: #2e7d32; color: #fff; }
  .hk-oc.red { background: var(--accent); color: #fff; }
  .hk-oc.rainbow { background: linear-gradient(90deg,#f22,#f90,#ff0,#0f0,#0af,#c0f); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
  .hk-arrow { color: var(--muted); font-size: 14px; line-height: 1; }
  .hk-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .hk-table td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; line-height: 1.45; }
  .hk-table td:first-child { color: var(--muted); width: 44%; }
  .hk-table td em { color: var(--accent); font-style: normal; font-weight: 600; }
  .hk-yt-list { display: flex; flex-direction: column; gap: 8px; }
  .hk-yt-link { display: flex; gap: 12px; background: var(--card); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--fg); transition: background 0.18s; }
  .hk-yt-link:hover { background: rgba(139,0,0,0.15); }
  .hk-yt-thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
  .hk-yt-info { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
  .hk-yt-title { font-size: 12px; font-weight: 600; color: var(--fg); line-height: 1.4; }
  .hk-yt-sub { font-size: 11px; color: var(--muted); }
  .hk-src { font-size: 10px; color: rgba(255,255,255,0.28); text-align: center; padding: 6px 0 12px; }
  /* CZゾーンマップ */
  .czmap-track { position:relative; height:28px; background:rgba(255,255,255,0.04); border-radius:6px; border:1px solid var(--border); overflow:visible; margin-bottom:4px; }
  .czmap-zone-band { position:absolute; top:0; bottom:0; background:var(--accent-glow); opacity:0.38; border-radius:3px; transition:opacity .2s; }
  .czmap-period-tick { position:absolute; top:0; bottom:0; width:1px; background:rgba(255,255,255,0.12); }
  .czmap-cursor-line { position:absolute; top:-5px; bottom:-5px; width:2px; background:#fff; border-radius:1px; box-shadow:0 0 7px rgba(255,255,255,0.75); z-index:2; pointer-events:none; }
  .czmap-scale { display:flex; justify-content:space-between; font-size:9px; color:var(--muted-dim); padding:0 2px; margin-top:2px; }
  .czmap-legend { display:flex; gap:14px; font-size:11px; color:var(--muted); margin-top:7px; flex-wrap:wrap; }
  .czmap-legend-dot { display:inline-block; width:10px; height:10px; border-radius:2px; vertical-align:middle; margin-right:3px; }
  .hk-guide-toggle { cursor:pointer; font-size:12px; color:var(--accent); padding:8px 0 2px; user-select:none; display:flex; align-items:center; gap:6px; border-top:1px solid rgba(255,255,255,0.07); margin-top:10px; }
  .hk-guide-body { display:none; padding-top:10px; }
  .hk-card.hk-guide-open .hk-guide-body { display:block; }
  .hk-guide-arrow { display:inline-block; transition:transform 0.2s; font-size:10px; }
  .hk-card.hk-guide-open .hk-guide-arrow { transform:rotate(180deg); }
  .hk-intro-flow { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:10px 0 8px; }
  .hk-intro-step { background:rgba(255,255,255,0.07); padding:4px 10px; border-radius:20px; font-size:11px; color:var(--fg); }
  .hk-intro-step.hl { background:var(--accent); color:#000; font-weight:700; }
  .hk-intro-arr { color:var(--muted); font-size:11px; }
  .hk-warn-box { background:rgba(192,57,43,0.15); border-left:3px solid #c0392b; padding:8px 10px; border-radius:4px; font-size:12px; margin:6px 0 2px; color:var(--fg); line-height:1.55; }

#auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #0a0a0f;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
#auth-overlay.hidden { display: none; }
.auth-box {
  width: 100%; max-width: 340px; padding: 0 24px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.auth-logo {
  font-size: 36px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(135deg, #d1001f 0%, #7b0012 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.auth-sub { font-size: 13px; color: rgba(255,255,255,0.35); text-align: center; }
.auth-input-wrap { width: 100%; position: relative; }
.auth-input {
  width: 100%; padding: 14px 16px; font-size: 18px; letter-spacing: 4px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; color: #fff; text-align: center; outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: rgba(209,0,31,0.6); }
.auth-input.error { border-color: rgba(255,59,82,0.8); animation: shake 0.3s; }
@keyframes shake {
  0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)}
}
.auth-btn {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, #d1001f, #7b0012);
  border: none; border-radius: 12px; color: #fff; cursor: pointer;
  transition: opacity 0.2s;
}
.auth-btn:active { opacity: 0.8; }
.auth-error { font-size: 13px; color: #ff3b52; min-height: 18px; }

  .guide-hero {
    background: linear-gradient(160deg, rgba(209,31,53,0.18) 0%, rgba(160,100,217,0.12) 100%);
    border-bottom: 1px solid var(--border);
    padding: 24px 18px 20px;
    text-align: center;
  }
  .guide-hero-title {
    font-size: 22px; font-weight: 900; color: #fff;
    line-height: 1.3; margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255,42,68,0.4);
  }
  .guide-hero-sub {
    font-size: 13px; color: var(--muted); line-height: 1.6;
  }
  .concept-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  .concept-num {
    font-family: var(--font-en); font-size: 11px; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--accent-glow); margin-bottom: 8px;
    display: flex; align-items: center; gap: 7px;
  }
  .concept-num::before {
    content: ""; width: 24px; height: 1px;
    background: var(--accent-glow);
    box-shadow: 0 0 8px var(--accent-glow);
  }
  .concept-title {
    font-size: 17px; font-weight: 900; color: #fff;
    margin-bottom: 10px; line-height: 1.3;
  }
  .concept-body {
    font-size: 13px; color: var(--muted); line-height: 1.75;
  }
  .concept-body strong { color: var(--text); }
  .concept-highlight {
    background: rgba(255,42,68,0.1);
    border: 1px solid rgba(255,42,68,0.35);
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 13px; line-height: 1.7;
    margin-top: 10px; color: var(--text);
  }
  .concept-highlight.green {
    background: rgba(47,224,122,0.08);
    border-color: rgba(47,224,122,0.35);
    color: var(--green);
  }
  .concept-highlight.blue {
    background: rgba(74,168,255,0.08);
    border-color: rgba(74,168,255,0.35);
    color: var(--blue);
  }
  .concept-highlight.yellow {
    background: rgba(255,176,0,0.08);
    border-color: rgba(255,176,0,0.35);
    color: var(--yellow);
  }
  /* モードビジュアル */
  .mode-ladder {
    display: flex; flex-direction: column; gap: 8px;
    padding: 0 4px; margin-top: 14px;
  }
  .mode-rung {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 12px 14px;
    position: relative;
    transition: border-color 0.2s;
  }
  .mode-rung .dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  }
  .mode-rung .ml { flex: 1; }
  .mode-rung .ml-name { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
  .mode-rung .ml-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
  .mode-rung .ml-ceil {
    font-family: var(--font-mono); font-size: 18px; font-weight: 700;
    text-align: right; white-space: nowrap; flex-shrink: 0;
  }
  .mode-rung.m-normal { border-color: rgba(255,255,255,0.1); }
  .mode-rung.m-normal .dot { background: var(--muted-dim); }
  .mode-rung.m-normal .ml-ceil { color: var(--muted); }
  .mode-rung.m-c { border-color: rgba(74,168,255,0.35); }
  .mode-rung.m-c .dot { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
  .mode-rung.m-c .ml-ceil { color: var(--blue); }
  .mode-rung.m-prep { border-color: rgba(160,100,217,0.5); }
  .mode-rung.m-prep .dot { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); }
  .mode-rung.m-prep .ml-ceil { color: var(--accent2-glow); }
  .mode-rung.m-heaven {
    border-color: rgba(255,176,0,0.8);
    background: rgba(255,176,0,0.06);
    box-shadow: 0 0 20px -10px rgba(255,176,0,0.8);
  }
  .mode-rung.m-heaven .dot { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }
  .mode-rung.m-heaven .ml-ceil { color: var(--yellow); }
  .mode-arrow-down {
    text-align: center; font-size: 18px;
    color: var(--accent-glow);
    filter: drop-shadow(0 0 6px rgba(255,42,68,0.6));
  }

  /* ステップフロー */
  .app-steps { display: flex; flex-direction: column; gap: 0; }
  .app-step {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .app-step:last-child { border: none; }
  .app-step-num {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #8c1322);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-en); font-size: 14px; font-weight: 700; color: #fff;
    box-shadow: 0 0 14px -3px rgba(255,42,68,0.7);
  }
  .app-step-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
  .app-step-desc { font-size: 13px; color: var(--muted); line-height: 1.65; }
  .app-step-desc strong { color: var(--text); }

  /* 試算ボックス */
  .calc-box {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 12px; line-height: 1.7; color: var(--muted);
    margin-top: 10px;
  }
  .calc-box strong { color: var(--text); }

  .guide-chapter {
    font-family: var(--font-en);
    font-size: 10px; font-weight: 700; letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-glow);
    padding: 22px 18px 4px;
    display: flex; align-items: center; gap: 10px;
  }
  .guide-chapter::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(255,42,68,0.4), transparent);
  }
  .toc-chapter > a { font-weight: 700; color: var(--accent-glow); }
  .toc-sub { padding-left: 14px; }
  .toc-sub > a { font-size: 12px; color: var(--muted); }
  .toc-sub > a:hover { color: var(--text); }
  /* 折りたたみ TOC */
  details.toc-block > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
  details.toc-block > summary::-webkit-details-marker { display: none; }
  details.toc-block > summary::marker { display: none; }
  details.toc-block > summary .toc-arrow { font-size: 10px; color: var(--muted); transition: transform 0.2s; }
  details.toc-block[open] > summary .toc-arrow { transform: rotate(180deg); }
  details.toc-block > .toc-list { margin-top: 10px; }
  /* 示唆テーブル */
  .hint-table { width: 100%; border-collapse: collapse; font-family: var(--font-jp); font-size: 13px; }
  .hint-table th {
    background: var(--surface3); color: var(--accent-glow);
    font-size: 11px; letter-spacing: 0.06em; font-weight: 700;
    padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
  }
  .hint-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); line-height: 1.5; vertical-align: top; }
  .hint-table tr:last-child td { border-bottom: none; }
  .hint-table .tag {
    display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; white-space: nowrap;
  }
  .tag-g { background: rgba(74,168,255,0.18); border: 1px solid rgba(74,168,255,0.5); color: var(--blue); }
  .tag-s { background: rgba(255,176,0,0.18); border: 1px solid rgba(255,176,0,0.5); color: var(--yellow); }
  .tag-def { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); }
  /* キャラカード */
  .char-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
  .char-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; font-family: var(--font-jp); font-size: 12px; line-height: 1.5;
  }
  .char-card .cn { font-weight: 700; color: #fff; margin-bottom: 3px; }
  .char-card.mod-b  { border-color: rgba(74,168,255,0.5); }
  .char-card.mod-c  { border-color: rgba(160,100,217,0.5); }
  .char-card.mod-h  { border-color: rgba(255,176,0,0.5); }
  .char-card.mod-hh { border-color: rgba(255,176,0,0.8); background: rgba(255,176,0,0.06); }
  .char-card.set-e  { border-color: rgba(47,224,122,0.5); }
  .char-card.set-4  { border-color: rgba(47,224,122,0.7); background: rgba(47,224,122,0.06); }
  .char-card.set-6  { border-color: var(--accent-glow); background: rgba(255,42,68,0.08); }
  /* やめどきリスト */
  .quit-block { margin: 0 16px 10px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
  .quit-row {
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    font-family: var(--font-jp); font-size: 13px; line-height: 1.6;
    display: flex; gap: 10px; align-items: flex-start;
  }
  .quit-row:last-child { border: none; }
  .quit-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
  .quit-title { font-weight: 700; color: #fff; margin-bottom: 2px; }
  .quit-desc { color: var(--muted); }
  .quit-continue { background: rgba(47,224,122,0.07); border: 1px solid rgba(47,224,122,0.3); }
  .quit-stop { background: rgba(255,59,82,0.06); border: 1px solid rgba(255,59,82,0.25); }
  /* ===== TABLE OF CONTENTS ===== */
  .toc-block {
    margin: 12px 16px 18px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
  }
  .toc-title {
    font-family: var(--font-jp);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .toc-list li {
    border-top: 1px solid var(--border);
  }
  .toc-list li:first-child { border-top: none; }
  .toc-list a {
    display: block;
    padding: 8px 4px;
    font-family: var(--font-jp);
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s;
  }
  .toc-list a:hover { color: var(--accent-glow); }

  .img-gallery-section {
    margin: 0 0 6px;
  }
  .img-gallery-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0 16px 12px;
    overflow: hidden;
  }
  .img-gallery-block__header {
    padding: 14px 16px 6px;
  }
  .img-gallery-block__title {
    font-family: var(--font-jp);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
  }
  .img-gallery-block__desc {
    font-family: var(--font-jp);
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
  }
  .img-gallery-block__img-wrap {
    margin: 10px 16px 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface2);
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .img-gallery-block__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .img-gallery-block__placeholder {
    font-family: var(--font-jp);
    font-size: 12px;
    color: var(--muted-dim);
    text-align: center;
  }
  .img-gallery-block .cite-bar {
    margin: 8px 16px 14px;
  }
  /* ロールピッカー */
  .drum-picker {
    width: 100%; height: 132px;
    overflow: hidden; position: relative;
    touch-action: none; user-select: none; -webkit-user-select: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    -webkit-tap-highlight-color: transparent;
    cursor: ns-resize;
  }
  .drum-inner {
    position: absolute; left: 0; right: 0; top: 0;
    will-change: transform;
  }
  .drum-item {
    height: 44px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 17px;
    color: rgba(255,255,255,0.22);
  }
  .drum-item.sel {
    font-size: 30px; font-weight: 800; color: var(--text);
  }
  .drum-sel-line {
    position: absolute; top: 44px; left: 0; right: 0; height: 44px;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    pointer-events: none; z-index: 2;
  }