:root {
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-strong: #fff7e7;
  --border: #d8d0c1;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #d97706;
  --accent-strong: #b45309;
  --accent-soft: #f59e0b;
  --success: #047857;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #f1ece2 0%, #f7f4ee 35%, #fdfbf7 100%);
  color: var(--text);
  font-family:
    "Hiragino Sans",
    "Noto Sans JP",
    "Yu Gothic",
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 18px 16px 96px;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.18), transparent 36%),
    linear-gradient(160deg, #fffdf8 0%, #fff7e8 100%);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 30px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1,
.section-title {
  margin: 10px 0 8px;
  font-size: 1.55rem;
  line-height: 1.28;
}

.hero p,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 14px;
}

.section {
  margin-top: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(31, 41, 55, 0.08);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}

.card.soft {
  background: var(--surface-strong);
}

.grid-2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 800;
}

.badge-row,
.choice-list,
.action-list,
.session-meta,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.pill.muted {
  background: rgba(107, 114, 128, 0.12);
  color: var(--muted);
}

.cta,
.ghost-button,
.choice-button,
.toggle-button {
  border: 0;
  border-radius: 18px;
  min-height: 52px;
  padding: 0 16px;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}

.cta {
  background: var(--accent);
  color: white;
  font-weight: 800;
  width: 100%;
}

.cta.secondary {
  background: var(--text);
}

.ghost-button {
  width: 100%;
  background: rgba(31, 41, 55, 0.06);
  color: var(--text);
  font-weight: 700;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-button {
  width: 100%;
  text-align: left;
  padding: 16px 14px;
  background: white;
  border: 1px solid rgba(31, 41, 55, 0.12);
  color: var(--text);
}

.choice-button.selected {
  background: rgba(217, 119, 6, 0.14);
  border-color: rgba(217, 119, 6, 0.55);
}

.choice-button.correct {
  background: rgba(4, 120, 87, 0.12);
  border-color: rgba(4, 120, 87, 0.36);
}

.choice-button.wrong {
  background: rgba(185, 28, 28, 0.1);
  border-color: rgba(185, 28, 28, 0.3);
}

.question-card {
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #d97706, #2563eb);
}

.question-text {
  margin: 12px 0 0;
  font-size: 1.12rem;
  line-height: 1.55;
  white-space: pre-line;
}

.answer-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(31, 41, 55, 0.04);
}

.answer-panel.correct {
  background: rgba(4, 120, 87, 0.1);
}

.answer-panel.wrong {
  background: rgba(185, 28, 28, 0.09);
}

.answer-title {
  font-weight: 800;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  padding: 14px;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(31, 41, 55, 0.08);
}

.tiny {
  font-size: 0.82rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.08);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97706, #2563eb);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input[type="range"] {
  width: 100%;
}

.field select,
.field input[type="checkbox"] {
  accent-color: var(--accent);
}

.nav-shell {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  width: min(calc(100% - 16px), 460px);
  transform: translateX(-50%);
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(31, 41, 55, 0.08);
  box-shadow: 0 18px 35px rgba(31, 41, 55, 0.12);
  backdrop-filter: blur(18px);
}

.nav-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, 1fr);
}

.nav-link {
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 10px 6px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.nav-link.active {
  background: rgba(217, 119, 6, 0.14);
  color: var(--accent-strong);
}

.nav-emoji {
  font-size: 1.1rem;
}

.empty-state {
  display: grid;
  gap: 10px;
  text-align: center;
  padding: 22px 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 8px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.footer-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero h1,
  .section-title {
    font-size: 1.38rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}
