:root {
  --bp: #14386b;
  --bpd: #0d2747;
  --acc: #0a8a72;
  --acc-soft: #e8f4f0;
  --bp-soft: #e9f0f9;
  --txt: #16202e;
  --muted: #5b6b7f;
  --muted-2: #7c8b9c;
  --muted-3: #9aa9bb;
  --line: #e2e6ec;
  --page: #dfe4ea;
  --card: #ffffff;
  --rad: 8px;
  --head: 'Libre Franklin', sans-serif;
  --body: 'IBM Plex Sans', sans-serif;
  --pdf-bg: #fceceb;
  --pdf-fg: #a3281f;
  --xlsx-bg: #e8f6ee;
  --xlsx-fg: #17663d;
  --docx-bg: #eaf2fe;
  --docx-fg: #1f4d93;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, #f6f8fb 0%, #e5eaf2 30%, transparent 50%),
    linear-gradient(165deg, #ecf0f6 0%, var(--page) 56%, #d6dde6 100%);
  color: var(--txt);
  font-family: var(--body);
  min-height: 100vh;
  padding: 24px 14px 34px;
}

#app {
  max-width: 940px;
  margin: 0 auto;
}

.storage-warning {
  margin-bottom: 10px;
  border: 1px solid #d9e6f1;
  background: #f2f7fa;
  color: #23455f;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.shell {
  border-radius: 14px;
  background: var(--card);
  box-shadow:
    0 1px 2px rgba(13, 39, 71, 0.09),
    0 14px 30px rgba(18, 33, 53, 0.08);
  border: 1px solid #edf0f4;
  overflow: hidden;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.monogram {
  width: 36px;
  height: 36px;
  border-radius: calc(var(--rad) - 2px);
  background: linear-gradient(140deg, var(--bp) 0%, var(--bpd) 100%);
  color: #fff;
  font-family: var(--head);
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
  letter-spacing: 0.04em;
}

.brand-name {
  font-family: var(--head);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.brand-tagline {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.shell-label {
  text-transform: uppercase;
  font-family: var(--head);
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-2);
  text-align: right;
}

.embed-plan-title {
  font-family: var(--head);
  font-size: 22px;
  font-weight: 800;
  color: var(--bpd);
  line-height: 1.1;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  gap: 2px;
}

.tab {
  position: relative;
  appearance: none;
  border: 0;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--head);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 10px 10px;
  cursor: pointer;
}

.tab.active {
  color: var(--bp);
  font-weight: 700;
  border-bottom-color: var(--bp);
}

.tab-dot {
  position: absolute;
  top: 8px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acc);
}

.content {
  padding: 22px 20px 24px;
}

.eyebrow {
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--head);
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--head);
  margin: 0;
}

.stage-headline {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  color: var(--bpd);
  margin-bottom: 10px;
}

.lead {
  margin: 0;
  color: var(--txt);
  line-height: 1.48;
}

.easy-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn,
.link-pill {
  border: 1px solid color-mix(in srgb, var(--bp) 36%, white 64%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 16%, white 84%) 0%, color-mix(in srgb, var(--bp) 24%, white 76%) 100%);
  color: var(--bpd);
  border-radius: 999px;
  font: 600 13px var(--head);
  padding: 8px 13px;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sample-download-btn {
  padding: 12px 20px;
  border-radius: 8px;
}

.pill-btn:hover,
.link-pill:hover {
  border-color: var(--bpd);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 22%, white 78%) 0%, color-mix(in srgb, var(--bp) 32%, white 68%) 100%);
}

.info-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bp-soft);
  color: var(--bp);
  display: inline-grid;
  place-items: center;
  font: 700 12px var(--head);
}

.step-cards {
  margin: 16px 0 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.step-num,
.group-num,
.stage-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--head);
  font-size: 12px;
  font-weight: 700;
  background: var(--bp-soft);
  color: var(--bp);
  flex: 0 0 24px;
}

.step-label {
  font-family: var(--head);
  font-size: 13px;
  font-weight: 600;
  color: var(--txt);
}

.small-gray {
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.46;
  margin: 0;
}

.divider {
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.subhead {
  font-size: 24px;
  color: var(--bpd);
  margin-bottom: 6px;
}

.stage-grid,
.resource-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stage-card,
.resource-card {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: #fff;
}

.stage-card {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.stage-card.active {
  border-color: color-mix(in srgb, var(--bp) 55%, white 45%);
  background: var(--bp-soft);
}

.stage-meta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.stage-title {
  font-family: var(--head);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stage-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.34;
}

.arrow {
  color: var(--muted-2);
  font-size: 18px;
}

.resource-card {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 8%, white 92%) 0%, color-mix(in srgb, var(--bp) 16%, white 84%) 100%);
  border-color: color-mix(in srgb, var(--bp) 26%, white 74%);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.resource-card:hover {
  border-color: var(--bpd);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 14%, white 86%) 0%, color-mix(in srgb, var(--bp) 24%, white 76%) 100%);
  transform: translateY(-1px);
}

.resource-meta h4 {
  font-family: var(--head);
  font-size: 15px;
  margin-bottom: 4px;
}

.resource-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.file-badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.file-PDF {
  background: var(--pdf-bg);
  color: var(--pdf-fg);
}

.file-XLSX {
  background: var(--xlsx-bg);
  color: var(--xlsx-fg);
}

.file-DOCX {
  background: var(--docx-bg);
  color: var(--docx-fg);
}

