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

:root {
  /* Green palette — reserved for quiz correct/wrong feedback */
  --g900: #1B4332;
  --g800: #1E6B45;
  --g700: #2D6A4F;
  --g600: #357A5B;
  --g500: #40916C;
  --g400: #52B788;
  --g300: #74C69D;
  --g200: #B7E4C7;
  --g100: #D8F3DC;
  --g50:  #F0FAF4;

  /* Blue palette — primary brand */
  --blue:       #2563EB;
  --blue-mid:   #3B82F6;
  --blue-light: #60A5FA;
  --blue-100:   #DBEAFE;
  --blue-50:    #EFF6FF;

  /* Status */
  --red:    #DC2626;
  --red-bg: #FEF2F2;
  --amber:    #D97706;
  --amber-bg: #FFFBEB;

  /* Text */
  --text:     #111827;
  --text-mid: #374151;
  --text-sub: #9CA3AF;
  --border:   #E5E7EB;
  --bg:       #F3F6FB;
  --white:    #FFFFFF;

  /* Navy — limited to text accents */
  --navy:       #1E3A8A;
  --navy-mid:   #243355;
  --navy-light: #2E3F6E;
  --gold:       #A88030;
  --gold-light: #E8C97A;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 22px;
  --shadow:    0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --font: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
  --ease: 0.18s ease;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
}

@media (min-width: 430px) {
  #app { box-shadow: 0 0 48px rgba(0,0,0,0.12); }
}

@media (min-width: 600px) {
  #app { max-width: 600px; }
}

@media (min-width: 768px) {
  #app { max-width: 720px; }
}

@media (min-width: 1024px) {
  #app { max-width: 760px; }
}

/* ── Animations ── */
.screen {
  min-height: 100vh;
  animation: fadeIn 0.2s ease both;
}

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

@keyframes slideUp {
  from { transform: translate(-50%, 18px); opacity: 0; }
  to   { transform: translateX(-50%);       opacity: 1; }
}

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── Shared Header ── */
.header {
  background: var(--white);
  color: var(--text);
  padding: calc(13px + env(safe-area-inset-top, 0px)) 16px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  border-bottom: 1px solid var(--border);
}

.quiz-header {
  background: linear-gradient(140deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: calc(13px + env(safe-area-inset-top, 0px)) 16px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(37,99,235,0.28);
}

/* Back button — default (white header) */
.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: 24px;
  padding: 7px 14px 7px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font);
  transition: background var(--ease);
  min-height: 44px;
}
.btn-back:active { background: var(--blue-100); }

/* Back button overrides inside quiz-header (dark bg) */
.quiz-header .btn-back {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.32);
  color: var(--white);
}
.quiz-header .btn-back:active { background: rgba(255,255,255,0.34); }

.btn-back-arrow { font-size: 16px; line-height: 1; }

.header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-badge {
  background: rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.bookmark-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none; color: white;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background var(--ease);
}
.bookmark-btn.active {
  background: var(--amber);
  animation: pop 0.3s ease;
}
.bookmark-btn:active { background: rgba(255,255,255,0.34); }

/* ── HOME Hero ── */
/* ── HOME Hero ── */
.home-hero {
  background: linear-gradient(160deg, #F0F7FF 0%, #DBEAFE 60%, #EFF6FF 100%);
  color: var(--text);
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px 60px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(37,99,235,0.06);
}
.home-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle at center, rgba(59,130,246,0.14) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.home-hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 88%, rgba(59,130,246,0.05) 0%, transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(99,170,246,0.06) 0%, transparent 22%);
  pointer-events: none;
}

.home-hero-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.home-logo-wrap {
  width: 44px;
  height: 44px;
  background: var(--white);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.10);
  flex-shrink: 0;
}
.home-logo-wrap > span { font-size: 24px !important; opacity: 0.85; }
.home-hero-titles { flex: 1; min-width: 0; }
.home-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.2;
}
.home-subtitle {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}
.home-hero-bell {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.75;
  box-shadow: 0 1px 3px rgba(37,99,235,0.08);
}

