:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --field: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --primary: #0d6efd;
  --primary-ink: #ffffff;
  --primary-soft: #e7f0ff;
  --hint-border: #b6d0ff;
  --subtle-fill: #f1f5f9;
  --tab-active-fill: #ffffff;
  --primary-hover: #0b5ed7;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --pill-ok-bg: #ecfdf5;
  --pill-ok-fg: #047857;
  --danger-fill-soft: #fef2f2;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #121a2e;
  --field: #1a2540;
  --ink: #e8edf5;
  --ink-soft: #94a3b8;
  --muted: #6b7c93;
  --line: #2d3f5c;
  --primary: #4d93ff;
  --primary-ink: #ffffff;
  --primary-soft: rgba(77, 147, 255, 0.14);
  --hint-border: #3d5a8f;
  --subtle-fill: #1e2a42;
  --tab-active-fill: #263858;
  --primary-hover: #6aa6ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
  --pill-ok-bg: rgba(34, 197, 94, 0.16);
  --pill-ok-fg: #4ade80;
  --danger-fill-soft: rgba(220, 38, 38, 0.12);
}

html[data-theme="dark"] .pill:not(.pill--muted):not(.pill--bad) {
  background: var(--pill-ok-bg);
  color: var(--pill-ok-fg);
}

html[data-theme="dark"] .pill--muted {
  background: var(--subtle-fill);
  color: var(--ink-soft);
}

html[data-theme="dark"] .pill--bad {
  background: var(--danger-fill-soft);
  color: var(--danger);
}

html[data-theme="dark"] .tab.active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(77, 147, 255, 0.22);
}

html[data-theme="dark"] .btn.link.danger:hover {
  background: var(--danger-fill-soft);
}

html[data-theme="dark"] .status {
  background: var(--subtle-fill);
}

html[data-theme="dark"] .status.scheduled {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

html[data-theme="dark"] .status.in_progress {
  background: rgba(251, 191, 36, 0.14);
  color: #fcd34d;
}

html[data-theme="dark"] .status.completed {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}

html[data-theme="dark"] .status.failed {
  background: rgba(248, 113, 113, 0.14);
  color: #fca5a5;
}

html[data-theme="dark"] .status.cancelled {
  color: var(--ink-soft);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.logo-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #38bdf8);
  display: inline-block;
  align-self: center;
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-sub { color: var(--ink-soft); font-size: 14px; }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
}
.navlink {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  transition: background 120ms ease, color 120ms ease;
}
.navlink:hover { background: var(--subtle-fill); color: var(--ink); }
.navlink.active { background: var(--primary-soft); color: var(--primary); }

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

.theme-toggle,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    border-color 120ms ease;
}

.theme-toggle:hover,
.icon-btn:hover {
  background: var(--subtle-fill);
  color: var(--ink);
}

.theme-toggle:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-icon,
.icon {
  width: 19px;
  height: 19px;
}

.pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pill-ok-bg);
  color: var(--pill-ok-fg);
  font-weight: 600;
}
.pill--muted { background: var(--subtle-fill); color: var(--ink-soft); }
.pill--bad { background: var(--danger-fill-soft); color: var(--danger); }

/* Layout */
.layout {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.layout--narrow {
  max-width: 480px;
  grid-template-columns: 1fr;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stack label span:first-child {
  font-weight: 600;
  font-size: 13px;
}

.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
}
.auth-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.btn--small {
  font-size: 12px;
  padding: 5px 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.card h2 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--ink-soft); }
.muted.empty { padding: 12px 4px; }

/* Scheduling-mode tabs (sit between the form intro and the form itself) */
.tabs {
  display: inline-flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  background: var(--subtle-fill);
  border-radius: 10px;
}
.tab {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  background: var(--tab-active-fill);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* The two scheduling-mode panels (appointment vs direct). They share the
   same form, so we just toggle [hidden] on the wrapper. */
.mode-panel { display: contents; }
.mode-panel[hidden] { display: none; }

/* Warn state for the computed call-time preview when the appointment is too
   close (less than 96 hours away). */
.hint strong.warn { color: var(--danger); }

/* Form */
form { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.row { display: grid; gap: 16px; }
.row.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row.two { grid-template-columns: 1fr; } }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
label em { color: var(--muted); font-style: normal; font-weight: 500; }

input[type="text"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  background: var(--field);
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; min-height: 110px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--primary-soft);
  border: 1px dashed var(--hint-border);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  align-self: end;
}
.hint strong { color: var(--ink); font-size: 14px; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.form-status { font-size: 13px; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--success); }

