.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}
body.is-workspace .container {
  max-width: 1280px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sp-client-picker {
  display: flex;
  align-items: center;
  min-width: 160px;
  max-width: 240px;
}
.sp-client-picker select {
  width: 100%;
  font: 550 13px/1.2 var(--sp-font);
  border: 1px solid var(--sp-line);
  border-radius: 10px;
  background: var(--sp-surface);
  color: var(--sp-ink);
  padding: 6px 10px;
}

/* —— Typography —— */
h1 {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  line-height: 1.15;
}
h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
}
.panel-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.25;
}
.panel-sub {
  margin: 0;
  font-size: 15px;
  color: var(--sp-muted);
  line-height: 1.45;
  max-width: 46em;
}
.panel-section-head {
  margin-bottom: 22px;
}
.wizard-panel-inner {
  padding: 28px 28px 26px;
}
.side-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 13px;
  color: var(--sp-muted);
  background: #f5f5f7;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 20px;
  line-height: 1.45;
}
.side-note strong { color: var(--sp-ink); font-weight: 550; }
.subtitle {
  color: var(--sp-muted);
  margin: 0 0 28px;
  font-size: 15px;
  max-width: 42em;
  line-height: 1.4;
}
.onboard-header .subtitle {
  font-size: 15px;
  margin-bottom: 0;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.page-header .subtitle { margin-bottom: 0; }
.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--sp-muted);
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

