:root {
  --bg: #f5efe3;
  --bg-2: #efe2c2;
  --surface: rgba(255, 251, 244, 0.84);
  --surface-strong: rgba(255, 248, 238, 0.96);
  --line: rgba(67, 45, 22, 0.14);
  --line-strong: rgba(67, 45, 22, 0.28);
  --text: #2c2216;
  --muted: #6f5e49;
  --accent: #9b5f17;
  --accent-2: #356a57;
  --danger: #9e3a2d;
  --warning: #b96f1d;
  --success: #2f6d52;
  --shadow: 0 24px 72px rgba(84, 57, 21, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 232, 184, 0.88), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(147, 178, 150, 0.34), transparent 28%),
    linear-gradient(180deg, #f8f3ea 0%, #f4ead8 34%, #efe1c4 100%);
  font-family: "Manrope", "PingFang SC", "Helvetica Neue", sans-serif;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 32px;
  background:
    linear-gradient(140deg, rgba(255, 249, 239, 0.96), rgba(247, 239, 222, 0.9)),
    linear-gradient(120deg, rgba(255, 202, 122, 0.22), transparent 42%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -4% -40% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 106, 87, 0.16), transparent 68%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr;
  gap: 22px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
}

.hero h1,
.section-title,
.panel-title {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  letter-spacing: -0.02em;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.02;
}

.hero p {
  max-width: 70ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions,
.chip-row,
.toolbar,
.input-actions,
.mini-actions,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #9b5f17, #bb7b2b);
  color: #fff7ec;
}

.btn-secondary {
  border-color: var(--line-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
}

.hero-note,
.micro-copy,
.helper,
.muted {
  color: var(--muted);
}

.hero-card,
.panel,
.metric,
.mini-card,
.upload-item,
.option-card,
.resource-card,
.alert-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(98, 73, 36, 0.08);
}

.hero-card {
  padding: 22px;
}

.hero-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-card li + li,
.resource-card li + li {
  margin-top: 8px;
}

.sticky-bar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 26px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(84, 57, 21, 0.08);
}

.sticky-bar strong {
  font-weight: 800;
}

.sticky-bar small {
  display: block;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric {
  padding: 18px;
}

.metric-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  margin-top: 10px;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  line-height: 1;
}

.metric-detail {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.grid-2,
.grid-3,
.grid-4,
.options-grid,
.matrix-grid,
.science-grid,
.resources-grid {
  display: grid;
  gap: 18px;
}

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

.grid-3,
.options-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.section {
  margin-top: 26px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(26px, 4vw, 42px);
}

.section-copy {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.panel {
  padding: 22px;
}

.panel-title {
  font-size: 22px;
}

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.list,
.ordered-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.criterion-row,
.redline-row,
.supplement-row,
.exam-target,
.mapping-row,
.evidence-card,
.resource-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 246, 0.82);
}

.criterion-main,
.inline-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.criterion-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(155, 95, 23, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.criterion-meta,
.pill,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill {
  background: rgba(53, 106, 87, 0.12);
  color: var(--accent-2);
}

.status-pill {
  background: rgba(155, 95, 23, 0.1);
  color: var(--accent);
}

.status-pill.good {
  background: rgba(47, 109, 82, 0.12);
  color: var(--success);
}

.status-pill.warn {
  background: rgba(185, 111, 29, 0.12);
  color: var(--warning);
}

.status-pill.danger {
  background: rgba(158, 58, 45, 0.12);
  color: var(--danger);
}

.tag {
  background: rgba(44, 34, 22, 0.06);
  color: var(--muted);
}

.field,
.textarea,
.select,
.upload-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
}

.field:focus,
.textarea:focus,
.select:focus,
.upload-input:focus {
  outline: 2px solid rgba(155, 95, 23, 0.18);
  border-color: rgba(155, 95, 23, 0.38);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.compact-textarea {
  min-height: 92px;
}

.small-field {
  width: 92px;
  text-align: center;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

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

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

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

.helper {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
}

.ordered-list {
  counter-reset: section;
}

.ordered-list .criterion-row::before {
  counter-increment: section;
  content: counter(section);
}

.option-card {
  padding: 20px;
}

.option-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.option-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(155, 95, 23, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.option-title {
  margin: 0;
  font-size: 22px;
}

.option-summary {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.option-meta {
  margin-top: 16px;
}

.bullet-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.risk-list {
  margin-top: 14px;
}

.risk-list strong {
  color: var(--text);
}

.matrix-wrap,
.mapping-table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.matrix-score {
  min-width: 104px;
}

.result-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(155, 95, 23, 0.14), rgba(53, 106, 87, 0.08)),
    rgba(255, 251, 244, 0.9);
}

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.result-main {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1;
}

.result-secondary {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.decision-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.05fr 0.95fr;
}

.network {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 249, 242, 0.9);
}

.network-label {
  font-size: 14px;
  font-weight: 700;
  fill: #3b3022;
}

.network-note {
  font-size: 12px;
  fill: #786550;
}

.slider-row {
  display: grid;
  gap: 12px;
}

.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slider-value {
  font-weight: 800;
}

.slider {
  width: 100%;
}

.resource-card {
  padding: 18px;
}

.resource-card h3 {
  margin: 0;
  font-size: 19px;
}

.resource-card p,
.resource-card ul {
  color: var(--muted);
  line-height: 1.75;
}

.resource-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.alert-box {
  padding: 16px 18px;
  color: var(--text);
}

.alert-box strong {
  display: block;
  margin-bottom: 6px;
}

.alert-box.warn {
  border-color: rgba(185, 111, 29, 0.28);
  background: rgba(255, 239, 215, 0.82);
}

.alert-box.success {
  border-color: rgba(47, 109, 82, 0.28);
  background: rgba(234, 246, 239, 0.82);
}

.alert-box.danger {
  border-color: rgba(158, 58, 45, 0.24);
  background: rgba(249, 236, 233, 0.84);
}

.footer-note {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 1120px) {
  .hero-grid,
  .decision-columns,
  .science-grid,
  .grid-3,
  .options-grid,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .metrics,
  .grid-2,
  .input-grid,
  .input-grid-3,
  .input-grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
  }

  .hero,
  .panel,
  .metric,
  .hero-card,
  .option-card {
    padding: 18px;
  }

  .sticky-bar {
    position: static;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 36px;
  }
}
