@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #eef3ed;
  --surface: #fffdf8;
  --surface-2: #f7faf5;
  --ink: #171b17;
  --ink-soft: #2b332e;
  --muted: #657066;
  --line: #d8e0d6;
  --line-strong: #bfcabc;
  --accent: #ec5534;
  --accent-dark: #bc351e;
  --teal: #0d8f83;
  --teal-soft: #dff5ef;
  --amber: #f5b642;
  --danger: #bd2b23;
  --shadow: 0 22px 70px rgba(32, 41, 34, 0.12);
  --shadow-soft: 0 10px 34px rgba(32, 41, 34, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(23, 27, 23, 0.05) 1px, transparent 1px),
    linear-gradient(45deg, rgba(13, 143, 131, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #f5f8f3 0%, var(--bg) 48%, #e8eee6 100%);
  background-size: 42px 42px, 56px 56px, auto;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
.button-link {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: #fffdf8;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover,
.button-link:hover {
  background: #2a312b;
  box-shadow: 0 10px 24px rgba(23, 27, 23, 0.16);
  transform: translateY(-1px);
}

.secondary,
.ghost {
  background: rgba(255, 253, 248, 0.08);
  border: 1px solid rgba(255, 253, 248, 0.18);
  color: currentColor;
}

.secondary {
  background: #fffdf8;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover,
.ghost:hover {
  background: var(--teal-soft);
  border-color: rgba(13, 143, 131, 0.26);
  color: var(--ink);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 143, 131, 0.12);
  outline: none;
}

textarea {
  min-height: 108px;
  resize: vertical;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  gap: 7px;
}

table {
  border-collapse: collapse;
  font-size: 14px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

pre {
  background: #121612;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #eafff7;
  overflow-x: auto;
  padding: 16px;
}

.topbar {
  align-items: center;
  background: rgba(20, 26, 22, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fffdf8;
  display: grid;
  gap: 18px;
  grid-template-columns: auto 1fr auto;
  height: 72px;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  height: 46px;
  text-decoration: none;
}

.brand img {
  display: block;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.16));
  height: 38px;
  width: auto;
}

.product-badge {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 253, 248, 0.72);
  font-size: 12px;
  font-weight: 850;
  justify-self: start;
  padding: 7px 11px;
}

.page {
  margin: 0 auto;
  max-width: 1320px;
  padding: 32px;
}

.page.is-loading {
  cursor: progress;
}

.page.is-loading .view-control-panel,
.page.is-loading .stats-grid,
.page.is-loading .goal-funnel-card,
.page.is-loading .step-funnel-card,
.page.is-loading .analysis-grid,
.page.is-loading .table-grid,
.page.is-loading .event-flow-card,
.page.is-loading .setup-grid {
  opacity: 0.58;
  transition: opacity 120ms ease;
}

.flash {
  background: #fff4e8;
  border: 1px solid #ffd2a1;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
  padding: 12px 15px;
}

.flash p {
  margin: 0;
}

.auth-panel {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(216, 224, 214, 0.9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin: 9vh auto 0;
  max-width: 470px;
  padding: 34px;
}

.auth-logo {
  display: block;
  height: auto;
  margin-bottom: 24px;
  max-width: 285px;
  width: 100%;
}

.auth-panel h1,
.hero-row h1,
.project-head h1 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.form-stack,
.create-project,
.compact-form,
.note-form,
.page-form {
  display: grid;
  gap: 12px;
}

.hero-row,
.project-head {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 440px);
  margin-bottom: 22px;
}

.hero-row h1,
.project-head h1 {
  font-size: 56px;
  line-height: 0.96;
  margin: 0;
  max-width: 760px;
}

.hero-copy {
  color: var(--muted);
  font-size: 17px;
  max-width: 720px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.create-project {
  background: #17201b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: #fffdf8;
  padding: 18px;
}

.create-project h2 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 24px;
  margin: 0 0 4px;
}

.create-project label {
  color: rgba(255, 253, 248, 0.72);
}

.grid,
.stats-grid,
.analysis-grid,
.table-grid,
.setup-grid {
  display: grid;
  gap: 16px;
}

.projects-grid {
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
}

.card,
.empty-state,
.page-command,
.view-control-panel {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(216, 224, 214, 0.94);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.card h2,
.empty-state h2,
.page-command h2,
.view-control-panel h2 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1.1;
  margin: 0 0 10px;
}

.view-control-panel {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.11), transparent 38%),
    linear-gradient(35deg, rgba(236, 85, 52, 0.08), transparent 48%),
    rgba(255, 253, 248, 0.96);
  border-color: rgba(13, 143, 131, 0.2);
  margin-bottom: 16px;
}

.view-summary {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.view-summary h2 {
  font-size: 30px;
  margin-bottom: 6px;
}

.view-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 520px;
}

.view-chips span {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(216, 224, 214, 0.9);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 7px 10px;
}

.view-chips strong {
  color: var(--ink);
}

.page-command {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.12), transparent 34%),
    linear-gradient(45deg, rgba(236, 85, 52, 0.12), transparent 44%),
    rgba(255, 253, 248, 0.98);
  border-color: rgba(13, 143, 131, 0.22);
}

.page-form {
  align-items: end;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(216, 224, 214, 0.86);
  border-radius: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) auto;
  margin: 16px 0;
  padding: 14px;
}

.page-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(286px, 1fr));
}

.page-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  padding: 15px;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.page-card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.page-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 143, 131, 0.12);
}

.page-card-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.page-card h3 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 21px;
  margin: 0;
}

