:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #fbfcfd;
  --nav: #ffffff;
  --ink: #172026;
  --muted: #66737d;
  --line: #dce3e8;
  --field: #ffffff;
  --field-line: #c8d2d9;
  --accent: #176b87;
  --accent-dark: #0d4f63;
  --action: #f47b20;
  --action-dark: #c95d0d;
  --warn: #a45a00;
  --danger: #a13030;
  --ok: #2d7047;
  --shadow: rgba(23, 32, 38, .08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11181d;
  --panel: #182229;
  --panel-soft: #141d23;
  --nav: #131b21;
  --ink: #edf3f6;
  --muted: #a5b3bd;
  --line: #2d3a43;
  --field: #101820;
  --field-line: #3b4a54;
  --accent: #65b8d1;
  --accent-dark: #9fd3e3;
  --action: #f47b20;
  --action-dark: #ff9a49;
  --warn: #f0b45d;
  --danger: #ff8b84;
  --ok: #7fce9b;
  --shadow: rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

nav {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--nav);
}

nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: 8px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

nav a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.theme-toggle {
  margin-left: auto;
  min-height: 34px;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 0 11px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

.theme-toggle-icon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--panel);
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
}

nav .brand span:not(.brand-mark) {
  letter-spacing: .1px;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(9, 19, 26, .14));
}

.brand-mark-bg {
  fill: #ffffff;
  stroke: rgba(13, 27, 36, .16);
  stroke-width: 1;
}

.brand-mark-pipe,
.brand-mark-bolt {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark-pipe {
  stroke: #15242d;
  stroke-width: 2.2;
}

.brand-mark-bolt {
  stroke: #f97316;
  stroke-width: 2.35;
}

.brand-mark-node {
  fill: #ffffff;
  stroke: #0f1f28;
  stroke-width: 1.8;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 34px; margin-bottom: 8px; }
h2 { font-size: 20px; }

.hero, .page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.splash {
  min-height: min(720px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .85fr);
  gap: 34px;
  align-items: center;
}

.marketing-hero {
  padding: 34px 0 42px;
}

.splash-copy h1 {
  max-width: 680px;
  font-size: 62px;
  line-height: 1;
  margin-bottom: 16px;
}

.splash-copy p:not(.eyebrow) {
  max-width: 630px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.45;
}

.wordmark {
  display: block;
  width: min(660px, 100%);
  height: auto;
  margin: 0 0 22px;
  mix-blend-mode: multiply;
}

html[data-theme="dark"] .wordmark {
  filter: none;
  mix-blend-mode: normal;
}

html[data-theme="dark"] .brand-mark-bg {
  fill: #f8fafc;
  stroke: rgba(255, 255, 255, .3);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

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

.button.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-dark);
}

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

.button.secondary:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

.splash-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 18px 42px var(--shadow);
}

.marketing-panel {
  align-self: center;
}

.marketing-section {
  padding: 58px 0;
  border-top: 1px solid var(--line);
}

.marketing-cards-section {
  display: grid;
  gap: 28px;
}

.section-head {
  max-width: 760px;
}

.marketing-section h2,
.marketing-band h2 {
  margin-bottom: 10px;
  font-size: 32px;
  line-height: 1.12;
}

.marketing-section p:not(.eyebrow),
.marketing-band p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

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

.benefit-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 1px 2px var(--shadow);
}

.benefit-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.benefit-card span {
  color: var(--muted);
  line-height: 1.6;
}

.how-section {
  border-top: 0;
  padding-top: 18px;
}

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

.how-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 1px 2px var(--shadow);
}

.how-card h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}

.how-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: var(--action-dark);
  font-size: 15px;
  font-weight: 900;
}

.how-card-accent {
  border-color: color-mix(in srgb, var(--action) 34%, var(--line));
  background: color-mix(in srgb, var(--action) 11%, var(--panel));
}

.marketing-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  box-shadow: 0 1px 2px var(--shadow);
}

.boxed-band {
  margin: 18px 0 54px;
}

.plus-actions,
.pilot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.plus-actions span {
  min-width: 94px;
  border: 1px solid color-mix(in srgb, var(--action) 48%, var(--line));
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--action-dark);
  background: color-mix(in srgb, var(--action) 11%, var(--panel));
  font-weight: 900;
  text-align: center;
}

.business-grid,
.profile-list {
  display: grid;
  gap: 12px;
}

.business-tile,
.profile-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: inherit;
  text-decoration: none;
}

