:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-muted: #f9fbfd;
  --text: #0c1733;
  --muted: #60708e;
  --border: #d6deea;
  --border-strong: #aebbd0;
  --blue: #1155d9;
  --blue-dark: #0b3fa7;
  --blue-soft: #eaf1ff;
  --green: #0b8f5b;
  --green-soft: #e8f8ef;
  --amber: #b66b00;
  --amber-soft: #fff4df;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(22, 34, 59, 0.08);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(17, 85, 217, 0.22);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 260px),
    var(--bg);
  color: var(--text);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.85rem clamp(1rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-name,
.brand-subtitle,
.section-kicker,
.microcopy,
.page-footer,
.status-line,
.field small {
  margin: 0;
}

.brand-name {
  font-size: clamp(1rem, 2vw, 1.22rem);
  font-weight: 800;
  line-height: 1.2;
}

.brand-subtitle {
  margin-top: 0.14rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.top-actions,
.form-actions,
.export-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0.68rem 1rem;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0;
}

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

.primary-button:hover {
  background: var(--blue-dark);
}

.ghost-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--blue);
}

.ghost-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.wide-button {
  flex: 1 1 auto;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(440px, 1.1fr);
  gap: 1rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 2.6vw, 2rem);
}

.offer-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(420px, 1.25fr);
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.45rem);
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intake-panel,
.output-panel {
  padding: clamp(1rem, 2vw, 1.45rem);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-kicker {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 680px;
  margin-top: 0.28rem;
  font-size: clamp(1.28rem, 2.6vw, 1.9rem);
  line-height: 1.16;
}

h2 {
  margin-top: 0.28rem;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

h3 {
  font-size: 1rem;
}

.microcopy {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
}

form,
.field {
  display: grid;
  gap: 0.78rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.82rem;
}

.field span {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  color: #1c2a44;
  font-size: 0.9rem;
  font-weight: 750;
}

.field strong {
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 0.96rem;
}

input,
select {
  min-height: 44px;
  padding: 0 0.78rem;
}

textarea {
  min-height: 94px;
  resize: vertical;
  padding: 0.78rem;
  line-height: 1.45;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--blue);
}

.field small {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-actions {
  margin-top: 0.4rem;
}

.output-heading {
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.score-card {
  min-width: 152px;
  text-align: right;
}

.score-number {
  color: var(--green);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 850;
  line-height: 1;
}

.score-total {
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}

.score-label,
.impact-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
}

.score-label.good,
.impact-pill.strong {
  background: var(--green-soft);
  color: var(--green);
}

.score-label.weak {
  background: #fdecec;
  color: var(--danger);
}

.score-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.score-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 220ms ease;
}

.output-section {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--border);
}

.output-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.checklist,
.compact-list,
.action-list,
.plan-list {
  margin: 0;
  padding-left: 1.22rem;
}

.checklist li,
.compact-list li,
.action-list li,
.plan-list li {
  margin: 0.42rem 0;
  line-height: 1.45;
}

.checklist li {
  list-style: square;
}

.checklist li.complete {
  color: var(--green);
}

.two-column-output {
  display: grid;
  grid-template-columns: minmax(210px, 0.86fr) minmax(260px, 1.14fr);
  gap: 1rem;
}

.positioning-text {
  margin: 0.55rem 0 0;
  color: #1d2c46;
  line-height: 1.55;
}

.offer-copy,
.offer-note,
.price-card p {
  color: var(--muted);
  line-height: 1.5;
}

.offer-copy {
  max-width: 620px;
  margin: 0.65rem 0 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 1rem;
}

.price-card h3 {
  font-size: 0.95rem;
}

.price-card p {
  min-height: 4.2rem;
  margin: 0.55rem 0 0.8rem;
  font-size: 0.9rem;
}

.price-card strong {
  color: var(--green);
  font-size: 1.05rem;
}

.offer-note {
  grid-column: 2;
  margin: -0.2rem 0 0;
  font-size: 0.88rem;
}

.plan-list li strong {
  color: var(--blue);
}

.export-box {
  display: grid;
  gap: 0.75rem;
  padding-top: 1.05rem;
}

#markdownOutput {
  min-height: 220px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
}

.status-line {
  min-height: 1.3rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0 2rem 2rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.page-footer a {
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .offer-panel {
    grid-template-columns: 1fr;
  }

  .offer-note {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0.75rem;
  }

  .field-grid,
  .two-column-output,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .output-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-card {
    width: 100%;
    text-align: left;
  }

  .form-actions,
  .export-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .page-footer {
    padding: 0 0.9rem 1.5rem;
  }
}