/* Stats card: large white card pulled up into hero */
.stats-card-large {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(37,99,235,0.14);
  margin: -42px 14px 0;
  padding: 14px 4px;
  display: flex;
}
.stat-cell {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 6px 4px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-cell:last-child { border-right: none; }
.stat-cell-icon {
  width: 26px;
  height: 26px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  margin-bottom: 2px;
}
.stat-cell-val {
  font-size: 19px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-cell-unit { font-size: 12px; font-weight: 800; color: var(--text); margin-left: 1px; }
.stat-cell-label { font-size: 10px; color: var(--text-sub); white-space: nowrap; font-weight: 700; }

/* ── HOME Body ── */
.home-body {
  padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Daily CTA card — horizontal main card */
.home-daily-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1.5px solid var(--blue-100);
  box-shadow: 0 8px 22px rgba(37,99,235,0.16), 0 2px 6px rgba(37,99,235,0.08);
  padding: 16px 14px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-daily-badge {
  width: 58px;
  height: 58px;
  background: linear-gradient(140deg, #BFDBFE 0%, #DBEAFE 100%);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,0.10);
}
.home-daily-badge-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
}
.home-daily-badge-text {
  font-size: 10px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-top: 2px;
}
.home-daily-content { flex: 1; min-width: 0; }
.home-daily-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.2;
}
.home-daily-sub {
  font-size: 11px;
  color: var(--text-mid);
  line-height: 1.4;
}
.home-daily-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  text-align: center;
  box-shadow: 0 4px 12px rgba(37,99,235,0.30);
  transition: transform var(--ease);
  flex-shrink: 0;
  min-height: 44px;
  white-space: nowrap;
}
.home-daily-btn:active { transform: scale(0.97); }
.home-daily-btn-arrow { font-size: 16px; font-weight: 400; line-height: 1; }

.home-done-card {
  background: var(--white);
  border: 1.5px solid var(--g200);
  border-radius: var(--r-md);
  box-shadow: 0 4px 18px rgba(82,183,136,0.12);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-done-badge {
  width: 58px;
  height: 58px;
  background: linear-gradient(140deg, var(--g300), var(--g400));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(82,183,136,0.30);
}
.home-done-check {
  font-size: 28px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}
.home-done-text { flex: 1; min-width: 0; }
.home-done-title { font-size: 15px; font-weight: 900; color: var(--g700); }
.home-done-sub { font-size: 12px; color: var(--text-mid); margin-top: 3px; }

/* Today's Tip card — single-action recommendation */
.home-tip-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-tip-badge {
  width: 36px;
  height: 36px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-tip-icon { font-size: 16px; line-height: 1; }
.home-tip-content { flex: 1; min-width: 0; }
.home-tip-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.home-tip-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
}
.home-tip-reason {
  font-size: 11px;
  color: var(--text-mid);
  line-height: 1.4;
  margin-top: 2px;
}
.home-tip-btn {
  background: var(--white);
  border: 1.5px solid var(--blue);
  color: var(--blue);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform var(--ease), background var(--ease);
}
.home-tip-btn:active { transform: scale(0.96); background: var(--blue-50); }

/* Weakness section */
.home-section {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.home-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Weakness 3-col metric row */
.weakness-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 8px;
  margin-bottom: 14px;
}
.weakness-cell {
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  border: 1px solid transparent;
}
.weakness-cell-red { background: #FEF5F5; border-color: #FEE2E2; }
.weakness-cell-red.weakness-cell-muted { background: #F4F8FE; border-color: #E3EDFC; }
.weakness-cell-blue { background: #F4F8FE; border-color: #E3EDFC; }
.weakness-cell-good {
  background: #F4FBF6;
  border-color: #DCF1E3;
}
.weakness-cell-good.weakness-cell-good-warn {
  background: #F4F8FE;
  border-color: #E3EDFC;
}
.weakness-cell-val {
  font-size: 26px;
  font-weight: 900;
  color: var(--blue);
  line-height: 1;
  letter-spacing: -0.5px;
}
.weakness-cell-red:not(.weakness-cell-muted) .weakness-cell-val { color: #E04848; }
.weakness-cell-unit {
  font-size: 12px;
  font-weight: 800;
  margin-left: 1px;
  color: inherit;
  opacity: 0.85;
}
.weakness-cell-label {
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 700;
  margin-top: 6px;
}
.weakness-cell-msg-label {
  font-size: 11px;
  color: var(--g600);
  font-weight: 700;
  margin-bottom: 4px;
}
.weakness-cell-good-warn .weakness-cell-msg-label { color: var(--blue); }
.weakness-cell-msg-body {
  font-size: 17px;
  font-weight: 900;
  color: var(--g600);
  line-height: 1.1;
}
.weakness-cell-good-warn .weakness-cell-msg-body { color: var(--blue); }

/* Weakness worst category (TOP1) */
.weakness-worst {
  margin-bottom: 12px;
}
.weakness-worst-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.weakness-worst-label { font-weight: 700; color: var(--text-sub); }
.weakness-worst-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weakness-worst-rate {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}
.weakness-worst-empty {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
  padding: 6px 0;
}

/* Weakness progress bar */
.weakness-progress {
  margin-bottom: 12px;
}
.weakness-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.weakness-progress-label { font-weight: 700; }
.weakness-progress-val { color: var(--text-sub); }
.weakness-progress-val strong { color: var(--blue); font-size: 13px; font-weight: 900; }

.home-pace-status {
  border-radius: var(--r-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
}
.home-pace-ok {
  background: linear-gradient(90deg, var(--g50), #ECFDF5);
  color: var(--g700);
  border: 1px solid var(--g200);
  border-left: 3px solid var(--g400);
}
.home-pace-info {
  background: var(--blue-50);
  color: var(--blue);
  border: 1px solid var(--blue-100);
  border-left: 3px solid var(--blue-light);
}

.home-review-btn { margin-top: 12px; }

.weakness-detail-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity var(--ease);
}
.weakness-detail-link:active { opacity: 0.6; }

/* Plan card */
.home-plan-card {
  background: linear-gradient(150deg, #F0FDF4 0%, var(--g50) 100%);
  border: 1px solid var(--g200);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.home-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-plan-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.home-plan-icon {
  width: 30px;
  height: 30px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(82,183,136,0.18);
}
.home-plan-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--g700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-plan-check-btn {
  background: var(--white);
  border: 1.5px solid var(--g300);
  color: var(--g700);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.home-plan-check-btn:active { transform: scale(0.96); }

.home-plan-days-badge {
  background: var(--white);
  border: 1px solid var(--g200);
  color: var(--g700);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.home-plan-body {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-top: 8px;
}
.home-plan-days strong { color: var(--text); font-weight: 800; }
.home-plan-pace-need { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.home-plan-pace-need strong { color: var(--g700); font-weight: 800; }

/* ── HOME Menu ── */
.menu-section { padding: 0; }

.section-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 12px 18px;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform var(--ease), box-shadow var(--ease);
  font-family: var(--font);
  width: 100%;
  min-height: 106px;
}
.menu-btn:active { transform: scale(0.95); box-shadow: none; }

/* Home menu grid items: horizontal layout (icon | text | arrow) */
.menu-grid > .menu-btn {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  text-align: left;
  gap: 0 12px;
  padding: 14px 12px 14px 14px;
  min-height: 84px;
  position: relative;
}
.menu-grid > .menu-btn .btn-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 40px;
  height: 40px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.menu-grid > .menu-btn .btn-label {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.menu-grid > .menu-btn .btn-sub {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.3;
  margin-top: 2px;
}
.menu-grid > .menu-btn::after {
  content: '›';
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 20px;
  color: var(--text-sub);
  font-weight: 300;
  line-height: 1;
}

/* Home full-width menu buttons (使い方 / 復習) — unified icon style */
.menu-section > .menu-btn.full .btn-icon,
.home-section .menu-btn.full .btn-icon {
  width: 36px;
  height: 36px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.menu-section > .menu-btn.full .btn-label {
  font-size: 14px;
  font-weight: 800;
}
.menu-section > .menu-btn.full .btn-sub {
  font-size: 11px;
}

.menu-btn.full {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  min-height: 58px;
  padding: 16px 20px;
}

.menu-btn.full::after {
  content: '›';
  font-size: 22px;
  color: var(--text-sub);
  font-weight: 300;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}

.menu-btn.full.primary::after { content: ''; }

.menu-btn.primary {
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}
.menu-btn.primary .btn-label,
.menu-btn.primary .btn-sub { color: var(--white); }

.btn-icon  { font-size: 36px; line-height: 1; }
.btn-label { font-size: 15px; font-weight: 800; color: var(--text); line-height: 1.3; }
.btn-sub   { font-size: 12px; color: var(--text-sub); line-height: 1.3; }

/* ── CATEGORIES ── */
.cat-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color var(--ease), transform var(--ease);
  min-height: 84px;
}
.cat-card:active { transform: scale(0.98); border-color: var(--blue-100); }

.cat-icon { font-size: 34px; flex-shrink: 0; }

.cat-info { flex: 1; }
.cat-name { font-size: 17px; font-weight: 800; }
.cat-meta { font-size: 12px; color: var(--text-sub); }
.cat-rate { text-align: right; flex-shrink: 0; }
.cat-rate-num   { font-size: 24px; font-weight: 900; color: var(--blue); }
.cat-rate-label { font-size: 11px; color: var(--text-sub); }

/* ── Dashboard card body ── */
.cat-body { flex: 1; min-width: 0; }
.cat-name-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.cat-total { font-size: 11px; color: var(--text-sub); }
.cat-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
.cat-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 100%); border-radius: 2px; }
.cat-stats-row { display: flex; gap: 10px; font-size: 11px; flex-wrap: wrap; align-items: center; }
.cat-stat-done  { color: var(--text-sub); }
.cat-stat-rate  { color: var(--blue); font-weight: 700; }
.cat-stat-wrong { color: var(--text-mid); font-weight: 600; }

/* ── RANDOM COUNT SELECTION ── */
.count-select-body {
  padding: 28px 14px calc(28px + env(safe-area-inset-bottom, 0px));
}

.count-select-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 20px;
}

.count-select-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.count-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  font-family: var(--font);
  transition: border-color var(--ease), transform var(--ease);
  min-height: 80px;
  width: 100%;
}
.count-card:hover  { border-color: var(--blue-100); }
.count-card:active { transform: scale(0.98); border-color: var(--blue); }

.count-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--blue);
}

.count-sub {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 600;
}

/* ── CHAPTER SELECTION ── */
.chapter-select-body {
  padding: 20px 14px calc(28px + env(safe-area-inset-bottom, 0px));
}

.chapter-select-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 10px;
  padding-left: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chapter-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  font-family: var(--font);
  transition: border-color var(--ease), transform var(--ease);
  width: 100%;
  margin-bottom: 10px;
}
.chapter-card:hover  { border-color: var(--blue-100); }
.chapter-card:active { transform: scale(0.98); border-color: var(--blue); }

.chapter-all {
  border-color: var(--blue-100);
  background: linear-gradient(135deg, var(--blue-50), var(--white));
  margin-bottom: 18px;
}

.chapter-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.chapter-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.chapter-meta {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.chapter-rate {
  font-size: 22px;
  font-weight: 900;
  color: var(--blue);
  min-width: 50px;
  text-align: right;
}

/* ── QUIZ Progress ── */
.quiz-progress-track {
  height: 5px;
  background: var(--blue-100);
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transition: width 0.35s ease;
}

/* ── QUIZ Body ── */
.quiz-body {
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

/* Question card */
.q-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.q-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.q-tag {
  display: inline-block;
  background: var(--blue-50);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
}

.q-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

.q-text {
  font-size: 17px;
  line-height: 1.88;
  color: var(--text);
  font-weight: 500;
}

/* ── OPTIONS ── */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.opt-btn {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  font-family: var(--font);
  width: 100%;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
  box-shadow: var(--shadow);
}
.opt-btn:hover:not(:disabled) { border-color: var(--blue-100); }
.opt-btn:active:not(:disabled) { transform: scale(0.985); }
.opt-btn:disabled { cursor: default; }

.opt-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-50);
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--ease), color var(--ease);
  border: 2px solid var(--blue-100);
}

/* Correct option — keep green for conventional correct=green */
.opt-btn.correct {
  border-color: var(--g500);
  background: #E9F8F0;
}
.opt-btn.correct .opt-num {
  background: var(--g500);
  color: var(--white);
  border-color: var(--g500);
}

/* Wrong selected option */
.opt-btn.wrong {
  border-color: var(--red);
  background: var(--red-bg);
}
.opt-btn.wrong .opt-num {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* ── FEEDBACK Banner ── */
.feedback {
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: pop 0.25s ease;
}

.feedback.ok {
  background: var(--g100);
  border: 2.5px solid var(--g400);
}
.feedback.ng {
  background: var(--red-bg);
  border: 2.5px solid var(--red);
}

.feedback-icon { font-size: 28px; flex-shrink: 0; }

.feedback-body { flex: 1; }

.feedback-label {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}
.feedback.ok .feedback-label { color: var(--g800); }
.feedback.ng .feedback-label { color: var(--red); }

.feedback-hint {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
}
.feedback.ok .feedback-hint { color: var(--g600); }
.feedback.ng .feedback-hint { color: #922B21; }

/* ── EXPLANATION ── */
.explanation {
  background: var(--amber-bg);
  border-left: 5px solid var(--amber);
  border-radius: var(--r-md);
  padding: 16px 16px;
  margin-bottom: 16px;
}

.expl-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--amber);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.expl-text {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-mid);
}

/* ── NEXT Button ── */
.next-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  transition: transform var(--ease), opacity var(--ease);
  box-shadow: 0 6px 22px rgba(37,99,235,0.38);
  letter-spacing: 0.2px;
}
.next-btn:active { transform: scale(0.975); opacity: 0.92; }

/* ── RESULT ── */
.result-hero {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: 44px 24px 32px;
  text-align: center;
}

.result-donut { margin-bottom: 4px; }

.result-sub {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 24px;
}

.result-chips {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.result-chip {
  background: rgba(255,255,255,0.17);
  border-radius: var(--r-md);
  padding: 14px 24px;
  text-align: center;
  min-width: 100px;
}
.result-chip-val   { font-size: 28px; font-weight: 900; }
.result-chip-label { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.result-actions {
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.res-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--ease);
}
.res-btn:active { transform: scale(0.97); }
.res-btn.primary {
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  box-shadow: 0 5px 16px rgba(37,99,235,0.35);
}
.res-btn.secondary {
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* ── WRONG LIST ── */
.wrong-section { padding: 0 16px 4px; }
.wrong-title   { font-size: 14px; font-weight: 800; color: var(--text-mid); margin-bottom: 10px; }

.wrong-item {
  background: var(--white);
  border-left: 4px solid var(--red);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow);
}
.wrong-cat { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.wrong-q {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── STATS ── */
.stats-body { padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }

.stats-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 20px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.plan-card {
  background: var(--g50);
  border: 1.5px solid var(--g200);
  padding: 16px;
}

.stats-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* 2×2 grid for overall stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-metric {
  background: var(--blue-50);
  border-radius: var(--r-sm);
  padding: 16px 12px;
  text-align: center;
}
.stats-metric.accent {
  background: var(--blue-100);
}

.stats-metric-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--blue);
  line-height: 1.1;
}
.stats-metric-label {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* Category stat rows */
.cat-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cat-stat-row:last-child { border-bottom: none; padding-bottom: 0; }

.cat-stat-icon  { font-size: 28px; flex-shrink: 0; }
.cat-stat-info  { flex: 1; min-width: 0; }
.cat-stat-name  { font-size: 15px; font-weight: 800; }
.cat-stat-count { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

.cat-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 7px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.cat-stat-rate {
  font-size: 20px;
  font-weight: 900;
  color: var(--blue);
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.cat-stat-date {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 5px;
}

/* 苦手問題 TOP5 */
.weak-list {
  display: flex;
  flex-direction: column;
}

.weak-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.weak-item:last-child { border-bottom: none; padding-bottom: 0; }

.weak-rank {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-sub);
  min-width: 22px;
  padding-top: 2px;
}

.weak-info { flex: 1; min-width: 0; }

.weak-cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-50);
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
}

.weak-q-text {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
}

.weak-wrong-count {
  font-size: 14px;
  font-weight: 900;
  color: var(--red);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
}

.weak-empty {
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
  padding: 16px 0 4px;
}

.reset-btn {
  width: 100%;
  padding: 15px;
  background: var(--white);
  border: 2px solid var(--red);
  color: var(--red);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 4px;
  min-height: 44px;
  transition: background var(--ease);
}
.reset-btn:active { background: var(--red-bg); }

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-sub);
}
.empty-icon  { font-size: 64px; margin-bottom: 14px; }
.empty-title { font-size: 18px; font-weight: 800; color: var(--text-mid); margin-bottom: 8px; }
.empty-text  { font-size: 14px; line-height: 1.75; }

/* ── Phase 6: Today's 5 Questions ── */
/* .stats-bar-sm merged into .stats-bar (single horizontal scroll row) */

.menu-btn.daily {
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  box-shadow: 0 4px 16px rgba(37,99,235,0.40);
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  min-height: 72px;
  padding: 18px 24px;
  margin-bottom: 12px;
}
.menu-btn.daily .btn-icon  { font-size: 28px; }
.menu-btn.daily .btn-label { color: var(--white); font-size: 18px; }
.menu-btn.daily .btn-sub   { color: rgba(255,255,255,0.82); }

.menu-btn.daily.daily-done {
  background: linear-gradient(140deg, var(--g700), var(--g500));
  box-shadow: 0 4px 16px rgba(64,145,108,0.30);
}

/* ── Daily 5 CTA card ── */
.daily-cta-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1.5px solid var(--blue-100);
  border-top: 3px solid var(--blue);
  box-shadow: 0 4px 18px rgba(37,99,235,0.10);
  overflow: hidden;
  padding: 16px 16px 14px;
}

.daily-cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.daily-cta-icon-wrap {
  width: 60px;
  height: 60px;
  background: var(--blue-50);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 2px;
}

.daily-cta-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.daily-cta-body { flex: 1; min-width: 0; }

.daily-cta-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
}

