:root {
  --ink: #1e211d;
  --muted: #6c7168;
  --paper: #f5f4ef;
  --card: #fffef9;
  --line: #deddd5;
  --sage: #48604d;
  --sage-light: #e5ebe4;
  --clay: #a3523e;
  --shadow: 0 18px 50px rgba(31, 37, 31, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 88% 0, #e9eee5, transparent 28rem),
    var(--paper);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: .55;
}
main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
}
.login-shell {
  width: min(460px, 100%);
  margin: 14vh auto 0;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.wordmark {
  margin: 0 0 8px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 14px;
  font-family: Georgia, serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 500;
  letter-spacing: -.035em;
}
h2 {
  margin-bottom: 0;
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -.025em;
}
h3 {
  margin-bottom: 20px;
  font-size: 16px;
}
.lede {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.quiet {
  color: var(--muted);
  font-size: 13px;
}
.primary,
.secondary,
.quiet-button,
.action-button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  font-weight: 700;
}
.primary {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--sage);
  color: white;
  background: var(--sage);
}
.secondary {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.quiet-button,
.action-button {
  border: 0;
  background: transparent;
  color: var(--sage);
}
.action-button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.workspace {
  padding: 38px 0 80px;
}
.topbar,
.section-heading,
.topbar-actions,
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar h1 {
  margin: 0;
  font-size: 38px;
}
.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
select,
input {
  min-height: 42px;
  padding: 0 11px;
}
textarea {
  padding: 11px;
  resize: vertical;
}
select:focus,
input:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(72, 96, 77, .14);
  outline: none;
}
.range select {
  width: auto;
  min-height: 38px;
}
.tabs {
  display: flex;
  gap: 5px;
  margin: 34px 0 24px;
  padding: 5px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
}
.tab {
  min-width: 110px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}
