/* ==========================================================================
   診断士 PassPro - Commercial Grade Design System & Styles
   Engineered for Professional Learners: Flawless Typography, Visual Hierarchy,
   Glassmorphism, Thumb-friendly Ergonomics, and Tactile Micro-Interactions.
   ========================================================================== */

:root {
  /* Surface & Base Colors — Soft Owl Theme (ロゴのペリウィンクル #676BB3 とクリーム #FEEBC6 が基調) */
  --bg-deep: #f8f5ee;
  --bg-surface: #fffdf8;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: #ffffff;
  --bg-card-elevated: #ffffff;

  /* Borders & Dividers */
  --border-subtle: rgba(58, 58, 94, 0.10);
  --border-medium: rgba(58, 58, 94, 0.18);
  --border-accent: rgba(103, 107, 179, 0.45);

  /* Brand Accents */
  --color-primary: #676bb3;
  --color-primary-glow: rgba(103, 107, 179, 0.28);
  --color-emerald: #0e9f6e;
  --color-emerald-glow: rgba(14, 159, 110, 0.25);
  --color-rose: #e8496b;
  --color-rose-glow: rgba(232, 73, 107, 0.25);
  --color-amber: #dd8a0b;
  --color-cyan: #0891b2;
  --color-purple: #7c5cd6;

  /* Pass Grades Palette */
  --grade-s: #9333ea;
  --grade-a: #0e9f6e;
  --grade-b: #0284c7;
  --grade-c: #d97706;
  --grade-d: #ea580c;
  --grade-e: #dc2626;

  /* Typography */
  --font-display: 'M PLUS Rounded 1c', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text Colors */
  --text-main: #38385c;
  --text-muted: #6f6f8c;
  --text-dim: #9a9ab0;

  /* Metrics & Scales */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --shadow-sm: 0 3px 8px -2px rgba(103, 107, 179, 0.14);
  --shadow-md: 0 10px 24px -8px rgba(103, 107, 179, 0.20);
  --shadow-lg: 0 22px 44px -12px rgba(103, 107, 179, 0.28);

  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --font-scale: 1rem;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Background Ambient Glow Orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
}
.orb-primary {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -180px;
  right: -100px;
}
.orb-emerald {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
  bottom: -100px;
  left: -150px;
}

/* App Shell */
.pass-app-shell {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 1rem 95px 1rem;
}

@media (min-width: 769px) {
  .pass-app-shell {
    padding: 0 2rem 3rem 2rem;
  }
}

/* Top App Bar */
.app-top-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: max(0.65rem, env(safe-area-inset-top)) 0 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: rgba(6, 9, 17, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 60;
  margin-bottom: 1rem;
}

.top-bar-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.icon-btn-round {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.icon-btn-round:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-medium);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-titles-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(108, 107, 196, 0.35);
  flex-shrink: 0;
}

.brand-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: visible;
  margin: 0;
}

.gradient-text {
  background: linear-gradient(135deg, #f59e0b, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.compliance-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-emerald);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* サブステータス行 (習慣化バー) */
.top-bar-sub-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.top-bar-sub-row::-webkit-scrollbar {
  display: none;
}

.header-status-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.22rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.h-stat-icon {
  font-size: 0.75rem;
}
.h-stat-val {
  font-weight: 700;
  color: #38bdf8;
}

/* Live Pass Probability Meter in Header */
.pass-prob-meter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.prob-label {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.prob-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}
.grade-s { background: rgba(168, 85, 247, 0.2); color: var(--grade-s); border: 1px solid var(--grade-s); }
.grade-a { background: rgba(16, 185, 129, 0.2); color: var(--grade-a); border: 1px solid var(--grade-a); }
.grade-b { background: rgba(6, 182, 212, 0.2); color: var(--grade-b); border: 1px solid var(--grade-b); }
.grade-c { background: rgba(245, 158, 11, 0.2); color: var(--grade-c); border: 1px solid var(--grade-c); }
.grade-d, .grade-e { background: rgba(239, 68, 68, 0.2); color: var(--grade-e); border: 1px solid var(--grade-e); }

.prob-rate {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.streak-badge {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-amber);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
}

.hub-link-chip {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition);
}
.hub-link-chip:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

@media (max-width: 600px) {
  .prob-label { display: none; }
  .hub-link-chip { display: none; }
}

/* Top Nav Tabs (Desktop) */
.app-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

@media (max-width: 768px) {
  .app-nav-tabs {
    display: none; /* Mobile uses bottom navigation */
  }
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.counter-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}

/* Stage Views */
.stage-view {
  display: none;
  animation: fadeInView 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stage-view.active {
  display: block;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Prediction Hero Card */
.prediction-hero-card {
  background: linear-gradient(135deg, rgba(26, 38, 64, 0.7), rgba(13, 20, 36, 0.9));
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-cyan);
  margin-bottom: 0.35rem;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.highlight-grade {
  color: var(--grade-b);
}

.hero-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 580px;
}

.hero-gauge-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--color-cyan);
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.gauge-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.gauge-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Benchmark Unlock Progress Box */
.benchmark-progress-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.bench-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.bench-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bench-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Exam Year Selector Card */
.exam-year-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(16px);
}

.year-header {
  margin-bottom: 1rem;
}

.year-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.year-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.year-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.year-pills-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.year-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  outline: none;
}

.year-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.year-pill.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--color-cyan);
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Cutoff Alert Banner */
.cutoff-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #fca5a5;
  margin-bottom: 1.25rem;
}

.alert-icon {
  font-size: 1.2rem;
}

/* Hero Action Buttons */
.hero-action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Bookmark Drill & Question Search (Top5-⑤) */
.bookmark-search-card {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.bookmark-search-card .btn {
  align-self: flex-start;
}
.bookmark-search-card .btn:disabled {
  cursor: not-allowed;
}
.bookmark-drill-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}
.question-search-box {
  display: flex;
  gap: 0.5rem;
}
.question-search-box input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
}
.question-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.search-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:hover {
  background: rgba(255, 255, 255, 0.09);
}
.search-result-head {
  font-weight: 700;
  font-size: 0.88rem;
}
.search-result-meta {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.search-result-snippet {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  outline: none;
  position: relative;
}

.btn-lg {
  padding: 0.95rem 1.6rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}
.btn-secondary:hover {
  background: rgba(244, 63, 94, 0.25);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

.badge-bubble {
  background: rgba(255, 255, 255, 0.25);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* Section Title Bar */
.section-title-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.4rem;
}

.title-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.title-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.compliance-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
}

/* Subjects Mosaic Grid */
.subjects-mosaic {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 680px) {
  .subjects-mosaic {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  }
}

.subject-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.subject-tile:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.tile-icon-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.tile-icon {
  font-size: 1.5rem;
}

.tile-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.tile-questions-count {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.tile-grade-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.tile-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tile-stat-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.stat-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.accuracy-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.meter-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

/* 40% cutoff threshold marker line */
.meter-cutoff-marker {
  position: absolute;
  left: 40%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(239, 68, 68, 0.7);
  z-index: 2;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   QUIZ VIEW: HIGH END WORKSPACE
   ========================================================================= */

.quiz-nav-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz-meta-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.quiz-mode-pill {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Mock Timer */
.exam-timer-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fca5a5;
  animation: pulseTimer 2s infinite ease-in-out;
}

@keyframes pulseTimer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.quiz-meta-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.font-sizer {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-font-size {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-font-size:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.bookmark-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}
.bookmark-btn.active {
  color: var(--color-amber);
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.progress-indicator-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.quiz-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Question Sheet Card */
.question-sheet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.question-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags-cluster {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.category-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.source-chip {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.difficulty-stars {
  font-size: 0.72rem;
  color: var(--color-amber);
  letter-spacing: 0.1em;
}

.compliance-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Revision Notice Banner */
.revision-notice-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* Question Text */
.question-text-area {
  font-size: var(--font-scale);
  font-weight: 600;
  line-height: 1.7;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.elimination-hint-bar {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
}

/* Options Sheet */
.options-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.option-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.035);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--font-scale);
}

.option-card:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.option-index-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

.option-content-text {
  flex: 1;
  line-height: 1.5;
}

/* Elimination (Cross-out) Button */
.btn-eliminate {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-eliminate:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Option States */
.option-card.eliminated {
  opacity: 0.35;
  text-decoration: line-through;
  background: rgba(0, 0, 0, 0.2);
}

.option-card.correct {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: var(--color-emerald) !important;
  color: #ffffff !important;
}
.option-card.correct .option-index-badge {
  background: var(--color-emerald);
  color: #ffffff;
}

.option-card.wrong {
  background: rgba(244, 63, 94, 0.18) !important;
  border-color: var(--color-rose) !important;
  color: #fca5a5 !important;
}
.option-card.wrong .option-index-badge {
  background: var(--color-rose);
  color: #ffffff;
}

/* Explanation Drawer */
.explanation-drawer {
  margin-top: 2rem;
  padding-top: 1.8rem;
  border-top: 1px dashed var(--border-medium);
  animation: slideDrawer 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDrawer {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.verdict-status-strip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.verdict-icon-big {
  font-size: 2.2rem;
}

.verdict-heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}
.verdict-heading.correct { color: var(--color-emerald); }
.verdict-heading.wrong { color: var(--color-rose); }

.verdict-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Flashcard */
.keypoint-flashcard {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.03));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.keypoint-title-bar {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-amber);
  margin-bottom: 0.4rem;
}

.keypoint-body {
  font-size: calc(var(--font-scale) * 0.95);
  font-weight: 600;
  color: #fef3c7;
  line-height: 1.55;
}

/* Options Breakdown */
.options-breakdown-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.breakdown-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.breakdown-item {
  font-size: calc(var(--font-scale) * 0.88);
  line-height: 1.5;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.02);
}
.breakdown-item.is-correct-opt {
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
  border-left: 3px solid var(--color-emerald);
}
.breakdown-item.is-wrong-opt {
  color: #cbd5e1;
}

/* General Explanation */
.general-explanation-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.gen-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.gen-body {
  font-size: calc(var(--font-scale) * 0.9);
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--text-main);
}

/* Anki Spaced Repetition Box */
.anki-spaced-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.anki-intro-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-align: center;
}

.anki-ratings-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.anki-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.anki-pill:hover {
  transform: translateY(-2px);
}

.interval-text {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.rate-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.anki-again { border-color: rgba(239, 68, 68, 0.4); color: #ef4444; }
.anki-hard { border-color: rgba(245, 158, 11, 0.4); color: #f59e0b; }
.anki-good { border-color: rgba(16, 185, 129, 0.4); color: #10b981; }
.anki-easy { border-color: rgba(6, 182, 212, 0.4); color: #06b6d4; }

.next-action-btn {
  padding: 1rem;
  font-size: 1.05rem;
}

/* =========================================================================
   RESULTS VIEW: REPORT CARD
   ========================================================================= */

.result-report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  backdrop-filter: blur(20px);
}

.result-banner {
  text-align: center;
  margin-bottom: 2rem;
}

.result-badge-verdict {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}
.result-badge-verdict.pass {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--color-emerald);
  color: var(--color-emerald);
}
.result-badge-verdict.fail {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-rose);
  color: var(--color-rose);
}

.result-headline {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
}

.result-sub-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.score-summary-cluster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.score-stat-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.cell-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.cell-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
}
.highlight-color { color: var(--color-emerald); }

.subject-breakdown-section {
  margin-bottom: 2rem;
}

.breakdown-headline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.subject-scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.res-subject-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.res-sub-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.res-sub-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.res-sub-pct {
  font-family: var(--font-mono);
  font-weight: 700;
}

.cutoff-status-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}
.cutoff-ok { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.cutoff-danger { background: rgba(239, 68, 68, 0.2); color: var(--color-rose); }

.result-button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================================================================
   MOCK & WEAKNESS INTRO CARDS
   ========================================================================= */

.mock-intro-card, .weakness-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(20px);
}

.mock-badge, .weak-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.mock-title, .weak-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.mock-desc, .weak-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.mock-params-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .mock-params-grid { grid-template-columns: repeat(2, 1fr); }
}

.param-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
}
.param-card.alert-param {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.08);
}