.business-tile span,
.profile-card span {
  color: var(--muted);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.profile-actions form {
  margin: 0;
}

.profile-card.disabled {
  opacity: .72;
}

.status-pill {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.enabled {
  background: #e6f4ea;
  color: var(--ok);
}

.status-pill.disabled {
  background: #eceff3;
  color: #52606a;
}

.stats-grid,
.stats-mini-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-grid {
  margin-bottom: 26px;
}

.stats-client-list {
  display: grid;
  gap: 14px;
}

.stats-client-card {
  gap: 14px;
}

.stats-client-head,
.stats-foot {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-tile {
  display: grid;
  gap: 3px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.metric-tile span,
.metric-tile small {
  color: var(--muted);
}

.metric-tile span {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-tile strong {
  font-size: 24px;
  line-height: 1.1;
}

.business-logo {
  width: min(170px, 34vw);
  max-height: 110px;
  object-fit: contain;
  justify-self: end;
}

.business-logo-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
}

.business-logo-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

.return-panel {
  margin-top: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.return-panel p {
  margin: 0;
}

.return-panel a {
  justify-self: start;
  color: var(--action);
  font-weight: 800;
}

.flow-step {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--action);
  padding: 14px 14px 14px 16px;
  background: var(--panel-soft);
  border-radius: 6px;
}

.flow-step strong {
  font-size: 17px;
}

.flow-step span {
  color: var(--muted);
  line-height: 1.4;
}

.hero {
  min-height: 170px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 2px var(--shadow);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.panel * {
  min-width: 0;
  max-width: 100%;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

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

input, textarea, select {
  width: 100%;
  border: 1px solid var(--field-line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--field);
}

textarea { resize: vertical; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--action);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: var(--action-dark); }

button.secondary-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-dark);
}

button.secondary-action:hover {
  border-color: var(--accent);
  background: var(--panel-soft);
}

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

button.danger-action {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--panel);
  color: var(--danger);
}

button.danger-action:hover {
  background: color-mix(in srgb, var(--danger) 12%, var(--panel));
}

.lead-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lead-card {
  display: grid;
  gap: 8px;
  min-height: 190px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.lead-card span, .lead-card small { color: var(--muted); }

.lead-card.closed {
  background: var(--panel-soft);
}

.lead-list.archived .lead-card {
  min-height: 170px;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8eef2;
  color: #24323a;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.emergency { background: #ffe6e4; color: var(--danger); }
.badge.high { background: #fff2d8; color: var(--warn); }
.badge.normal { background: #e6f4ea; color: var(--ok); }
.badge.junk { background: #eceff3; color: #52606a; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px 14px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--panel-soft);
  font-family: Consolas, "Courier New", monospace;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  min-width: 0;
}

.timeline li {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.timeline p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.quick-actions form { margin: 0; }

.quick-actions button {
  min-height: 36px;
  padding-inline: 12px;
}

.lifecycle-actions {
  display: grid;
  gap: 16px;
}

.lifecycle-actions form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.closed-note {
  margin-top: 0;
  color: var(--muted);
}

.notice {
  margin-bottom: 18px;
  border-left: 4px solid var(--ok);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ok) 14%, var(--panel));
  font-weight: 700;
}

.admin-context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.admin-context-bar span {
  font-weight: 800;
  color: var(--text);
}

.admin-context-bar div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-context-bar a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.section-title {
  margin-top: 30px;
}

.pending {
  color: var(--warn);
  font-weight: 800;
}

.verified {
  color: var(--ok);
  font-weight: 800;
}

.empty {
  color: var(--muted);
  margin: 0;
}

.photo-summary {
  color: var(--muted);
  line-height: 1.45;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 150px));
  gap: 12px;
  align-items: start;
}

.photo-tile {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 150px;
  color: inherit;
  text-decoration: none;
}

.photo-tile img {
  width: 100%;
  max-width: 150px;
  height: 118px;
  max-height: 118px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.qualification-panel {
  margin-bottom: 22px;
}

.qualification-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
}

.qualification-summary strong {
  color: var(--text);
}

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

.qualification-metrics span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

.qualification-metrics strong {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.qualification-answers {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.qualification-answers li span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.photo-tile span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  nav, main { padding-left: 16px; padding-right: 16px; }
  .form-grid, .two-col, .splash, .marketing-section, .marketing-band { grid-template-columns: 1fr; }
  .hero, .page-head { display: block; }
  .page-actions { justify-content: flex-start; margin-top: 14px; }
  .splash { min-height: auto; }
  .splash-copy h1 { font-size: 42px; }
  .splash-copy p:not(.eyebrow) { font-size: 18px; }
  .benefit-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .benefit-card,
  .how-card { min-height: auto; }
  .photo-grid { grid-template-columns: repeat(auto-fit, minmax(96px, 132px)); }
  .photo-tile { max-width: 132px; }
  .photo-tile img { max-width: 132px; height: 104px; max-height: 104px; }
  h1 { font-size: 28px; }
}