.tab.active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 2px 9px rgba(35, 40, 35, .08);
}
.status {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}
.status.error {
  color: var(--clay);
}
.section-heading {
  margin: 24px 0;
  align-items: end;
}
.eyebrow {
  margin-bottom: 5px;
  color: var(--sage);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric,
.card {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 5px 20px rgba(31, 37, 31, .035);
}
.metric {
  min-height: 116px;
  padding: 21px;
  border-radius: 18px;
}
.metric-label {
  display: block;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.metric-value {
  display: block;
  margin-top: 5px;
  font-family: Georgia, serif;
  font-size: 32px;
}
.metric-value.compact {
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 20px;
}
.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.section-jump {
  display: flex;
  gap: 8px;
  margin: 0 0 34px;
  padding-bottom: 8px;
  overflow-x: auto;
}
.section-jump a {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sage);
  background: rgba(255, 255, 255, .5);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.analytics-section {
  margin: 0 0 52px;
  scroll-margin-top: 18px;
}
.priority-section {
  margin-bottom: 68px;
  padding: 24px;
  border: 1px solid #d3dbd1;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(229, 235, 228, .72), rgba(255, 254, 249, .45));
}
.cohort-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.cohort-window {
  max-width: 420px;
  margin: 0;
  text-align: right;
}
.subtle-notice {
  margin-bottom: 18px;
  background: rgba(255, 254, 249, .72);
}
.platform-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.platform-title,
.version-cohort-heading,
.version-cohort-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.platform-title h3,
.version-cohort-heading h3 {
  margin: 0;
}
.platform-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(72, 96, 77, .10);
}
.platform-dot.android { background: #527c55; }
.platform-dot.ios { background: #526273; }
.cohort-card,
.retention-card {
  padding: 21px;
}
.version-cohort {
  padding: 18px 0 4px;
  border-bottom: 1px solid #e5e7e0;
}
.version-cohort:last-child { border-bottom: 0; }
.version-cohort-heading {
  justify-content: space-between;
  margin-bottom: 9px;
}
.version-cohort-title strong {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}
.measurement-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #526052;
  background: #e8eee7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.measurement-badge.mixed {
  color: #775a25;
  background: #f5ead1;
}
.measurement-badge.approximate {
  color: #874b3b;
  background: #f4dfd9;
}
.cohort-speed {
  color: var(--muted);
  font-size: 11px;
}
.cohort-funnel {
  display: grid;
  gap: 2px;
}
.cohort-stage {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) 44px minmax(112px, auto);
  gap: 8px;
  align-items: baseline;
  min-height: 31px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.cohort-stage:nth-child(even) { background: rgba(72, 96, 77, .045); }
.cohort-stage.branch {
  margin-left: 12px;
  color: #425246;
}
.cohort-stage-count { text-align: right; }
.cohort-stage-rate {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}
.retention-matrix-wrap { overflow-x: auto; }
.retention-matrix {
  min-width: 560px;
  font-size: 11px;
}
.retention-matrix th,
.retention-matrix td {
  padding: 7px 5px;
  text-align: center;
  white-space: nowrap;
}
.retention-matrix .cohort-label-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 98px;
  color: var(--ink);
  background: var(--card);
  text-align: left;
}
.cohort-label-cell > * {
  display: block;
  width: fit-content;
}
.cohort-label-cell .measurement-badge { margin-top: 4px; }
.cohort-date {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.retention-offset { min-width: 43px; }
.retention-cell {
  border: 2px solid var(--card);
  border-radius: 7px;
}
.retention-cell strong,
.retention-cell span { display: block; }
.retention-cell span {
  margin-top: 1px;
  font-size: 9px;
  opacity: .78;
}
.retention-cell.heat-0 { background: #f2f1ec; }
.retention-cell.heat-1 { background: #e9efe7; }
.retention-cell.heat-2 { background: #d7e4d4; }
.retention-cell.heat-3 { background: #b9d0b8; }
.retention-cell.heat-4 { background: #86ad89; color: #15251a; }
.retention-cell.heat-5 { background: #527757; color: #fff; }
.retention-cell.future {
  color: #aaa;
  background: transparent;
}
.analytics-heading {
  margin-bottom: 18px;
}
.analytics-heading h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}
.analytics-section > .card + .card,
#panel-push > .card + .card {
  margin-top: 18px;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.align-start {
  align-items: start;
}
.card {
  min-width: 0;
  padding: 24px;
  border-radius: 20px;
}
.notice {
  padding: 13px 16px;
  border: 1px solid #cfd9cd;
  border-radius: 12px;
  color: #3f5545;
  background: var(--sage-light);
  font-size: 13px;
  line-height: 1.45;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}
th,
td {
  padding: 10px 9px;
  border-bottom: 1px solid #ecebe5;
  vertical-align: top;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.activation-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr 90px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ecece6;
}
.bar::-webkit-progress-bar {
  border-radius: 999px;
  background: #ecece6;
}
.bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--sage);
}
.bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--sage);
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--sage-light);
  color: var(--sage);
  font-size: 11px;
  font-weight: 800;
}
.pill.paused,
.pill.cancelled,
.pill.failed {
  color: var(--clay);
  background: #f4e5df;
}
.experiment {
  padding: 15px 0;
  border-bottom: 1px solid #ecebe5;
}
.experiment:first-child {
  padding-top: 0;
}
.experiment:last-child {
  border-bottom: 0;
}
.experiment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.experiment h4 {
  margin: 0;
  font-size: 14px;
}
.experiment-meta {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.experiment-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
form {
  display: grid;
  gap: 14px;
}
form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.field-row > label {
  flex: 1;
}
.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: start;
}
.check input {
  width: 18px;
  min-height: 18px;
}
.deliberate {
  padding: 12px;
  border: 1px solid #d9cbbf;
  border-radius: 10px;
  color: var(--ink);
  background: #faf2ea;
  line-height: 1.4;
}
.locked-field {
  display: flex;
  justify-content: space-between;
  padding: 13px;
  border-radius: 10px;
  background: var(--sage-light);
  color: var(--muted);
  font-size: 12px;
}
.locked-field strong {
  color: var(--sage);
}
.empty {
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 850px) {
  main {
    width: min(100% - 24px, 700px);
  }
  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-actions {
    justify-content: flex-start;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-column,
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .priority-section {
    margin-inline: -8px;
    padding: 18px 12px;
    border-radius: 22px;
  }
  .cohort-heading {
    display: block;
  }
  .cohort-window {
    margin-top: 8px;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .login-shell {
    margin-top: 8vh;
    padding: 28px;
  }
  .workspace {
    padding-top: 24px;
  }
  .tabs {
    width: 100%;
  }
  .tab {
    min-width: 0;
    flex: 1;
    padding: 0 8px;
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    min-height: 104px;
    padding: 17px;
  }
  .topbar-actions {
    align-items: stretch;
    width: 100%;
  }
  .range {
    width: 100%;
  }
  .range select {
    flex: 1;
  }
  .field-row {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