.resource-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.resource-right .arrow {
  color: var(--bpd);
  font-weight: 700;
}

.question-title {
  font-size: 30px;
  line-height: 1.1;
  color: var(--bpd);
}

.question-subtitle {
  margin-top: 8px;
  font-family: var(--head);
  font-size: 17px;
  font-weight: 700;
}

.question-long {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.stage-row {
  margin-top: 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.change-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.state-label {
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
}

.answer-counter {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.progress-wrap {
  margin: 10px 0 18px;
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--bp) 0%, var(--acc) 100%);
  width: 0;
}

.group {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 12px;
  margin-bottom: 12px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.group-title {
  font-size: 18px;
  color: var(--bpd);
}

.question-item {
  margin-bottom: 12px;
}

.question-item:last-child {
  margin-bottom: 0;
}

.question-label {
  display: block;
  font-family: var(--head);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.question-help {
  color: var(--muted-3);
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 6px;
}

.input,
.select,
.textarea,
.money {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  font: 400 14px var(--body);
  color: var(--txt);
  background: #fff;
}

.input,
.select,
.money input {
  height: 40px;
  padding: 0 10px;
}

.textarea {
  min-height: 82px;
  padding: 9px 10px;
  resize: vertical;
}

.money {
  display: flex;
  align-items: center;
  overflow: hidden;
}

.money span {
  color: var(--muted-2);
  font-weight: 700;
  padding-left: 10px;
}

.money input {
  border: 0;
  outline: 0;
  width: 100%;
}

.footer-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.primary-btn {
  border: 0;
  border-radius: var(--rad);
  background: linear-gradient(130deg, var(--bp) 0%, var(--bpd) 100%);
  color: #fff;
  font: 700 14px var(--head);
  padding: 10px 14px;
  cursor: pointer;
}

.primary-btn:hover {
  filter: brightness(1.06);
}

.theme-row {
  max-width: 940px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 0 4px;
}

.theme-btn {
  border: 1px solid color-mix(in srgb, var(--bp) 30%, white 70%);
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 10%, white 90%) 0%, color-mix(in srgb, var(--bp) 18%, white 82%) 100%);
  color: var(--bpd);
  cursor: pointer;
  font: 600 12px var(--head);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-btn:hover {
  border-color: var(--bpd);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bp) 18%, white 82%) 0%, color-mix(in srgb, var(--bp) 28%, white 72%) 100%);
}

.theme-btn.active {
  border-color: var(--bp);
  color: var(--bp);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.hidden {
  display: none;
}

.modal {
  width: min(760px, 96vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dce2ea;
  box-shadow: 0 28px 52px rgba(20, 28, 43, 0.26);
  padding: 18px;
  position: relative;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  cursor: pointer;
  position: absolute;
  right: 12px;
  top: 8px;
}

.modal h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--bpd);
}

.modal-helper {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

body[data-theme='meridian'] {
  background: var(--page);
}

body[data-theme='meridian'] .shell {
  border-radius: 10px;
  border-color: #d9e8ef;
  box-shadow:
    0 1px 2px rgba(0, 63, 93, 0.06),
    0 8px 20px rgba(0, 86, 125, 0.08);
}

body[data-theme='meridian'] .head {
  padding: 16px 18px;
}

body[data-theme='meridian'] .embed-plan-title {
  font-size: 20px;
  font-weight: 800;
}

body[data-theme='meridian'] .stage-headline {
  font-size: clamp(24px, 3.2vw, 30px);
  line-height: 1.15;
}

body[data-theme='meridian'] .subhead {
  font-size: 22px;
}

body[data-theme='meridian'] .question-title {
  font-size: 27px;
  line-height: 1.15;
}

body[data-theme='meridian'] .stage-card,
body[data-theme='meridian'] .resource-card,
body[data-theme='meridian'] .link-pill {
  background: #f2f7fa;
  color: #00567d;
}

body[data-theme='meridian'] .stage-card:hover,
body[data-theme='meridian'] .resource-card:hover,
body[data-theme='meridian'] .link-pill:hover {
  background: linear-gradient(0deg, rgba(0, 0, 0, .03), rgba(0, 0, 0, .03)), #f2f7fa;
  color: #00567d;
}

body[data-theme='meridian'] .stage-card .stage-title,
body[data-theme='meridian'] .resource-card h4,
body[data-theme='meridian'] .resource-card .arrow,
body[data-theme='meridian'] .link-pill {
  color: #00567d;
}

body[data-theme='meridian'] .pill-btn,
body[data-theme='meridian'] .primary-btn,
body[data-theme='meridian'] .theme-btn {
  background: #00567d;
  color: #ffffff;
  border: 1px solid #00567d;
  border-radius: 12px;
  padding: 11px 18px;
}

body[data-theme='meridian'] .pill-btn:hover,
body[data-theme='meridian'] .primary-btn:hover,
body[data-theme='meridian'] .theme-btn:hover {
  background: #003f5d;
  border-color: #003f5d;
  color: #ffffff;
}

body[data-theme='meridian'] .pill-btn .info-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.code-block {
  margin: 0;
  padding: 14px;
  border-radius: var(--rad);
  background: #0f1724;
  color: #dce7f9;
  font: 400 13px/1.45 'IBM Plex Mono', monospace;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .stage-grid,
  .resource-grid,
  .step-cards {
    grid-template-columns: 1fr;
  }

  .head {
    align-items: flex-start;
  }

  .question-title {
    font-size: 25px;
  }
}