.daily-cta-sub {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.6;
}

.daily-go-btn {
  width: 100%;
  display: block;
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  text-align: center;
  box-shadow: 0 4px 12px rgba(37,99,235,0.28);
  transition: transform var(--ease);
  min-height: 48px;
}
.daily-go-btn:active { transform: scale(0.98); }

.daily-done-card {
  border-left: 4px solid var(--g400);
  background: var(--g50);
}

.weakness-motivation {
  font-size: 12px;
  color: var(--g600);
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.5;
}

.cat-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.cat-bar-row:last-child { border-bottom: none; }

.weakness-status-ok {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--g50);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--g700);
  border-left: 3px solid var(--g400);
}

.weakness-status-warn {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
}

.daily-complete-banner {
  background: rgba(255,255,255,0.20);
  border: 2px solid rgba(255,255,255,0.45);
  border-radius: var(--r-md);
  padding: 14px 20px;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 20px;
  display: block;
}
.daily-complete-sub {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 4px;
}

/* ── Phase 6-D: Continuity Calendar ── */
.cal-week  { display:flex; justify-content:space-around; margin:4px 0; }
.cal-day   { display:flex; flex-direction:column; align-items:center; gap:6px; }
.cal-label { font-size:11px; font-weight:700; color:var(--text-sub); }
.cal-dot   { width:30px; height:30px; border-radius:50%; background:var(--border); }
.cal-dot.done  { background: var(--blue-light); }
.cal-dot.today { box-shadow: 0 0 0 2.5px var(--blue); }