.param-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.param-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}

.mock-compliance-info {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #a7f3d0;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.weakness-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.weak-count-badge {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-rose);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
}

.empty-state-box {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* =========================================================================
   ANALYTICS VIEW
   ========================================================================= */

.analytics-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(20px);
}

.analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.analytics-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
}

.analytics-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 680px) {
  .diagnostic-grid { grid-template-columns: 1fr 1fr; }
}

.diag-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.diag-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.diag-metric-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.diag-big-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: #ffffff;
}

.diag-grade-tag {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.diag-advice {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.diag-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.d-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.4rem;
}

.mastery-section {
  margin-top: 1.5rem;
}

.mastery-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.mastery-bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mastery-bar-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.mb-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.mb-cutoff-warning {
  color: var(--color-rose);
  font-size: 0.72rem;
  font-weight: 700;
}

/* =========================================================================
   MOBILE BOTTOM NAVIGATION
   ========================================================================= */

.mobile-bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(6, 9, 17, 0.94);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
  z-index: 100;
}

@media (min-width: 769px) {
  .mobile-bottom-tabs {
    display: none;
  }
}

.m-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.m-tab.active {
  color: var(--color-cyan);
}

.m-icon {
  font-size: 1.25rem;
}

.m-label {
  font-size: 0.68rem;
  font-weight: 700;
}

/* Toast */
.toast-popup {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
  z-index: 200;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.toast-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mode Switcher Tabs */
.mode-switcher-container {
  margin: 1.25rem 0 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mode-switcher-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
}
.mode-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mode-tab-btn.active {
  background: var(--bg-card);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.5);
}
.mode-tab-btn .tab-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}
.mode-tab-btn .tab-badge.special {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 700;
}
.mode-switcher-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0 4px;
}
.term-highlight-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 0.5rem;
}


/* ==========================================================================
   2次筆記試験 実戦ケーススタディ演習 (事例 I〜IV) STYLES
   ========================================================================== */

.case-list-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.case-hero-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.1);
  border-radius: 18px;
  padding: 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.case-hero-banner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.case-hero-content {
  flex: 1;
}

.hero-tag {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.case-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.case-hero-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

.case-hero-stats {
  display: flex;
  gap: 1rem;
}

.c-stat-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.8rem 1.2rem;
  text-align: center;
  min-width: 85px;
}

.c-stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
}

.c-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Filter Bar */
.case-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}

.case-filter-bar::-webkit-scrollbar {
  display: none;
}

.case-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.case-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.case-filter-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

/* Case Cards Grid */
.case-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.2rem;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.case-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.case-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.case-badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}

.badge-case1 {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.badge-case2 {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-case3 {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-case4 {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.case-time-pill {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.case-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
  margin: 0 0 0.6rem 0;
}

.case-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.case-card-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.case-q-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-start-case {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-start-case:hover {
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Case Workspace (スプリットレイアウト)
   ========================================================================== */

.case-workspace-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 120px);
}

.case-workspace-bar {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.bar-left-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

.ws-case-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-right-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.case-timer-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fbbf24;
}

.timer-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.9rem;
}

.draft-indicator {
  font-size: 0.75rem;
  color: #10b981;
}

/* Mobile Switcher */
.case-mobile-switch {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.c-mob-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

.c-mob-tab.active {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Split Layout */
.case-split-layout {
  display: flex;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
}

.case-story-pane,
.case-questions-pane {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.sec-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0 0 0.8rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

/* Company profile */
.story-header-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
}

.company-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem 0;
}

.company-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.comp-tag {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
}

.company-summary-box {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Story Paragraphs */
.story-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-para {
  line-height: 1.85;
  font-size: calc(var(--font-scale) * 0.95);
  color: #e2e8f0;
  position: relative;
  padding-left: 2.8rem;
  text-align: justify;
}

.para-num-badge {
  position: absolute;
  left: 0;
  top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 1.5rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
}

/* Financial Tables */
.financial-tables-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fin-table-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.8rem;
  overflow-x: auto;
}

.fin-table-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 0.5rem;
}

.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.fin-table th,
.fin-table td {
  padding: 5px 8px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fin-table th:first-child,
.fin-table td:first-child {
  text-align: left;
  font-family: var(--font-main, sans-serif);
}

.fin-table th {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* Questions Pane */
.case-q-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.case-q-nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.case-q-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.case-q-nav-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border-color: #f59e0b;
  color: #fff;
}

.case-q-active-card {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  flex: 1;
}

.q-header-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.q-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.q-points-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
}

.q-desc-box {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #f59e0b;
  padding: 0.8rem 1rem;
  border-radius: 0 10px 10px 0;
  font-size: calc(var(--font-scale) * 0.92);
  color: #e2e8f0;
  line-height: 1.65;
}

/* Sub-questions */
.sub-q-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.sub-q-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #cbd5e1;
  margin: 0 0 0.5rem 0;
  display: flex;
  justify-content: space-between;
}

/* Textarea & Counter */
.case-textarea-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.case-answer-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.7;
  font-family: var(--font-main, sans-serif);
  resize: vertical;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.case-answer-textarea:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.char-counter-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  padding: 0 4px;
}

.char-count-text {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.char-count-text.over-limit {
  color: #f87171;
  font-weight: 700;
}

.char-status-badge {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 6px;
}

.status-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-over {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-weight: 700;
}

/* Action Buttons */
.q-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1rem;
}

.btn-score-case {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-score-case:hover {
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Case Result Modal (採点＆模範解答)
   ========================================================================== */

.case-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.case-modal-content {
  background: #111827;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  display: block;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.5rem;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.score-summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-display-box {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.score-achieved {
  font-size: 2.2rem;
  font-weight: 800;
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
}

.score-total {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* User Answer with highlights */
.user-ans-preview {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #f1f5f9;
}

.kw-hit {
  background: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  border-bottom: 2px solid #10b981;
}

/* Keypoints Grid */
.kw-analysis-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kw-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.kw-item-row.matched {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.kw-item-row.missed {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

/* Model Answer Card */
.model-answer-card {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  padding: 1.2rem;
}

.model-ans-text {
  font-size: 0.95rem;
  color: #eff6ff;
  line-height: 1.75;
  margin: 0;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-top: 0.6rem;
}

/* Process & Framework */
.process-expl-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.2rem;
}

.process-framework-tag {
  display: inline-block;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.process-text {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .case-split-layout {
    flex-direction: column;
  }
  .case-mobile-switch {
    display: flex;
  }
  .case-story-pane.hidden-mob,
  .case-questions-pane.hidden-mob {
    display: none;
  }
  .case-hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .case-hero-stats {
    width: 100%;
    justify-content: space-between;
  }
  .c-stat-box {
    flex: 1;
  }
}


/* ==========================================================================
   ビズロギア - ゲーム性 (Lv/EXP/称号) & 初級編 MBA STYLES
   ========================================================================== */

/* Header Level & EXP Badge */
.player-level-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-level-badge:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
}

.lvl-circle {
  display: flex;
  align-items: baseline;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 3px 7px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  font-family: 'JetBrains Mono', monospace;
}

.lvl-prefix {
  font-size: 0.65rem;
  font-weight: 600;
  margin-right: 1px;
}

.lvl-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 95px;
}

.lvl-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.lvl-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.lvl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   初級編: MBA Top View
   ========================================================================== */

.mba-top-container {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding-bottom: 2.5rem;
}

.mba-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(16, 185, 129, 0.1);
  border-radius: 20px;
  padding: 1.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.mba-hero-left {
  flex: 1.4;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mba-badge-pill {
  display: inline-block;
  align-self: flex-start;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}

.mba-hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.6rem 0;
  letter-spacing: -0.02em;
}

.mba-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 1.2rem 0;
}

.mba-hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* MBA Player Status Dashboard Card */
.mba-player-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
}

.p-eyebrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.p-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.p-rank-icon {
  font-size: 1.5rem;
}

.p-rank-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fbbf24;
  margin: 0;
}

.p-level-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 700;
}

