:root {
  color-scheme: light;
  --bg: #efe7d8;
  --bg-2: #f8f3ea;
  --paper: rgba(255, 251, 245, 0.88);
  --paper-strong: #fffaf2;
  --line: rgba(12, 62, 54, 0.14);
  --text: #14352f;
  --muted: rgba(20, 53, 47, 0.64);
  --accent: #0f6b5d;
  --accent-2: #c96e34;
  --accent-soft: rgba(15, 107, 93, 0.12);
  --warn-soft: rgba(201, 110, 52, 0.12);
  --danger-soft: rgba(168, 49, 29, 0.12);
  --danger: #9d3f21;
  --shadow: 0 22px 60px rgba(72, 57, 28, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 107, 93, 0.16), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(201, 110, 52, 0.18), transparent 28%),
    linear-gradient(180deg, #f6f0e1 0%, var(--bg) 40%, #ede3d3 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.28)),
    repeating-linear-gradient(
      90deg,
      rgba(15, 107, 93, 0.03) 0,
      rgba(15, 107, 93, 0.03) 1px,
      transparent 1px,
      transparent 112px
    );
  mix-blend-mode: soft-light;
}

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

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

code,
pre {
  font-family: "SFMono-Regular", "Consolas", monospace;
}

.hidden {
  display: none !important;
}

.shell {
  width: min(1440px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(255, 251, 245, 0.92), rgba(255, 246, 235, 0.86)),
    rgba(255, 251, 245, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand__mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(150deg, rgba(15, 107, 93, 0.98), rgba(15, 107, 93, 0.72)),
    var(--accent);
  color: #fff7ed;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__title,
.panel__head h3,
.subpanel__head h4,
.gate h2,
.hero h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.brand__title {
  font-size: clamp(26px, 3vw, 38px);
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page {
  margin-top: 20px;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.92), rgba(255, 248, 238, 0.88)),
    var(--paper);
  box-shadow: var(--shadow);
}

.hero,
.panel,
.gate {
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 18px;
  overflow: hidden;
}

.hero__copy {
  max-width: 74ch;
}

.hero__text,
.gate p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.hero__meta {
  display: grid;
  gap: 12px;
}

.hero-stat,
.metric,
.mini-stat,
.result-card,
.account-card,
.campaign-item,
.sequence-card,
.stats-strip__item,
.code-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
}

.hero-stat,
.metric,
.result-card,
.account-card,
.campaign-item,
.sequence-card {
  padding: 16px;
}

.hero-stat__label,
.metric__label,
.stats-strip__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-stat strong,
.metric strong,
.stats-strip__value {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.2;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric {
  min-height: 122px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(244, 236, 221, 0.84)),
    rgba(255, 255, 255, 0.64);
}

.metric strong {
  font-size: 34px;
  font-family: var(--font-display);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.rail {
  display: grid;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.detail {
  display: grid;
  gap: 18px;
}

.panel__head,
.subpanel__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.panel__head h3,
.subpanel__head h4 {
  font-size: clamp(24px, 2.2vw, 30px);
}

.subpanel {
  padding-top: 8px;
  border-top: 1px solid rgba(20, 53, 47, 0.12);
}

.subpanel:first-child {
  padding-top: 0;
  border-top: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.form-grid--sequence {
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  align-items: center;
}

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

.field > span {
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid rgba(20, 53, 47, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(15, 107, 93, 0.56);
  box-shadow: 0 0 0 4px rgba(15, 107, 93, 0.12);
  background: #fffdf9;
}

.week-grid,
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.toggle,
.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(20, 53, 47, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.chip input,
.toggle input,
.choice input {
  margin: 0;
}

.choice {
  border-radius: 16px;
  align-items: flex-start;
}

.choice__meta {
  display: grid;
  gap: 4px;
}

.choice__meta strong {
  font-size: 14px;
}

.choice__meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.choice-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toggle--single {
  min-height: 100%;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease,
    background 160ms ease;
}

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

.button--primary {
  background: linear-gradient(135deg, var(--accent), #17806f);
  color: #fff9ef;
  box-shadow: 0 14px 28px rgba(15, 107, 93, 0.18);
}

.button--ghost {
  border-color: rgba(20, 53, 47, 0.14);
  background: rgba(255, 255, 255, 0.68);
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(20, 53, 47, 0.14);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flash {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 107, 93, 0.2);
  background: var(--accent-soft);
}

.flash--error {
  border-color: rgba(157, 63, 33, 0.22);
  background: var(--danger-soft);
}

.flash--warn {
  border-color: rgba(201, 110, 52, 0.22);
  background: var(--warn-soft);
}

.campaign-item {
  appearance: none;
  width: 100%;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.campaign-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 107, 93, 0.24);
}

.campaign-item.is-active {
  border-color: rgba(15, 107, 93, 0.34);
  background: linear-gradient(180deg, rgba(15, 107, 93, 0.08), rgba(255, 255, 255, 0.74));
}

.campaign-item__row,
.sequence-card__row,
.result-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.campaign-item__title,
.sequence-card__title {
  font-weight: 800;
  line-height: 1.4;
}

.campaign-item__meta,
.sequence-card__meta,
.account-card__meta,
.result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 107, 93, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag--warn {
  background: rgba(201, 110, 52, 0.12);
  color: var(--accent-2);
}

.tag--danger {
  background: rgba(157, 63, 33, 0.14);
  color: var(--danger);
}

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

.stats-strip__item {
  padding: 14px;
}

.sequence-card__body,
.code-block,
.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.code-block {
  padding: 6px 18px;
  overflow: auto;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(20, 53, 47, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.48);
}

.result-card--ok {
  border-color: rgba(15, 107, 93, 0.24);
}

.result-card--error {
  border-color: rgba(157, 63, 33, 0.24);
}

.account-card {
  display: grid;
  gap: 8px;
}

.account-card__title {
  font-weight: 800;
}

.account-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gate {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.gate__copy h2 {
  font-size: clamp(34px, 4vw, 48px);
  margin-bottom: 12px;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 107, 93, 0.34);
  outline-offset: 2px;
}

@media (max-width: 1200px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

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

  .topbar,
  .hero,
  .panel,
  .gate {
    padding: 18px;
  }

  .topbar,
  .hero {
    grid-template-columns: 1fr;
  }

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

  .rail {
    position: static;
  }

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

@media (max-width: 640px) {
  .brand__mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar__actions,
  .panel__head,
  .subpanel__head,
  .choice-row,
  .inline-actions {
    align-items: stretch;
  }

  .metrics,
  .stats-strip,
  .form-grid,
  .form-grid--sequence {
    grid-template-columns: 1fr;
  }

  .button,
  .status-pill,
  .badge {
    width: 100%;
    justify-content: center;
  }
}