/* ── Phase 9-C: Exam Mode ── */
.exam-alloc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.exam-alloc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--blue-50);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-mid);
}

.exam-timer-bar {
  text-align: center;
  padding: 5px 0;
  font-size: 15px;
  background: var(--blue-50);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

.exam-cat-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.exam-cat-row:last-child { border-bottom: none; }

.exam-pass-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 10px;
}
.exam-pass-badge.pass { background: rgba(82,183,136,0.18); color: #2D6A4F; }
.exam-pass-badge.fail { background: rgba(220,38,38,0.10);  color: var(--red); }

/* ── Phase 9-A: Resume Dialog ── */
#resume-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 24px;
}

.resume-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resume-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.resume-body {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

.resume-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.resume-btn-primary {
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.resume-btn-sub {
  background: transparent;
  color: var(--text-mid);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}


/* ── PREMIUM LOCK (Cycle 2-A1) ──────────────────────────────────────── */
#premium-lock-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.premium-lock-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-lock-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.premium-lock-body {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

.premium-lock-note {
  font-size: 12px;
  color: var(--text-sub);
}

.premium-lock-close {
  margin-top: 6px;
  background: linear-gradient(140deg, var(--blue), var(--blue-mid));
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.premium-lock-close:focus-visible {
  outline: 3px solid var(--border);
  outline-offset: 3px;
}

.count-card-locked {
  opacity: 0.85;
  border-style: dashed;
}

.count-card-locked .count-num {
  color: var(--text-sub);
}

.count-lock {
  font-size: 18px;
  margin-right: 2px;
}

/* Cycle 2-C: home 模試カードの無料ロック表示（menu-grid レイアウトを保ったまま鍵を表示） */
.menu-btn-locked {
  opacity: 0.85;
  border-style: dashed;
}
.menu-btn-locked .btn-label,
.menu-btn-locked .btn-sub {
  color: var(--text-sub);
}
.menu-grid > .menu-btn-locked::after {
  content: none;
}
.menu-grid > .menu-btn-locked .menu-lock {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 18px;
  line-height: 1;
}

/* Cycle 3-F: 重要数字/混同の無料プレビュー末尾ロックカード（共通） */
.preview-lock-card {
  display: block;
  width: 100%;
  text-align: center;
  border: 1.5px dashed var(--border);
  background: var(--g50);
  border-radius: var(--r-md);
  padding: 18px 16px;
  margin-top: 4px;
  cursor: pointer;
  font-family: var(--font);
}
.preview-lock-card .preview-lock-icon { font-size: 22px; line-height: 1; }
.preview-lock-card .preview-lock-text {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-mid);
}
.preview-lock-card .preview-lock-sub {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-sub);
}

/* Cycle 3-G: 学習記録の有料範囲ロック概要カード */
.premium-history-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1.5px dashed var(--border);
  cursor: pointer;
  font-family: var(--font);
}
.premium-history-card .premium-history-detail {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-mid);
}
.premium-history-card .premium-history-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}