.page-card p {
  margin: 4px 0 0;
}

.page-sources {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 11px;
}

.page-sources > div,
.source-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.page-sources em {
  color: var(--teal);
  font-style: normal;
  font-weight: 850;
}

.empty-inline {
  background: rgba(255, 255, 255, 0.66);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  padding: 18px;
}

.analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0;
}

.table-grid {
  grid-template-columns: 1.3fr 1fr;
  margin: 16px 0;
}

.setup-grid {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  margin: 16px 0;
}

.card-title-row {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title-row h2,
.card-title-row p {
  margin-bottom: 0;
}

.copy-button {
  white-space: nowrap;
}

.copy-button.copied {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.goal-preset-panel {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.09), transparent 44%),
    linear-gradient(40deg, rgba(236, 85, 52, 0.08), transparent 54%),
    rgba(247, 250, 245, 0.9);
  border: 1px solid rgba(13, 143, 131, 0.18);
  border-radius: 14px;
  display: grid;
  gap: 14px;
  margin: 12px 0 16px;
  padding: 14px;
}

.goal-preset-panel h3 {
  font-size: 18px;
  margin: 0 0 4px;
}

.preset-lock {
  background: #fff7df;
  border: 1px solid #f5d889;
  border-radius: 10px;
  color: #8a5b00;
  font-size: 13px;
  font-weight: 850;
  margin: 10px 0 0;
  padding: 9px 11px;
}

.goal-preset-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.goal-preset-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(216, 224, 214, 0.95);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 13px;
}

.goal-preset-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.goal-preset-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
}

.goal-preset-card ul {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.goal-preset-card li {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
}

.goal-preset-card .goal-level {
  margin: 0 6px 0 0;
}

.goal-preset-card button {
  min-height: 38px;
  width: 100%;
}

.goal-preset-card button:disabled {
  background: #e7eee5;
  border-color: var(--line);
  box-shadow: none;
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
}

.goal-funnel-card {
  margin: 0 0 16px;
}

.funnel-head-actions {
  align-items: flex-end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.funnel-mode-switch {
  background: #edf3ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.funnel-mode-switch a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  padding: 8px 12px;
  text-decoration: none;
}

.funnel-mode-switch a.active {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 8px 18px rgba(23, 27, 23, 0.14);
}

.funnel-mode-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.funnel-start {
  align-items: center;
  background: #eef6f2;
  border: 1px solid rgba(13, 143, 131, 0.2);
  border-radius: 14px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(160px, 1fr) auto minmax(190px, 0.8fr);
  margin: 14px 0;
  padding: 14px;
}

.funnel-start span,
.funnel-stage h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.funnel-start strong {
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 36px;
  line-height: 1;
}

.funnel-start em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
  text-align: right;
}

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

.funnel-stage {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  padding: 13px;
}

.funnel-stage h3 {
  margin: 0;
}

.funnel-step {
  background: #fff;
  border: 1px solid rgba(216, 224, 214, 0.95);
  border-radius: 12px;
  display: grid;
  gap: 9px;
  padding: 12px;
}

.funnel-step-head,
.funnel-step-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.funnel-step-head strong {
  line-height: 1.2;
}

.funnel-step-head span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.funnel-bar {
  background: #e7eee5;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.funnel-bar b {
  background: linear-gradient(90deg, var(--teal), var(--accent));
  display: block;
  height: 100%;
}

.funnel-step-meta {
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
}

.funnel-step-meta em {
  color: var(--ink-soft);
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.step-funnel-card {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.09), transparent 32%),
    linear-gradient(45deg, rgba(236, 85, 52, 0.08), transparent 42%),
    rgba(255, 253, 248, 0.98);
  margin: 0 0 16px;
}

.step-funnel-flow {
  display: grid;
  gap: 14px;
  grid-auto-columns: minmax(210px, 0.95fr);
  grid-auto-flow: column;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}

.step-node {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 224, 214, 0.95);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 15px;
  position: relative;
  scroll-snap-align: start;
}

.step-node:not(:last-child)::after {
  background: var(--ink);
  border-radius: 999px;
  color: #fffdf8;
  content: "→";
  display: grid;
  font-weight: 900;
  height: 28px;
  place-items: center;
  position: absolute;
  right: -21px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  z-index: 2;
}

.step-node span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-node strong {
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 42px;
  line-height: 1;
}

.step-node h3 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
}

.step-node p,
.step-node em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.3;
  margin: 0;
}

.step-node em {
  color: var(--ink-soft);
}

.start-node {
  background: #17201b;
  border-color: #17201b;
  color: #fffdf8;
}

.start-node span,
.start-node em,
.start-node strong {
  color: #fffdf8;
}

.step-progress {
  background: #e7eee5;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.step-progress b {
  background: linear-gradient(90deg, var(--teal), var(--accent));
  display: block;
  height: 100%;
}

.project-card {
  display: grid;
  gap: 14px;
}

.card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions form {
  margin: 0;
}

.compact-actions {
  justify-content: flex-end;
}

.danger-button {
  background: #fff3f0;
  border-color: #ffc3b7;
  color: var(--danger);
}

.danger-button:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.small-button {
  font-size: 13px;
  min-height: 34px;
  padding: 0 11px;
}

.mini-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 0;
}

.stats-grid {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  margin-bottom: 16px;
}

.mini-stats div,
.stat {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 250, 245, 0.92));
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 128px;
  padding: 15px 15px 13px;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat::before {
  background: var(--line-strong);
  content: "";
  height: 3px;
  left: 0;
  opacity: 0.9;
  position: absolute;
  right: 0;
  top: 0;
}

