:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6874;
  --paper: #fbf7ef;
  --panel: #fffdf8;
  --line: #e5d7bf;
  --accent: #7c2d12;
  --accent-2: #164e63;
  --gold: #c0841a;
  --green: #166534;
  --red: #991b1b;
  --shadow: 0 20px 60px rgb(61 42 20 / 12%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgb(192 132 26 / 18%), transparent 30rem),
    linear-gradient(135deg, #f6ead7 0%, #f8f4ec 50%, #e9f3f5 100%);
  min-height: 100vh;
}

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

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

.hero {
  display: grid;
  gap: 18px;
  padding: 38px;
  background: linear-gradient(140deg, #2d1b13 0%, #66351e 55%, #164e63 100%);
  color: #fffaf1;
  border-radius: 30px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
}

.eyebrow,
.section-count {
  margin: 0;
  color: #ffd99f;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 8px;
}

h4 {
  margin-bottom: 8px;
  color: var(--accent-2);
}

.hero-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: #f5e7d3;
  font-size: 1.08rem;
}

.safety-card,
.warning,
.deadline-card,
.scope-strip {
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgb(255 255 255 / 11%);
}

.progress-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 580px;
  color: #ffe4ba;
}

.progress-track {
  flex: 1;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 20%);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #fef3c7);
  transition: width 180ms ease;
}

.scope-strip {
  margin: 18px 0;
  color: var(--accent-2);
  background: rgb(255 253 248 / 78%);
  border-color: var(--line);
}

.panel {
  display: grid;
  gap: 20px;
  padding: 32px;
  background: rgb(255 253 248 / 92%);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.muted,
.field-help {
  color: var(--muted);
}

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

.field-label {
  font-weight: 800;
}

.field-help {
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8c8ad;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffaf2;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgb(22 78 99 / 24%);
  border-color: var(--accent-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 900;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

.secondary {
  color: var(--accent-2);
  background: #dcedf1;
}

.link-button {
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.validation,
.missing {
  color: var(--red);
  font-weight: 800;
}

.review-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: #fffaf2;
}

.review-group summary {
  font-weight: 900;
  cursor: pointer;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 2fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid #eadcc5;
}

.review-label {
  font-weight: 800;
}

.review-value {
  color: var(--muted);
  white-space: pre-wrap;
}

.warning {
  color: #5f220c;
  background: #fff1d6;
  border-color: #e4b45f;
}

.deadline-card {
  color: #0f3c4c;
  background: #e7f4f7;
  border-color: #b8dce4;
}

.deadline-card p {
  margin-bottom: 0;
}

.summary-section {
  display: grid;
  gap: 18px;
  padding-top: 10px;
}

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

.claim-card,
.component-card,
.total-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffaf2;
}

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

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  background: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 900;
}

.likely .badge {
  background: var(--green);
}

.possible .badge,
.uncertain .badge {
  background: var(--gold);
}

.unlikely .badge,
.out_of_scope .badge {
  background: var(--muted);
}

.caution,
.caution-list {
  color: #7a3e06;
}

.component-value {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 900;
}

.total-card {
  color: #fffaf1;
  background: linear-gradient(135deg, var(--accent-2), #0f2e38);
  border: 0;
}

.total-card p {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 900;
}

.next-steps li {
  margin-bottom: 8px;
}

.markdown-export pre {
  overflow: auto;
  max-height: 460px;
  padding: 18px;
  border-radius: 18px;
  background: #17202a;
  color: #fffaf1;
  white-space: pre-wrap;
}

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

  .hero,
  .panel {
    padding: 22px;
    border-radius: 22px;
  }

  .progress-wrap,
  .actions,
  .claim-head {
    align-items: stretch;
    flex-direction: column;
  }

  .review-row,
  .claim-grid,
  .component-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