.p-level-val {
  color: #fff;
  font-size: 1.1rem;
}

.p-exp-val {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.p-exp-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.p-exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.p-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.p-stat-item {
  text-align: center;
}

.p-stat-num {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.p-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 7 Categories Grid */
.mba-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

.mba-cat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  cursor: pointer;
}

.mba-cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.cat-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.cat-card-icon {
  font-size: 1.8rem;
  padding: 0.6rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.cat-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.3rem 0;
}

.cat-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.cat-card-bottom {
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cat-stat-info {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.cat-btn-train {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-btn-train:hover {
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   初級編: MBA Quiz View
   ========================================================================== */

.mba-quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.mba-quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.mba-q-category-tag {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 0.5rem;
}

.mba-q-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.mba-quiz-streak-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mba-question-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.mba-term-pill {
  align-self: flex-start;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
}

.mba-q-text {
  font-size: calc(var(--font-scale) * 1.25);
  font-weight: 700;
  color: #fff;
  line-height: 1.6;
  margin: 0;
}

.mba-options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mba-opt-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.95rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  text-align: left;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.mba-opt-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.mba-opt-btn.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #fff !important;
  font-weight: 700;
}

.mba-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

.mba-feedback-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: fadeIn 0.3s ease;
}

.fb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fb-badge {
  font-size: 1rem;
  font-weight: 800;
}

.fb-badge.correct {
  color: #34d399;
}

.fb-badge.wrong {
  color: #f87171;
}

.fb-exp-gain {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.fb-explanation {
  font-size: calc(var(--font-scale) * 0.92);
  color: #cbd5e1;
  line-height: 1.7;
}

.fb-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

/* ==========================================================================
   Level Up Celebration Modal
   ========================================================================== */

.level-up-modal-card {
  background: linear-gradient(145deg, #111827 0%, #0f172a 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.4), 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: 24px;
  padding: 2.2rem;
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lvl-up-sparkle {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.lvl-up-icon-wrap {
  font-size: 3.5rem;
  margin: 0.5rem 0;
  animation: bounce 1s infinite alternate;
}

.lvl-up-headline {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.04em;
  margin: 0 0 0.4rem 0;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lvl-up-number-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

.lvl-up-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1.2rem 0;
}

.lvl-up-new-title-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
}

.new-title-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.new-title-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fbbf24;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@media (max-width: 900px) {
  .mba-hero-card {
    flex-direction: column;
  }
}


/* ==========================================================================
   勉強時間自動トラッキング & キャラクターアバター & PROプランモーダル STYLES
   ========================================================================== */

/* Study Time Auto-Log Badge */
.study-time-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #34d399;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.st-icon {
  font-size: 0.9rem;
}

.header-refresh-pill {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  transition: all 0.2s ease;
}

.header-refresh-pill:active {
  transform: scale(0.95);
  background: rgba(56, 189, 248, 0.3);
}

/* Header Avatar Icon */
.lvl-avatar-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}

.player-level-badge:hover .lvl-avatar-icon {
  transform: scale(1.15) rotate(-5deg);
}

/* PRO Upgrade Chip */
.pro-upgrade-chip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.4rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.pro-upgrade-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

/* PRO Modal Card */
.pro-modal-card {
  background: linear-gradient(145deg, #111827 0%, #0a0f1d 100%);
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.25), 0 25px 60px rgba(0, 0, 0, 0.8);
  border-radius: 24px;
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pro-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pro-crown-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.pro-modal-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.pro-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Plan Toggle Row */
.pro-plan-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0.4rem 0;
}

.pro-plan-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1rem 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.pro-plan-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(245, 158, 11, 0.4);
}

.pro-plan-btn.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.p-rec-tag {
  position: absolute;
  top: -9px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.p-plan-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #cbd5e1;
}

.p-plan-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.p-period {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-main, sans-serif);
}

/* Perks List */
.pro-perks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1rem;
}

.perk-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.85rem;
}

.perk-item strong {
  color: #f1f5f9;
  display: block;
}

.perk-item p {
  margin: 2px 0 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.perk-check {
  font-size: 0.95rem;
  margin-top: 1px;
}

.pro-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.btn-lg {
  padding: 0.95rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.trial-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}


/* ==========================================================================
   アバター対話吹き出し / デイリーミッション / 実績バッジ / バックアップ STYLES
   ========================================================================== */

/* Floating Avatar Speech Bubble */
.avatar-speech-bubble {
  position: absolute;
  top: 58px;
  right: 180px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
  max-width: 260px;
  animation: popIn 0.25s ease;
  pointer-events: none;
}

.bubble-arrow {
  position: absolute;
  top: -6px;
  left: 24px;
  width: 10px;
  height: 10px;
  background: #1e293b;
  border-left: 1px solid rgba(245, 158, 11, 0.4);
  border-top: 1px solid rgba(245, 158, 11, 0.4);
  transform: rotate(45deg);
}

/* Daily Mission Card */
.daily-mission-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mission-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  padding: 3px 9px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.mission-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.mission-circle-wrap {
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.5rem 0.9rem;
}

.mission-progress-text {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
}

.mission-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.mission-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.m-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.m-check-item.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.m-icon-status {
  margin-right: 0.6rem;
}

.m-label {
  flex: 1;
}

.m-reward {
  font-size: 0.75rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* Achievements Section */
.achievements-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.badge-count-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 10px;
  border-radius: 10px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.achieve-badge-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all 0.25s ease;
}

.achieve-badge-card.unlocked {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.achieve-badge-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.achieve-icon {
  font-size: 1.8rem;
  min-width: 42px;
  text-align: center;
}

.achieve-info {
  overflow: hidden;
}

.achieve-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.achieve-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* Data Backup Card */
.data-backup-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.backup-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.3rem 0;
}

.backup-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.backup-actions-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Confetti Fullscreen Canvas */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

@media (max-width: 600px) {
  .avatar-speech-bubble {
    right: 20px;
    top: 55px;
    max-width: 220px;
  }
}

/* Order Mode Selector Card (NEW) */
.order-mode-selector-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.order-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.order-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.order-title {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0.15rem 0 0 0;
}

.order-pills-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.order-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.order-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.order-pill-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.order-mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

/* Sub-category Filter Chips on Subject Tile (NEW) */
.tile-subcats-box {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.subcat-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.subcat-label-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

.subcat-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.subcat-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.subcat-chip-btn:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.5);
  color: #93c5fd;
  transform: translateY(-1px);
}

.subcat-chip-btn.mba-chip-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
}

.subcat-chip-btn .sc-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Sub-Category Selection Modal (NEW) */
.subcat-modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  max-width: 580px;
  width: 95%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.subcat-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.subcat-modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.subcat-modal-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 12px;
}

.subcat-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.subcat-modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0 0;
}

.modal-order-toggle-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.m-order-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}

.subcat-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.subcat-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.subcat-card-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateX(4px);
}

.subcat-card-left {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.subcat-item-icon {
  font-size: 1.4rem;
  margin-top: 2px;
}

.subcat-item-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.25rem 0;
}

.subcat-item-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.subcat-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 80px;
}

.subcat-item-count-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
}

.subcat-item-start-btn {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

/* Sub-Category Fast Panel (常時表示セレクター) */
.subcat-fast-panel {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.subcat-fast-header {
  margin-bottom: 1rem;
}

.subcat-fast-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
  display: block;
}

.subcat-fast-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0.2rem 0 0.3rem 0;
}

