:root {
  color-scheme: light;
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-soft: #f8f6ef;
  --ink: #161b1a;
  --muted: #65706a;
  --faint: #8d938e;
  --line: #e2ded3;
  --line-strong: #cac2b3;
  --sidebar: #000000;
  --sidebar-soft: #141414;
  --accent: #0f7b63;
  --accent-strong: #095c4a;
  --blue: #345f9b;
  --amber: #b87925;
  --rose: #a64c5b;
  --danger: #a13d3d;
  --shadow: 0 18px 45px rgba(38, 33, 24, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background:
    repeating-linear-gradient(90deg, rgba(22, 27, 26, 0.025) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(184, 121, 37, 0.08), transparent 340px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #edf4ef;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 22px 18px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: flex-start;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.auth-brand {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 12px;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: auto;
  /* SVG has empty viewBox space on the left; this nudge aligns the
     visible "healf." glyphs with the strapline below. */
  margin-left: -18px;
  width: 132px;
}

.brand-subtitle {
  color: rgba(237, 244, 239, 0.58);
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  align-items: center;
  background: #f2d9a9;
  border-radius: 8px;
  color: #231b12;
  display: inline-flex;
  font-size: 18px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.brand strong,
.auth-brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.brand small,
.auth-brand small {
  color: rgba(237, 244, 239, 0.66);
  display: block;
  font-size: 12px;
  margin-top: 1px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.side-nav a {
  border-radius: 7px;
  color: rgba(237, 244, 239, 0.82);
  display: block;
  font-weight: 700;
  padding: 12px;
}

.side-nav a:hover {
  background: var(--sidebar-soft);
  color: #fff;
  text-decoration: none;
}

.sidebar-footer {
  border-top: 1px solid rgba(237, 244, 239, 0.12);
  color: rgba(237, 244, 239, 0.72);
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 18px 4px 0;
}

.sidebar-footer span {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer a {
  color: #d9f3e4;
  font-weight: 700;
}

.app-main {
  margin: 0 auto;
  max-width: 1280px;
  padding: 34px 42px 56px;
  width: 100%;
}

.auth-main {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 28px;
}

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

h1 {
  font-size: 42px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
}

p {
  color: var(--muted);
  margin: 7px 0 0;
}

.eyebrow {
  color: var(--amber);
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.page-heading {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-masthead {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.dashboard-masthead h1 {
  max-width: 720px;
}

.dashboard-masthead p {
  max-width: 680px;
}

.actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 26px;
}

.metric-grid article,
.panel,
.table-section,
.auth-panel,
.decision-card,
.experiment-card,
.campaign-tile,
.empty-state {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.decision-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  margin-bottom: 16px;
}

.decision-card {
  background:
    linear-gradient(135deg, rgba(15, 123, 99, 0.92), rgba(17, 22, 21, 0.96)),
    #111615;
  color: #fff;
  min-height: 252px;
  overflow: hidden;
  padding: 28px;
  position: relative;
}

.decision-card::after {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 12px);
  bottom: 0;
  content: "";
  opacity: 0.32;
  position: absolute;
  right: 0;
  top: 0;
  width: 38%;
}

.decision-card h2,
.decision-card p,
.decision-card .signal-row {
  position: relative;
  z-index: 1;
}

.decision-card h2 {
  color: #fff;
  font-size: 22px;
  margin: 0 0 14px;
}

.decision-card p {
  color: rgba(255, 255, 255, 0.74);
  max-width: 520px;
}

.card-kicker {
  color: #f2d9a9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  position: relative;
  text-transform: uppercase;
  z-index: 1;
}

.hero-number {
  color: #fff;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
  position: relative;
  z-index: 1;
}

.signal-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
  max-width: 560px;
}

.signal-row span {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.68);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.signal-row strong {
  color: #fff;
  font-size: 20px;
}

.experiment-card {
  min-height: 252px;
  padding: 24px;
}

.experiment-card .card-kicker {
  color: var(--blue);
}

.split-meter {
  background: #ece7db;
  border-radius: 8px;
  display: flex;
  height: 92px;
  margin: 18px 0 20px;
  overflow: hidden;
}

.split-meter div {
  align-items: flex-end;
  display: flex;
  padding: 12px;
}

.split-meter div:first-child {
  background: var(--accent);
  color: #fff;
}

.split-meter div:last-child {
  background: var(--amber);
  color: #fff;
  min-width: 96px;
}

.split-meter span {
  font-size: 12px;
  font-weight: 900;
}

.compact-stats {
  display: grid;
  gap: 10px;
  margin: 0;
}

.compact-stats div {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
}

.compact-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-stats dd {
  color: var(--ink);
  font-weight: 900;
  margin: 0;
}

.metric-grid article {
  min-height: 112px;
  padding: 18px;
  position: relative;
}

.metric-grid article::before {
  background: var(--amber);
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 18px;
  position: absolute;
  right: 18px;
  top: 0;
}

.metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.metric-grid strong {
  color: var(--ink);
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric-grid small {
  color: var(--faint);
  display: block;
  font-size: 13px;
  margin-top: 10px;
}

.table-section {
  margin-bottom: 24px;
  overflow: hidden;
}

.campaign-board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.campaign-tile {
  color: var(--ink);
  display: grid;
  min-height: 230px;
  padding: 22px;
  text-decoration: none;
}

.campaign-tile:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  text-decoration: none;
}

.campaign-tile .pill {
  justify-self: start;
}

.campaign-tile h2 {
  font-size: 24px;
  margin-top: 22px;
}

.campaign-tile p {
  margin-bottom: 20px;
}

.empty-state {
  padding: 28px;
}

.section-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}

.section-title p {
  font-size: 13px;
}

.section-title.compact {
  border-bottom: 0;
  padding: 0 0 14px;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 20px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f2eee4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: #26312e;
}

td span {
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  background: #e5f3ee;
  border: 1px solid #c7e3d8;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
}

button,
.button-link {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 10px 15px;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.button-link:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

.button-link.secondary {
  background: #fffaf0;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-link.secondary:hover {
  background: var(--surface-soft);
}

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

.panel,
.auth-panel {
  padding: 22px;
}

.campaign-form {
  margin-bottom: 24px;
  max-width: 880px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.campaign-form .form-section {
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}

.campaign-form .form-section:last-of-type {
  border-bottom: 0;
}

.campaign-form .form-section-head {
  margin-bottom: 18px;
}

.campaign-form .form-section-head .eyebrow {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.campaign-form .form-section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.campaign-form .form-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.campaign-form .form-section-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}

.campaign-form .form-section-body label {
  align-content: start;
}

.campaign-form .form-section-body .span-2 { grid-column: span 2; }
.campaign-form .form-section-body .span-3 { grid-column: 1 / -1; }

.campaign-form .form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 18px 28px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}

.campaign-form .form-actions button {
  width: auto;
  min-width: 180px;
  padding: 11px 24px;
}

.campaign-form[data-campaign-type="ongoing_note"] .field--discount,
.campaign-form[data-campaign-type="discount_code"] .field--ongoing {
  display: none;
}

.campaign-form .field-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.campaign-type-hint { display: none; }

.campaign-form[data-campaign-type="ongoing_note"] .campaign-type-hint[data-type-hint="ongoing_note"],
.campaign-form[data-campaign-type="discount_code"] .campaign-type-hint[data-type-hint="discount_code"] {
  display: block;
}

@media (max-width: 720px) {
  .campaign-form .form-section-body {
    grid-template-columns: 1fr;
  }
  .campaign-form .form-section-body .span-2,
  .campaign-form .form-section-body .span-3 {
    grid-column: auto;
  }
}

.chip-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  cursor: text;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.chip-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 118, 95, 0.14);
}

.chip-list {
  display: contents;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 11px;
  background: #e5f3ee;
  color: var(--accent-strong);
  border-radius: 999px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.chip-label {
  white-space: nowrap;
}

.chip-remove {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  opacity: 0.6;
  min-height: 0;
  font-weight: 700;
}

.chip-remove:hover {
  background: rgba(9, 92, 74, 0.14);
  opacity: 1;
}

.chip-input-entry {
  flex: 1 1 160px;
  min-width: 160px;
  border: none;
  outline: none;
  padding: 4px 2px;
  min-height: 28px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  box-shadow: none;
  width: auto;
}

.chip-input-entry::placeholder {
  color: var(--faint);
  text-transform: none;
  font-family: inherit;
}

.chip-input-entry:focus {
  box-shadow: none;
  border: none;
}

.auth-panel {
  max-width: 440px;
  width: 100%;
}

.auth-panel .auth-brand {
  color: var(--ink);
  margin-bottom: 26px;
}

.auth-panel .auth-brand small {
  color: var(--muted);
}

.auth-panel .form-grid {
  grid-template-columns: 1fr;
  margin-top: 20px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 118, 95, 0.14);
  outline: none;
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.import-panel {
  margin-bottom: 24px;
}

.filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 240px auto;
  margin-bottom: 18px;
}

.import-panel .filters {
  margin-bottom: 0;
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  position: fixed;
  right: 24px;
  top: 24px;
  width: min(360px, calc(100vw - 48px));
  z-index: 1000;
}

.flash {
  animation: toast-in 0.22s ease;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(22, 27, 26, 0.12), 0 2px 6px rgba(22, 27, 26, 0.05);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px 14px;
  pointer-events: auto;
}

.flash.success { border-left-color: var(--accent); }
.flash.error { border-left-color: var(--danger); color: var(--ink); }
.flash.info { border-left-color: var(--blue); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 20px;
  }

  .sidebar-footer {
    display: none;
  }

  .metric-grid,
  .decision-grid,
  .campaign-board,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-main,
  .auth-main {
    padding: 22px;
  }

  .page-heading,
  .dashboard-masthead,
  .actions,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .side-nav,
  .metric-grid,
  .decision-grid,
  .campaign-board,
  .form-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 28px;
  }
}

/* Design handoff refresh: dense analytics surface with Healf/RoboQuill accents. */
:root {
  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-soft: #f1f3f4;
  --ink: #0c1116;
  --muted: #5b6470;
  --faint: #8a939e;
  --line: #e6e8eb;
  --line-strong: #d2d7dd;
  --sidebar: #0f1714;
  --sidebar-soft: #19231f;
  --accent: #0e7c66;
  --accent-strong: #095c4a;
  --accent-soft: #dbf0e9;
  --amber: #b6792a;
  --amber-soft: #fbf1dc;
  --danger: #b8473a;
  --danger-soft: #f7dfdc;
  --shadow: 0 1px 2px rgba(12, 17, 22, 0.05);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

html,
body {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 14px;
}

.brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 4px 16px;
}

.brand-logo {
  width: 118px;
}

.brand-subtitle,
.sidebar-footer small {
  color: rgba(237, 244, 239, 0.54);
  font-size: 11px;
  font-weight: 600;
}

.side-nav {
  gap: 2px;
  margin-top: 18px;
}

.side-nav a {
  align-items: center;
  border-radius: 6px;
  color: rgba(237, 244, 239, 0.78);
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
  min-height: 34px;
  padding: 7px 8px;
}

.side-nav a.active,
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-icon {
  color: rgba(237, 244, 239, 0.44);
  font-family: var(--mono);
  font-size: 10px;
  width: 18px;
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
  gap: 4px;
  padding-top: 14px;
}

.sidebar-footer a {
  color: #d6f2e6;
  font-size: 12px;
}

.app-main {
  margin: 0;
  max-width: none;
  padding: 0;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 24px;
}

.breadcrumbs {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.breadcrumbs strong {
  color: var(--ink);
  font-weight: 650;
}

.sync-state {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 11px;
  gap: 7px;
}

.sync-state span {
  background: #22a06b;
  border-radius: 999px;
  height: 7px;
  width: 7px;
}

.content-wrap {
  padding: 22px 24px 32px;
}

h1 {
  font-size: 24px;
  font-weight: 650;
  line-height: 1.15;
}

h2 {
  font-size: 14px;
  font-weight: 650;
}

p {
  color: var(--muted);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.page-heading,
.dashboard-masthead {
  align-items: flex-end;
  margin-bottom: 18px;
}

.page-heading p,
.dashboard-masthead p {
  font-size: 13px;
  max-width: 760px;
}

.actions {
  flex-wrap: wrap;
}

.page-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.page-tabs a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 0;
  text-decoration: none;
}

.page-tabs a.active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.page-tabs span,
.mono {
  font-family: var(--mono);
}

.page-tabs span {
  color: var(--faint);
  font-size: 11px;
  margin-left: 4px;
}

.metric-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.metric-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-grid article,
.panel,
.table-section,
.auth-panel,
.campaign-tile,
.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-grid article {
  min-height: 104px;
  padding: 13px 14px;
}

.metric-grid article::before {
  display: none;
}

.metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-transform: none;
}

.metric-grid strong {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.1;
}

.metric-grid small {
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 7px;
}

.metric-hero {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff;
}

.metric-hero span,
.metric-hero small,
.metric-hero strong {
  color: #fff;
}

.metric-hero small {
  opacity: 0.78;
}

.analytics-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  margin-bottom: 14px;
}

