@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=IBM+Plex+Sans:wght@400;500&display=swap");

:root {
  --ink: #1e201a;
  --muted: #58564c;
  --accent: #2f4b3f;
  --accent-soft: #dfe4da;
  --highlight: #b36a2e;
  --card: rgba(255, 255, 255, 0.85);
  --border: #d1cbbd;
  --shadow: rgba(30, 32, 26, 0.12);
  --bg-start: #f4f1e8;
  --bg-end: #dcd4c4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, var(--bg-start), var(--bg-end));
  min-height: 100vh;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  padding: 24px 24px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

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

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 12px;
}

.subhead {
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 8px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 20px var(--shadow);
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

button {
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(47, 75, 63, 0.2);
}

button.primary {
  background: var(--accent);
  color: #f8f6ef;
}

button.ghost {
  border-color: var(--highlight);
  color: var(--highlight);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 18px;
  margin-top: 12px;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--ink);
}

.checkbox-row input {
  margin-top: 2px;
}

select,
input[type="range"] {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fffdf8;
  font-size: 0.95rem;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.slider-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.scale-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.scale-item {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(32px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.scale-options label {
  font-size: 0.75rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  display: block;
}

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

.scale-options span {
  display: block;
  padding: 6px 0;
  border-radius: 6px;
  background: var(--accent-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.scale-options input:checked + span {
  background: var(--accent);
  color: #f8f6ef;
}

.status {
  margin-top: 12px;
  color: var(--muted);
}

.note {
  color: var(--muted);
}

.consent-text {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  max-height: 320px;
  overflow-y: auto;
}

.consent-text h3 {
  margin-top: 16px;
}

.link-row {
  margin-top: 12px;
}

.link-row a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.link-row a:hover {
  border-bottom: 1px solid var(--accent);
}

.notice {
  border: 1px dashed var(--highlight);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
}

.notice strong {
  color: var(--highlight);
}

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

.chart-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 32, 26, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal-card {
  background: #fffdf8;
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 30px rgba(30, 32, 26, 0.2);
}

.modal-card p {
  margin-bottom: 16px;
}

.hidden {
  display: none;
}

.reveal {
  animation: fadeUp 0.6s ease both;
}

.foot {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

@media (max-width: 720px) {
  .page {
    padding: 24px 18px 40px;
  }

  .slider-row {
    flex-direction: column;
    align-items: stretch;
  }

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