.subcat-fast-sub {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.subcat-fast-subject-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sf-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sf-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.sf-tab.active {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.subcat-fast-chips-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.sf-chip-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.sf-chip-card:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.sf-chip-card-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.sf-chip-icon {
  font-size: 1.35rem;
}

.sf-chip-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.sf-chip-desc {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
  line-height: 1.35;
}

.tile-bottom-action {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.tile-btn-subcat,
.cat-btn-subcat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tile-btn-subcat:hover,
.cat-btn-subcat:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.tile-btn-train {
  color: #fff;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tile-btn-train:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cat-card-btn-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cat-btn-train {
  color: #fff;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cat-btn-train:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ==========================================================================
   上市・法務モーダル & 共通フッター スタイル (Legal & Footer)
   ========================================================================== */

.pro-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pro-legal-links a {
  color: var(--text-muted);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.pro-legal-links a:hover {
  color: #38bdf8;
}

.legal-modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 95%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.8);
}

.legal-tab-nav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
}

.legal-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.legal-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.legal-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #cbd5e1;
}

.legal-doc-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 1.2rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-content-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 1.2rem 0 0.4rem 0;
}

.legal-content-section p {
  margin: 0 0 0.8rem 0;
  color: #94a3b8;
}

/* 特定商取引法 テーブル */
.tokusho-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 0.5rem 0;
}

.tokusho-table th,
.tokusho-table td {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.tokusho-table th {
  width: 32%;
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  font-weight: 700;
  white-space: nowrap;
}

.tokusho-table td {
  color: #cbd5e1;
}

.tokusho-table a {
  color: #38bdf8;
  text-decoration: underline;
}

/* 共通フッター */
.app-site-footer {
  margin-top: 3.5rem;
  padding: 2.5rem 1.5rem 4rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.4);
  text-align: center;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.f-logo {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.f-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.footer-links span {
  color: rgba(255, 255, 255, 0.2);
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin: 0.4rem 0 0 0;
}

/* =========================================================================
   HABIT-FORMING & STREAK TRACKER WIDGET (習慣化エンジン)
   ========================================================================= */

.habit-streak-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.habit-streak-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.habit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.habit-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.habit-badge-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.habit-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.streak-highlight {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: #f59e0b;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.habit-cheer {
  font-size: 0.78rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* 週間ストリーク（7日間スタンプ） */
.weekly-streak-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.w-day-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.15rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.w-day-box.completed {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.w-day-box.today {
  outline: 2px solid #38bdf8;
  outline-offset: -1px;
}

.w-day-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.w-day-box.completed .w-day-name {
  color: #fde68a;
}

.w-day-icon {
  font-size: 1rem;
  line-height: 1;
}

/* クイック再開ボックス */
.quick-resume-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
}

.resume-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.resume-label {
  font-size: 0.72rem;
  color: var(--color-emerald);
  font-weight: 700;
}

.resume-target {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-resume {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.btn-resume:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-resume:active {
  transform: translateY(0);
}

.habit-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.daily-one-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(14, 165, 233, 0.04) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.daily-one-box:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.d1-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.d1-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.d1-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.d1-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.d1-sub {
  font-size: 0.7rem;
  color: #7dd3fc;
  white-space: nowrap;
}

.d1-badge {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.d1-badge.cleared {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}


/* =========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE ENGINE (スマホUI完全最適化)
   ========================================================================= */

@media (max-width: 680px) {
  /* 全体コンテナ */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
  }

  .pass-app-shell {
    padding: 0 0.65rem calc(82px + env(safe-area-inset-bottom)) 0.65rem !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* ヘッダー (スマホセーフエリア ＆ 2段構成) - iPhoneステータスバー・Dynamic Island完全回避 */
  .app-top-bar {
    padding-top: max(48px, calc(env(safe-area-inset-top, 44px) + 8px)) !important;
    padding-left: max(0.6rem, env(safe-area-inset-left)) !important;
    padding-right: max(0.6rem, env(safe-area-inset-right)) !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.65rem !important;
    gap: 0.4rem !important;
  }

  .top-bar-main-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .bar-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .brand-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .brand-titles-wrap {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .brand-logo-mark {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.65rem !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
  }

  .compliance-tag {
    font-size: 0.62rem !important;
    white-space: nowrap !important;
    display: block !important;
    margin-top: 1px !important;
    color: #34d399 !important;
  }

  .bar-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    flex-shrink: 0 !important;
  }

  .top-bar-sub-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    width: 100% !important;
    padding-top: 0.3rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .streak-badge {
    font-size: 0.72rem !important;
    padding: 0.22rem 0.45rem !important;
    white-space: nowrap !important;
  }

  .study-time-badge {
    font-size: 0.72rem !important;
    padding: 0.22rem 0.45rem !important;
    white-space: nowrap !important;
  }
  .study-time-badge .st-icon {
    font-size: 0.75rem !important;
  }

  .player-level-badge {
    padding: 0.2rem 0.45rem !important;
    gap: 0.25rem !important;
  }

  .player-level-badge .lvl-avatar-icon {
    font-size: 1.1rem !important;
  }

  .player-level-badge .lvl-circle {
    font-size: 0.68rem !important;
    font-weight: 800 !important;
  }

  .player-level-badge .lvl-info {
    display: none !important; /* スマホでは長いランク文字を隠してすっきり1行に */
  }

  .desktop-only-badge {
    display: none !important;
  }

  /* 習慣化カード & デイリーミッションカード */
  .habit-streak-card,
  .daily-mission-card,
  .prediction-hero-card,
  .exam-year-selector-card,
  .order-mode-selector-card {
    padding: 0.9rem 0.85rem !important;
    border-radius: 14px !important;
    margin-bottom: 0.9rem !important;
    box-sizing: border-box !important;
  }

  .habit-header,
  .mission-header,
  .hero-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .weekly-streak-strip {
    padding: 0.45rem 0.25rem !important;
    gap: 0.25rem !important;
  }

  .w-day-name {
    font-size: 0.62rem !important;
  }

  .w-day-icon {
    font-size: 0.85rem !important;
  }

  .habit-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .quick-resume-box {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.65rem 0.75rem !important;
  }

  .btn-resume {
    width: 100% !important;
    text-align: center !important;
    padding: 0.6rem !important;
  }

  .hero-gauge-circle {
    align-self: center !important;
    margin: 0.25rem 0 !important;
  }

  .hero-headline {
    font-size: 1.15rem !important;
  }

  .hero-summary {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
  }

  .hero-action-buttons {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.45rem !important;
  }

  .hero-action-buttons .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    padding: 0.7rem 0.9rem !important;
  }

  /* セレクター群の横スクロール（親指スワイプ対応） */
  .year-pills-row,
  .order-pills-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.4rem !important;
    padding: 0.15rem 0.1rem 0.4rem 0.1rem !important;
    width: 100% !important;
    scrollbar-width: none !important;
  }

  .year-pills-row::-webkit-scrollbar,
  .order-pills-row::-webkit-scrollbar {
    display: none !important;
  }

  .year-pill,
  .order-pill-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  /* 科目カードグリッド（1カラムで押しやすく） */
  .subjects-grid,
  .mba-categories-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .subject-card,
  .mba-category-card {
    padding: 1rem 0.85rem !important;
    border-radius: 14px !important;
  }

  /* 小カテゴリモーダルのボトムシート化 (Bottom Sheet) */
  .case-modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .subcat-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 85vh !important;
    padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom)) 1rem !important;
    margin: 0 !important;
    animation: slideUpBottomSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes slideUpBottomSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .subcat-modal-header {
    margin-bottom: 0.8rem !important;
    padding-bottom: 0.75rem !important;
  }

  .subcat-modal-title {
    font-size: 1.1rem !important;
  }

  .subcat-modal-sub {
    font-size: 0.75rem !important;
  }

  .subcat-card-item {
    padding: 0.75rem 0.85rem !important;
  }

  .sc-name {
    font-size: 0.85rem !important;
  }

  /* クイズ演習画面 (viewQuiz) のスマホ最適化 */
  .quiz-nav-strip {
    gap: 0.4rem !important;
    margin-bottom: 0.4rem !important;
  }

  .quiz-sub-pill {
    font-size: 0.8rem !important;
  }

  .quiz-mode-pill {
    font-size: 0.68rem !important;
  }

  .progress-indicator-text {
    font-size: 0.78rem !important;
  }

  .question-sheet-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: 14px !important;
    margin-bottom: 0.8rem !important;
  }

  .question-text-area {
    font-size: calc(var(--font-scale) * 0.92) !important;
    line-height: 1.6 !important;
    margin: 0.8rem 0 !important;
  }

  .option-card {
    padding: 0.75rem 0.65rem !important;
    min-height: 48px !important;
    margin-bottom: 0.5rem !important;
  }

  /* 実クラス名は .option-content-text（旧指定 .option-text は生成HTMLと
     一致せず無音だったため、実在クラスへ付け替えて有効化） */
  .option-content-text {
    font-size: calc(var(--font-scale) * 0.86) !important;
    line-height: 1.45 !important;
  }

  .explanation-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: 14px !important;
  }

  .exp-title {
    font-size: 0.95rem !important;
  }

  .exp-body {
    font-size: calc(var(--font-scale) * 0.85) !important;
    line-height: 1.6 !important;
  }

  /* モバイルボトムナビの親指操作最適化 */
  .mobile-bottom-tabs {
    padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom)) 0.2rem !important;
    height: auto !important;
  }

  .m-tab {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 0.2rem 0.15rem !important;
    gap: 0.15rem !important;
  }

  .m-icon {
    font-size: 1.15rem !important;
  }

  .m-label {
    font-size: 0.64rem !important;
    white-space: nowrap !important;
    letter-spacing: -0.03em !important;
  }

  /* モード切替タブ (実戦過去問 vs スピード用語マスター) のスマホ文字切れ完全解消 */
  .mode-switcher-bar {
    padding: 3px !important;
    gap: 4px !important;
  }

  .mode-tab-btn {
    flex-direction: column !important;
    gap: 2px !important;
    padding: 0.55rem 0.35rem !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .mode-tab-btn .tab-icon {
    font-size: 1.05rem !important;
    margin-bottom: 1px !important;
  }

  .mode-tab-btn .tab-title {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    letter-spacing: -0.02em !important;
  }

  .mode-tab-btn .tab-badge {
    font-size: 0.65rem !important;
    padding: 1px 6px !important;
    border-radius: 8px !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
  }

  /* 2次筆記試験 ワークスペース (スマホ崩れ完全解消) */
  .case-workspace-container {
    height: auto !important;
    min-height: calc(100vh - 120px) !important;
    padding-bottom: 5.5rem !important;
    gap: 0.6rem !important;
  }

  .case-workspace-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.7rem 0.8rem !important;
    border-radius: 12px !important;
  }

  .case-workspace-bar .bar-left-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.4rem !important;
    width: 100% !important;
    overflow: visible !important;
  }

  #btnCaseBackToList {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.55rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  #wsCaseTypeBadge {
    font-size: 0.7rem !important;
    padding: 2px 7px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  #wsCaseTitle {
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 140px !important;
    flex: 1 1 auto !important;
    margin: 0 !important;
  }

  .case-workspace-bar .bar-right-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding-top: 0.35rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    gap: 0.5rem !important;
  }

  .case-timer-box {
    font-size: 0.8rem !important;
    padding: 0.25rem 0.55rem !important;
  }

  .draft-indicator {
    font-size: 0.7rem !important;
    white-space: nowrap !important;
  }

  /* モバイルタブ切り替え (与件文 vs 設問・記述解答) */
  .case-mobile-switch {
    display: flex !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 3px !important;
    margin-bottom: 0.4rem !important;
  }

  .c-mob-tab {
    padding: 0.5rem 0.4rem !important;
    font-size: 0.78rem !important;
    text-align: center !important;
  }

  .case-split-layout {
    flex-direction: column !important;
    gap: 0.75rem !important;
    min-height: auto !important;
  }

  .case-story-pane,
  .case-questions-pane {
    padding: 0.85rem !important;
    border-radius: 12px !important;
    overflow-y: visible !important;
    height: auto !important;
  }

  .case-q-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 0.35rem !important;
    scrollbar-width: none !important;
  }
  .case-q-nav::-webkit-scrollbar {
    display: none !important;
  }

  .case-q-nav-btn {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
    flex-shrink: 0 !important;
  }

  .q-header-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.35rem !important;
  }

  .q-title {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
  }

  .q-desc-box {
    padding: 0.65rem 0.75rem !important;
    font-size: calc(var(--font-scale) * 0.84) !important;
    line-height: 1.55 !important;
  }

  .sub-q-block {
    padding: 0.75rem !important;
  }

  .sub-q-title {
    font-size: 0.88rem !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
  }

  .case-answer-textarea {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    min-height: 110px !important;
    padding: 0.65rem 0.75rem !important;
  }

  .case-char-counter {
    font-size: 0.72rem !important;
  }

  .btn-submit-action {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.88rem !important;
  }
}