.chart-panel {
  padding: 14px;
}

.section-title {
  padding: 13px 14px;
}

.section-title.compact {
  padding: 0 0 12px;
}

.section-title h2 {
  font-size: 14px;
}

.section-title p {
  font-size: 12px;
}

.rate-chart {
  display: grid;
  gap: 14px;
}

.rate-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 150px minmax(120px, 1fr) 64px;
}

.rate-row strong {
  display: block;
  font-size: 13px;
}

.rate-row span {
  color: var(--faint);
  display: block;
  font-size: 11.5px;
}

.bar-track {
  background: var(--surface-soft);
  border-radius: 6px;
  height: 26px;
  overflow: hidden;
}

.bar-track span {
  background: var(--accent);
  height: 100%;
}

.rate-row.muted .bar-track span {
  background: var(--faint);
}

.rate-row b {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.funnel {
  display: grid;
  gap: 10px;
}

.funnel div {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 32px;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
}

.funnel span {
  background: var(--accent);
  bottom: 0;
  left: 0;
  opacity: 0.22;
  position: absolute;
  top: 0;
}

.funnel strong,
.funnel b {
  color: var(--ink);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.funnel b {
  font-family: var(--mono);
  font-weight: 600;
}

.split-meter.dense {
  background: var(--surface-soft);
  height: 76px;
  margin: 6px 0 0;
}

.split-meter.dense div:first-child {
  background: var(--accent);
}

.split-meter.dense div:last-child {
  background: var(--amber);
}

.campaign-board {
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.campaign-tile {
  min-height: 210px;
  padding: 16px;
}

.campaign-tile h2 {
  font-size: 20px;
  margin-top: 18px;
}

.tile-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.tile-topline .mono {
  color: var(--faint);
  font-size: 11px;
}

.compact-stats div {
  border-top-color: var(--line);
}

.compact-stats dt {
  color: var(--muted);
  font-weight: 600;
}

.compact-stats dd {
  font-family: var(--mono);
  font-weight: 650;
}

.table-section {
  margin-bottom: 18px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  font-size: 12.5px;
  min-width: 860px;
}

th,
td {
  border-bottom-color: var(--line);
  padding: 10px 14px;
}

th {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

td {
  color: var(--ink);
}

.table-primary {
  display: block;
  font-weight: 650;
}

.table-sub {
  color: var(--faint);
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 2px;
}

.text-right {
  text-align: right;
}

.good {
  color: var(--accent);
  font-weight: 650;
}

.pill {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
}

.status-active,
.group-treatment,
.note-sent {
  background: var(--accent-soft);
  border-color: #bfdfd3;
  color: var(--accent);
}

.status-paused,
.status-draft,
.note-pending,
.note-sending,
.note-sending_unknown {
  background: var(--amber-soft);
  border-color: #ead8ae;
  color: var(--amber);
}

.status-archived,
.group-holdout,
.group-suppressed,
.note-not_applicable,
.note-suppressed_previous_note {
  background: var(--surface-soft);
  color: var(--muted);
}

.note-failed,
.flash.error {
  background: var(--danger-soft);
  border-color: #ecc2bd;
  color: var(--danger);
}

button,
.button-link {
  background: var(--ink);
  border-color: var(--ink);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 34px;
  padding: 7px 12px;
}

button:hover,
.button-link:hover {
  background: #202830;
  border-color: #202830;
}

.button-link.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-link.secondary:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.panel,
.auth-panel {
  padding: 16px;
}

.campaign-form {
  gap: 12px;
  margin-bottom: 14px;
}

label {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0;
}

input,
select,
textarea {
  border-color: var(--line-strong);
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
}

.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-template-columns: 1fr 240px auto;
  margin-bottom: 14px;
  padding: 10px;
}

.import-filters {
  border: 0;
  padding: 0;
}

.flash {
  border-radius: 6px;
}

.auth-main {
  background: var(--bg);
}

.auth-panel {
  max-width: 420px;
}

.brand-mark {
  background: var(--ink);
  color: #fff;
}

@media (max-width: 1180px) {
  .metric-grid-six,
  .campaign-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: none;
  }

  .content-wrap {
    padding: 18px;
  }

  .metric-grid,
  .metric-grid-six,
  .campaign-board,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .content-wrap,
  .auth-main {
    padding: 16px;
  }

  .page-heading,
  .dashboard-masthead,
  .actions,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .page-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .side-nav,
  .metric-grid,
  .metric-grid-six,
  .campaign-board,
  .form-grid,
  .filters,
  .rate-row {
    grid-template-columns: 1fr;
  }

  .rate-row b {
    text-align: left;
  }
}

.panel-footnote {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: sticky;
  top: 12px;
  z-index: 5;
}

.doc-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.doc-nav a:hover {
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}

.doc-panel {
  max-width: 880px;
  padding: 28px 32px;
  margin-bottom: 18px;
}

.doc-panel + .doc-panel {
  margin-top: 0;
}

.doc-panel-head {
  margin-bottom: 18px;
}

.doc-panel-head .eyebrow {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.doc-panel-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc-panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.doc-panel p {
  font-size: 14.5px;
  line-height: 1.62;
  color: #2c332f;
  margin: 0 0 12px;
}

.doc-panel p:last-child {
  margin-bottom: 0;
}

.doc-lead {
  font-size: 15.5px !important;
  line-height: 1.65 !important;
  color: var(--ink) !important;
}

.doc-tldr-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.doc-tldr-grid > div {
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: 10px;
}

.doc-tldr-grid .eyebrow.accent {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.doc-tldr-grid p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
}

.doc-glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
}

.doc-glossary > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.doc-glossary > div:last-child,
.doc-glossary > div:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

.doc-glossary dt {
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
  margin-bottom: 4px;
}

.doc-glossary dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.doc-glossary code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--surface-soft);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink);
}