/* —— Panels / cards —— */
.panel {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-md);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.entity-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.entity-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.06);
}
.entity-card .card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.entity-card .card-body { flex: 1; min-width: 0; }
.entity-card .card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.25;
}
.entity-card .card-meta {
  font-size: 13px;
  color: var(--sp-muted);
  margin: 0;
}
.entity-card .card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 4px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8e8ed, #d2d2d7);
  color: var(--sp-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.avatar.hh { background: linear-gradient(145deg, #dce9f8, #c5d8ef); }
.avatar.unassigned { background: linear-gradient(145deg, #ececef, #dddde2); color: var(--sp-muted); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip, .badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: #f0f0f2;
  color: var(--sp-ink);
  border: 1px solid transparent;
}
.chip.ok, .badge.ok { background: var(--sp-green-bg); color: var(--sp-green); border-color: var(--sp-green-border); }
.chip.warn, .badge.warn { background: var(--sp-warn-bg); color: var(--sp-warn-ink); border-color: var(--sp-amber-border); }
.chip.err, .badge.err { background: var(--sp-red-bg); color: var(--sp-red); border-color: var(--sp-red-border); }
.chip.muted, .badge.muted { background: #f0f0f2; color: var(--sp-muted); }
.chip.accent { background: var(--sp-primary-soft); color: var(--sp-primary); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}
.pill.quiet {
  background: #f0f0f2;
  color: var(--sp-muted);
  font-weight: 550;
}
.pill.quiet.ok {
  background: var(--sp-green-bg);
  color: var(--sp-green);
}
.pill.quiet.warn {
  background: var(--sp-warn-bg);
  color: var(--sp-warn-ink);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.chip.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 650;
  background: #f0f0f2;
}

/* —— Segmented control —— */
.seg {
  display: inline-flex;
  align-items: stretch;
  padding: 3px;
  background: #e8e8ed;
  border-radius: 10px;
  gap: 2px;
  min-height: 36px;
}
.seg button,
.seg .seg-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--sp-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  min-height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.seg button.active,
.seg .seg-btn.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 600;
}
.seg button:hover:not(.active),
.seg .seg-btn:hover:not(.active) {
  color: var(--sp-muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 22px;
  justify-content: space-between;
}
.toolbar-left, .toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-input {
  width: 240px;
  max-width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  background: var(--sp-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%86868b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 12px center no-repeat;
  font-size: 14px;
  font-family: inherit;
  color: var(--sp-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.search-input:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 3px var(--sp-primary-soft);
}

/* —— Progress —— */
.progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-label {
  font-size: 12px;
  color: var(--sp-muted);
  font-weight: 500;
}
.progress-track {
  height: 6px;
  background: #e8e8ed;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--sp-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-fill.warn { background: #e6a817; }
.progress-fill.empty { background: transparent; }

/* —— Forms —— */
label {
  display: block;
  font-weight: 550;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--sp-ink);
  letter-spacing: -0.01em;
}
.field { margin-bottom: 18px; }
.hint { color: var(--sp-muted); font-size: 13px; margin-top: 6px; line-height: 1.4; }
.hint-inline { color: var(--sp-muted); font-size: 13px; font-weight: 400; }

select,
input[type=text],
input[type=password],
input[type=number],
input[type=url],
input[type=file],
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--sp-line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--sp-ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus,
input[type=text]:focus,
input[type=password]:focus,
input[type=number]:focus,
input[type=url]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.5);
  box-shadow: 0 0 0 3px var(--sp-primary-soft);
}
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--sp-primary); }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 200px; }

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f5f5f7;
  border-radius: var(--sp-radius-sm);
  margin-bottom: 18px;
}
.toggle-field label {
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.field.prominent input {
  font-size: 16px;
  padding: 12px 14px;
  font-weight: 500;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 980px;
  border: 1px solid transparent;
  background: var(--sp-primary);
  color: #fff;
  font-weight: 550;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--sp-primary-hover); text-decoration: none; color: #fff; }
.btn.secondary {
  background: #fff;
  color: var(--sp-ink);
  border-color: var(--sp-line);
}
.btn.secondary:hover { background: #f5f5f7; color: var(--sp-ink); }
.btn.ghost {
  background: transparent;
  color: var(--sp-primary);
  border-color: transparent;
  padding: 8px 12px;
}
.btn.ghost:hover { background: var(--sp-primary-soft); color: var(--sp-primary); }
.btn.danger { background: #b42318; }
.btn.danger:hover { background: #912018; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; align-items: center; }

.pack-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}
.pack-bar .btn { font-size: 13px; padding: 7px 14px; }

/* —— ICP targeting rows —— */
.icp-group { margin-bottom: 22px; }
.icp-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}
.icp-lane { margin-bottom: 14px; }
.icp-lane-title {
  font-size: 13px;
  font-weight: 550;
  color: var(--sp-ink);
  margin: 0 0 8px;
}
.icp-row {
  display: grid;
  grid-template-columns: auto 1fr minmax(200px, 280px);
  gap: 12px 16px;
  align-items: center;
  padding: 12px 14px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-sm);
  margin-bottom: 8px;
}
.icp-row .icp-check { display: flex; align-items: center; }
.icp-row .icp-info { min-width: 0; }
.icp-row .icp-name {
  font-weight: 550;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.icp-row .icp-campaign input:disabled {
  opacity: 0.45;
  background: #f5f5f7;
}

@media (max-width: 720px) {
  .icp-row {
    grid-template-columns: auto 1fr;
  }
  .icp-row .icp-campaign { grid-column: 1 / -1; }
}

/* —— Sticky playbook note —— */
.sticky-note {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: #fffef5;
  border: 1px solid rgba(196, 140, 20, 0.22);
  border-radius: var(--sp-radius);
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: var(--sp-shadow-md);
  font-size: 13px;
  color: var(--sp-warn-ink);
}
.sticky-note strong { color: var(--sp-ink); }
.sticky-note .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: 8px;
  display: block;
  margin-top: 6px;
  color: var(--sp-ink);
}

/* —— Preview panel —— */
.preview-panel {
  background: #f5f5f7;
  border-radius: var(--sp-radius-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.preview-panel h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.preview-panel .preview-body {
  font-size: 14px;
  color: var(--sp-ink);
  white-space: pre-wrap;
  line-height: 1.5;
  margin: 0 0 14px;
}
.preview-panel .preview-body:last-child { margin-bottom: 0; }

.followup-snip {
  font-size: 13px;
  color: var(--sp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.lane-section { margin-bottom: 28px; }
.lane-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.vertical-block { margin-bottom: 36px; }

.unassigned-section {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px solid var(--sp-line);
}
.unassigned-section .entity-card {
  opacity: 0.92;
  background: #fafafa;
}

.warning-banner {
  background: var(--sp-warn-bg);
  border: 1px solid var(--sp-amber-border);
  color: var(--sp-warn-ink);
  border-radius: var(--sp-radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.warning-banner.hidden { display: none; }

/* —— Steps / tables / notices (shared) —— */
.steps { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.step {
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8e8ed;
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--sp-muted);
}
.step.current { background: var(--sp-primary); border-color: var(--sp-primary); color: #fff; font-weight: 600; }
.step.done { background: var(--sp-green-bg); border-color: var(--sp-green-border); color: var(--sp-green); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sp-line); vertical-align: top; }
th {
  color: var(--sp-muted);
  font-weight: 550;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr:last-child td { border-bottom: none; }
td input[type=text] { font-size: 13px; padding: 6px 8px; }

.notice {
  padding: 12px 16px;
  border-radius: var(--sp-radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.notice.warn { background: var(--sp-warn-bg); border: 1px solid var(--sp-amber-border); color: var(--sp-warn-ink); }
.notice.err { background: var(--sp-red-bg); border: 1px solid var(--sp-red-border); color: var(--sp-red); }
.notice.ok { background: var(--sp-green-bg); border: 1px solid var(--sp-green-border); color: var(--sp-green); }

.empty { color: var(--sp-muted); font-style: italic; padding: 18px 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 340px; }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-all;
}

.confirm-box {
  background: var(--sp-warn-bg);
  border: 1px solid var(--sp-amber-border);
  border-radius: var(--sp-radius);
  padding: 16px;
  margin: 18px 0;
}

.is-hidden { display: none !important; }


/* ========================================================================
   Core — reset, typography, topbar, mobile nav, shared components,
   glassmorphism utilities, and animation primitives.
   ======================================================================== */

/* --- Reset & base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sp-bg);
  color: var(--sp-ink);
  font: 16px/1.5 var(--sp-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--sp-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* --- Typography --------------------------------------------------------- */
h1, h2, h3, h4 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }

.subtitle {
  margin: 4px 0 0;
  color: var(--sp-muted);
  font-size: 14px;
}
.hint {
  color: var(--sp-faint);
  font-size: 13px;
}

/* --- Page header -------------------------------------------------------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  font: 600 15px/1.2 var(--sp-font);
  cursor: pointer;
  background: var(--sp-primary);
  color: var(--sp-primary-ink);
  transition: background var(--sp-ease), transform var(--sp-ease), box-shadow var(--sp-ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--sp-primary-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--sp-shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: var(--sp-surface);
  color: var(--sp-ink);
  border: 1px solid var(--sp-line);
}
.btn.secondary:hover {
  background: var(--sp-bg);
  border-color: var(--sp-primary);
}

.btn.sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* --- Chips -------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- Panel (generic card container) ------------------------------------- */
.panel {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 16px 18px;
  box-shadow: var(--sp-shadow-sm);
  transition: box-shadow var(--sp-ease), transform var(--sp-ease);
}
.panel:hover {
  box-shadow: var(--sp-shadow-md);
}

/* --- Glassmorphism card ------------------------------------------------- */
.glass-card {
  background: var(--sp-glass-bg);
  -webkit-backdrop-filter: blur(var(--sp-glass-blur));
  backdrop-filter: blur(var(--sp-glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-sm);
  transition: transform var(--sp-ease), box-shadow var(--sp-ease);
}
.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sp-shadow-md);
}

/* --- Entity card (lead, client, etc.) ----------------------------------- */
.entity-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 14px 16px;
  box-shadow: var(--sp-shadow-sm);
  transition: box-shadow var(--sp-ease), border-color var(--sp-ease),
              transform var(--sp-ease), opacity var(--sp-ease);
}
.entity-card:hover {
  box-shadow: var(--sp-shadow-md);
  transform: translateY(-2px);
}

/* --- Forms -------------------------------------------------------------- */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
textarea,
select {
  border: 1px solid var(--sp-line);
  border-radius: 12px;
  padding: 10px 14px;
  font: 15px/1.45 var(--sp-font);
  color: var(--sp-ink);
  background: var(--sp-surface);
  transition: border-color var(--sp-ease), box-shadow var(--sp-ease);
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--sp-primary);
  box-shadow: 0 0 0 3px var(--sp-primary-soft);
}

/* --- Topbar (inside base.html) ------------------------------------------ */
.sp-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--sp-glass-bg);
  -webkit-backdrop-filter: blur(var(--sp-glass-blur));
  backdrop-filter: blur(var(--sp-glass-blur));
  border-bottom: 1px solid var(--sp-line);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-topbar-brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--sp-ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.sp-topbar-brand:hover { text-decoration: none; }

.sp-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.sp-nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font: 600 14px var(--sp-font);
  color: var(--sp-muted);
  text-decoration: none;
  transition: color var(--sp-ease), background var(--sp-ease);
  position: relative;
}
.sp-nav-link:hover {
  color: var(--sp-ink);
  background: var(--sp-primary-soft);
  text-decoration: none;
}
.sp-nav-link.is-active {
  color: var(--sp-primary);
}
.sp-nav-link.is-active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--sp-gradient);
}

/* --- Hamburger button --------------------------------------------------- */
.sp-hamburger {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  cursor: pointer;
  position: relative;
  padding: 0;
}
.sp-hamburger span,
.sp-hamburger span::before,
.sp-hamburger span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sp-ink);
  border-radius: 2px;
  transition: transform var(--sp-ease), opacity var(--sp-ease);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.sp-hamburger span { top: 50%; margin-top: -1px; }
.sp-hamburger span::before { content: ""; top: -7px; left: 0; width: 22px; }
.sp-hamburger span::after { content: ""; top: 7px; left: 0; width: 22px; }

.sp-hamburger.is-open span { background: transparent; }
.sp-hamburger.is-open span::before { top: 0; transform: rotate(45deg); }
.sp-hamburger.is-open span::after { top: 0; transform: rotate(-45deg); }

/* --- Mobile nav drawer -------------------------------------------------- */
.sp-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 199;
  opacity: 0;
  transition: opacity var(--sp-ease);
}
.sp-drawer-backdrop.is-open {
  display: block;
  opacity: 1;
}