.btn {
  border: 0;
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, color 120ms ease;
}
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 6px 12px;
  font-size: 13px;
}
.btn.ghost:hover { background: var(--subtle-fill); color: var(--ink); }
.btn.link {
  background: transparent;
  color: var(--ink-soft);
  padding: 4px 8px;
  font-size: 12px;
}
.btn.link:hover { background: var(--subtle-fill); color: var(--ink); }
.btn.link.danger { color: var(--danger); }
.btn.link.danger:hover { background: var(--danger-fill-soft); color: var(--danger); }

.row-actions { display: inline-flex; gap: 6px; }

.history-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.history-toggle {
  width: 100%;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}
.history-toggle::before {
  content: "▸";
  font-size: 11px;
  transition: transform 120ms ease;
  display: inline-block;
}
.history-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }

.history-list { margin-top: 10px; }
.history-list .call-item { opacity: 0.85; }

/* Template preview shown above the instructions textarea */
.template-preview {
  background: var(--primary-soft);
  border: 1px solid var(--hint-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.template-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
}
.template-preview pre {
  margin: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}

/* Inline "Manage templates →" link next to a label */
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.label-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.label-link:hover { text-decoration: underline; }

.templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--field);
}
.template-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}
.template-row-body {
  margin: 6px 0 0;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  max-height: 120px;
  overflow: auto;
}

/* Calls list */
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.calls-list { display: flex; flex-direction: column; gap: 10px; }