.doc-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.doc-steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 56px;
  margin: 0;
}

.doc-steps > li + li {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.doc-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 22px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.doc-steps > li:first-child::before {
  top: 0;
}

.doc-steps h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.doc-bullets {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.doc-bullets li {
  margin-bottom: 6px;
  color: #2c332f;
  font-size: 14px;
  line-height: 1.55;
}

.doc-callout {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--amber);
  background: #fdf5e6;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4a3c1f;
}

.doc-faq details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.doc-faq details:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 8px;
}

.doc-faq summary::-webkit-details-marker { display: none; }

.doc-faq summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.doc-faq details[open] summary::before {
  content: "−";
}

.doc-faq details > *:not(summary) {
  margin-top: 12px;
  margin-left: 32px;
}

.doc-faq p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 720px) {
  .doc-tldr-grid,
  .doc-glossary {
    grid-template-columns: 1fr;
  }
  .doc-panel {
    padding: 20px;
  }
  .doc-nav {
    position: static;
  }
}

.kv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kv-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.kv-list li:last-child {
  border-bottom: 0;
}

.kv-list span {
  color: var(--muted);
}

.kv-list b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.pagination {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 6px 2px 0;
}

.pagination .page-meta {
  color: var(--muted);
  font-size: 13px;
}