.sp-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--sp-glass-bg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--sp-line);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 72px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sp-mobile-drawer.is-open {
  transform: translateX(0);
}
.sp-mobile-drawer .sp-nav-link {
  display: block;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: var(--sp-radius);
}
.sp-mobile-drawer .sp-nav-link:hover {
  background: var(--sp-primary-soft);
}
.sp-mobile-drawer .sp-nav-link.is-active {
  background: var(--sp-primary-soft);
  color: var(--sp-primary);
}
.sp-mobile-drawer .sp-nav-link.is-active::after {
  display: none;
}

/* --- Stat cards with gradient accent ------------------------------------ */
.stat-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 14px 16px;
  box-shadow: var(--sp-shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform var(--sp-ease), box-shadow var(--sp-ease);
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--sp-gradient);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sp-shadow-md);
}

/* --- Glass modal / overlay ---------------------------------------------- */
.glass-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 300;
  place-items: center;
  padding: 24px;
}
.glass-overlay.is-on { display: grid; }

.glass-modal {
  background: var(--sp-glass-bg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--sp-shadow-lg);
  max-width: 440px;
  width: 100%;
}

/* --- Toast notifications ------------------------------------------------ */
.rv-toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}
.rv-toast {
  background: var(--sp-ink);
  color: #f5f5f7;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  box-shadow: var(--sp-shadow-lg);
  max-width: 320px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.rv-toast.is-ok { background: var(--sp-primary); }
.rv-toast.is-err { background: var(--sp-red); }
.rv-toast.has-action {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
}
.rv-toast-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rv-toast-undo {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.rv-toast-undo:hover { background: rgba(255, 255, 255, 0.26); }
.rv-toast-undo:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rv-toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: left center;
  animation: rv-toast-countdown linear forwards;
}
@keyframes rv-toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .rv-toast-timer { animation: none; display: none; } }
@media (max-width: 520px) {
  .rv-toast-wrap { left: 16px; right: 16px; bottom: 16px; }
  .rv-toast { max-width: none; }
}

