:root {
  color-scheme: dark;
  --ink: #ecf7f4;
  --muted: #8fa9a6;
  --faint: #5f7777;
  --surface: #0b1a25;
  --surface-2: #102532;
  --surface-3: #15303c;
  --line: rgba(166, 219, 205, 0.16);
  --green: #43e59c;
  --green-strong: #1bcf82;
  --green-dim: rgba(67, 229, 156, 0.12);
  --amber: #ffc768;
  --amber-dim: rgba(255, 199, 104, 0.13);
  --blue: #7ed6ff;
  --red: #ff7d87;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% -10%, rgba(36, 184, 130, 0.18), transparent 31rem),
    radial-gradient(circle at 95% 15%, rgba(23, 101, 130, 0.18), transparent 28rem),
    #07131f;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .13;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); }

.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 19, 31, .84);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: #061711;
  font-weight: 900;
  letter-spacing: -.08em;
  box-shadow: 0 0 28px rgba(67,229,156,.26);
}
.brand-word { font-size: 18px; font-weight: 780; letter-spacing: .06em; }
.brand-sub { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

.user-tools { display: flex; align-items: center; gap: 14px; }
.user-chip { text-align: right; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }

.page { width: min(1240px, 92vw); margin: 0 auto; padding: 54px 0 90px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 760; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { max-width: 870px; margin: 13px 0 15px; font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.055em; }
.hero > p { max-width: 700px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 38px 0; }
.metric { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(14, 35, 46, .58); }
.metric strong { display: block; margin-bottom: 5px; font-size: 25px; }
.metric span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 54px 0 18px; }
.section-head h2 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.section-head p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.5; }

.campaign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr)); gap: 18px; }
.campaign-card {
  position: relative;
  overflow: hidden;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(16, 42, 52, .92), rgba(9, 26, 37, .92));
  box-shadow: var(--shadow);
}
.campaign-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -110px;
  top: -140px;
  border-radius: 50%;
  background: rgba(67, 229, 156, .12);
  filter: blur(2px);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand-pill, .state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.state-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.state-pill.active, .state-pill.validated, .state-pill.complete { color: var(--green); background: var(--green-dim); }
.state-pill.awaiting_review, .state-pill.awaiting_validation { color: var(--amber); background: var(--amber-dim); }
.state-pill.ready, .state-pill.action_in_progress { color: var(--blue); }
.state-pill.locked { color: var(--faint); }
.state-pill.review_changes { color: var(--red); }
.campaign-card h3 { position: relative; z-index: 1; margin: 22px 0 10px; font-size: 27px; letter-spacing: -.03em; }
.campaign-card .question { min-height: 76px; color: var(--muted); line-height: 1.52; }

.progress-row { display: flex; align-items: center; gap: 12px; margin: 22px 0 25px; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07); }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-strong), #8df4c5); box-shadow: 0 0 16px rgba(67,229,156,.3); }
.progress-row span { min-width: 92px; color: var(--muted); font-size: 12px; text-align: right; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255,255,255,.04);
  font-weight: 730;
  font-size: 13px;
  letter-spacing: .015em;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(117,240,191,.5); background: rgba(255,255,255,.08); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(67,229,156,.28); outline-offset: 2px; }
.btn:disabled { cursor: not-allowed; opacity: .34; }
.btn-primary { border-color: transparent; color: #051711; background: var(--green); }
.btn-primary:hover:not(:disabled) { background: #6af0b3; }
.btn-amber { color: #211704; border-color: transparent; background: var(--amber); }
.btn-danger { color: #2b080b; border-color: transparent; background: var(--red); }
.btn-quiet { min-height: 34px; padding: 0 11px; color: var(--muted); }
.btn-wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.breadcrumbs { margin-bottom: 26px; }
.breadcrumbs button { padding: 0; border: 0; color: var(--muted); background: none; }
.breadcrumbs button:hover { color: var(--green); }
.campaign-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 34px; }
.campaign-hero h1 { max-width: 860px; margin: 11px 0 13px; font-size: clamp(38px, 5vw, 61px); line-height: 1.02; letter-spacing: -.05em; }
.campaign-question { max-width: 860px; color: var(--muted); font-size: 17px; line-height: 1.58; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; min-width: 190px; }

.workflow { margin-top: 48px; }
.workflow-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 17px; }
.workflow-head h2 { margin: 0; font-size: 24px; }
.workflow-head p { margin: 4px 0 0; color: var(--muted); }
.workflow-line { display: grid; gap: 13px; }
.step-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 29, 40, .84);
}
.step-card.current { border-color: rgba(67,229,156,.38); box-shadow: inset 3px 0 0 var(--green); }
.step-card.locked { opacity: .58; }
.step-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  color: var(--green);
  font-size: 18px;
  font-weight: 850;
}
.step-copy h3 { margin: 0 0 6px; font-size: 17px; }
.step-copy p { max-width: 700px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.48; }
.step-meta { display: flex; align-items: center; gap: 11px; margin-top: 11px; }
.step-meta small { color: var(--faint); }
.step-actions { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 8px; }
.step-actions .btn { padding: 0 13px; }
.btn.action-ready:not(:disabled) { color: var(--blue); border-color: rgba(126,214,255,.34); }
.btn.review-ready:not(:disabled) { color: var(--amber); border-color: rgba(255,199,104,.38); }
.btn.validate-ready:not(:disabled) { color: var(--green); border-color: rgba(67,229,156,.38); }

