:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --ink-2: #333336;
  --muted: #6e6e73;
  --muted-2: #6e6e73;
  --canvas: #f5f5f7;
  --paper: #fafafa;
  --surface: #fff;
  --surface-2: #f5f5f7;
  --line: rgba(29, 29, 31, .09);
  --line-strong: rgba(29, 29, 31, .15);
  --control-border: #86868b;
  --accent: #0071e3;
  --accent-deep: #0066cc;
  --accent-soft: #e8f2ff;
  --accent-faint: #f5f9ff;
  --amber: #875500;
  --amber-soft: #fff5e4;
  --rose: #b42318;
  --rose-soft: #fff0ee;
  --shadow-md: 0 10px 28px rgba(29, 29, 31, .1);
  --radius: 28px;
  --radius-inner: 16px;
  --radius-modal: 28px;
  --pill: 999px;
  --topbar: 108px;
  --control: 44px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: var(--canvas); color: var(--ink); font-size: 15px; line-height: 1.47; }
button, input, select, textarea { font: inherit; }
button { min-height: var(--control); color: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  min-height: var(--control);
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 0;
  border-radius: var(--pill);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
}
.skip-link:focus-visible { transform: translateY(0); }

[aria-busy="true"] { cursor: progress; }
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
}

/* Apple–Braun chrome: a quiet navigation rail and circular action surfaces. */
.app-shell { --sidebar-width: 15rem; --topbar: 72px; min-height: 100vh; padding-inline-start: var(--sidebar-width); }
.workspace-content { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.app-main { min-width: 0; flex: 1; }
.studio-sidebar { position: fixed; inset-block-start: 0; inset-inline-start: 0; z-index: 40; width: var(--sidebar-width); height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 24px 16px 20px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 20px; background: #ededf0; }
.studio-sidebar > * { flex-shrink: 0; }
.studio-toolbar { position: sticky; top: 0; z-index: 30; background: rgba(245,245,247,.9); backdrop-filter: saturate(150%) blur(18px); }
.topbar, .portal-globalbar { width: min(1240px, 100%); margin-inline: auto; display: flex; align-items: center; padding-inline: 32px; }
.studio-brand { min-height: 48px; display: flex; align-items: center; gap: 12px; padding-inline: 6px; text-decoration: none; white-space: nowrap; }
.studio-brand strong { display: grid; font-size: 18px; font-weight: 650; letter-spacing: -.025em; line-height: 1.25; }
.studio-brand strong span { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 450; letter-spacing: .01em; }
.public-brand strong > span { color: var(--muted); font-weight: 400; margin-left: 3px; }
.workspace-nav { min-width: 0; display: grid; gap: 4px; }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 4px 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.4; }
.nav-label { min-width: 0; overflow-wrap: anywhere; }
.nav-item .nav-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 50%; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-item.active { color: var(--accent-deep); font-weight: 650; }
.nav-item.active .nav-icon { background: var(--accent); color: white; }
.nav-item:last-child { margin-block-start: 24px; }
.nav-count { margin-inline-start: auto; color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-count { color: var(--accent-deep); }
.sidebar-account { min-width: 0; display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 12px 6px 0; }
.sidebar-account .avatar { background: #e1e1e6; }
.sidebar-account svg { width: 16px; height: 16px; }
.sidebar-account > div { min-width: 0; }
.sidebar-account strong { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; }
.sidebar-account div > span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar { min-height: 72px; gap: 16px; }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumbs strong { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs .slash { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.labelled-action { display: inline-flex; align-items: center; justify-content: center; gap: 12px; color: var(--accent-deep); font-size: 15px; }
.labelled-action > span { min-width: 0; }
.topbar .labelled-action { margin-left: 8px; font-size: 13px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.avatar.dark { background: var(--ink); color: white; }
.avatar.small { width: 28px; height: 28px; font-size: 11px; }
.workspace-footer { width: min(1240px, 100%); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 auto; padding: 20px 32px 32px; color: var(--muted); font-size: 12px; }
.workspace-footer a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; text-decoration: none; }
.workspace-footer > span { align-self: center; }
.workspace-footer svg { width: 13px; height: 13px; }
.modal:has(> .navigation-sheet) { width: min(320px, calc(100vw - 24px)); height: calc(100vh - 24px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); margin: 12px auto 12px 12px; background: #ededf0; overscroll-behavior: contain; }
.navigation-sheet .modal-header { padding: 20px 20px 12px; background: #ededf0; }
.navigation-sheet .modal-header h2 { font-size: 18px; letter-spacing: -.025em; }
.navigation-sheet .modal-header p { font-size: 12px; }
.navigation-sheet .modal-body { padding: 12px 20px 24px; }
.navigation-tools { display: grid; gap: 12px; margin-top: 24px; padding-inline: 6px; }
.navigation-tools .labelled-action, .navigation-tools .button { justify-content: space-between; font-size: 14px; }
.navigation-tools .labelled-action { color: var(--ink-2); }


.icon-button {
  position: relative;
  width: var(--control);
  height: var(--control);
  min-height: var(--control);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, .04);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, transform 140ms var(--ease-out);
}
.icon-button svg { width: 17px; height: 17px; }
.icon-button.mobile-menu { display: none; }
.icon-button { flex: 0 0 var(--control); text-decoration: none; box-shadow: none; background: #e8e8ed; }
.icon-button.primary, .icon-button.auth-circle { background: var(--accent); color: white; }
.notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--canvas);
  border-radius: var(--pill);
  background: var(--rose);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
}

/* Page framing and controls */
.page { width: min(1240px, 100%); min-width: 0; margin: 0 auto; padding: 54px 32px 80px; }
.home-page { width: min(1240px, 100%); }
.page-header { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; }
.page-title-group { min-width: 0; }
.context-label { margin: 0 0 8px; color: var(--muted); font-size: 14px; font-weight: 620; }
h1 { margin: 0; font-size: clamp(34px, 4vw, 56px); font-weight: 670; line-height: 1.02; letter-spacing: -.035em; }
.page-header h1 { font-size: clamp(36px, 4.5vw, 52px); }
.page-description { max-width: 680px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* Action labels remain visible; only the trailing action surface is circular. */
.button { min-height: var(--control); display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent-deep); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 1.3; text-align: left; cursor: pointer; }
.button::after { content: "›" / ""; width: var(--control); height: var(--control); flex: 0 0 var(--control); display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 24px; font-weight: 400; line-height: 1; transition: background-color 140ms ease, transform 140ms var(--ease-out); }
.button > svg { display: none; }
.button.primary::after, .button.accent::after { background: var(--accent); color: white; }
.button.ghost { color: var(--muted); }
.button.ghost::after { background: var(--surface-2); color: var(--ink-2); }
.button.danger { color: var(--rose); }
.button.danger::after { content: "×" / ""; background: var(--rose-soft); color: var(--rose); }
.button[data-action="close-modal"]::after { content: "×" / ""; }
.button.small { font-size: 13px; }
.button.block { width: 100%; justify-content: space-between; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button:disabled::after { transform: none; }
.button:active::after, .icon-button:not(:disabled):active { transform: scale(.96); }
.icon-button:disabled { opacity: .45; cursor: not-allowed; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; color: var(--accent-deep); text-decoration: none; font-size: 17px; }
.text-link svg { width: 17px; height: 17px; }


/* A spacious introduction, followed by the real operational picture. */
.command-hero { min-width: 0; display: grid; justify-items: center; margin: 0 auto 72px; padding: 24px 0 12px; text-align: center; }
.command-greeting { margin: 0 0 20px; color: var(--ink); font-size: 19px; font-weight: 500; letter-spacing: -.02em; }
.command-hero h1 { max-width: 960px; font-size: clamp(42px, 5.6vw, 76px); font-weight: 650; line-height: 1.04; letter-spacing: -.05em; }
.command-hero h1 > span { color: var(--muted); }
.hero-description { max-width: 600px; margin: 24px 0 0; color: var(--muted); font-size: 21px; line-height: 1.4; letter-spacing: -.015em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; margin-top: 28px; }
.hero-actions .labelled-action { font-size: 17px; }
.section-heading { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; }
.section-heading h2 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.section-heading h2 span { color: var(--muted); }
.section-heading > span { margin-left: auto; color: var(--muted); font-size: 12px; }


/* Metrics and surfaces */
.metric-grid { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card {
  min-width: 0;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
}
.metric-card.featured { color: var(--ink); background: var(--accent-soft); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-card.featured .metric-label,
.metric-card.featured .metric-foot { color: var(--muted); }
.metric-value { margin-top: auto; font-size: clamp(30px, 3vw, 42px); font-weight: 620; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.metric-card.featured .metric-value { font-size: clamp(30px, 3vw, 42px); }
.metric-foot { margin-top: 7px; color: var(--muted-2); font-size: 13px; }

.summary-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
}
.summary-stat { min-width: 0; padding: 12px 14px; border-radius: var(--radius-inner); }
.summary-stat span { display: block; color: var(--muted); font-size: 13px; }
.summary-stat strong { display: block; margin-top: 6px; color: var(--ink); font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.summary-stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.summary-stat.attention { background: var(--amber-soft); }

.action-icon, .project-sigil, .activity-dot,
.file-icon, .run-icon, .sop-card .sop-icon, .client-action .check, .success-visual {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}
.metric-icon { display: none; }

.dashboard-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.stack { min-width: 0; display: grid; gap: 24px; }
.panel, .detail-hero, .sop-card, .onboarding-card { min-width: 0; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.panel { overflow: visible; }
.panel.pad { padding: 20px; }
.panel-header { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 26px 28px 14px; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.panel-header .panel-actions { display: flex; gap: 7px; margin-left: auto; }
.panel-section { padding: 24px 28px; }
.panel-section + .panel-section { padding-top: 6px; }
.panel-copy-title { font-size: 13px; }
.panel-copy { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.meta-inline { font-size: 13px; }

.focus-card { padding: 32px; background: var(--surface); color: var(--ink); }
.focus-top { display: flex; align-items: center; gap: 10px; color: var(--accent-deep); }
.focus-label { color: var(--accent-deep); font-size: 13px; font-weight: 800; }
.focus-card h2 { max-width: 700px; margin: 24px 0 10px; font-size: clamp(25px, 3vw, 38px); font-weight: 630; line-height: 1.12; letter-spacing: -.035em; }
.focus-card > p { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.focus-card .button { margin-left: auto; }
.focus-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }

/* Status */
.badge, .status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}
.badge::before, .status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .62; }
.badge.no-dot::before { display: none; }
.status-on_track, .status-active, .status-success, .status-approved, .status-verified, .status-done, .status-deposit_paid, .status-complete, .status-processed { color: var(--accent-deep); }
.status-attention, .status-awaiting_payment, .status-review, .status-client_confirmed, .status-in_progress { color: var(--amber); }
.status-at_risk, .status-failed, .status-changes_requested, .status-overdue { color: var(--rose); }
.status-qualified, .status-proposal_sent, .status-awaiting_signature, .status-ready_for_onboarding, .status-requested, .status-todo,
.status-onboarding, .status-waiting_client, .status-paused, .status-completed, .status-not_started, .status-not_sent, .status-sent { color: var(--muted); }

/* Lists and rows */
.action-list, .project-list, .activity-list { min-width: 0; display: grid; gap: 4px; padding: 6px; }
.action-row, .project-row, .activity-item, .deliverable-card, .automation-summary,
.client-action, .workflow-step { min-width: 0; border: 0; border-radius: var(--radius-inner); transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.action-row > *, .project-row > *, .activity-item > *, .deliverable-card > *, .client-action > * { min-width: 0; }

.action-row { min-height: 70px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; }
.action-icon { width: 38px; height: 38px; }
.action-icon svg { width: 15px; height: 15px; }
.action-title { margin: 0; font-size: 14px; font-weight: 680; }
.action-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.action-meta { color: var(--muted-2); text-align: right; font-size: 13px; }
.action-meta code { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.project-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(120px, .7fr) minmax(130px, .7fr) 92px auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  text-decoration: none;
}
.project-name { min-width: 0; display: flex; align-items: center; gap: 11px; }
.project-sigil { width: 40px; height: 40px; background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; font-weight: 780; }
.project-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.project-name span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.cell-label { display: none; color: var(--muted-2); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.cell-value { color: var(--ink-2); font-size: 13px; }
.progress-track { height: 6px; display: block; overflow: hidden; border-radius: var(--pill); background: #e5e5ea; }
.progress-bar { height: 100%; display: block; border-radius: inherit; background: var(--accent); }
.progress-label { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.row-chevron svg { width: 15px; height: 15px; color: var(--muted-2); }

.activity-item { position: relative; min-height: 54px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px; }
.activity-dot { width: 34px; height: 34px; background: var(--surface-2); }
.activity-dot svg { width: 13px; height: 13px; }
.activity-item p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; }
.activity-item time { display: block; margin-top: 4px; color: var(--muted-2); font-size: 13px; }

.empty-state { padding: 48px 28px; color: var(--muted); text-align: center; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.empty-state p { max-width: 360px; margin: 7px auto 0; font-size: 14px; line-height: 1.55; }

/* Filters, pipeline and tables */
.filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--paper); }
.segmented button {
  min-height: var(--control);
  padding: 0 13px;
  border: 0;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, transform 140ms var(--ease-out);
}
.segmented button.active { background: var(--ink); color: #fff; }

.filter-input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font-size: 16px;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.filter-input { width: 240px; height: var(--control); padding: 0 15px; border-radius: var(--pill); }
.filter-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.field [aria-invalid="true"], .field input:user-invalid, .field textarea:user-invalid { border-color: var(--rose); }
.field [aria-invalid="true"]:focus-visible { outline-color: var(--rose); }
.filter-input::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); opacity: 1; }

.pipeline-board {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(245px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x proximity;
}
.pipeline-column { min-width: 0; min-height: 440px; padding: 10px; border-radius: var(--radius); background: var(--paper); scroll-snap-align: start; }
.pipeline-column-header { display: flex; align-items: center; gap: 8px; padding: 4px 3px 12px; }
.pipeline-column-header h3 { margin: 0; font-size: 13px; font-weight: 740; }
.pipeline-column-header span { margin-left: auto; color: var(--muted); font-size: 13px; }
.deal-card {
  min-width: 0;
  display: block;
  margin-bottom: 8px;
  padding: 14px;
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: background-color 120ms ease, transform 140ms var(--ease-out);
}
.deal-card-top { min-width: 0; display: flex; align-items: flex-start; gap: 10px; }
.deal-card h4 { margin: 0; font-size: 14px; line-height: 1.35; }
.deal-card .org { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.deal-card .amount { margin-top: 16px; font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.deal-card-footer { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.deal-card-footer .avatar { margin-left: auto; }

.table-wrap { max-width: 100%; overflow: auto; border-radius: var(--radius); }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted-2); text-align: left; font-size: 13px; font-weight: 750; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color 120ms ease; }
.table-link { min-height: var(--control); display: flex; flex-direction: column; justify-content: center; text-decoration: none; }
.table-link strong { display: block; font-size: 14px; }
.table-link span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.inline-link { min-height: var(--control); display: inline-flex; align-items: center; }
.meta-copy { margin-top: 4px; font-size: 13px; }

/* Detail and delivery */
.detail-hero { position: relative; overflow: hidden; padding: 36px; }
.detail-hero-top { min-width: 0; display: flex; align-items: flex-start; gap: 16px; }
.detail-hero h1 { margin-top: 12px; font-size: clamp(34px, 4vw, 52px); }
.detail-hero p { max-width: 700px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.detail-stat-row,
.portal-summary { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 24px; }
.detail-stat, .portal-summary-item { min-width: 0; padding: 13px 15px; border-radius: var(--radius-inner); background: var(--surface-2); }
.detail-stat span { display: block; color: var(--muted-2); font-size: 13px; }
.detail-stat strong { display: block; margin-top: 6px; font-size: 14px; }

.tab-bar { max-width: 100%; display: flex; gap: 4px; margin: 18px 0 14px; padding: 4px; overflow-x: auto; border-radius: var(--pill); background: var(--paper); }
.tab-link {
  min-height: var(--control);
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: var(--pill);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, transform 140ms var(--ease-out);
}
.tab-link.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(29, 29, 31, .06); }
.detail-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.context-rail { min-width: 0; position: sticky; top: calc(var(--topbar) + 18px); display: grid; gap: 12px; }
.notice { min-width: 0; padding: 15px; border-radius: var(--radius-inner); background: var(--surface-2); }
.notice.warning { background: var(--amber-soft); }
.notice h3 { margin: 0; font-size: 13px; }
.notice p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.workflow-steps { min-width: 0; display: grid; }
.workflow-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 6px 4px; padding: 11px; background: var(--paper); }
.step-marker { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 750; }
.workflow-step.complete .step-marker { background: var(--accent-soft); color: var(--accent-deep); }
.workflow-step.current .step-marker { background: var(--accent); color: white; }
.workflow-step strong { display: block; font-size: 13px; }
.workflow-step span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.kanban { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-width: 0; min-height: 380px; padding: 10px; border-radius: var(--radius); background: var(--paper); }
.kanban-title { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; font-size: 13px; font-weight: 740; }
.column-empty { padding: 10px; font-size: 13px; }
.task-card { min-width: 0; margin-bottom: 8px; padding: 12px; border-radius: var(--radius-inner); background: var(--surface); transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.task-card h4 { margin: 0; font-size: 13px; line-height: 1.35; }
.task-card p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.task-card-footer { display: flex; align-items: center; gap: 6px; margin-top: 11px; }
.task-card-footer time { margin-left: auto; color: var(--muted-2); font-size: 13px; }
.task-actions { display: flex; gap: 4px; margin-top: 8px; }
.task-actions button { min-height: var(--control); flex: 1; padding: 5px 10px; border: 0; border-radius: var(--pill); background: var(--surface-2); color: var(--muted); font-size: 14px; cursor: pointer; transition: background-color 120ms ease, color 120ms ease, transform 140ms var(--ease-out); }

.deliverable-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 6px 4px; padding: 12px; background: var(--paper); }
.file-icon { width: 42px; height: 42px; }
.file-icon svg { width: 17px; height: 17px; }
.deliverable-card strong { display: block; font-size: 13px; }
.deliverable-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.deliverable-actions { display: flex; gap: 6px; }

.milestone-list, .file-list { min-width: 0; display: grid; }
.milestone-row, .file-row {
  width: calc(100% - 12px);
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 6px 4px;
  padding: 12px;
  border: 0;
  background: var(--paper);
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.file-row { min-height: 66px; cursor: pointer; transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.file-row > svg { width: 16px; height: 16px; color: var(--muted); }
.file-row strong, .milestone-row strong { display: block; font-size: 13px; }
.file-row small, .milestone-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.milestone-marker { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 750; }
.milestone-marker.complete { background: var(--accent-soft); color: var(--accent-deep); }
.milestone-marker.active { background: var(--accent); color: white; }
.milestone-marker svg { width: 15px; height: 15px; }

.automation-run { min-width: 0; border: 0; }
.automation-summary {
  width: calc(100% - 12px);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 0 6px 4px;
  padding: 12px;
  border: 0;
  background: var(--paper);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.run-icon { width: 38px; height: 38px; background: var(--accent-soft); color: var(--accent-deep); }
.run-icon.failed { background: var(--rose-soft); color: var(--rose); }
.automation-copy { min-width: 0; display: grid; gap: 3px; }
.automation-copy strong { font-size: 13px; }
.automation-copy small { color: var(--muted); font-size: 13px; }
.automation-time { font-size: 13px; }
.website-inquiry-details { padding: 0 20px 18px; }
.website-inquiry-details summary { cursor: pointer; font-size: 14px; padding: 10px 0; }
.website-inquiry-details dl { display: grid; gap: 14px; margin: 12px 0 0; }
.website-inquiry-details dt { font-weight: 600; margin-bottom: 4px; }
.website-inquiry-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.automation-details { display: none; padding: 0 16px 14px 59px; }
.automation-run.open .automation-details { display: grid; }
.automation-step { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 7px 0; }
.automation-step::before { content: ""; position: absolute; left: 7px; top: 23px; bottom: -7px; width: 1px; background: var(--line-strong); }
.automation-step:last-child::before { display: none; }
.automation-step-dot { width: 15px; height: 15px; display: grid; place-items: center; z-index: 1; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); font-size: 13px; }
.automation-step.failed .automation-step-dot { background: var(--rose-soft); color: var(--rose); }
.automation-step strong { display: block; font-size: 13px; }
.automation-step span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }

.sop-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sop-card { padding: 20px; }
.sop-card-top { display: flex; align-items: center; justify-content: space-between; }
.sop-card .sop-icon { width: 44px; height: 44px; }
.sop-card .sop-icon svg { width: 17px; height: 17px; }
.sop-card h3 { margin: 18px 0 6px; font-size: 14px; }
.sop-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sop-card ol { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.sop-card li { counter-increment: steps; display: flex; gap: 8px; padding: 6px 0; color: var(--muted); font-size: 13px; }
.sop-card li::before { content: counter(steps); width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 13px; }

/* Public onboarding */
.public-shell, .portal-shell { min-width: 0; min-height: 100vh; background: var(--canvas); }
.public-header, .portal-header { background: rgba(250,250,252,.92); backdrop-filter: saturate(180%) blur(18px); }
.public-header { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px max(24px, calc((100vw - 1176px) / 2)); }
.public-brand { min-width: max-content; min-height: var(--control); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.public-brand strong { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.public-header-note { margin-left: auto; color: var(--muted); font-size: 13px; }
.onboarding-layout { min-width: 0; min-height: calc(100vh - 70px); display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); }
.onboarding-aside {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(34px, 6vw, 82px);
  background: var(--paper);
  color: var(--ink);
}
.onboarding-aside h1 { max-width: 520px; color: var(--ink); font-size: clamp(36px, 5vw, 62px); }
.onboarding-aside > p { max-width: 510px; margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.onboarding-progress { position: relative; z-index: 2; display: grid; gap: 17px; margin-top: 56px; }
.onboarding-progress-item { min-width: 0; display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: center; gap: 11px; color: var(--muted); }
.onboarding-progress-item .number { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--control-border); border-radius: 50%; font-size: 13px; }
.onboarding-progress-item strong { display: block; color: inherit; font-size: 13px; }
.onboarding-progress-item span { display: block; margin-top: 3px; font-size: 13px; }
.onboarding-progress-item.active { color: var(--ink); }
.onboarding-progress-item.active .number { border-color: var(--accent); background: var(--accent); color: white; }
.onboarding-progress-item.complete { color: var(--accent-deep); }
.onboarding-main { min-width: 0; display: grid; place-items: center; padding: clamp(28px, 6vw, 76px); }
.onboarding-card { width: min(680px, 100%); padding: clamp(22px, 4vw, 38px); }
.onboarding-card h2, .modal-header h2 { margin: 0; font-size: clamp(28px, 4vw, 43px); font-weight: 650; letter-spacing: -.035em; }
.onboarding-card .lead { margin: 10px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { min-width: 0; display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.field label .optional { color: var(--muted-2); font-weight: 500; }
.field input, .field select { height: 54px; padding: 0 15px; }
.field textarea { min-height: 112px; padding: 14px 15px; resize: vertical; line-height: 1.5; }
.field small { color: var(--muted-2); font-size: 13px; line-height: 1.45; }
.field .error { color: var(--rose); }
.checkbox-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.checkbox-card { position: relative; min-width: 0; min-height: 70px; display: flex; align-items: flex-start; gap: 9px; padding: 12px; border-radius: var(--radius-inner); background: var(--surface-2); cursor: pointer; transition: background-color 120ms ease; }
.checkbox-card input { margin: 2px 0 0; accent-color: var(--accent-deep); }
.checkbox-card strong { display: block; font-size: 13px; }
.checkbox-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.checkbox-card.full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.form-actions .button:last-child { margin-left: auto; }
.form-save-note { font-size: 13px; line-height: 1.45; }
.review-block { margin-top: 8px; padding: 14px 16px; border-radius: var(--radius-inner); background: var(--surface-2); }
.review-block h3 { margin: 0 0 9px; color: var(--muted); font-size: 13px; }
.review-pairs { min-width: 0; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 16px; }
.review-pairs dt { color: var(--muted); font-size: 13px; }
.review-pairs dd { min-width: 0; margin: 0; font-size: 13px; font-weight: 620; line-height: 1.5; }
.success-card { text-align: center; }
.success-visual { width: 76px; height: 76px; margin: 0 auto 20px; background: var(--accent); color: white; }
.success-visual svg { width: 32px; height: 32px; }
.success-card p { max-width: 520px; margin: 12px auto 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.portal-login-card { width: min(560px, 100%); padding: 48px; text-align: center; }
.portal-login-card h1 { font-size: clamp(36px, 4vw, 52px); line-height: 1.06; letter-spacing: -.04em; }
.portal-login-card .lead { margin: 20px 0 32px; font-size: 17px; }
.auth-eyebrow { margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.portal-login-card .success-visual { width: 64px; height: 64px; background: var(--accent-soft); color: var(--accent-deep); }
.auth-recovery { border-top: 1px solid var(--line); padding-top: 16px; font-size: 14px; }
.auth-recovery summary { min-height: 44px; }
.auth-footer a { color: var(--accent-deep); }
.portal-login-card form, .portal-login-card .notice { margin-top: 24px; text-align: left; }
.auth-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; text-align: left; }
.auth-action p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.auth-action .icon-button { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; }
.auth-circle { background: var(--accent); color: white; }
.auth-recovery { margin-top: 28px; text-align: left; }
.auth-recovery summary { padding-block: 10px; cursor: pointer; }
.auth-footer { margin-top: 32px; font-size: 13px; color: var(--muted); }
.auth-footer a { text-underline-offset: 4px; }
.upload-button { width: max-content; margin-top: 2px; }

/* Client portal shares the same navigation, surfaces, and action language. */
.portal-workspace { --sidebar-width: 15rem; padding-inline-start: var(--sidebar-width); }
.portal-header { position: fixed; inset-block-start: 0; inset-inline-start: 0; z-index: 30; width: var(--sidebar-width); height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 24px; padding: 24px 16px 20px; overflow-y: auto; overscroll-behavior: contain; background: #ededf0; backdrop-filter: none; }
.portal-header > * { flex-shrink: 0; }
.portal-globalbar { display: block; min-height: 0; width: 100%; padding: 0 6px; }
.portal-globalbar .public-brand strong { display: grid; font-size: 18px; line-height: 1.25; }
.portal-globalbar .public-brand strong > span { margin: 3px 0 0; font-size: 12px; }
.portal-project-name { margin: 20px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.portal-header .portal-nav { display: grid; gap: 4px; min-width: 0; width: 100%; margin: 0; padding: 0; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.portal-nav a { min-height: 44px; flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 4px 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; scroll-snap-align: center; }
.portal-nav .nav-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 50%; }
.portal-nav a.active { color: var(--accent-deep); font-weight: 650; }
.portal-nav a.active .nav-icon { background: var(--accent); color: white; }
.portal-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-inline: 6px; }
.portal-account-link { display: none; }
.portal-viewer { min-width: 0; text-align: left; overflow-wrap: anywhere; }
.portal-viewer strong { display: block; font-size: 13px; font-weight: 500; }
.portal-viewer > span { display: block; color: var(--muted); font-size: 12px; }
.portal-page { width: min(1240px, 100%); min-width: 0; margin: 0 auto; padding: 64px 32px 80px; }
.portal-welcome { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 64px; margin-bottom: 48px; }
.portal-welcome h1 { max-width: 820px; font-size: clamp(40px, 5vw, 64px); font-weight: 650; letter-spacing: -.045em; line-height: 1.06; }
.portal-welcome p:not(.context-label) { max-width: 660px; margin: 20px 0 14px; color: var(--muted); font-size: 19px; line-height: 1.45; }
.portal-welcome .context-label { margin: 0 0 18px; color: var(--ink); font-size: 16px; font-weight: 500; }
.health-orb { position: relative; width: 176px; height: 176px; display: grid; place-items: center; flex-shrink: 0; }
.health-orb > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: #e5e5ea; }
.ring-value { stroke: var(--accent); }
.health-orb-inner { width: 78%; height: 78%; display: grid; place-items: center; border-radius: 50%; background: var(--canvas); text-align: center; }
.health-orb strong { display: block; font-size: 44px; font-weight: 600; line-height: 1.1; letter-spacing: -.045em; }
.health-orb strong small { font-size: 24px; }
.health-orb-inner > span > span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.portal-summary { margin: 0 0 32px; gap: 16px; }
.portal-summary-item { padding: 24px; background: var(--surface); border-radius: var(--radius); }
.portal-summary-item span { display: block; color: var(--muted); font-size: 13px; }
.portal-summary-item strong { display: block; margin-top: 10px; font-size: 17px; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
.portal-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.client-action { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0 12px 8px; padding: 16px; background: var(--paper); }
.client-action .check { width: 28px; height: 28px; }
.client-action .check svg { width: 15px; height: 15px; }
.client-action strong { display: block; font-size: 14px; font-weight: 600; }
.client-action p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.meeting-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.meeting-meta { margin: 12px 0 0; font-size: 14px; line-height: 1.5; }
.contact-row { display: flex; align-items: center; gap: 12px; }

/* Readiness uses plain service rows, not a wall of success badges. */
.settings-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
.settings-caption { margin: 8px 28px 20px; max-width: 66ch; color: var(--muted); font-size: 13px; line-height: 1.55; }
.settings-loaded { margin: -16px 0 24px; color: var(--muted); font-size: 13px; }
.service-row summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; align-items: center; gap: 12px; min-height: 80px; padding: 16px 28px; cursor: pointer; list-style: none; }
.service-row summary::-webkit-details-marker { display: none; }
summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--radius-inner); }
.service-heading strong { display: block; font-size: 16px; font-weight: 600; }
.service-heading > span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.disclosure-circle { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--canvas); }
.disclosure-circle svg { width: 16px; height: 16px; transition: transform 120ms ease; }
.service-row[open] > summary .disclosure-circle svg { transform: rotate(180deg); }
.service-details { padding: 0 28px 24px; max-width: 72ch; }
.service-details p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.service-checklist { list-style: none; margin: 20px 0; padding: 16px 20px; border-radius: var(--radius-inner); background: var(--canvas); }
.service-checklist li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 13px; }
.service-checklist li > :last-child { flex-shrink: 0; color: var(--muted); }
.service-checklist li > .setup-missing { color: var(--amber); font-weight: 600; }
.optional-services > summary, .technical-settings > summary { padding: 24px 28px; cursor: pointer; font-size: 15px; font-weight: 600; }
.optional-services > summary > span, .technical-settings > summary > span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 400; }
.technical-settings > .stack { padding: 0 8px 12px; }
.technical-settings .panel { background: transparent; border-radius: 0; }
.kickoff-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px; }
.kickoff-panel h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.025em; }
.kickoff-panel p { max-width: 60ch; margin: 0; color: var(--muted); line-height: 1.55; }
.kickoff-panel > .button { flex-shrink: 0; }
.contact-row strong { font-size: 15px; }
.contact-meta { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }


/* Modal and feedback */
.modal {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-modal);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  overflow: auto;
}
.modal::backdrop { background: rgba(0,0,0,.28); backdrop-filter: blur(6px); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 12px; padding: 24px 24px 12px; background: var(--surface); }
.modal-header h2 { font-size: 30px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.modal-header .icon-button { margin-left: auto; }
.modal-body { padding: 18px 24px 24px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px 20px; background: var(--surface); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { width: min(400px, calc(100vw - 40px)); display: grid; grid-template-columns: 36px minmax(0,1fr) 44px; align-items: start; gap: 12px; padding: 16px; border-radius: 24px; background: rgba(255,255,255,.94); color: var(--ink); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 8px 32px rgba(0,0,0,.12); backdrop-filter: blur(16px); pointer-events: auto; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.toast-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-deep); }
.toast.error .toast-symbol { background: var(--rose-soft); color: var(--rose); }
.toast svg { width: 17px; height: 17px; }
.toast-app { display: block; margin: 0 0 4px; font-size: 11px; color: var(--muted); }
.toast strong { display: block; font-size: 14px; font-weight: 600; }
.toast p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.toast-dismiss { background: transparent; }
.toast[data-phase="closing"] { opacity: 0; transform: translateY(6px) scale(.98); pointer-events: none; }
@starting-style { .toast { opacity: 0; transform: translateY(6px) scale(.98); } }

/* Utilities */
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-block { margin: 0; padding: 14px; overflow: auto; border-radius: var(--radius-inner); background: var(--surface-2); color: var(--ink-2); font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.plain-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.plain-list li { display: flex; align-items: center; gap: 8px; }
.plain-list li::before { content: "✓"; color: var(--accent-deep); font-weight: 800; }
.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.loading-indicator { display: flex; align-items: center; gap: 7px; }
.loading-indicator span, .loading-dot { width: 7px; height: 7px; display: block; border-radius: 50%; background: var(--ink); animation: loading-pulse 900ms ease-in-out infinite alternate; }
.loading-indicator span:nth-child(2), .loading-dot:nth-child(2) { animation-delay: 150ms; }
.loading-indicator span:nth-child(3), .loading-dot:nth-child(3) { animation-delay: 300ms; }
@keyframes loading-pulse { from { opacity: .28; } to { opacity: 1; } }
.route-error {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px;
}
.route-error h1 { font-size: clamp(28px, 5vw, 42px); }
.route-error p { margin: 10px 0 20px; color: var(--muted); line-height: 1.55; }
.busy-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 110;
  min-height: var(--control);
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.busy-status[hidden] { display: none; }
html[data-mutating="true"] button,
html[data-mutating="true"] input[type="submit"] { cursor: progress; }

@media (hover: hover) and (pointer: fine) {
  .nav-item:not(.active):hover .nav-icon { background: #dcdce1; }
  .nav-item:hover { color: var(--accent-deep); }
  .text-link:hover, .workspace-footer a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 4px; }
  .icon-button:hover { background: #dcdce1; }
  .icon-button.primary:hover, .icon-button.auth-circle:hover, .button.primary:hover::after, .button.accent:hover::after { background: #0077ed; }
  .button:hover::after { background: #d9eaff; }
  .button.ghost:hover::after { background: #e8e8ed; }
  .button.danger:hover::after { background: #ffdfdc; }
  .project-row:hover, .action-row:hover, .automation-summary:hover, .file-row:hover, .data-table tbody tr:hover { background: var(--surface-2); }
  .deal-card:hover, .task-card:hover { background: #fcfcfd; }
  .tab-link:hover, .portal-nav a:hover { color: var(--accent-deep); }
  .checkbox-card:hover { background: #e8e8ed; }
}

@media (max-width: 1100px) {
  .dashboard-grid, .detail-grid, .portal-grid { grid-template-columns: 1fr; }
  .context-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-row { grid-template-columns: minmax(180px, 1.2fr) minmax(100px, .7fr) 80px auto; }
  .project-row .hide-medium { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { padding-inline-start: 0; }
  .studio-sidebar { display: none; }
  .icon-button.mobile-menu { display: grid; }
  .topbar, .portal-globalbar { padding-inline: 24px; }
  .portal-workspace { padding-inline-start: 0; }
  .portal-header { position: sticky; inset: auto; top: 0; width: 100%; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 12px 24px 0; overflow: visible; background: rgba(250,250,252,.94); backdrop-filter: saturate(150%) blur(18px); }
  .portal-header .portal-globalbar { grid-column: 1; grid-row: 1; align-self: center; padding: 0; }
  .portal-globalbar .public-brand strong { display: block; }
  .portal-globalbar .public-brand strong > span { margin-left: 4px; }
  .portal-project-name { display: none; }
  .portal-header .portal-nav { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 24px; padding: 0; }
  .portal-nav .nav-icon { display: none; }
  .portal-nav a { position: relative; min-height: 48px; padding: 4px 0; }
  .portal-nav a.active::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--accent); }
  .portal-header .portal-account { grid-column: 2; grid-row: 1; margin: 0; padding: 0; }
  .portal-account-link { display: grid; }
  .page, .portal-page { padding: 40px 24px 60px; }
  .portal-welcome { gap: 32px; }
  .context-rail { grid-template-columns: 1fr; }
  .detail-stat-row, .portal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding-layout { grid-template-columns: 1fr; }
  .onboarding-aside { padding: 32px 24px; }
  .onboarding-aside h1 { font-size: 38px; }
  .onboarding-progress { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 28px; }
  .onboarding-progress-item { display: block; }
  .onboarding-progress-item strong, .onboarding-progress-item span { display: none; }
  .onboarding-progress-item.active { display: flex; gap: 8px; }
  .onboarding-progress-item.active strong { display: block; }
  .onboarding-progress-item .number { margin: 0; }
  .onboarding-main { padding: 32px 24px 48px; }
}

@media (max-width: 600px) {
  :root { --radius: 24px; }
  .topbar, .portal-globalbar { padding-inline: 16px; }
  .topbar { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .topbar .labelled-action { margin-left: 0; }
  .topbar .labelled-action > span, .topbar .hide-mobile { display: none; }
  .breadcrumbs > span { display: none; }
  .page, .portal-page { padding: 32px 16px 48px; }
  .page-header { display: block; margin-bottom: 28px; }
  .page-actions { margin: 18px 0 0; }
  .command-hero { padding: 18px 0 8px; margin-bottom: 48px; }
  .command-greeting { font-size: 16px; margin-bottom: 18px; }
  .command-hero h1 { font-size: clamp(34px, 8.3vw, 48px); }
  .hero-description { font-size: 18px; margin-top: 20px; }
  .hero-actions { gap: 10px 24px; margin-top: 22px; }
  .hero-actions .labelled-action, .text-link { font-size: 16px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading > span { display: none; }
  .metric-grid { gap: 12px; margin-bottom: 20px; }
  .metric-card { min-height: 148px; padding: 20px; }
  .metric-label { font-size: 12px; }
  .metric-value, .metric-card.featured .metric-value { font-size: 32px; }
  .metric-foot { font-size: 12px; line-height: 1.4; }
  .dashboard-grid, .detail-grid, .portal-grid, .stack { gap: 20px; }
  .panel-header { padding: 22px 20px 10px; }
  .panel-header h2 { font-size: 20px; }
  .panel-header p { font-size: 12px; }
  .panel-section { padding: 20px; }
  .focus-card { padding: 24px; }
  .focus-card h2 { font-size: 30px; }
  .focus-meta { gap: 8px; }
  .project-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .project-row > :not(.project-name):not(.row-chevron) { display: none; }
  .action-row { grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; }
  .action-icon { width: 32px; height: 32px; }
  .action-meta { max-width: 108px; overflow-wrap: anywhere; }
  .action-meta .button { flex-wrap: wrap; gap: 4px; }
  .sop-grid, .form-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .review-pairs { grid-template-columns: 1fr; gap: 4px; }
  .review-pairs dd { margin-bottom: 10px; }
  .detail-hero { padding: 24px; }
  .detail-stat { padding: 12px; }
  .detail-stat-row { gap: 8px; }
  .deliverable-card { grid-template-columns: 36px minmax(0,1fr); }
  .deliverable-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: flex-end; }
  .automation-summary { grid-template-columns: 30px minmax(0,1fr) auto; }
  .automation-summary > time { display: none; }
  .automation-details { padding-left: 48px; }
  .public-header-note { display: none; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .onboarding-main { padding: 24px 16px 40px; }
  .onboarding-card { padding: 24px; }
  .portal-login-card { padding: 36px 24px; }
  .portal-login-card .lead { font-size: 16px; }
  .auth-action { gap: 16px; }
  .portal-globalbar { min-height: 64px; gap: 8px; }
  .public-brand strong { font-size: 15px; }
  .public-brand strong > span { display: none; }
  .portal-globalbar .public-brand strong > span { display: inline; }
  .portal-viewer { display: none; }
  .portal-account { gap: 8px; }
  .portal-header { padding-inline: 16px; }
  .portal-welcome { grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }
  .portal-welcome h1 { font-size: 42px; }
  .portal-welcome p:not(.context-label) { font-size: 18px; }
  .health-orb { width: 128px; height: 128px; padding: 0; }
  .health-orb strong { font-size: 34px; }
  .health-orb strong small { font-size: 20px; }
  .portal-summary { gap: 12px; margin-bottom: 20px; }
  .portal-summary-item { padding: 20px; }
  .portal-summary-item strong { font-size: 15px; }
  .client-action { grid-template-columns: 28px minmax(0,1fr); }
  .client-action > .button { grid-column: 2; justify-self: end; }
  .service-row summary { grid-template-columns: minmax(0, 1fr) 36px; gap: 10px 12px; padding-inline: 20px; }
  .service-row summary > .status-pill { grid-column: 1; grid-row: 2; justify-self: start; }
  .service-row .disclosure-circle { grid-column: 2; grid-row: 1 / 3; }
  .service-details { padding-inline: 20px; }
  .settings-caption { margin-inline: 20px; }
  .optional-services > summary, .technical-settings > summary { padding-inline: 20px; }
  .kickoff-panel { align-items: flex-start; flex-direction: column; padding: 24px; }
  .kickoff-panel > .button { align-self: flex-end; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .form-save-note { width: 100%; }
  .modal-header { padding: 24px 20px 12px; }
  .modal-body { padding: 16px 20px 24px; }
  .modal-footer { padding: 12px 20px 20px; gap: 20px; }
  .workspace-footer { padding: 8px 20px 24px; gap: 4px; }
}

@media (max-width: 360px) {
  .metric-card, .portal-summary-item { padding: 16px; }
  .summary-strip { grid-template-columns: 1fr; }
  .command-hero h1 { font-size: 32px; }
  .onboarding-card { padding: 24px 18px; }
  .onboarding-progress-item.active strong { display: none; }
}

.getting-started { padding: 28px; margin-bottom: 32px; }
.getting-started h2 { font-size: 26px; letter-spacing: -.035em; }
.getting-started p, .guide-list p { color: var(--muted); line-height: 1.6; max-width: 64ch; }
.journey-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 28px 0; list-style: none; }
.journey-steps strong, .journey-steps span { display: block; }
.journey-steps span { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 8px; }
.guide-list { display: grid; gap: 24px; }
.guide-list h3 { margin: 0 0 8px; }
.guide-list p { margin: 0; }
.payment-requests { display: grid; gap: 16px; }
.payment-request { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; }
.payment-request h2 { margin: 8px 0; font-size: 32px; letter-spacing: -.04em; }
.payment-request p:not(.context-label) { color: var(--muted); }
.payment-methods { padding: 0; margin: 0 0 28px; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.payment-methods legend { margin-bottom: 12px; font-weight: 600; }
.payment-methods label { display: flex; gap: 12px; padding: 18px; border-radius: 20px; background: var(--canvas); cursor: pointer; align-items: center; min-height: 76px; }
.payment-methods label:has(input:checked) { background: var(--accent-soft); outline: 2px solid var(--accent); }
.payment-methods label:has(input:disabled) { cursor: default; color: var(--muted); }
.payment-methods input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; border-radius: 50%; accent-color: var(--accent); }
.payment-methods small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.4; }
[data-payment-panel] { line-height: 1.6; }
[data-payment-panel][hidden] { display: none; }
[data-payment-panel] .review-pairs dd { overflow-wrap: anywhere; }
.payment-total { padding: 20px; border-radius: 20px; background: var(--canvas); }
.payment-total strong { color: var(--ink); font-size: 20px; }
@media (max-width: 900px) { .journey-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .journey-steps, .payment-methods { grid-template-columns: 1fr; }
  .getting-started, .payment-request { padding: 24px; }
  .payment-request { align-items: flex-start; flex-direction: column; gap: 16px; }
  .payment-request > .button { align-self: flex-end; }
  .modal form[data-form="client-payment"] .modal-footer > [data-action="close-modal"] { display: none; }
  .modal form[data-form="client-payment"] .modal-footer > [type="submit"] { width: 100%; justify-content: space-between; }
  .workspace-footer { flex-wrap: wrap; gap: 16px; }
}

html[data-input="keyboard"] *, html[data-input="keyboard"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-property: color, background-color, opacity !important; transition-duration: 1ms !important; }
  .button:active::after, .icon-button:active { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .studio-toolbar, .public-header, .portal-header { background: #fafafa; backdrop-filter: none; }
  .toast { background: white; backdrop-filter: none; }
  .modal::backdrop { backdrop-filter: none; background: rgba(0,0,0,.4); }
}
@media (prefers-contrast: more) {
  :root { --muted: #48484b; --muted-2: #48484b; --line: #86868b; }
  .studio-toolbar, .public-header, .portal-header { background: white; backdrop-filter: none; border-bottom: 1px solid var(--line); }
  .studio-sidebar { border-inline-end: 1px solid var(--line); }
  .nav-item.active .nav-icon { outline: 1px solid currentColor; outline-offset: 2px; }
  .panel, .onboarding-card, .metric-card, .portal-summary-item { outline: 1px solid var(--line); }
}