/* --- Utility classes ---------------------------------------------------- */
.sp-gradient-text {
  background: var(--sp-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Client-facing layout (base_client.html) ---------------------------- */
.cm-head {
  padding-bottom: 20px;
  border-bottom: 2px solid var(--sp-ink);
  margin-bottom: 22px;
}
.cm-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sp-primary);
}
.cm-sub {
  margin: 4px 0 0;
  color: var(--sp-muted);
  font-size: 14px;
}

/* --- Pack health warning ------------------------------------------------ */
.jr-pack-health {
  background: var(--sp-amber-bg);
  border: 1px solid rgba(196, 140, 20, 0.28);
  color: var(--sp-amber);
  border-radius: var(--sp-radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.jr-pack-health a { font-weight: 650; }
.page-header .btn-row { gap: 8px; }

/* --- Mobile breakpoint -------------------------------------------------- */
@media (max-width: 768px) {
  .sp-hamburger { display: block; }
  .sp-nav { display: none; }

  .sp-topbar { padding: 0 16px; }

  body { font-size: 15px; }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  h1 { font-size: 22px; }
}

/* Shell navigation and small screens */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sp-primary); outline-offset: 3px; }
.sp-topbar-session { display: flex; gap: 8px; align-items: center; }
.sp-topbar-session form { margin: 0; }
.sp-section-nav { display: flex; gap: 16px; padding: 10px 24px; flex-wrap: wrap; border-bottom: 1px solid var(--sp-line); background: var(--sp-surface); }
.sp-section-nav a { font-size: 13px; color: var(--sp-muted); }
.sp-section-nav a[aria-current] { color: var(--sp-primary); font-weight: 650; }
.sp-drawer-close { position: absolute; right: 20px; top: 16px; }
.sp-hamburger span::before, .sp-hamburger span::after { transform: none; }
.login-wrap { min-height: calc(100dvh - 180px); }
.login-card { width: min(420px, 100%); }
.login-card form { margin-top: 24px; }
input[type="password"], input[type="number"] { border: 1px solid var(--sp-line); border-radius: 12px; padding: 10px 14px; font: inherit; background: var(--sp-surface); color: var(--sp-ink); }
@media (max-width: 1000px) { .sp-hamburger { display: block; } .sp-nav { display: none; } .sp-desktop-logout { display: none; } }
@media (max-width: 768px) {
  .container { padding: 24px 16px 48px; }
  .sp-topbar-brand { font-size: 15px; }
  .panel, .wizard-panel-inner, body.is-client-meeting .panel, body.is-client-meeting .wizard-panel-inner { padding: 18px 16px; }
  .field, .row > *, .panel, .wizard-panel { min-width: 0; }
  .cm-container { padding: 20px 16px; }
  body.is-client-meeting .wizard-step { padding: 10px 8px; font-size: 13px; }
  body.is-client-meeting .wizard-steps { flex-wrap: wrap; }
  .table-wrap { overflow-x: auto; }
}
dialog.sp-mobile-drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; max-width: none; border-top: 0; border-right: 0; border-bottom: 0; color: var(--sp-ink); }
dialog.sp-mobile-drawer::backdrop { background: rgba(0,0,0,.3); }
.entity-card .card-actions { flex-wrap: wrap; gap: 6px; justify-content: flex-start; }