.auth-wrap { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(36px, 7vw, 92px); border-right: 1px solid var(--line); }
.auth-story h1 { max-width: 760px; margin: 26px 0 20px; font-size: clamp(44px, 7vw, 84px); line-height: .96; letter-spacing: -.06em; }
.auth-story p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.auth-flow { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 36px; }
.auth-flow span { padding: 8px 11px; border-radius: 9px; background: var(--green-dim); color: var(--green); font-size: 12px; font-weight: 760; letter-spacing: .05em; }
.auth-panel { display: grid; place-items: center; padding: 34px; background: rgba(4, 14, 23, .52); }
.auth-card { width: min(430px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h2 { margin: 7px 0 8px; font-size: 29px; letter-spacing: -.035em; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { color: #bdd0cd; font-size: 12px; font-weight: 690; letter-spacing: .035em; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255,255,255,.035);
}
.field textarea { min-height: 118px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #607778; }
.field-hint { margin-top: -2px; color: var(--faint); font-size: 11px; line-height: 1.45; }
.form-error { min-height: 20px; margin: 8px 0; color: var(--red); font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; background: rgba(2,9,15,.78); backdrop-filter: blur(8px); }
.modal { width: min(760px, 100%); max-height: min(880px, 92vh); overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: #0b1c27; box-shadow: 0 36px 100px rgba(0,0,0,.56); }
.modal.wide { width: min(1020px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 23px 25px 19px; border-bottom: 1px solid var(--line); background: rgba(11,28,39,.96); backdrop-filter: blur(12px); }
.modal-head h2 { margin: 5px 0 0; font-size: 24px; }
.modal-body { padding: 25px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.icon-button { width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; font-size: 22px; }
.icon-button:hover { color: var(--ink); background: rgba(255,255,255,.06); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.detail-box { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.detail-box span { display: block; margin-bottom: 6px; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }
.detail-box strong { font-size: 14px; }
.summary-box { margin: 18px 0; padding: 19px; border-left: 3px solid var(--green); border-radius: 0 12px 12px 0; background: var(--green-dim); line-height: 1.6; }
.json-view { overflow: auto; max-height: 350px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #06121b; color: #b6d8d0; font: 12px/1.58 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.evidence-list { display: grid; gap: 9px; margin-top: 14px; }
.evidence-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.evidence-item strong { display: block; margin-bottom: 5px; font-size: 13px; }
.evidence-item span { color: var(--muted); font-size: 11px; }
.evidence-item a { font-size: 12px; text-decoration: none; }

.results-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 17px 0 25px; }
.result-card { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.result-card strong { display: block; margin-bottom: 5px; font-size: 25px; }
.result-card span { color: var(--muted); font-size: 11px; line-height: 1.4; text-transform: uppercase; letter-spacing: .07em; }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 170px minmax(90px, 1fr) 48px; align-items: center; gap: 12px; font-size: 12px; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.notice { padding: 15px 17px; border: 1px solid rgba(255,199,104,.25); border-radius: 12px; color: #ebd19d; background: var(--amber-dim); line-height: 1.5; }
.limitation-list { color: var(--muted); line-height: 1.55; }

.empty { padding: 42px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.loading { display: grid; min-height: 100vh; place-items: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border: 3px solid rgba(255,255,255,.09); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: grid; gap: 10px; }
.toast { max-width: 410px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 11px; background: #0e2630; box-shadow: var(--shadow); font-size: 13px; animation: rise .18s ease-out; }
.toast.error { border-left-color: var(--red); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 920px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-story { min-height: 420px; border-right: 0; border-bottom: 1px solid var(--line); }
  .campaign-hero { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: row; min-width: 0; }
  .step-card { grid-template-columns: 52px minmax(0, 1fr); }
  .step-actions { grid-column: 1 / -1; }
  .results-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .topbar { padding: 0 18px; }
  .brand-sub, .user-chip { display: none; }
  .page { width: min(100% - 32px, 1240px); padding-top: 35px; }
  .metrics { grid-template-columns: 1fr; }
  .section-head, .workflow-head { align-items: start; flex-direction: column; }
  .campaign-card { padding: 21px; }
  .step-card { grid-template-columns: 1fr; gap: 13px; }
  .step-number { width: 42px; height: 42px; }
  .step-actions { grid-template-columns: 1fr; }
  .auth-story { padding: 32px 24px; }
  .auth-panel { padding: 20px; }
  .auth-card { padding: 24px; }
  .detail-grid, .results-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px minmax(70px, 1fr) 35px; }
}