.stat:hover {
  border-color: rgba(13, 143, 131, 0.3);
  box-shadow: 0 16px 34px rgba(32, 41, 34, 0.09);
  transform: translateY(-1px);
}

.stat:has(.info-tip.is-open),
.stat:has(.info-tip:hover),
.stat:has(.info-tip:focus) {
  z-index: 8;
}

.stat-primary::before {
  background: var(--ink);
}

.stat-accent::before {
  background: var(--teal);
}

.mini-stats dt,
.stat-label span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.stat-label {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: space-between;
}

.info-tip {
  align-items: center;
  background: rgba(23, 32, 27, 0.045);
  border: 1px solid rgba(23, 32, 27, 0.09);
  border-radius: 999px;
  color: var(--muted);
  cursor: help;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  height: 17px;
  justify-content: center;
  line-height: 1;
  position: relative;
  text-transform: none;
  transform: translateY(-1px);
  width: 17px;
  z-index: 4;
}

.info-tip > span {
  background: #17201b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  bottom: calc(100% + 12px);
  box-shadow: 0 18px 38px rgba(20, 36, 28, 0.22);
  color: #fffdf8;
  font-family: inherit;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  left: 50%;
  line-height: 1.35;
  max-width: 260px;
  min-width: 220px;
  opacity: 0;
  padding: 10px 11px;
  pointer-events: none;
  position: absolute;
  text-transform: none;
  transform: translate(-50%, 6px);
  transition: opacity 150ms ease, transform 150ms ease;
  visibility: hidden;
  white-space: normal;
  z-index: 20;
}

.info-tip > span::after {
  background: #17201b;
  bottom: -5px;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.info-tip:hover,
.info-tip:focus,
.info-tip.is-open {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  outline: none;
}

.info-tip:hover > span,
.info-tip:focus > span,
.info-tip.is-open > span {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.mini-stats dd,
.stat strong {
  color: var(--ink);
  display: block;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 39px;
  line-height: 1;
  margin: 12px 0 0;
}

.stat small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  margin-top: 8px;
}

.warn {
  background: linear-gradient(180deg, #fffaf0, #fff6dd);
  border-color: #f5d889;
  color: #8a5b00;
}

.warn::before {
  background: var(--amber);
}

.success {
  background: linear-gradient(180deg, #effbf7, #e4f7f0);
  border-color: #a8ded0;
  color: var(--teal);
}

.success .stat-label span,
.success small {
  color: #4d6f68;
}

.danger {
  background: linear-gradient(180deg, #fff7f5, #ffedeb);
  border-color: #ffc2ba;
  color: var(--danger);
}

.danger::before {
  background: var(--danger);
}

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

.head-actions,
.filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.head-actions form {
  margin: 0;
}

.filters {
  background: rgba(255, 253, 248, 0.68);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 10px 0 0;
  padding: 14px;
}

.filters label {
  min-width: 220px;
}

.page-tabs {
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid rgba(216, 224, 214, 0.94);
  border-radius: 18px;
  display: flex;
  gap: 8px;
  margin: 16px 0 10px;
  overflow-x: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.page-tab {
  background: rgba(238, 246, 242, 0.72);
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--ink);
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  min-width: 178px;
  padding: 12px 14px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.page-tab:hover {
  background: #fff;
  border-color: rgba(13, 143, 131, 0.28);
  box-shadow: 0 10px 24px rgba(20, 36, 28, 0.08);
  transform: translateY(-1px);
}

.page-tab.active {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.18), transparent 52%),
    #17201b;
  border-color: rgba(23, 32, 27, 0.88);
  color: #fffdf8;
}

.page-tab span {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

.page-tab em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-tab.active em {
  color: rgba(255, 253, 248, 0.72);
}

.post-goal-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.13), transparent 42%),
    linear-gradient(35deg, rgba(236, 85, 52, 0.11), transparent 52%),
    rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(13, 143, 131, 0.22);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 0.8fr);
  margin: 16px 0;
  padding: 18px;
}

.post-goal-panel h2 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 28px;
  line-height: 1.05;
  margin: 0 0 8px;
}

.post-goal-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.post-goal-stats div,
.event-type-list span {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(216, 224, 214, 0.9);
  border-radius: 12px;
  padding: 12px;
}

.post-goal-stats span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.post-goal-stats strong {
  color: var(--ink);
  display: block;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 34px;
  line-height: 1;
  margin-top: 8px;
}

.event-type-list {
  display: grid;
  gap: 8px;
}