.call-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.call-item .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  grid-column: 1 / -1;
}
.call-item .who {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}
.call-item .who strong { color: var(--ink); }
.call-item .who .phone { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.call-item .when {
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.call-item .when--appt {
  font-size: 12px;
  color: var(--muted);
}
.call-item .body { grid-column: 1 / -1; color: var(--ink-soft); font-size: 13px; white-space: pre-wrap; }
.call-item .meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--subtle-fill);
  color: var(--ink-soft);
}
.status.scheduled { background: #e0f2fe; color: #0369a1; }
.status.in_progress { background: #fef3c7; color: #92400e; }
.status.completed { background: #dcfce7; color: #166534; }
.status.failed { background: #fee2e2; color: #991b1b; }
.status.cancelled { background: #f1f5f9; color: #475569; }

/* Collapsible body for past calls. The summary shows a template chip (or a
   "Custom instructions" hint) and an inline Show/Hide toggle. */
.call-item .body-toggle { grid-column: 1 / -1; }
.call-item .body-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 2px 0;
}
.call-item .body-toggle > summary::-webkit-details-marker { display: none; }
.call-item .body-toggle > summary::before {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 120ms ease;
  display: inline-block;
}
.call-item .body-toggle[open] > summary::before { transform: rotate(90deg); }
.call-item .body-toggle .toggle-hint { font-size: 12px; }
.call-item .body-toggle:not([open]) .toggle-open { display: none; }
.call-item .body-toggle[open] .toggle-closed { display: none; }
.call-item .body-toggle .body { margin-top: 8px; }

.template-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Calendar page ---- */

.calendar-page {
  max-width: 1040px;
  margin: 32px auto;
  padding: 0 24px;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.calendar-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calendar-title {
  font-size: 20px;
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
  min-width: 200px;
  letter-spacing: -0.01em;
}

.cal-legend {
  font-size: 13px;
  margin: 10px 0 14px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}

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

.cal-day {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
  background: var(--field);
}

.cal-day--fade {
  opacity: 0.4;
}

.cal-day--today {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

.cal-day-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  min-height: 0;
}

.cal-chip {
  border: 0;
  border-radius: 6px;
  padding: 3px 5px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  background: var(--primary-soft);
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cal-chip:hover {
  opacity: 0.9;
}

.cal-modal-meta {
  font-size: 13px;
  margin: 0 0 14px;
}

.cal-modal-actions {
  flex-wrap: wrap;
}

.modal-dialog--narrow {
  width: min(440px, 100%);
}

@media (max-width: 640px) {
  .calendar-page {
    padding: 0 16px;
  }
  .cal-day {
    min-height: 72px;
    padding: 4px;
  }
  .cal-chip {
    font-size: 9px;
    padding: 2px 4px;
  }
}

/* ---- Modal (settings gear) ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  overflow-y: auto;
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(560px, 100%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.modal-head .btn.ghost {
  font-size: 22px;
  line-height: 1;
  padding: 2px 10px;
}

.modal-body {
  padding: 18px 20px 20px;
}

/* Custom help popovers: narrow column so copy stacks tall, not like OS title tooltips */
.settings-form .settings-field-tip-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-form .settings-wh-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
}

.settings-form .settings-wh-icon--sun {
  margin-top: 1px;
}

.settings-form .settings-field-tip-head {
  position: relative;
  display: block;
  width: 100%;
  cursor: help;
}

.settings-form .settings-field-tip--row .settings-field-tip-head {
  width: auto;
  flex: 1;
  min-width: 0;
}

.settings-form .settings-tip-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: min(9.75rem, calc(100vw - 48px));
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.015em;
  color: var(--ink-soft);
  text-align: left;
  hyphens: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.14s ease;
  transform: translateY(6px);
}

html[data-theme="dark"] .settings-form .settings-tip-panel {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.settings-form .settings-field-tip:hover .settings-tip-panel,
.settings-form .settings-field-tip:focus-within .settings-tip-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-form { margin-top: 0; }
.settings-form .actions { margin-top: 8px; }

.settings-banner {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--subtle-fill);
  color: var(--ink-soft);
}

.settings-banner.ok {
  background: var(--pill-ok-bg);
  color: var(--pill-ok-fg);
  border-color: transparent;
}

.settings-banner.warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warn);
  border-color: rgba(217, 119, 6, 0.35);
}

.settings-form code {
  background: var(--subtle-fill);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* Landing / splash — sober system typography (avoid marketing / playful feel) */
body[data-forseti-page="landing"] {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.topbar--landing {
  position: relative;
  z-index: 2;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
}

@supports not (background: color-mix(in srgb, white 50%, black)) {
  .topbar--landing {
    background: var(--surface);
  }
}

.brand--landing {
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.brand-hit {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-hit:hover .brand-name {
  color: var(--primary);
}

.splash-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 15% 15%, rgba(13, 110, 253, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 60% at 85% 25%, rgba(56, 189, 248, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 95%, rgba(13, 110, 253, 0.04), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}

html[data-theme="dark"] .splash-bg {
  background:
    radial-gradient(ellipse 90% 70% at 15% 15%, rgba(77, 147, 255, 0.1), transparent 55%),
    radial-gradient(ellipse 70% 60% at 85% 25%, rgba(56, 189, 248, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 50% at 50% 95%, rgba(77, 147, 255, 0.05), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}

.splash-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.18;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}

.splash {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.splash-hero {
  padding: 48px 0 56px;
  text-align: center;
}

.splash-kicker {
  display: inline-block;
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.splash-title {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4.2vw, 2.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

.splash-accent {
  color: var(--primary);
  font-weight: 700;
}

.splash-lead {
  margin: 0 auto 28px;
  max-width: 46ch;
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: 400;
}

.splash-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.splash-btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: 12px;
}

.splash-panel {
  margin-top: 8px;
}

.splash-h2 {
  margin: 0 0 24px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: center;
}

.splash-h2--compact {
  margin-bottom: 8px;
  text-align: left;
}

.splash-panel--grid .splash-h2 {
  margin-bottom: 28px;
}

.splash-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.splash-card {
  padding: 22px 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.splash-card:hover {
  transform: translateY(-1px);
  border-color: var(--hint-border);
}

.splash-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.splash-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.splash-card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.splash-card-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.splash-strip {
  margin-top: 40px;
  padding: 28px 28px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(
    135deg,
    var(--primary-soft) 0%,
    var(--surface) 48%,
    var(--subtle-fill) 100%
  );
  box-shadow: var(--shadow);
}

.splash-strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.splash-strip-lead {
  margin: 0;
  max-width: 46ch;
  font-size: 14px;
}

@media (max-width: 560px) {
  .splash-hero {
    padding-top: 28px;
  }

  .splash-strip-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .splash-strip-inner .btn {
    width: 100%;
    text-align: center;
  }
}