/* ── NUMBERS MAP ───────────────────────────────────────────────────── */
.numbers-body {
  padding: 16px;
}

.numbers-intro {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.6;
}

.numbers-card {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.numbers-cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.numbers-label {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.numbers-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 6px;
}

.numbers-note {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}

.numbers-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.numbers-cat-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.numbers-cat-btn-icon {
  font-size: 22px;
  line-height: 1;
}

.numbers-cat-btn-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.numbers-cat-btn-count {
  font-size: 13px;
  color: var(--text-sub);
}

.numbers-cat-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue);
}

/* ── CONFUSION MAP ─────────────────────────────────────────────────── */
.confusion-body {
  padding: 16px;
}

.confusion-intro {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.6;
}

.confusion-card {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.confusion-cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.confusion-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.confusion-compare {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.confusion-side {
  flex: 1;
  padding: 10px 12px;
}

.confusion-side:first-child {
  border-right: 1px solid var(--border);
}

.confusion-side-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
  line-height: 1.4;
}

.confusion-side-body {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.7;
}

.confusion-remember {
  font-size: 12px;
  color: var(--navy);
  background: #f0f4ff;
  border-radius: 4px;
  padding: 7px 10px;
  margin-bottom: 6px;
  line-height: 1.6;
}

.confusion-danger {
  font-size: 12px;
  color: #7a4000;
  background: #fff7ed;
  border-radius: 4px;
  padding: 7px 10px;
  line-height: 1.6;
}

/* ── EXAM REVIEW ─── */
.exam-review {
  background: var(--white);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.exam-review-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--blue);
}

.exam-review-comment {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 10px;
}

.exam-review-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.exam-review-tag-label {
  font-size: 12px;
  color: var(--text-sub);
}

.exam-review-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 4px;
  padding: 2px 8px;
}

.exam-review-actions {
  margin: 0;
  padding-left: 18px;
}

.exam-review-actions li {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.7;
}
