:root {
  --bg: #f2efe8;
  --panel: #fffaf2;
  --panel-strong: #f7f0df;
  --text: #1f1b16;
  --muted: #70675f;
  --border: #d8ccbb;
  --shadow: 0 18px 40px rgba(69, 53, 37, 0.08);
  --accent: #0d6f63;
  --accent-strong: #084c44;
  --secondary: #d55d2a;
  --secondary-strong: #9c3d16;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 111, 99, 0.13), transparent 30%),
    radial-gradient(circle at top right, rgba(213, 93, 42, 0.14), transparent 30%),
    linear-gradient(180deg, #f9f5ec 0%, #efe9dd 100%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
}

.app-shell {
  padding: 32px 16px 48px;
}

.site-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.hero,
.panel,
.metric-card {
  border: 1px solid rgba(216, 204, 187, 0.9);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 20px;
  padding: 30px 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.95), rgba(247, 240, 223, 0.92));
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

h1,
h2,
h3,
legend {
  margin: 0;
  font-weight: 500;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  max-width: none;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
}

h3 {
  font-size: 1rem;
}

.hero-copy,
.muted,
.message,
.legend-row,
.status-badge,
.field span,
.field legend,
.audio-title,
.metric-card p,
th,
td,
li,
input,
select,
button {
  font-size: 0.97rem;
}

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta span,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(13, 111, 99, 0.08);
  border: 1px solid rgba(13, 111, 99, 0.18);
  color: var(--accent-strong);
  font-weight: 500;
}

.panel {
  margin-top: 24px;
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 250, 242, 0.96);
}

.panel-wide {
  padding: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(247, 240, 223, 0.6);
  border: 1px solid var(--border);
}

.field input,
.field select,
.inline-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fffdf9;
  color: var(--text);
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.radio-row label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
  white-space: nowrap;
}

.actions,
.choice-row,
.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions {
  grid-column: 1 / -1;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 500;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

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

.button-secondary {
  background: rgba(13, 111, 99, 0.08);
  color: var(--accent-strong);
}

.button-choice {
  flex: 1;
  min-width: 220px;
  background: var(--accent-strong);
  color: #fff;
}

.button-choice-alt {
  background: var(--secondary-strong);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

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

.audio-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fffdf9;
}

.audio-card-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(13, 111, 99, 0.06), rgba(255, 255, 255, 0.94));
}

.audio-title {
  margin: 0 0 10px;
  font-weight: 500;
}

audio {
  width: 100%;
}

.metric-grid,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  margin: 24px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff9ef 0%, #f4ede1 100%);
}

.metric-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.metric-card strong {
  font-size: 1.9rem;
  font-weight: 500;
}

.dashboard-grid {
  grid-template-columns: 1.2fr 1fr;
}

.stack-bar {
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  min-height: 44px;
  margin-top: 8px;
}

.stack-bar-baseline,
.stack-bar-proposed {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
}

.stack-bar-baseline {
  background: #7b7168;
}

.stack-bar-proposed {
  background: var(--accent);
}

.legend-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

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

.stat-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(216, 204, 187, 0.6);
}

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

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(216, 204, 187, 0.7);
}

.data-table th {
  color: var(--muted);
  font-weight: 500;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 27, 22, 0.55);
  backdrop-filter: blur(4px);
}

.overlay-card {
  width: min(780px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 24px;
  padding: 28px;
  background: #fffaf2;
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(31, 27, 22, 0.26);
}

.message.error {
  color: #af2f17;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .form-grid,
  .audio-grid,
  .dashboard-grid,
  .metric-grid,
  .demographic-columns {
    grid-template-columns: 1fr;
  }

  .section-head,
  .progress-row {
    flex-direction: column;
  }
}