.event-type-list span {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.event-type-list b {
  color: var(--ink);
  font-size: 14px;
}

.heatmap-card {
  grid-column: 1 / -1;
}

.heatmap-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.segmented {
  align-items: center;
  background: #eef6f2;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 14px;
  font-weight: 850;
  min-height: 38px;
  padding: 0 13px;
  text-decoration: none;
}

.segmented.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.preview-meta {
  align-items: center;
  background: #eef6f2;
  border: 1px solid rgba(13, 143, 131, 0.18);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.preview-meta a {
  color: var(--teal);
  font-weight: 850;
}

.heatmap-stage {
  background: #111611;
  border: 1px solid #0b0f0c;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  height: 760px;
  margin-inline: auto;
  overflow: auto;
  position: relative;
}

.desktop-stage {
  max-width: 100%;
}

.mobile-stage {
  border-radius: 30px;
  box-sizing: border-box;
  height: 760px;
  max-width: 430px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  width: min(430px, 100%);
}

.heatmap-viewport {
  height: 100%;
  max-width: none;
  min-width: 100%;
  position: relative;
}

.heatmap-viewport iframe {
  background: #fff;
  border: 0;
  border-radius: 8px;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.mobile-stage iframe {
  border-radius: 20px;
}

.mobile-stage .heatmap-viewport {
  max-width: 100%;
  min-width: 0;
}

.heatmap-overlay {
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 2;
}

.hotspot {
  background: rgba(236, 85, 52, 0.52);
  border: 2px solid rgba(188, 53, 30, 0.48);
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgba(236, 85, 52, 0.13), 0 0 34px rgba(236, 85, 52, 0.32);
  height: var(--s);
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--s);
}

.center-muted {
  left: 50%;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.heatmap-empty {
  background: #eef6f2;
  border: 1px dashed rgba(13, 143, 131, 0.34);
  border-radius: 12px;
  color: var(--muted);
  padding: 28px;
}

.bar-list,
.source-list,
.plain-list {
  display: grid;
  gap: 10px;
}

.metric-pill {
  align-items: center;
  background: #eef6f2;
  border: 1px solid rgba(13, 143, 131, 0.2);
  border-radius: 999px;
  color: var(--teal);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.scroll-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 18px;
}

.scroll-summary div {
  background: #f3ede3;
  border: 1px solid rgba(216, 224, 214, 0.9);
  border-radius: 12px;
  padding: 13px;
}

.scroll-summary span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.scroll-summary strong {
  color: var(--ink);
  display: block;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 30px;
  line-height: 1;
  margin-top: 8px;
}

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

.scroll-depth-grid h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 80px 1fr 40px;
}

.bar-row div {
  background: #e7eee5;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.bar-row b {
  background: linear-gradient(90deg, var(--teal), var(--accent));
  display: block;
  height: 100%;
}

.bar-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.scroll-bar-row {
  grid-template-columns: 72px 1fr 54px;
}

.scroll-bar-row em::after {
  content: " session";
  font-size: 11px;
}

.event-flow-card {
  overflow: hidden;
}

.event-streams {
  display: grid;
  gap: 14px;
}

.event-stream {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.event-stream-head {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(13, 143, 131, 0.12), transparent 56%),
    #f5f1e9;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 14px;
}

.event-stream[open] .event-stream-head {
  border-bottom: 1px solid var(--line);
}

.event-stream-head::marker,
.event-stream-head::-webkit-details-marker {
  display: none;
}

.event-stream-head::before {
  color: var(--teal);
  content: "▸";
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.event-stream[open] .event-stream-head::before {
  content: "▾";
}

.event-stream-head strong,
.event-stream-head span,
.event-stream-head em {
  display: block;
}

.event-stream-head strong {
  font-size: 16px;
}

.event-stream-head span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.event-stream-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.event-stream table {
  background: rgba(255, 253, 248, 0.72);
}

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

.event-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 16px;
  padding-top: 14px;
}

.event-pagination > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.event-pagination a:last-child {
  justify-self: end;
}

.plain-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.plain-list li {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.goal-row {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.goal-row form {
  margin: 0;
}

.goal-edit-form {
  display: grid;
  gap: 10px;
}

.goal-card-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.goal-card-head > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.goal-edit-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.goal-edit-fields label {
  min-width: 0;
}

.goal-edit-fields input,
.goal-edit-fields select {
  min-height: 38px;
  padding: 7px 10px;
}

.goal-delete-form {
  justify-self: start;
}

.goal-scope {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.goal-type-pill,
.goal-step-pill {
  background: #edf3ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  padding: 5px 8px;
}

.goal-step-pill {
  background: var(--teal-soft);
  border-color: rgba(13, 143, 131, 0.22);
  color: var(--teal);
}

.funnel-order-note {
  background: #eef6f2;
  border: 1px solid rgba(13, 143, 131, 0.18);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin: 10px 0 6px;
  padding: 10px 12px;
}

.funnel-order-note strong {
  color: var(--ink);
}

.funnel-builder {
  background:
    linear-gradient(135deg, rgba(13, 143, 131, 0.08), transparent 36%),
    rgba(248, 251, 246, 0.92);
  border: 1px solid rgba(13, 143, 131, 0.15);
  border-radius: 18px;
  display: grid;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
}

.funnel-builder-head,
.funnel-config-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.funnel-builder h3 {
  font-size: 28px;
  margin: 0 0 6px;
}

.funnel-create-form,
.funnel-step-add {
  align-items: end;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto;
  padding: 12px;
}

.funnel-create-form label,
.funnel-step-add label,
.funnel-step-config label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
  min-width: 0;
  text-transform: uppercase;
}

.funnel-create-form input,
.funnel-step-add input,
.funnel-step-add select,
.funnel-step-config input,
.funnel-step-config select {
  min-height: 42px;
  padding: 8px 11px;
}

.funnel-config-list {
  display: grid;
  gap: 12px;
}

.funnel-config-card {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(216, 224, 214, 0.95);
  border-radius: 16px;
  box-shadow: 0 14px 35px rgba(18, 26, 21, 0.05);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.funnel-config-head strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
}

.funnel-config-head span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 4px;
}

.funnel-step-configs {
  display: grid;
  gap: 8px;
}

.funnel-step-config {
  align-items: end;
  background: rgba(241, 246, 239, 0.7);
  border: 1px solid rgba(216, 224, 214, 0.86);
  border-radius: 13px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 10px;
}

.funnel-step-config form:first-child {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 92px minmax(220px, 1fr) auto;
}

.funnel-step-config form {
  margin: 0;
}

.funnel-step-add {
  grid-template-columns: 130px minmax(220px, 1fr) auto;
}

.empty-panel {
  border: 1px dashed rgba(109, 124, 112, 0.35);
  border-radius: 14px;
  margin: 0;
  padding: 14px;
}

.goal-level {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  margin: 0 8px;
  padding: 4px 8px;
  text-transform: uppercase;
}

.goal-level.primary {
  background: var(--teal-soft);
  color: var(--teal);
}

.goal-level.secondary {
  background: #fff7df;
  color: #8a5b00;
}

.goal-level.tertiary {
  background: #eef0ff;
  color: #4451a8;
}

.report {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 900px;
  padding: 34px;
}

@media (max-width: 920px) {
  .page {
    padding: 18px;
  }

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

  .product-badge {
    display: none;
  }

  .hero-row,
  .project-head {
    grid-template-columns: 1fr;
  }

  .view-summary {
    grid-template-columns: 1fr;
  }

  .view-chips {
    justify-content: flex-start;
  }

  .create-project {
    min-width: 0;
  }

  .page-form {
    grid-template-columns: 1fr;
  }

  .analysis-grid,
  .table-grid,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .scroll-summary,
  .scroll-depth-grid {
    grid-template-columns: 1fr;
  }

  .post-goal-panel {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .funnel-start,
  .funnel-grid {
    grid-template-columns: 1fr;
  }

  .funnel-start em {
    text-align: left;
  }

  .funnel-head-actions {
    justify-items: start;
  }

  .page-tabs {
    border-radius: 14px;
    margin-top: 14px;
  }

  .page-tab {
    min-width: 152px;
    padding: 11px 12px;
  }

  .card-title-row {
    display: grid;
  }

  .event-stream-head {
    align-items: start;
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .goal-row {
    align-items: start;
    display: grid;
  }

  .goal-edit-fields {
    grid-template-columns: 1fr;
  }

  .goal-card-head {
    align-items: stretch;
    display: grid;
  }

  .funnel-builder-head,
  .funnel-config-head,
  .funnel-step-config {
    display: grid;
  }

  .funnel-create-form,
  .funnel-step-add,
  .funnel-step-config form:first-child {
    grid-template-columns: 1fr;
  }

  .funnel-step-config .small-button,
  .funnel-step-add button,
  .funnel-create-form button {
    width: 100%;
  }

  .event-stream-head em {
    text-align: left;
  }

  .event-pagination {
    grid-template-columns: 1fr;
  }

  .event-pagination a,
  .event-pagination a:last-child {
    justify-self: stretch;
  }

  .heatmap-actions {
    justify-content: flex-start;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* Premium interface pass */
:root {
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #edf3f1;
  --ink: #0e1513;
  --ink-soft: #27322f;
  --muted: #61706b;
  --line: #dce5e1;
  --line-strong: #b8c7c1;
  --accent: #d75d3b;
  --accent-dark: #a83f27;
  --teal: #11786f;
  --teal-dark: #0a4e49;
  --teal-soft: #e4f4f1;
  --sapphire: #244f9f;
  --amber: #dca83c;
  --danger: #b8342b;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 24px 80px rgba(18, 32, 29, 0.12);
  --shadow-soft: 0 10px 34px rgba(18, 32, 29, 0.075);
  --shadow-focus: 0 0 0 4px rgba(17, 120, 111, 0.13);
}

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

body {
  background:
    linear-gradient(rgba(14, 21, 19, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 21, 19, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, #f8faf9 0%, #eef2f0 52%, #e7eeeb 100%);
  background-attachment: fixed;
  background-size: 36px 36px, 36px 36px, auto;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body::before {
  background: linear-gradient(90deg, var(--teal), var(--sapphire), var(--accent));
  content: "";
  height: 3px;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
}

button,
.button-link {
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset;
  font-weight: 800;
  letter-spacing: 0;
  min-height: 42px;
}

button:hover,
.button-link:hover {
  box-shadow: 0 12px 28px rgba(14, 21, 19, 0.18);
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover,
.ghost:hover {
  background: #f0f6f4;
  border-color: rgba(17, 120, 111, 0.28);
}

.ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.danger-button {
  background: #fff7f5;
  border-color: #efbbb2;
  color: var(--danger);
}

input,
select,
textarea {
  background: #ffffff;
  border-color: #d7e1dc;
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(14, 21, 19, 0.025);
  font-weight: 650;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}

label {
  color: #5e6f69;
  font-size: 12px;
  font-weight: 800;
}

table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-spacing: 0;
  overflow: hidden;
}

th {
  background: #f3f6f5;
  color: #5d6b67;
}

td {
  background: rgba(255, 255, 255, 0.58);
}

pre {
  background: #0d1614;
  border-radius: var(--radius);
  color: #e6fff8;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.topbar {
  background: rgba(10, 18, 16, 0.92);
  backdrop-filter: blur(18px);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 55px rgba(4, 10, 8, 0.18);
  height: 76px;
}

.brand {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 7px 10px;
}

.brand img {
  filter: none;
  height: 32px;
}

.product-badge {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.76);
}

.page {
  max-width: 1440px;
  padding: 30px;
}

.auth-panel,
.card,
.empty-state,
.page-command,
.view-control-panel,
.post-goal-panel,
.flash,
.report {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 229, 225, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.auth-panel,
.create-project,
.view-control-panel,
.goal-funnel-card,
.step-funnel-card,
.post-goal-panel,
.page-command {
  box-shadow: var(--shadow);
}

.card h2,
.empty-state h2,
.page-command h2,
.view-control-panel h2,
.auth-panel h1,
.hero-row h1,
.project-head h1,
.create-project h2,
.page-card h3,
.funnel-start strong,
.step-node strong,
.mini-stats dd,
.stat strong,
.post-goal-panel h2,
.post-goal-stats strong,
.scroll-summary strong,
.report h1,
.report h2 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.hero-row h1,
.project-head h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.02;
}

.auth-panel h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  margin: 4px 0 10px;
}

.card h2,
.empty-state h2,
.page-command h2,
.view-control-panel h2 {
  font-size: 24px;
  font-weight: 800;
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-copy {
  color: #52615c;
  font-size: 16px;
}

.create-project {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #0d1614;
  border-radius: var(--radius);
  color: #ffffff;
}

.create-project input {
  background: rgba(255, 255, 255, 0.96);
}

.grid,
.stats-grid,
.analysis-grid,
.table-grid,
.setup-grid {
  gap: 14px;
}

.view-control-panel,
.page-command,
.goal-preset-panel,
.goal-funnel-card,
.step-funnel-card,
.post-goal-panel,
.funnel-builder {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 247, 0.9)),
    var(--surface);
  border-color: rgba(17, 120, 111, 0.16);
}

.view-summary h2 {
  font-size: 28px;
  font-weight: 800;
}

.view-chips span,
.metric-pill,
.goal-type-pill,
.goal-step-pill {
  background: #f2f6f5;
  border-color: #dce8e4;
  border-radius: 999px;
}

.page-tabs {
  background: rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.page-tab {
  background: #f4f7f6;
  border-radius: var(--radius-sm);
  min-width: 180px;
}

.page-tab.active {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #0e1513;
}

.filters,
.page-form,
.goal-preset-panel,
.goal-preset-card,
.funnel-stage,
.funnel-step,
.step-node,
.page-card,
.goal-row,
.funnel-create-form,
.funnel-step-add,
.funnel-config-card,
.funnel-step-config,
.event-stream,
.post-goal-stats div,
.event-type-list span,
.scroll-summary div,
.empty-inline,
.empty-panel {
  border-radius: var(--radius);
}

.mini-stats div,
.stat {
  background: #ffffff;
  border-color: rgba(220, 229, 225, 0.95);
  border-radius: var(--radius);
  min-height: 118px;
  overflow: visible;
}

.stat::before {
  height: 4px;
}

.stat strong,
.mini-stats dd {
  font-size: 39px;
  font-weight: 800;
}

.stat-label span,
.mini-stats dt {
  color: #62716c;
  letter-spacing: 0.05em;
}

.success {
  background: #f2fbf8;
  border-color: #b8e4da;
  color: var(--teal);
}

.warn {
  background: #fff9eb;
  border-color: #ead08e;
}

.danger {
  background: #fff4f2;
  border-color: #efbbb2;
}

.info-tip {
  background: #edf3f1;
  border-color: #d5e1dd;
  color: #65736f;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
}

.info-tip > span {
  background: #0d1614;
  border-radius: var(--radius);
  box-shadow: 0 22px 48px rgba(6, 14, 12, 0.28);
}

.info-tip > span::after {
  background: #0d1614;
}

.funnel-mode-switch {
  background: #eef3f1;
  border-radius: 999px;
}

.funnel-mode-switch a.active {
  background: #0e1513;
}

.funnel-start {
  background: #f0f8f5;
  border-radius: var(--radius);
}

.funnel-start strong,
.step-node strong,
.post-goal-stats strong,
.scroll-summary strong {
  font-weight: 800;
}

.funnel-bar,
.step-progress,
.scroll-bar-row div {
  background: #e3ebe7;
}

.funnel-bar b,
.step-progress b,
.scroll-bar-row b {
  background: linear-gradient(90deg, var(--teal), var(--sapphire), var(--accent));
}

.start-node {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    #0d1614;
  border-color: #0d1614;
}

.step-node:not(:last-child)::after {
  background: #0d1614;
}

.heatmap-card {
  overflow: hidden;
}

.preview-meta {
  background: #f1f7f5;
  border-color: #cde2dc;
  border-radius: var(--radius);
}

.heatmap-stage {
  background: #ffffff;
}

.segmented {
  border-radius: 999px;
}

.segmented.active {
  background: var(--teal);
  border-color: var(--teal);
}

.event-stream {
  background: #ffffff;
  border-color: #dae5e0;
}

.event-stream-head {
  background: #f2f6f4;
  border-radius: var(--radius) var(--radius) 0 0;
}

.plain-list li {
  border-bottom-color: #e1e8e5;
}

.goal-row,
.page-card,
.goal-preset-card,
.funnel-config-card {
  background: #ffffff;
}

.goal-level {
  letter-spacing: 0.03em;
}

.goal-level.primary {
  background: #e2f5ef;
}

.goal-level.secondary {
  background: #fff4d9;
}

.goal-level.tertiary {
  background: #edf1ff;
  color: var(--sapphire);
}

.auth-panel {
  margin-top: 10vh;
  max-width: 500px;
  padding: 38px;
}

.auth-logo {
  max-width: 245px;
}

.copy-button.copied {
  background: var(--teal);
}

@media (max-width: 920px) {
  .page {
    padding: 18px;
  }

  .hero-row h1,
  .project-head h1 {
    font-size: 40px;
  }

  .topbar {
    padding: 0 16px;
  }
}

@media (max-width: 560px) {
  .hero-row h1,
  .project-head h1 {
    font-size: 34px;
  }

  .auth-panel {
    margin-top: 6vh;
    padding: 24px;
  }

  .stat strong,
  .mini-stats dd {
    font-size: 34px;
  }
}

/* Neon executive theme */
:root {
  --bg: #080912;
  --surface: #111425;
  --surface-2: #171b31;
  --surface-3: #202541;
  --ink: #f7f4ff;
  --ink-soft: #d9d1ef;
  --muted: #9b93b8;
  --line: rgba(169, 146, 255, 0.2);
  --line-strong: rgba(230, 78, 255, 0.38);
  --accent: #ff2bd6;
  --accent-dark: #d916b5;
  --teal: #19d8ff;
  --teal-dark: #0f8fb0;
  --teal-soft: rgba(25, 216, 255, 0.13);
  --sapphire: #8b5cf6;
  --amber: #ffd166;
  --danger: #ff5b7a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34), 0 0 42px rgba(139, 92, 246, 0.12);
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.22);
  --shadow-focus: 0 0 0 4px rgba(255, 43, 214, 0.16), 0 0 24px rgba(25, 216, 255, 0.18);
}

html {
  background: #080912;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(139, 92, 246, 0.28), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(255, 43, 214, 0.2), transparent 26%),
    radial-gradient(circle at 45% 95%, rgba(25, 216, 255, 0.13), transparent 30%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, #090a16 0%, #0c0e1c 46%, #070812 100%);
  background-attachment: fixed;
  background-size: auto, auto, auto, 42px 42px, 42px 42px, auto;
  color: var(--ink);
}

body::before {
  background: linear-gradient(90deg, #19d8ff, #8b5cf6 48%, #ff2bd6);
  box-shadow: 0 0 26px rgba(255, 43, 214, 0.6);
}

body::after {
  background:
    linear-gradient(115deg, transparent 0 40%, rgba(255, 255, 255, 0.04) 40% 41%, transparent 41% 100%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 58%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

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

button,
.button-link {
  background: linear-gradient(135deg, #7c3aed, #ff2bd6);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.28), 0 0 24px rgba(255, 43, 214, 0.14);
}

button:hover,
.button-link:hover {
  background: linear-gradient(135deg, #8b5cf6, #ff3edf);
  box-shadow: 0 16px 38px rgba(139, 92, 246, 0.34), 0 0 30px rgba(255, 43, 214, 0.2);
}

.secondary,
.ghost {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(169, 146, 255, 0.22);
  color: var(--ink);
  box-shadow: none;
}

.secondary:hover,
.ghost:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(255, 43, 214, 0.42);
  color: #ffffff;
}

.danger-button {
  background: rgba(255, 91, 122, 0.12);
  border-color: rgba(255, 91, 122, 0.36);
  color: #ff91a6;
  box-shadow: none;
}

.danger-button:hover {
  background: #ff335f;
  border-color: #ff335f;
  color: #ffffff;
}

input,
select,
textarea {
  background: rgba(7, 8, 18, 0.64);
  border-color: rgba(169, 146, 255, 0.24);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(217, 209, 239, 0.45);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #ff2bd6;
  box-shadow: var(--shadow-focus);
}

label,
.muted,
.center-muted,
.hero-copy {
  color: var(--muted);
}

table {
  border-color: rgba(169, 146, 255, 0.18);
}

th {
  background: rgba(139, 92, 246, 0.12);
  color: #bfb4e6;
}

td {
  background: rgba(12, 14, 28, 0.52);
  color: var(--ink-soft);
}

pre {
  background: #050611;
  border-color: rgba(25, 216, 255, 0.2);
  color: #dffbff;
}

.topbar {
  background: rgba(5, 6, 17, 0.76);
  border-bottom-color: rgba(169, 146, 255, 0.16);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}

.brand {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(169, 146, 255, 0.18);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.11);
}

.product-badge,
.view-chips span,
.metric-pill,
.goal-type-pill,
.goal-step-pill {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(169, 146, 255, 0.22);
  color: #cfc6ef;
}

.auth-panel,
.card,
.empty-state,
.page-command,
.view-control-panel,
.post-goal-panel,
.flash,
.report,
.create-project,
.goal-preset-panel,
.goal-funnel-card,
.step-funnel-card,
.funnel-builder {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.035)),
    rgba(13, 15, 31, 0.78);
  border-color: rgba(169, 146, 255, 0.22);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.auth-panel,
.create-project,
.view-control-panel,
.goal-funnel-card,
.step-funnel-card,
.post-goal-panel,
.page-command {
  box-shadow: var(--shadow);
}

.card h2,
.empty-state h2,
.page-command h2,
.view-control-panel h2,
.auth-panel h1,
.hero-row h1,
.project-head h1,
.create-project h2,
.page-card h3,
.funnel-start strong,
.step-node strong,
.mini-stats dd,
.stat strong,
.post-goal-panel h2,
.post-goal-stats strong,
.scroll-summary strong,
.report h1,
.report h2 {
  color: var(--ink);
}

.hero-row h1,
.project-head h1 {
  background: linear-gradient(135deg, #ffffff 18%, #d8c9ff 48%, #ff8cec 76%, #8ff2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  color: #19d8ff;
  text-shadow: 0 0 18px rgba(25, 216, 255, 0.32);
}

.create-project input {
  background: rgba(7, 8, 18, 0.72);
}

.view-control-panel,
.page-command,
.goal-preset-panel,
.goal-funnel-card,
.step-funnel-card,
.post-goal-panel,
.funnel-builder {
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.13), transparent 38%),
    linear-gradient(35deg, rgba(255, 43, 214, 0.09), transparent 54%),
    rgba(13, 15, 31, 0.8);
  border-color: rgba(255, 43, 214, 0.18);
}

.page-tabs,
.filters,
.page-form,
.goal-preset-card,
.funnel-stage,
.funnel-step,
.step-node,
.page-card,
.goal-row,
.funnel-create-form,
.funnel-step-add,
.funnel-config-card,
.funnel-step-config,
.event-stream,
.post-goal-stats div,
.event-type-list span,
.scroll-summary div,
.empty-inline,
.empty-panel {
  background: rgba(10, 12, 26, 0.58);
  border-color: rgba(169, 146, 255, 0.18);
  color: var(--ink-soft);
}

.page-tab {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(169, 146, 255, 0.1);
  color: var(--ink);
}

.page-tab:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(255, 43, 214, 0.38);
  box-shadow: 0 14px 34px rgba(139, 92, 246, 0.2);
}

.page-tab.active {
  background: linear-gradient(135deg, rgba(25, 216, 255, 0.2), rgba(139, 92, 246, 0.3), rgba(255, 43, 214, 0.22));
  border-color: rgba(255, 43, 214, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 43, 214, 0.18), 0 16px 36px rgba(139, 92, 246, 0.22);
}

.page-tab em,
.page-tab.active em,
.view-chips strong,
.funnel-step-head strong,
.goal-card-head strong,
.funnel-config-head strong,
.goal-preset-card strong {
  color: var(--ink);
}

.mini-stats div,
.stat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(13, 15, 31, 0.78);
  border-color: rgba(169, 146, 255, 0.19);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.stat:hover {
  border-color: rgba(255, 43, 214, 0.36);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24), 0 0 26px rgba(139, 92, 246, 0.16);
}

.stat::before {
  background: linear-gradient(90deg, #19d8ff, #8b5cf6, #ff2bd6);
  box-shadow: 0 0 18px rgba(255, 43, 214, 0.42);
}

.stat-label span,
.mini-stats dt {
  color: #aaa1c9;
}

.success {
  background: linear-gradient(180deg, rgba(25, 216, 255, 0.14), rgba(139, 92, 246, 0.08)), rgba(13, 15, 31, 0.78);
  border-color: rgba(25, 216, 255, 0.3);
  color: #7cecff;
}

.success .stat-label span,
.success small {
  color: #a8dfea;
}

.warn {
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.16), rgba(139, 92, 246, 0.06)), rgba(13, 15, 31, 0.78);
  border-color: rgba(255, 209, 102, 0.32);
  color: #ffd166;
}

.danger {
  background: linear-gradient(180deg, rgba(255, 91, 122, 0.14), rgba(255, 43, 214, 0.06)), rgba(13, 15, 31, 0.78);
  border-color: rgba(255, 91, 122, 0.34);
  color: #ff91a6;
}

.info-tip {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(169, 146, 255, 0.26);
  color: #dcd3ff;
}

.info-tip > span,
.info-tip > span::after {
  background: #060711;
}

.info-tip:hover,
.info-tip:focus,
.info-tip.is-open,
.segmented.active,
.copy-button.copied {
  background: #ff2bd6;
  border-color: #ff2bd6;
  color: #ffffff;
}

.funnel-mode-switch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(169, 146, 255, 0.18);
}

.funnel-mode-switch a {
  color: #bdb3df;
}

.funnel-mode-switch a.active,
.start-node {
  background: linear-gradient(135deg, #111827, #312e81 42%, #7c2d92);
  border-color: rgba(255, 43, 214, 0.32);
}

.funnel-start {
  background: linear-gradient(135deg, rgba(25, 216, 255, 0.11), rgba(139, 92, 246, 0.1));
  border-color: rgba(25, 216, 255, 0.24);
}

.funnel-bar,
.step-progress,
.scroll-bar-row div {
  background: rgba(255, 255, 255, 0.1);
}

.funnel-bar b,
.step-progress b,
.scroll-bar-row b {
  background: linear-gradient(90deg, #19d8ff, #8b5cf6 48%, #ff2bd6);
  box-shadow: 0 0 18px rgba(255, 43, 214, 0.32);
}

.step-node:not(:last-child)::after {
  background: #ff2bd6;
  box-shadow: 0 0 18px rgba(255, 43, 214, 0.36);
}

.preview-meta {
  background: rgba(25, 216, 255, 0.08);
  border-color: rgba(25, 216, 255, 0.2);
  color: #c8f6ff;
}

.heatmap-stage,
.heatmap-viewport {
  background: rgba(255, 255, 255, 0.96);
}

.event-stream-head {
  background: rgba(139, 92, 246, 0.13);
}

.goal-level.primary {
  background: rgba(25, 216, 255, 0.16);
  color: #7cecff;
}

.goal-level.secondary {
  background: rgba(255, 43, 214, 0.14);
  color: #ff9ff0;
}

.goal-level.tertiary {
  background: rgba(139, 92, 246, 0.18);
  color: #c5b4ff;
}

.preset-lock {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.3);
  color: #ffe29a;
}

.source-list div,
.page-sources > div,
.plain-list li,
th,
td {
  border-color: rgba(169, 146, 255, 0.16);
}