/* =========================================================================
   CHARACTER "HOUSUKE" & MICRO-INTERACTION ENGINE (AI感払拭・生命感の注入)
   ========================================================================= */

/* キャラクター浮遊＆バウンスアニメーション */
.ch-idle-float {
  animation: housukeFloat 3.2s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes housukeFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

.ch-bounce-happy {
  animation: housukeHappy 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
  transform-origin: center bottom;
}

@keyframes housukeHappy {
  0% {
    transform: translateY(0) scale(1, 0.95);
  }
  100% {
    transform: translateY(-16px) scale(0.98, 1.05);
  }
}

/* 瞬きアニメーション */
.pupil-left, .pupil-right {
  animation: housukeBlink 4.5s infinite;
  transform-origin: center;
}

@keyframes housukeBlink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

/* ホーム画面のバディウェルカムカード */
.buddy-welcome-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.buddy-welcome-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6);
}

.buddy-speech-col {
  flex: 1;
  min-width: 0;
}

.buddy-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
}

.buddy-greeting {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}

.buddy-sub {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.buddy-avatar-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Duolingoライクな3D押し込みボタン (Tactile Press Buttons) */
.btn-primary, .btn-resume, .btn-submit-action, .btn-action-primary {
  position: relative;
  border: none !important;
  box-shadow: 0 4px 0 #047857, 0 6px 14px rgba(0, 0, 0, 0.4) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}

.btn-primary:active, .btn-resume:active, .btn-submit-action:active, .btn-action-primary:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #047857, 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.btn-secondary {
  box-shadow: 0 4px 0 #1e293b, 0 6px 14px rgba(0, 0, 0, 0.3) !important;
  transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}
.btn-secondary:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #1e293b !important;
}

/* 選択肢カード (Option Cards) の3D押し心地 */
.option-card {
  position: relative;
  box-shadow: 0 3px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.1s ease !important;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 5px 0 rgba(2, 132, 199, 0.3);
}

.option-card:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 rgba(2, 132, 199, 0.5) !important;
}

/* 正解時のポップバウンス */
.option-card.correct-flash {
  animation: correctPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 0 #059669, 0 0 16px rgba(16, 185, 129, 0.4) !important;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* 不正解時のシェイク (Shake) */
.option-card.incorrect-flash {
  animation: shakeHorizontal 0.35s ease-in-out;
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 4px 0 #b91c1c !important;
}

@keyframes shakeHorizontal {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* 炎のメラメラアニメーション */
.streak-badge {
  position: relative;
  overflow: visible;
  animation: flamePulse 2s ease-in-out infinite;
}

@keyframes flamePulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.65);
    border-color: #f59e0b;
  }
}

/* プログレスバーの光沢シマー (Shimmer) */
.lvl-bar-fill, .quiz-progress-bar-fill, .bench-fill {
  position: relative;
  overflow: hidden;
}

.lvl-bar-fill::after, .quiz-progress-bar-fill::after, .bench-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmerFlow 2.4s infinite;
}

@keyframes shimmerFlow {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* サウンドミュート切り替えボタン */
.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* クイズ解答時のリアクションキャラクターバナー */
.quiz-reaction-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-reaction-banner.correct {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.quiz-reaction-banner.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.qr-avatar {
  flex-shrink: 0;
}

.qr-text-wrap {
  flex: 1;
}

.qr-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
}

.quiz-reaction-banner.correct .qr-title {
  color: #34d399;
}

.quiz-reaction-banner.incorrect .qr-title {
  color: #f87171;
}

.qr-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin-top: 1px;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .buddy-welcome-card {
    padding: 0.9rem 1rem;
    gap: 0.8rem;
  }
  .buddy-greeting {
    font-size: 0.98rem;
  }
  .buddy-sub {
    font-size: 0.72rem;
  }
}

/* =========================================================================
   EXAM BREAK FINAL CHARGE (試験当日・休憩時間専用 直前予習機能)
   ========================================================================= */

/* ホーム画面のバナー */
.exam-break-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}

.eb-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eb-tag {
  font-size: 0.74rem;
  font-weight: 800;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.18);
  padding: 2px 9px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.eb-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.eb-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eb-text-col {
  flex: 1;
  min-width: 0;
}

.eb-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  line-height: 1.35;
}

.eb-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.4;
}

.eb-open-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  padding: 0.65rem 1.1rem !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 4px 0 #b45309, 0 6px 16px rgba(245, 158, 11, 0.35) !important;
  cursor: pointer;
  white-space: nowrap;
}

.eb-open-btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #b45309 !important;
}

/* 休憩時間モーダルカード */
.break-modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: zoomIn 0.22s ease-out;
}

.break-modal-header {
  padding: 1.1rem 1.4rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bm-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fbbf24;
  display: block;
  margin-bottom: 0.2rem;
}

.bm-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

/* 科目選択スワイプタブ */
.break-subject-nav {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.break-subject-nav::-webkit-scrollbar {
  display: none;
}

.bs-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.bs-tab.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.break-modal-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

/* ホウ助メッセージ */
.break-buddy-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.bb-avatar {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.bb-quote {
  font-size: 0.85rem;
  color: #fde68a;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

/* セクション切り替えタブ (チートシート vs ○×クイズ) */
.break-section-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}

.bss-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.6rem 0.4rem;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.bss-tab.active {
  background: var(--bg-card);
  color: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* チートシートカード */
.cheat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #f59e0b;
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

.cheat-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fbbf24;
  margin: 0 0 0.6rem 0;
}

.cheat-card-list {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cheat-card-list li {
  font-size: 0.86rem;
  color: #e2e8f0;
  line-height: 1.55;
}

/* ○×スピードチェックカード */
.ox-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.ox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.ox-num-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 7px;
  border-radius: 8px;
}

.ox-q-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.55;
  margin-bottom: 0.9rem;
}

.ox-btn-group {
  display: flex;
  gap: 0.75rem;
}

.ox-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
}