.pagination .page-controls {
  align-items: center;
  display: flex;
  gap: 8px;
}

.pagination .page-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
}

.pagination .page-link:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.pagination .page-link.disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.pagination .page-link.disabled:hover {
  background: var(--surface);
}

.campaign-selector {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 14px;
}

.campaign-selector form {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.campaign-selector label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.campaign-selector select {
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
}

.campaign-selector .selector-note {
  color: var(--muted);
  font-size: 13px;
}


/* --- Sign-in card ---------------------------------------------------- */

.auth-main {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(15, 123, 99, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(184, 121, 37, 0.08), transparent 60%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(22, 27, 26, 0.10), 0 6px 12px rgba(22, 27, 26, 0.04);
  max-width: 460px;
  overflow: hidden;
  width: 100%;
}

.auth-card-hero {
  align-items: flex-start;
  background: linear-gradient(135deg, #0e1311 0%, #0f2a23 70%, #0f7b63 145%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 36px;
  position: relative;
}

.auth-card-hero::after {
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 14px);
  bottom: 0;
  content: "";
  left: 0;
  opacity: 0.45;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}

.auth-card-logo {
  display: block;
  height: auto;
  margin-left: -22px;
  position: relative;
  width: 140px;
  z-index: 1;
}

.auth-card-eyebrow {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  position: relative;
  text-transform: uppercase;
  z-index: 1;
}

.auth-card-body {
  padding: 32px 36px 36px;
}

.auth-card-body h1 {
  font-size: 26px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.auth-lede {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 22px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-form input[type="email"] {
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  width: 100%;
}

.auth-form input[type="email"]:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 123, 99, 0.15);
  outline: none;
}

.auth-submit {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 4px;
  padding: 13px 16px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover {
  background: #000;
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-meta {
  color: var(--faint);
  font-size: 12.5px;
  margin: 22px 0 0;
}

.auth-meta a {
  color: var(--accent-strong);
  font-weight: 700;
}

.auth-success {
  text-align: center;
}

.auth-success-mark {
  align-items: center;
  background: rgba(15, 123, 99, 0.12);
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  height: 56px;
  justify-content: center;
  margin: 0 auto 18px;
  width: 56px;
}

.auth-success h1 {
  margin-bottom: 8px;
}

.auth-success p {
  color: var(--muted);
  margin: 0 0 6px;
}

@media (max-width: 520px) {
  .auth-card-hero {
    padding: 26px 24px;
  }
  .auth-card-body {
    padding: 26px 24px 30px;
  }
}

.auth-footer {
  align-items: center;
  color: var(--faint);
  display: flex;
  font-size: 12px;
  gap: 3px;
  justify-content: center;
  letter-spacing: 0.04em;
  margin-top: 18px;
  opacity: 0.8;
}

.auth-footer a {
  display: inline-flex;
}

.auth-footer-logo {
  display: block;
  height: 18px;
  /* roboquill-logo.svg has internal padding inside its viewBox; pull
     the visible glyphs closer to the "Powered by" text */
  margin-left: -6px;
  width: auto;
}

.auth-stack {
  align-items: center;
  display: flex;
  flex-direction: column;
  width: 100%;
}
