:root {
  --bg: #eef4ef;
  --bg-accent: #e4ece5;
  --surface: rgba(251, 253, 251, 0.9);
  --surface-strong: #fcfdfc;
  --border: rgba(76, 104, 83, 0.18);
  --text: #25322a;
  --muted: #617066;
  --primary: #5b7f67;
  --primary-deep: #476653;
  --accent: #a8c0ae;
  --success: #4d7b5c;
  --info: #4f6f61;
  --shadow: 0 18px 50px rgba(77, 104, 83, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
}

.hero-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.scale-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.scale-guide span {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.92rem;
}

.content-grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(116, 104, 88, 0.14);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 18px;
  border: 1px solid rgba(108, 83, 47, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

.question-card p {
  margin: 0 0 14px;
  font-weight: 700;
  line-height: 1.5;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 4px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.choice-score {
  display: block;
  font-weight: 700;
}

.choice-caption {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.choice input:checked + .choice-label {
  border-color: var(--primary);
  background: rgba(91, 127, 103, 0.14);
  transform: translateY(-1px);
}

.score-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.score-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.score-card small {
  display: block;
  color: var(--muted);
}

.score-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.result-message {
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(77, 123, 92, 0.12);
  color: var(--success);
  font-weight: 700;
}

.result-message.info {
  background: rgba(79, 111, 97, 0.12);
  color: var(--info);
}

.chart-card,
.type-section,
.debug-section {
  margin-top: 22px;
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.chart-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  gap: 12px;
  align-items: center;
}

.chart-track {
  overflow: hidden;
  height: 18px;
  border-radius: 999px;
  background: rgba(116, 104, 88, 0.14);
}

.chart-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  cursor: pointer;
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.type-tab {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
}

.type-tab.active {
  border-color: var(--primary);
  background: rgba(91, 127, 103, 0.14);
}

.type-content {
  margin-top: 16px;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.58);
}

.type-content h4 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.type-content section + section {
  margin-top: 18px;
}

.type-content ul {
  margin: 10px 0 0;
  padding-left: 1.2rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(108, 83, 47, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.primary-button,
.ghost-button {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.primary-button {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ghost-button {
  background: transparent;
  color: var(--text);
}

.footer-note {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 20px;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-cards {
    grid-template-columns: 1fr;
  }

  .chart-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