.ox-btn.btn-o {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.ox-btn.btn-o:active {
  transform: translateY(2px);
  background: rgba(16, 185, 129, 0.3);
}

.ox-btn.btn-x {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.ox-btn.btn-x:active {
  transform: translateY(2px);
  background: rgba(239, 68, 68, 0.3);
}

.ox-feedback-box {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  animation: fadeIn 0.2s ease;
}

.ox-feedback-box.correct {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.ox-feedback-box.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ox-fb-title {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.ox-feedback-box.correct .ox-fb-title {
  color: #34d399;
}

.ox-feedback-box.incorrect .ox-fb-title {
  color: #f87171;
}

.ox-fb-exp {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.break-modal-footer {
  padding: 0.9rem 1.4rem;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 680px) {
  .exam-break-banner {
    padding: 0.85rem 0.95rem;
  }
  .eb-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .eb-open-btn {
    width: 100%;
    text-align: center;
    padding: 0.6rem;
  }
  .break-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    margin: 0 !important;
  }
  .break-modal-header {
    padding: 0.9rem 1rem;
  }
  .break-modal-body {
    padding: 0.9rem 1rem;
  }
  .bss-tab {
    font-size: 0.74rem;
    padding: 0.5rem 0.2rem;
  }
}


/* ===================================================
   UIリファインメント層 (2026-11-09 Muse)
   日本語フォント統一・長文の可読性・操作感の底上げ
   =================================================== */

/* 日本語は Noto Sans JP で統一（従来は端末フォント任せだった） */
:root {
  --font-display: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

/* 長文問題の可読性アップ（行間と字間を広げて読み疲れを軽減） */
.question-text-area {
  line-height: 1.85;
  letter-spacing: 0.02em;
}

.mba-q-text {
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.fb-explanation {
  line-height: 1.8;
}

/* キーボード操作時のフォーカス表示 */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* カード全体がフォーカス対象の場合: 角丸を保ったまま少し強めのリングにする */
.subject-tile:focus-visible,
.mba-cat-card:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* ナビタブ: 横スクロールのバーを隠してスッキリ見せる */
.app-nav-tabs {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-nav-tabs::-webkit-scrollbar {
  display: none;
}

.app-nav-tabs .nav-tab {
  min-height: 44px;
  flex-shrink: 0;
}

/* 全体のスクロールバーをテーマに合わせて細く */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* 数字の桁揃え（タイマー・確率・EXPなど） */
.timer-digits,
.prob-rate,
.gauge-value,
.p-stat-num {
  font-variant-numeric: tabular-nums;
}

/* モーション軽減設定への配慮 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
  }
}


/* ===================================================
   テーマv2「Calm Learning OS」 (2026-11-09 Muse)
   光と色の主張を抑え、面と余白で整える落ち着いた学習画面に
   =================================================== */

/* 背景のグローは控えめに */
.bg-orb {
  opacity: 0.45;
}

/* トップバー: ガラス面＋細い境界線 */
.app-top-bar {
  background: rgba(7, 10, 19, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

/* ナビタブ: ピル型に統一し、選択中はインディゴの面で示す */
.app-nav-tabs {
  gap: 0.45rem;
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.app-nav-tabs .nav-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  color: var(--text-muted);
  transition: var(--transition);
}

.app-nav-tabs .nav-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.app-nav-tabs .nav-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #5457e8 60%, #7c6cf0 130%);
  border-color: rgba(129, 140, 248, 0.6);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

/* 主要カード: 面と影を静かなトーンに統一 */
.buddy-welcome-card,
.exam-break-banner,
.habit-streak-card,
.daily-mission-card,
.prediction-hero-card,
.exam-year-selector-card,
.order-mode-selector-card,
.mock-intro-card,
.weakness-intro-card,
.question-sheet-card,
.mba-hero-card,
.mba-player-card,
.mba-question-card,
.mba-result-card,
.weakness-intro-card {
  background: linear-gradient(180deg, rgba(21, 30, 52, 0.82) 0%, rgba(13, 20, 38, 0.9) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border-radius: 20px;
}

/* ボタン: 主ボタンはインディゴの柔らかいグラデーション */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #5457e8 55%, #7c6cf0 135%);
  border: 1px solid rgba(129, 140, 248, 0.55);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 13px;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
}

/* モード切替バー: 沈んだ面にピルを浮かせる */
.mode-switcher-bar {
  background: rgba(2, 6, 17, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  padding: 5px;
}

.mode-tab-btn {
  border-radius: 12px;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(84, 87, 232, 0.9));
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* 年・出題順のピル: 選択中だけ静かに光る */
.year-pill,
.order-pill-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.year-pill.active,
.order-pill-btn.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.55);
  color: #e0e7ff;
}

/* セクション見出し: 字間を整えて端正に */
.title-text {
  letter-spacing: 0.03em;
}

.title-sub {
  line-height: 1.6;
}

/* 問題シート: 内側の余白を広げ、読みの呼吸を作る */
.question-sheet-card {
  padding: 1.6rem;
}

@media (max-width: 600px) {
  .question-sheet-card {
    padding: 1.1rem;
  }
}

/* ==========================================================================
   [夜間改善 2026-11-09 03:32] クイズ選択肢ボタンの見た目整備（項目5）
   対象: app.js が生成する .option-card（通常クイズ）と
         .mba-opt-btn（MBAクイズ）。追記のみ・既存ルールは不変。
   備考: 「選択中」状態はJSに存在しない（クリック＝即回答のため）。
   選択の瞬間は .correct-flash / .incorrect-flash のアニメーションが担う。
   ========================================================================== */

/* 回答後: 選ばれなかった選択肢を薄くし、正解に視線を集める */
.option-card:disabled:not(.correct):not(.wrong):not(.eliminated),
.mba-opt-btn:disabled:not(.correct):not(.wrong) {
  opacity: 0.55;
  cursor: default;
}

/* 回答後も正解・不正解はくっきり残す */
.option-card:disabled.correct,
.option-card:disabled.wrong,
.mba-opt-btn:disabled.correct,
.mba-opt-btn:disabled.wrong {
  opacity: 1;
}

/* 正解・不正解にうっすら光を足す（フラッシュ無しの正解表示にも効く） */
.option-card.correct {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 6px 18px rgba(16, 185, 129, 0.18);
}
.option-card.wrong {
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.35), 0 6px 18px rgba(244, 63, 94, 0.15);
}
.mba-opt-btn.correct {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 6px 18px rgba(16, 185, 129, 0.18);
}
.mba-opt-btn.wrong {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 6px 18px rgba(239, 68, 68, 0.15);
}

/* 正解・不正解の印を右端に（JS・HTMLを触らずCSSだけで表示） */
.option-card.correct::after,
.mba-opt-btn.correct::after {
  content: "✓";
  margin-left: auto;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-emerald);
  flex-shrink: 0;
}
.option-card.wrong::after,
.mba-opt-btn.wrong::after {
  content: "✕";
  margin-left: auto;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-rose);
  flex-shrink: 0;
}

/* MBAクイズ: JSが付けるフラッシュ用クラスにアニメーションを結び付ける
   （従来は .option-card 用の定義しかなく、MBA側では無音だった） */
.mba-opt-btn.correct-flash {
  animation: correctPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mba-opt-btn.incorrect-flash {
  animation: shakeHorizontal 0.35s ease-in-out;
}

/* MBAクイズ: ホバー時の持ち上がり（通常クイズと揃える） */
.mba-opt-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   [夜間改善 2026-11-09 #6] 科目カード・MBAカテゴリカードの整備
   （index.css 末尾への追記のみ。JS・既存ルールは不変）
   クラス名は app.js より特定:
   - 科目カード: renderDashboard() が生成する .subject-tile
     （.tile-top / .tile-icon-title / .tile-icon / .tile-title /
      .tile-questions-count / .tile-grade-badge（.grade-a/b/c/e） /
      .tile-desc / .tile-stat-bar / .tile-bottom-action /
      .tile-btn-subcat / .tile-btn-train）
   - MBAカテゴリカード: renderMbaCategories() が生成する .mba-cat-card
     （.cat-card-top / .cat-card-icon / .cat-card-title / .cat-card-desc /
      .cat-card-bottom / .cat-stat-info / .cat-card-btn-group /
      .cat-btn-subcat / .cat-btn-train）
   - タイル全体・カード全体は <article>/<div> に onclick のため
     キーボードフォーカス不可（:focus-visible は付けられない）。
     キーボード操作対応はJS側の変更が必要なため今回は対象外。
   ========================================================================== */

/* (1) 科目カード: バッジが潰れて折り返さないようにする。
   「A判定 (82%)」などが狭いタイルで2行になるのを防ぐ */
.tile-grade-badge {
  white-space: nowrap;
  flex-shrink: 0;
}

/* (2) 科目カード: タイトル部とバッジの間隔を確保する */
.tile-top {
  gap: 0.6rem;
}

/* (3) 科目カード: ボタン群をカード下端に揃える。
   グリッドの行内で高さが違うカードでもボタン位置が揃う。
   （flex の gap 0.75rem が残るため、内容が詰まっていても間隔は保たれる） */
.subject-tile .tile-bottom-action {
  margin-top: auto;
}

/* (4) MBAカテゴリカード: 下部（進捗表示＋ボタン群）が狭い幅で
   はみ出さず折り返すようにする */
.cat-card-bottom {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

/* (5) モバイル（max-width: 680px）: 既存のモバイル最適化ブロック内に
   旧クラス名のまま残っていた指定を、正しいクラス名で有効化する。
   旧指定は .subjects-grid / .subject-card / .mba-category-card で、
   app.js が生成する .subjects-mosaic / .subject-tile / .mba-cat-card
   と一致せず無音になっていた（.mba-categories-grid だけは正しく、
   既に 1カラム化されている）。
   元の指定と同じ内容（1カラム・余白 1rem 0.85rem・角丸 14px）で、
   既存ブロックは残したまま末尾で上書きする。 */
@media (max-width: 680px) {
  .subjects-mosaic {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .subject-tile,
  .mba-cat-card {
    padding: 1rem 0.85rem !important;
    border-radius: 14px !important;
  }
}

/* ==========================================================================
   UI改善 (2026-11-09): ローディング表示 & ホーム画面の重複表示の間引き
   - クイズ開始時の「問題文読み込み中...」をCSSスピナーつき表示にする
   - ホーム表示中は、ヒーロー（合格判定）と習慣化カード（連続日数）が
     主表示のため、ヘッダー側の同一数値の重複表示を隠す。
     他画面ではヘッダー表示が戻る（機能・更新処理自体は従来どおり）。
     切替は app.js の switchView() が body.on-home-view を付け外しする。
   ========================================================================== */

/* クイズ読み込み中スピナー */
.quiz-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-primary);
  animation: quiz-spinner-spin 0.8s linear infinite;
}

@keyframes quiz-spinner-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 2.4s;
  }
}

/* ホーム表示中はヘッダーの重複数値を間引く
   （合格判定: #passProbMeter / #headerPassStatusPill、連続日数: #streakBadge） */
body.on-home-view #passProbMeter,
body.on-home-view #headerPassStatusPill,
body.on-home-view #streakBadge {
  display: none !important;
}


/* ==========================================================================
   Soft Owl Theme (2026-11-12) — ロゴ「本を読むフクロウ」に合わせた全面リテーマ
   基調: ペリウィンクル #676BB3 / クリーム #FEEBC6 / 温かみのある紙色の背景
   既存ルールの後に置くことで、主要サーフェスをライトで柔らかい質感へ寄せる。
   ========================================================================== */

:root {
  color-scheme: light;
}

::selection {
  background: rgba(103, 107, 179, 0.25);
}

/* 背景のグローはクリームとラベンダーで柔らかく */
.bg-orb {
  opacity: 0.5;
}
.orb-emerald {
  background: radial-gradient(circle, #f7dfa7 0%, transparent 70%);
}

/* ヘッダー: 紙色の半透明バー */
.app-top-bar {
  background: rgba(248, 245, 238, 0.92);
}

/* ロゴタイプ: 角丸フォント＋ロゴ色のグラデーション */
.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text-main);
}
.gradient-text {
  background: linear-gradient(120deg, #676bb3, #9a97d9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.compliance-tag {
  background: #feebc6;
  color: #97792b;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
}

/* プレイヤーバッジまわり */
.lvl-bar-track {
  background: rgba(58, 58, 94, 0.10);
}
.lvl-bar-fill {
  background: linear-gradient(90deg, #f2b880, #676bb3);
}
.lvl-avatar-icon {
  background: #feebc6;
  border-radius: var(--radius-full);
}
.icon-btn-round {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
.sound-toggle-btn {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.header-refresh-pill,
.header-status-pill {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* ナビゲーション (PCタブ / モバイル下部タブ) */
.nav-tab:hover {
  background: rgba(103, 107, 179, 0.08);
  color: var(--text-main);
}
.nav-tab.active {
  background: var(--color-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(103, 107, 179, 0.35);
}
.mobile-bottom-tabs {
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 -6px 20px rgba(103, 107, 179, 0.10);
}
.m-tab.active {
  color: var(--color-primary);
}
.c-mob-tab.active {
  color: var(--color-primary);
}

/* ヒーローカード: ロゴと同じペリウィンクルの島 (中だけ明るい文字色に切替) */
.prediction-hero-card {
  background: linear-gradient(135deg, #7678c4, #9a97d9);
  border: none;
  box-shadow: 0 16px 32px -12px rgba(103, 107, 179, 0.45);
  --text-main: #fff9ec;
  --text-muted: rgba(255, 249, 236, 0.88);
  --text-dim: rgba(255, 249, 236, 0.72);
  --border-subtle: rgba(255, 249, 236, 0.35);
  --border-medium: rgba(255, 249, 236, 0.5);
}
.case-hero-banner {
  --text-main: #fff9ec;
  --text-muted: rgba(255, 249, 236, 0.88);
  --text-dim: rgba(255, 249, 236, 0.72);
}

/* ボタン */
.btn-primary {
  background: linear-gradient(135deg, #676bb3, #8b87cc);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(103, 107, 179, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(103, 107, 179, 0.45);
}
.btn-secondary {
  background: #fff3d6;
  border: 1px solid #f0d48a;
  color: #97792b;
}
.btn-secondary:hover {
  background: #feebc6;
}
.btn-outline {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f3f1ea;
}
.btn-resume {
  background: linear-gradient(135deg, #676bb3, #8b87cc);
  color: #ffffff;
}

/* ピル・バッジ類 */
.counter-pill {
  background: rgba(232, 73, 107, 0.12);
  color: #d6336c;
}
.badge-bubble {
  background: rgba(103, 107, 179, 0.14);
  color: var(--text-main);
}
.badge-count-pill {
  background: #feebc6;
  color: #97792b;
}

/* カード類の影と輪郭を柔らかく (地色は変数側で反転済み) */
.daily-mission-card,
.habit-streak-card,
.buddy-welcome-card,
.diag-card,
.data-backup-card,
.bookmark-search-card,
.mock-intro-card,
.cheat-card,
.mba-question-card,
.keypoint-flashcard,
.achieve-badge-card,
.mastery-bar-card,
.empty-state-box,
.exam-year-selector-card,
.case-card,
.mba-cat-card,
.mba-hero-card,
.mba-result-card,
.analytics-dashboard,
.daily-one-box,
.cutoff-alert-banner {
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* バディ (ホウ助) の吹き出し */
.avatar-speech-bubble,
.buddy-speech-col {
  color: var(--text-main);
}
.bb-avatar {
  background: #feebc6;
  border-radius: var(--radius-full);
}

/* 入力欄 */
.case-answer-textarea,
input[type="text"],
input[type="search"],
textarea {
  color-scheme: light;
}
.case-answer-textarea {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

/* メーター・進捗バー */
.meter-track,
.bench-track {
  background: rgba(58, 58, 94, 0.10);
}

/* モーダルカード */
.legal-modal-card,
.break-modal-card,
.level-up-modal-card,
.case-modal-content {
  background: #fffdf8;
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
}

/* フッター */
.app-site-footer {
  border-top: 1px solid var(--border-subtle);
}
.f-logo {
  font-family: var(--font-display);
  color: var(--text-main);
}


/* Soft Owl Theme 追補 (2026-11-12): ハードコードされた濃色サーフェスの置き換え */
.buddy-welcome-card {
  background: linear-gradient(135deg, #ffffff 0%, #fbf7ea 100%);
}
.avatar-speech-bubble {
  background: #fff3d6;
  color: var(--text-main);
}
.bubble-arrow {
  background: #fff3d6;
}
.daily-mission-card {
  background: linear-gradient(135deg, #ffffff 0%, #fdfbf7 100%);
}
.exam-break-banner {
  background: linear-gradient(135deg, #fff3d6 0%, #feebc6 100%);
}
.mba-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f4f3fa 100%);
}
.case-hero-banner {
  background: linear-gradient(135deg, #7678c4, #9a97d9);
  border: none;
}
.weakness-intro-card {
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf7 100%);
}
.subcat-fast-panel {
  background: #ffffff;
}
.subcat-modal-card {
  background: #fffdf8;
  color: var(--text-main);
}
.anki-spaced-box {
  background: #f3f1ea;
}
.achieve-badge-card.unlocked {
  background: linear-gradient(135deg, #fff8e6, #feebc6);
}
.app-site-footer {
  background: rgba(255, 253, 248, 0.7);
}
.legal-modal-header {
  background: #f3f1ea;
}
.break-modal-header,
.break-modal-footer {
  background: #f8f5ee;
}
.level-up-modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #f3efff 100%);
  color: var(--text-main);
}
.pro-modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #fff6e0 100%);
  color: var(--text-main);
}
.mode-switcher-bar {
  background: rgba(255, 255, 255, 0.78);
}
.habit-cheer,
.mission-circle-wrap,
.weekly-streak-strip {
  background: rgba(103, 107, 179, 0.08);
}
.m-reward {
  color: #97792b;
}
.toast-popup {
  background: rgba(56, 56, 92, 0.96);
  --text-main: #fff9ec;
  --text-muted: rgba(255, 249, 236, 0.85);
  color: #fff9ec;
}
.p-exp-fill {
  background: linear-gradient(90deg, #f2b880, #676bb3);
}
.order-pill-btn.active,
.sf-tab.active,
.subcat-item-start-btn {
  background: linear-gradient(135deg, #676bb3, #8b87cc);
}


/* Soft Owl Theme 追補2 (2026-11-12): 旧テーマ層で濃色にされていた主要カードと文字色の是正 */
.habit-streak-card {
  background: linear-gradient(135deg, #fff8e6 0%, #ffffff 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.exam-year-selector-card,
.order-mode-selector-card,
.mock-intro-card,
.question-sheet-card,
.mba-player-card,
.mba-question-card,
.mba-result-card {
  background: linear-gradient(180deg, #ffffff 0%, #fdfbf7 100%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.buddy-greeting {
  color: var(--text-main);
}
.buddy-sub {
  color: var(--text-muted);
}
.eb-title {
  color: var(--text-main);
}
.eb-desc {
  color: var(--text-muted);
}
.habit-title {
  color: var(--text-main);
}
.streak-highlight {
  color: #dd8a0b;
}


/* Soft Owl Theme 追補3 (2026-11-12): 明るい地に対して白・淡色だった文字色の是正 */
.habit-cheer {
  color: #97792b;
}
.d1-title {
  color: var(--text-main);
}
.d1-sub {
  color: var(--color-cyan);
}
.resume-target {
  color: var(--text-main);
}


/* Soft Owl Theme 追補4 (2026-11-12): ペリウィンクルのヒーロー内ボタンの視認性 */
.prediction-hero-card .btn-outline {
  background: rgba(255, 249, 236, 0.14);
  border: 1px solid rgba(255, 249, 236, 0.55);
  color: #fff9ec;
}
.prediction-hero-card .btn-outline:hover {
  background: rgba(255, 249, 236, 0.26);
}
.prediction-hero-card .bookmark-search-card {
  background: rgba(255, 249, 236, 0.12);
  border: 1px solid rgba(255, 249, 236, 0.30);
  box-shadow: none;
}
.prediction-hero-card .question-search-box input {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(255, 249, 236, 0.4);
  color: #38385c;
}


/* Soft Owl Theme 追補5 (2026-11-12): 白カード上で白・淡色だった本文系の文字色を一括是正 */
.question-text-area,
.mba-q-text,
.case-card-title,
.company-name,
.cat-card-title,
.achieve-title,
.backup-title,
.bm-title,
.diag-big-number,
.legal-doc-title,
.modal-title,
.mission-title,
.lvl-up-headline,
.q-title {
  color: var(--text-main);
}
.mba-opt-btn {
  color: var(--text-main);
}
.fb-explanation,
.legal-modal-body,
.breakdown-item.is-wrong-opt,
.sub-q-title {
  color: var(--text-muted);
}
.legal-content-section h4 {
  color: var(--text-main);
}
.cheat-card-list li {
  color: var(--text-main);
}
.cheat-card-title,
.bm-tag,
.kw-item-row.missed,
.mba-quiz-streak-pill,
.mba-term-pill,
.badge-case2 {
  color: #dd8a0b;
}
.modal-eyebrow,
.c-stat-num,
.lvl-up-number-badge,
.lvl-up-sparkle {
  color: var(--color-amber);
}
.exam-timer-box {
  color: #e11d48;
}
.cutoff-alert-banner {
  color: #dc2626;
}


/* Soft Owl Theme 追補6 (2026-11-12): 用語バッジの淡色是正 */
.term-highlight-badge {
  background: rgba(103, 107, 179, 0.12);
  border: 1px solid rgba(103, 107, 179, 0.35);
  color: #5555a6;
}


/* Soft Owl Theme 追補7 (2026-11-12): データ蓄積中の合格判定ヒーローは静かな表示に */
.prediction-hero-card.is-locked .hero-headline {
  font-size: 1.3rem;
  font-weight: 700;
}
.prediction-hero-card.is-locked .highlight-grade {
  color: #d9d6f5;
}
.prediction-hero-card.is-locked .hero-gauge-circle {
  border-color: rgba(254, 235, 198, 0.55);
  background: radial-gradient(circle, rgba(254, 235, 198, 0.12) 0%, transparent 70%);
  box-shadow: none;
}
.prediction-hero-card.is-locked .gauge-value {
  font-size: 1.5rem;
  color: #fff9ec;
}
.prediction-hero-card.is-locked .gauge-sub {
  color: rgba(255, 249, 236, 0.75);
}


/* Soft Owl Theme 追補8 (2026-11-12): ヒーローを淡い色合いにし、上の余白とブックマーク枠の角丸を整える */
.prediction-hero-card {
  background: linear-gradient(150deg, #f2f1fa 0%, #faf6ea 100%);
  border: 1px solid rgba(103, 107, 179, 0.18);
  box-shadow: 0 10px 26px -12px rgba(87, 83, 160, 0.18);
  margin-top: 1.5rem;
  --text-main: #38385c;
  --text-muted: #6f6f8c;
  --text-dim: #8b8ba3;
  --border-subtle: rgba(58, 58, 94, 0.1);
  --border-medium: rgba(58, 58, 94, 0.18);
}
.prediction-hero-card .hero-eyebrow {
  color: var(--color-primary);
}
.prediction-hero-card .benchmark-progress-box {
  background: rgba(103, 107, 179, 0.08);
  border: 1px solid rgba(103, 107, 179, 0.14);
  border-radius: 16px;
}
.prediction-hero-card .hero-gauge-circle {
  border-color: rgba(103, 107, 179, 0.45);
  background: radial-gradient(circle, rgba(103, 107, 179, 0.1) 0%, transparent 70%);
  box-shadow: none;
}
.prediction-hero-card .gauge-value {
  color: var(--text-main);
}
.prediction-hero-card .gauge-sub {
  color: var(--text-muted);
}
.prediction-hero-card .btn-outline {
  background: #ffffff;
  border: 1px solid rgba(103, 107, 179, 0.35);
  color: var(--color-primary);
}
.prediction-hero-card .btn-outline:hover {
  background: #f2f1fa;
}
.prediction-hero-card .bookmark-search-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(103, 107, 179, 0.18);
  border-radius: 20px;
  padding: 0.9rem 1rem;
}
.prediction-hero-card .question-search-box input {
  background: #ffffff;
  border: 1px solid rgba(103, 107, 179, 0.25);
  color: #38385c;
}
.prediction-hero-card.is-locked .highlight-grade {
  color: #8a87c4;
}
.prediction-hero-card.is-locked .hero-gauge-circle {
  border-color: rgba(103, 107, 179, 0.3);
  background: radial-gradient(circle, rgba(103, 107, 179, 0.06) 0%, transparent 70%);
  box-shadow: none;
}
.prediction-hero-card.is-locked .gauge-value {
  color: var(--text-main);
}
.prediction-hero-card.is-locked .gauge-sub {
  color: var(--text-muted);
}


/* Soft Owl Theme 追補9 (2026-11-12): 淡色文字の一括是正2（習慣化トラッカーの曜日ほか） */
.w-day-box.completed .w-day-name {
  color: #b45309;
}
.w-day-box.today {
  outline-color: var(--color-primary);
}
.bb-quote {
  color: #97792b;
}
.ox-q-text,
.q-desc-box,
.story-para,
.user-ans-preview,
.ws-case-title,
.subcat-modal-title,
.subcat-item-name,
.subcat-fast-title,
.pro-modal-title,
.p-plan-name,
.p-plan-price,
.p-stat-num,
.p-level-val,
.order-title,
.sf-chip-name {
  color: var(--text-main);
}
.perk-item strong {
  color: var(--text-main);
}
.ox-fb-exp,
.subcat-chip-btn,
.tokusho-table td,
.qr-desc {
  color: var(--text-muted);
}
.tokusho-table th {
  color: var(--text-main);
}
.p-rank-title,
.pro-crown-badge,
.sec-heading,
.lvl-title,
.new-title-text {
  color: #dd8a0b;
}
.q-points-badge,
.para-num-badge {
  color: #b45309;
}
.timer-val {
  color: #d97706;
}
.category-chip,
.hub-link-chip {
  color: #5555a6;
}
.revision-notice-banner {
  color: #97792b;
}
.sf-tab:hover {
  color: var(--color-primary);
}
.fb-exp-gain {
  color: #0e9f6e;
}
.hero-tag {
  color: #ffedb8;
}


/* Soft Owl Theme 追補10 (2026-11-12): 上部タブが右端で切れないよう折り返しを許可 */
.app-nav-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
}
.app-nav-tabs .nav-tab {
  padding: 0.5rem 0.85rem;
}


/* Soft Owl Theme 追補11 (2026-11-12): 選択中ピル・タブの文字色是正（年度ピルほか） */
.year-pill.active {
  background: linear-gradient(135deg, #7678c4, #676bb3);
  border-color: transparent;
  color: #fff9ec;
  box-shadow: 0 6px 16px -6px rgba(103, 107, 179, 0.55);
}
.year-tag {
  color: var(--color-primary);
}
.legal-tab-btn.active {
  background: rgba(103, 107, 179, 0.14);
  border-color: rgba(103, 107, 179, 0.45);
  color: #5555a6;
}
.bs-tab.active {
  background: rgba(245, 158, 11, 0.22);
  color: #b45309;
}
.bss-tab.active {
  background: rgba(103, 107, 179, 0.14);
  color: #5555a6;
}
.case-filter-btn.active,
.case-q-nav-btn.active {
  color: #7c2d12;
}
.bookmark-btn.active {
  color: #dd8a0b;
}


/* Soft Owl Theme 追補12 (2026-11-12): 年度ピル行も折り返して全年度を見せる */
.year-pills-row {
  flex-wrap: wrap;
  overflow-x: visible;
}


/* Soft Owl Theme 追補13 (2026-11-12): トップバナー左右に余白を持たせてバランス調整 */
.app-top-bar {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