/* --- Collapsible settings sections (client_edit) ----------------------- */
.settings-section {
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  margin-bottom: 16px;
  background: var(--sp-surface);
}
.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.settings-section-header::-webkit-details-marker { display: none; }
.settings-section-header::marker { content: ""; }
.settings-section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.settings-section-hint {
  font-size: 13px;
  color: var(--sp-muted);
  font-weight: 500;
}
.settings-section-header::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--sp-muted);
  border-bottom: 2px solid var(--sp-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.settings-section[open] > .settings-section-header::after {
  transform: rotate(45deg);
}
.settings-section-body {
  padding: 0 18px 18px;
}
.settings-sub-head {
  font-size: 14px;
  font-weight: 600;
  color: var(--sp-muted);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Highlighted entry to the onboarding wizard */
.sp-onboard-cta { background: var(--sp-gradient); border: 0; color: #fff; white-space: nowrap; box-shadow: 0 2px 10px rgba(6, 126, 254, 0.25); }
.sp-onboard-cta:hover { color: #fff; filter: brightness(1.05); text-decoration: none; }
.sp-mobile-drawer .sp-onboard-cta { display: block; text-align: center; margin: 8px 0 12px; }
@media (max-width: 1000px) { .sp-topbar-session .sp-onboard-cta { display: none; } }
/* Client pages carry 8 tabs: give them the room between 1001px and 1300px. */
@media (max-width: 1300px) { body.is-workspace .sp-topbar-session .sp-onboard-cta { display: none; } }

/* --- Second navigation row: the current section's sub-pages (same on every page) --- */
.sp-subbar {
  position: sticky; top: 56px; z-index: 90;
  display: flex; align-items: center; gap: 6px 14px;
  padding: 0 24px; min-height: 46px;
  background: var(--sp-surface); border-bottom: 1px solid var(--sp-line);
}
.sp-subbar-back { font-size: 13px; font-weight: 600; color: var(--sp-muted); white-space: nowrap; text-decoration: none; }
.sp-subbar-back:hover { color: var(--sp-primary); text-decoration: none; }
.sp-subbar-title { font-weight: 700; font-size: 15px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  padding-right: 14px; border-right: 1px solid var(--sp-line); }
.sp-subbar-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.sp-subbar-links::-webkit-scrollbar { display: none; }
.sp-sub-link { position: relative; padding: 12px 12px; font: 600 13.5px var(--sp-font); color: var(--sp-muted); text-decoration: none; white-space: nowrap; }
.sp-sub-link:hover { color: var(--sp-ink); text-decoration: none; }
.sp-sub-link.is-active { color: var(--sp-primary); }
.sp-sub-link.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--sp-primary); }
.sp-drawer-label { margin: 14px 0 4px; font-size: 12px; font-weight: 700; color: var(--sp-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.sp-section-nav { display: none; } /* replaced by .sp-subbar */
@media (max-width: 900px) {
  .sp-subbar { padding: 0 16px; gap: 8px; }
  .sp-subbar-back { display: none; }
  .sp-subbar-title { max-width: 120px; padding-right: 8px; }
  .sp-sub-link { padding: 12px 9px; }
  .sp-client-picker { display: none; }
}
.table-wrap { overflow-x: auto; max-width: 100%; }
/* Live steps for long requests */
.has-steps { display: block; }
.sp-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.sp-steps li { position: relative; padding-left: 24px; color: var(--sp-faint); }
.sp-steps li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--sp-line-strong); }
.sp-steps li.is-done { color: var(--sp-muted); }
.sp-steps li.is-done::before { content: "✓"; border: 0; width: 16px; height: 16px; top: 1px; left: 0; font: 700 12px/16px var(--sp-font); text-align: center; color: #fff; background: var(--sp-ok, #1a7f37); }
.sp-steps li.is-now { color: var(--sp-ink); font-weight: 600; }
.sp-steps li.is-now::before { border-color: var(--sp-primary); border-right-color: transparent; animation: sp-spin 0.8s linear infinite; }
.sp-steps-time { margin: 6px 0 0; font-size: 12px; color: var(--sp-faint); }
@keyframes sp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp-steps li.is-now::before { animation: none; } }
