/* Sellisto design system — tokens, base, layout, components.
   Type: Plus Jakarta Sans (self-hosted, OFL). Palette: brand teal + slate ink + sky accent.
   Every text color below is checked for WCAG AA (4.5:1) on the surfaces it is used on. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ink-950: #070d1a;
  --ink-900: #0f172a;   /* primary text, 17.9:1 on white */
  --ink-700: #334155;   /* secondary text, 10.4:1 on white */
  --ink-500: #536072;   /* muted text, 6.4:1 on white, 6.0:1 on canvas */
  --ink-400: #8a96a8;   /* decorative only */
  --ink-300: #c5ccd7;   /* decorative only */
  --line: #e4e8ef;
  --line-strong: #cfd6e0;
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;

  --brand-50: #effaf8;
  --brand-100: #d2f2ec;
  --brand-200: #a7e4d9;
  --brand-400: #2dd4bf;  /* on dark surfaces only */
  --brand-500: #14b8a6;  /* decorative */
  --brand-600: #0d8578;
  --brand-700: #0f766e;  /* 5.5:1 with white text */
  --brand-800: #115e59;
  --brand-900: #123f3c;
  --accent-700: #0369a1; /* 5.9:1 on white */
  --accent-50: #f0f9ff;

  --navy-900: #0b1324;
  --navy-800: #111c33;
  --navy-700: #1b2843;

  --success-700: #15803d; --success-50: #ecfdf3; --success-100: #c7f0d6;
  --warning-700: #a15c07; --warning-50: #fffaeb; --warning-100: #fdecc4;
  --danger-700: #b42318;  --danger-50: #fef3f2;  --danger-100: #fcd9d5;
  --info-700: #1d4ed8;    --info-50: #eff6ff;    --info-100: #d6e4ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 0.05);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.05);
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 12px -2px rgb(15 23 42 / 0.07);
  --shadow-md: 0 2px 4px rgb(15 23 42 / 0.04), 0 12px 24px -6px rgb(15 23 42 / 0.10);
  --shadow-lg: 0 24px 48px -12px rgb(15 23 42 / 0.22);
  --focus-ring: 0 0 0 4px rgb(15 118 110 / 0.22);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 160ms;

  --sidebar-width: 264px;
  --content-max: 1160px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { margin: 0; line-height: 1.22; letter-spacing: -0.02em; color: var(--ink-900); }
h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 680; }
p { margin: 0; }
a { color: var(--brand-700); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color var(--dur) var(--ease); }
a:hover { color: var(--brand-800); }
img { max-width: 100%; height: auto; }
code { font-family: var(--font-mono); font-size: 0.9em; }
.tabular { font-variant-numeric: tabular-nums; }
::selection { background: var(--brand-100); color: var(--ink-900); }

:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; border-radius: 4px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--brand-700); box-shadow: var(--focus-ring); }

.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;
}
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 100;
  background: var(--ink-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 650; text-decoration: none; transition: top 0.15s;
}
.skip-link:focus { top: 12px; color: #fff; }
main:focus { outline: none; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-900); border-radius: var(--radius-sm); }
.brand:hover { color: var(--ink-900); }
.brand-mark { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 4px 8px rgb(15 118 110 / 0.28)); }
.brand-name { font-weight: 780; font-size: 1.16rem; letter-spacing: -0.03em; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 650; font-size: 0.94rem; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--dur) var(--ease); }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #11807a 0%, var(--brand-700) 100%);
  color: #fff; border-color: #0c655e;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.14), 0 4px 12px -4px rgb(15 118 110 / 0.5);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-800) 100%); color: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.12), inset 0 1px 0 rgb(255 255 255 / 0.14), 0 8px 18px -6px rgb(15 118 110 / 0.55); }
.btn-primary:hover svg:last-child:not(:first-child) { transform: translateX(2px); }
.btn-secondary { background: var(--surface); color: var(--ink-900); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-muted); color: var(--ink-900); border-color: var(--ink-300); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: rgb(15 23 42 / 0.05); color: var(--ink-900); }
.btn-danger { background: var(--danger-700); color: #fff; border-color: #912018; box-shadow: var(--shadow-xs); }
.btn-danger:hover { background: #912018; color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger-700); border-color: var(--danger-100); }
.btn-danger-outline:hover { background: var(--danger-50); color: var(--danger-700); border-color: #f5b5ad; }
.btn-light { background: #fff; color: var(--ink-900); border-color: #fff; box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.4); }
.btn-light:hover { background: #f1f5f9; color: var(--ink-900); }
.btn-outline-light { background: rgb(255 255 255 / 0.06); color: #fff; border-color: rgb(255 255 255 / 0.28); }
.btn-outline-light:hover { background: rgb(255 255 255 / 0.12); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 12px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.86rem; border-radius: 8px; }
.btn-icon { width: 42px; padding: 0; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--brand-700); font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }
.btn-link:hover { color: var(--brand-800); }

/* ---------- Forms ---------- */
.form-stack { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; gap: 18px; grid-template-columns: 2fr 1fr 1fr; }
.field { display: grid; gap: 7px; min-width: 0; }
.field-label { font-weight: 650; font-size: 0.89rem; color: var(--ink-900); }
.field-label .optional { font-weight: 450; color: var(--ink-500); }
.field-hint { font-size: 0.84rem; color: var(--ink-500); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px;
  font: inherit; color: var(--ink-900); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input[readonly] { background: var(--surface-muted); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23536072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input::placeholder, .textarea::placeholder { color: #737f90; }
.input.invalid, .select.invalid, .textarea.invalid, [aria-invalid="true"] { border-color: var(--danger-700); }
.input.invalid:focus-visible, [aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 4px rgb(180 35 24 / 0.16); }
.validation-message { color: var(--danger-700); font-size: 0.85rem; font-weight: 550; }
.validation-errors { margin: 0; padding: 12px 14px 12px 32px; border-radius: var(--radius); background: var(--danger-50); border: 1px solid var(--danger-100); color: var(--danger-700); font-size: 0.9rem; }
.validation-errors:empty { display: none; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; font-size: 0.93rem; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--brand-700); cursor: pointer; }
.input-color { display: flex; gap: 10px; align-items: center; }
.input-color input[type="color"] { width: 48px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
input[type="file"].input { padding: 7px 10px; }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 0.86rem; margin-right: 12px; padding: 6px 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-muted); color: var(--ink-900);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
.form-section { display: grid; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { display: grid; gap: 3px; }
.form-section-title p { color: var(--ink-500); font-size: 0.9rem; }
/* Honeypot: invisible to people, tempting to bots. */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-body { padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-header h2 { font-size: 1.02rem; }
.card-header p { color: var(--ink-500); font-size: 0.88rem; }
.card + .card { margin-top: 20px; }
.stat-row > .card, .split > .card, .split-wide > .card, .portal-layout > .card, .stack > .card { margin-top: 0; }
.stack { display: grid; gap: 20px; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }

/* ---------- Alerts and badges ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius); border: 1px solid; font-size: 0.92rem; box-shadow: var(--shadow-xs); }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert-success { background: var(--success-50); border-color: var(--success-100); color: var(--success-700); }
.alert-error { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger-700); }
.alert-info { background: var(--info-50); border-color: var(--info-100); color: var(--info-700); }
.alert-warning { background: var(--warning-50); border-color: var(--warning-100); color: var(--warning-700); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 650; line-height: 1.65; white-space: nowrap; letter-spacing: 0.005em;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.06);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: #eef1f5; color: var(--ink-700); }
.badge-success { background: var(--success-50); color: var(--success-700); box-shadow: inset 0 0 0 1px var(--success-100); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); box-shadow: inset 0 0 0 1px var(--warning-100); }
.badge-danger { background: var(--danger-50); color: var(--danger-700); box-shadow: inset 0 0 0 1px var(--danger-100); }
.badge-info { background: var(--info-50); color: var(--info-700); box-shadow: inset 0 0 0 1px var(--info-100); }
.tag { display: inline-flex; padding: 1px 9px; border-radius: 6px; background: var(--brand-50); color: var(--brand-800); font-size: 0.79rem; font-weight: 650; box-shadow: inset 0 0 0 1px var(--brand-100); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Page structure ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-header-text { display: grid; gap: 4px; min-width: 0; }
.page-header-text p { color: var(--ink-500); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 650; text-decoration: none; color: var(--ink-500); margin-bottom: 8px; }
.back-link:hover { color: var(--ink-900); }
.back-link svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.back-link:hover svg { transform: translateX(-2px); }
.muted { color: var(--ink-500); }
.small { font-size: 0.875rem; }

/* ---------- Tables (stack into cards on small screens) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); padding: 11px 18px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--dur) var(--ease); }
.table tbody tr:hover { background: #f6faf9; }
.table .cell-title { font-weight: 650; color: var(--ink-900); text-decoration: none; }
.table .cell-title:hover { color: var(--brand-700); text-decoration: underline; }
.table .cell-sub { display: block; font-size: 0.84rem; color: var(--ink-500); }

/* ---------- Filters, pagination, empty states ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.toolbar .field { flex: 1 1 220px; }
.toolbar .field-sm { flex: 0 1 170px; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-500); pointer-events: none; }
.search-input .input { padding-left: 40px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--ink-500); }
.pagination-links { display: flex; gap: 8px; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.empty-state-icon {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 4px;
  background: linear-gradient(145deg, var(--brand-50), var(--brand-100)); color: var(--brand-700);
  box-shadow: inset 0 0 0 1px var(--brand-100), 0 8px 20px -10px rgb(15 118 110 / 0.5);
}
.empty-state-icon svg { width: 26px; height: 26px; }
.empty-state p { color: var(--ink-500); max-width: 420px; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Detail lists ---------- */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0; font-size: 0.93rem; }
.details dt { color: var(--ink-500); font-weight: 550; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 12px 1fr; gap: 14px; font-size: 0.9rem; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-600); box-sizing: border-box; z-index: 1; }
.timeline li::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { color: var(--ink-500); font-size: 0.83rem; }

/* ---------- Checklist (dashboard) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 14px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--line); transition: background-color var(--dur) var(--ease); }
.checklist li:first-child { border-top: 0; }
.checklist li:hover { background: var(--surface-muted); }
.check-icon { width: 24px; height: 24px; flex: none; color: var(--ink-300); }
.check-icon.done { color: var(--success-700); }
.checklist-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.checklist-text p { color: var(--ink-500); font-size: 0.88rem; }
.checklist .done-label { text-decoration: line-through; text-decoration-color: var(--ink-300); color: var(--ink-500); }
.progress-track { height: 6px; border-radius: 999px; background: #e9edf2; overflow: hidden; margin-top: 10px; width: min(220px, 100%); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); }
.stat-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.stat { position: relative; padding: 20px 22px; overflow: hidden; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-label { color: var(--ink-500); font-size: 0.85rem; font-weight: 650; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 6px; color: var(--ink-900); }
.stat-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.tone-danger { background: var(--danger-50); color: var(--danger-700); box-shadow: inset 0 0 0 1px var(--danger-100); }
.stat-icon.tone-success { background: var(--success-50); color: var(--success-700); box-shadow: inset 0 0 0 1px var(--success-100); }
.stat-icon.tone-info { background: var(--accent-50); color: var(--accent-700); box-shadow: inset 0 0 0 1px #d4ecfb; }
.stat-row-hero .stat { padding: 22px 24px; }
.stat-row-hero .stat-value { font-size: 2rem; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); background: linear-gradient(90deg, var(--navy-900) var(--sidebar-width), var(--canvas) var(--sidebar-width)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px 16px; overflow-y: auto; color: #cbd5e1;
  background:
    radial-gradient(120% 50% at 0% 0%, rgb(20 184 166 / 0.16) 0%, transparent 60%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  border-right: 1px solid rgb(255 255 255 / 0.04);
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 0.15) transparent;
}
.sidebar :focus-visible { outline-color: var(--brand-400); }
.sidebar .brand, .sidebar .brand:hover { color: #fff; }
.sidebar-brand { padding: 2px 10px 18px; }
.business-chip { display: grid; gap: 2px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius); background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.08); }
.business-chip-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.business-chip-name { font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-switch { display: flex; gap: 6px; margin-top: 8px; }
.business-switch .select { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 0.85rem; background-color: rgb(255 255 255 / 0.06); color: #fff; border-color: rgb(255 255 255 / 0.14); box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.business-switch .select option { color: var(--ink-900); background: #fff; }
.business-switch .btn-secondary { background: rgb(255 255 255 / 0.1); color: #fff; border-color: rgb(255 255 255 / 0.16); box-shadow: none; }
.business-switch .btn-secondary:hover { background: rgb(255 255 255 / 0.16); color: #fff; }
.nav { display: grid; gap: 2px; }
.nav-section { margin: 18px 12px 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; min-height: 40px;
  color: #cbd5e1; text-decoration: none; font-weight: 600; font-size: 0.93rem;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link svg { width: 18px; height: 18px; flex: none; color: #94a3b8; transition: color var(--dur) var(--ease); }
.nav-link:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.nav-link:hover svg { color: #e2e8f0; }
.nav-link.active { background: linear-gradient(90deg, rgb(45 212 191 / 0.18), rgb(45 212 191 / 0.06)); color: #fff; box-shadow: inset 0 0 0 1px rgb(45 212 191 / 0.18); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-400); }
.nav-link.active svg { color: var(--brand-400); }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.08); display: grid; gap: 2px; }
.user-chip { display: flex; align-items: center; gap: 11px; padding: 8px 10px 10px; min-width: 0; }
.user-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 750; font-size: 0.82rem; color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--accent-700)); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.1); }
.user-chip-text { display: grid; min-width: 0; }
.user-chip strong { font-size: 0.9rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip span:not(.user-avatar) { font-size: 0.8rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link-button { width: 100%; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }

.main-area { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 36px 40px 72px; }
.flash-region { margin-bottom: 20px; }
.flash-region:empty { display: none; }

/* ---------- Auth & public layouts ---------- */
/* The form comes first in the DOM (so its h1 is the first heading); the brand panel is placed left visually. */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-shell > .auth-main { grid-column: 2; grid-row: 1; }
.auth-shell > .auth-panel { grid-column: 1; grid-row: 1; }
.auth-panel {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 52px; color: #cbd5e1; isolation: isolate;
  background:
    radial-gradient(60% 50% at 10% 0%, rgb(20 184 166 / 0.35) 0%, transparent 70%),
    radial-gradient(50% 45% at 100% 100%, rgb(3 105 161 / 0.35) 0%, transparent 70%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
}
.auth-panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 30% 30%, #000 0%, transparent 75%);
}
.auth-panel .brand, .auth-panel .brand:hover { color: #fff; }
.auth-panel-copy { display: grid; gap: 16px; max-width: 460px; }
.auth-panel-copy h2 { font-size: clamp(1.7rem, 2.6vw, 2.25rem); line-height: 1.15; color: #fff; letter-spacing: -0.035em; font-weight: 780; }
.auth-panel-copy p { color: #cbd5e1; font-size: 1rem; }
.auth-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 12px; color: #e2e8f0; font-size: 0.94rem; }
.auth-steps li { display: flex; gap: 12px; align-items: flex-start; }
.auth-steps .step-num { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 0.78rem; font-weight: 750; background: rgb(45 212 191 / 0.14); color: var(--brand-400); box-shadow: inset 0 0 0 1px rgb(45 212 191 / 0.3); }
.auth-panel-foot { font-size: 0.84rem; color: #94a3b8; }
.auth-preview { position: relative; max-width: 400px; }
.auth-preview .mock-float { position: static; display: inline-flex; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 26px; }
.auth-card.wide { max-width: 560px; }
.auth-card-header { display: grid; gap: 8px; }
.auth-card-header h1 { font-size: 1.9rem; }
.auth-card-header p { color: var(--ink-500); }
.auth-mobile-brand { display: none; }
.auth-links { display: grid; gap: 8px; font-size: 0.92rem; text-align: center; color: var(--ink-500); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-500); font-size: 0.84rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Public site ---------- */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.public-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgb(255 255 255 / 0.78); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgb(15 23 42 / 0.06);
}
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.public-header nav { display: flex; gap: 6px; align-items: center; }
.public-nav-links { display: flex; gap: 2px; margin-right: 10px; }
.public-nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--ink-700); font-weight: 600; font-size: 0.92rem; text-decoration: none; }
.public-nav-links a:hover { color: var(--ink-900); background: rgb(15 23 42 / 0.05); }
.public-footer { margin-top: auto; padding: 40px 24px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 0.88rem; background: var(--surface-muted); }
.public-footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.public-footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.public-footer-links a { color: var(--ink-700); text-decoration: none; font-weight: 600; }
.public-footer-links a:hover { color: var(--brand-700); }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 999px; background: var(--surface); color: var(--ink-700); font-size: 0.85rem; font-weight: 650; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pill-dot { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-800); font-size: 0.75rem; font-weight: 750; box-shadow: inset 0 0 0 1px var(--brand-100); }

.landing-section { padding: 96px 24px; }
.landing-section.tinted { background: var(--surface-muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.landing-inner { max-width: 1200px; margin: 0 auto; }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.035em; line-height: 1.12; font-weight: 780; }
.section-head p { color: var(--ink-700); font-size: 1.06rem; }
.eyebrow { font-size: 0.8rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-700); }

.hero-wrap { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.hero-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(40% 50% at 85% 20%, rgb(3 105 161 / 0.10) 0%, transparent 70%),
    radial-gradient(45% 55% at 10% 10%, rgb(20 184 166 / 0.16) 0%, transparent 70%),
    linear-gradient(180deg, #f7fbfb 0%, #ffffff 100%);
}
.hero-wrap::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgb(15 23 42 / 0.045) 1px, transparent 1px), linear-gradient(90deg, rgb(15 23 42 / 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 0%, transparent 80%);
}
.hero { max-width: 1200px; margin: 0 auto; padding: 88px 24px 96px; display: grid; gap: 56px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero h1 { font-size: clamp(2.35rem, 5.2vw, 3.9rem); letter-spacing: -0.045em; line-height: 1.04; font-weight: 800; }
.text-gradient { background: linear-gradient(100deg, var(--brand-700) 10%, var(--accent-700) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy > p { font-size: 1.15rem; color: var(--ink-700); max-width: 560px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-points { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--ink-700); font-size: 0.92rem; font-weight: 550; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points svg { width: 18px; height: 18px; color: var(--brand-700); }

/* Product illustration (pure HTML/CSS, example data) */
.hero-visual { position: relative; margin: 0; padding: 24px 8px 40px; }
.hero-visual figcaption { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 0.78rem; color: var(--ink-500); }
.mock-window { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), 0 0 0 8px rgb(255 255 255 / 0.6); overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e2e8f0; }
.mock-bar span { margin-left: 10px; font-size: 0.76rem; color: var(--ink-500); font-weight: 600; }
.mock-doc { padding: 22px 24px 24px; display: grid; gap: 16px; border-top: 4px solid var(--brand-700); }
.mock-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mock-biz { display: flex; align-items: center; gap: 10px; }
.mock-logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-600), var(--accent-700)); }
.mock-biz strong { display: block; font-size: 0.92rem; }
.mock-biz span, .mock-meta span { display: block; font-size: 0.76rem; color: var(--ink-500); }
.mock-meta { text-align: right; }
.mock-meta strong { display: block; font-size: 1rem; }
.mock-lines { display: grid; gap: 0; font-size: 0.84rem; border-top: 1px solid var(--line); }
.mock-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mock-lines div span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.mock-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 750; }
.mock-total span:last-child { font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mock-accept { margin-left: auto; width: 52%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 0.9rem; background: linear-gradient(180deg, #11807a, var(--brand-700)); }
.mock-accept svg { width: 18px; height: 18px; }
.mock-float {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px;
  background: rgb(255 255 255 / 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 0.84rem; color: var(--ink-900); text-align: left;
}
.mock-float strong { display: block; font-size: 0.86rem; }
.mock-float span { display: block; color: var(--ink-500); font-size: 0.76rem; }
.mock-float-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--success-50); color: var(--success-700); }
.mock-float-icon svg { width: 18px; height: 18px; }
.mock-float-icon.tone-info { background: var(--accent-50); color: var(--accent-700); }
.mock-float.one { top: 0; right: -18px; }
.mock-float.two { bottom: 50px; left: -28px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-copy, .hero-visual { animation: rise 0.6s var(--ease) both; }
.hero-visual { animation-delay: 0.1s; }

/* How it works */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.flow-step { position: relative; padding: 26px 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); display: grid; gap: 10px; align-content: start; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease); }
.flow-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-200); }
.flow-step-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--brand-600), var(--brand-800)); box-shadow: 0 8px 18px -8px rgb(15 118 110 / 0.7); }
.flow-step-icon svg { width: 22px; height: 22px; }
.flow-step-num { position: absolute; top: 22px; right: 22px; font-size: 0.78rem; font-weight: 750; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.flow-step h3 { font-size: 1.05rem; margin-top: 6px; }
.flow-step p { font-size: 0.92rem; color: var(--ink-700); }
.flow-step .badge { justify-self: start; }

/* Feature bento */
.features { display: grid; gap: 18px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.feature { grid-column: span 2; position: relative; display: grid; gap: 12px; align-content: start; padding: 28px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature.wide { grid-column: span 3; }
.feature-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }
.feature-icon svg { width: 22px; height: 22px; }
.feature-icon.tone-info { background: var(--accent-50); color: var(--accent-700); box-shadow: inset 0 0 0 1px #d4ecfb; }
.feature-icon.tone-warning { background: var(--warning-50); color: var(--warning-700); box-shadow: inset 0 0 0 1px var(--warning-100); }
.feature-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feature h3 { font-size: 1.12rem; letter-spacing: -0.02em; }
.feature p { color: var(--ink-700); font-size: 0.95rem; }
.feature.dark { background: radial-gradient(80% 80% at 100% 0%, rgb(20 184 166 / 0.25) 0%, transparent 60%), linear-gradient(160deg, var(--navy-800), var(--navy-900)); border-color: var(--navy-700); color: #cbd5e1; }
.feature.dark h3 { color: #fff; }
.feature.dark p { color: #cbd5e1; }
.feature.dark .feature-icon { background: rgb(45 212 191 / 0.14); color: var(--brand-400); box-shadow: inset 0 0 0 1px rgb(45 212 191 / 0.3); }
.feature.dark .badge-success { background: rgb(74 222 128 / 0.12); color: #86efac; box-shadow: inset 0 0 0 1px rgb(134 239 172 / 0.3); }
.mini-timeline { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; font-size: 0.86rem; }
.mini-timeline li { display: flex; align-items: center; gap: 10px; }
.mini-timeline li::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 4px rgb(45 212 191 / 0.15); }
.mini-timeline li.off::before { background: #64748b; box-shadow: none; }
.status-track { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-muted); border: 1px solid var(--line); }
.status-track svg { width: 16px; height: 16px; color: var(--ink-400); }

/* Audience chips */
.chip-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 820px; margin: 0 auto; list-style: none; padding: 0; }
.chip-cloud li { padding: 9px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); font-weight: 650; font-size: 0.94rem; color: var(--ink-700); }

/* Trust list */
.trust-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trust-item { display: grid; gap: 8px; grid-template-columns: 44px 1fr; align-items: start; column-gap: 16px; }
.trust-item .feature-icon { grid-row: span 2; width: 44px; height: 44px; }
.trust-item h3 { font-size: 1rem; }
.trust-item p { color: var(--ink-700); font-size: 0.93rem; }

/* Final call to action */
.cta-band { position: relative; overflow: hidden; isolation: isolate; max-width: 1200px; margin: 0 auto; padding: 64px 40px; border-radius: 28px; text-align: center; display: grid; gap: 20px; justify-items: center; color: #cbd5e1;
  background: radial-gradient(50% 80% at 0% 0%, rgb(20 184 166 / 0.4) 0%, transparent 70%), radial-gradient(50% 80% at 100% 100%, rgb(3 105 161 / 0.45) 0%, transparent 70%), linear-gradient(160deg, var(--navy-800), var(--navy-900));
  box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; font-size: clamp(1.75rem, 3.6vw, 2.6rem); letter-spacing: -0.035em; font-weight: 800; max-width: 680px; line-height: 1.1; }
.cta-band p { max-width: 560px; font-size: 1.05rem; color: #cbd5e1; }
.cta-band :focus-visible { outline-color: #fff; }

/* ---------- Dialog ---------- */
dialog.dialog { border: 0; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(460px, calc(100vw - 32px)); color: var(--ink-900); }
dialog.dialog[open] { animation: dialog-in 0.18s var(--ease); }
dialog.dialog::backdrop { background: rgb(7 13 26 / 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog-body { padding: 24px; display: grid; gap: 10px; }
.dialog-body p { color: var(--ink-700); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--surface-muted); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Status pages & logo ---------- */
.status-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 56px 24px; }
.status-page .stack { justify-items: center; max-width: 480px; }
.status-code { display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: 0.82rem; font-weight: 750; color: var(--brand-800); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100); letter-spacing: 0.08em; }
.logo-preview { width: 120px; height: 120px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-muted); overflow: hidden; color: var(--ink-500); }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

/* Blazor reconnect / error UI (interactive pages only) */
#blazor-error-ui { display: none; position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 1000; padding: 12px 16px; border-radius: var(--radius); background: var(--danger-50); color: var(--danger-700); border: 1px solid var(--danger-100); box-shadow: var(--shadow-md); }
#components-reconnect-modal { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px; }
#components-reconnect-modal p, #components-reconnect-modal button { display: none; }
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible { display: block; }
.components-rejoining-animation { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 64px; }
  .hero-visual { max-width: 560px; width: 100%; justify-self: center; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature, .feature.wide { grid-column: span 1; }
  .trust-grid { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin: 0 auto; }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); background: var(--canvas); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(300px, 86vw);
    transform: translateX(-102%); visibility: hidden; box-shadow: var(--shadow-lg);
    transition: transform 0.22s var(--ease), visibility 0.22s;
  }
  .sidebar[data-open="true"] { transform: translateX(0); visibility: visible; }
  .nav-link.active::before { display: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 40; background: rgb(7 13 26 / 0.5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .sidebar-scrim[hidden] { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px; position: sticky; top: 0; z-index: 30;
    background: rgb(255 255 255 / 0.85); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .content { padding: 24px 16px 56px; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-shell > .auth-main { grid-column: 1; }
  .auth-panel { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-main { align-items: flex-start; padding: 32px 16px; }
  .public-nav-links { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .page-header { align-items: stretch; }
  .page-actions .btn { flex: 1; }
  .card-body { padding: 18px; }
  .toolbar, .card-header, .pagination { padding-left: 16px; padding-right: 16px; }
  .checklist li { padding: 14px 16px; flex-wrap: wrap; }
  .checklist li .btn { margin-left: 38px; }
  .details { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .details dd { margin-bottom: 10px; }
  .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-stack tr { display: grid; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--ink-500); font-size: 0.85rem; font-weight: 600; }
  .table-stack td.cell-primary { display: block; }
  .table-stack td.cell-primary::before { content: none; }
  .public-header { padding: 12px 16px; }
  .public-header .btn-ghost { display: none; }
  .landing-section { padding: 72px 16px; }
  .hero { padding: 48px 16px 64px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .flow, .features { grid-template-columns: minmax(0, 1fr); }
  .mock-float.one { right: -4px; }
  .mock-float.two { display: none; }
  .mock-accept { width: 100%; }
  .cta-band { padding: 48px 22px; border-radius: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------------------------------
   Quotes: editor, document, portal
   --------------------------------------------------------------------------------------------- */
.num { text-align: right; }
.pre-line { white-space: pre-line; }
.strong { font-weight: 700; }
.stack-sm { display: grid; gap: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.list-row > a { flex: 1 1 auto; font-weight: 650; }
.split-wide { grid-template-columns: minmax(0, 5fr) minmax(0, 2fr); }
.stat-link { display: grid; gap: 4px; color: inherit; text-decoration: none; transition: border-color var(--dur) var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.stat-link:hover { color: inherit; border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-link .stat-more { position: absolute; right: 18px; bottom: 18px; width: 18px; height: 18px; color: var(--ink-400); opacity: 0; transform: translateX(-4px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.stat-link:hover .stat-more, .stat-link:focus-visible .stat-more { opacity: 1; transform: none; color: var(--brand-700); }
.share-link .input { font-size: 0.85rem; }
.share-link h2 { font-size: 1rem; margin: 0 0 4px; }

.line-editor { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.line-row {
  display: grid; gap: 10px 12px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 90px 120px 80px 110px 42px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-muted);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.line-row:focus-within { border-color: var(--brand-200); background: #fbfefd; }
.line-row .field { margin: 0; }
.line-amount { display: grid; gap: 6px; justify-items: end; padding-top: 2px; }
.line-amount output { padding: 10px 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.line-remove { padding-top: 27px; }
.totals-preview { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; margin: 0; max-width: 360px; justify-self: end; width: 100%; padding: 16px 18px; border-radius: var(--radius); background: var(--surface-muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.totals-preview dt { color: var(--ink-700); }
.totals-preview dd { margin: 0; text-align: right; }

.doc { --doc-accent: var(--brand-700); border-top: 4px solid var(--doc-accent); padding-top: 22px; display: grid; gap: 24px; color: var(--ink-900); }
.doc-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.doc-from { display: flex; gap: 16px; align-items: flex-start; }
.doc-logo { max-width: 140px; max-height: 64px; object-fit: contain; }
.doc-party { display: grid; gap: 2px; font-size: 0.9rem; color: var(--ink-700); }
.doc-party strong { color: var(--ink-900); font-size: 1rem; }
.doc-meta { text-align: right; }
.doc-title { font-size: 1.4rem; margin: 0; letter-spacing: -0.025em; }
.doc-subtitle { margin: 4px 0 0; color: var(--ink-700); }
.doc-dates { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 10px 0 0; justify-content: end; font-size: 0.9rem; }
.doc-dates dt { color: var(--ink-500); }
.doc-dates dd { margin: 0; }
.doc-label { display: block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); margin-bottom: 4px; }
.doc-lines { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.doc-lines th { text-align: left; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); border-bottom: 1px solid var(--line-strong); padding: 9px 10px; }
.doc-lines td { border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: top; }
.doc-lines .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-lines th.num { text-align: right; }
.doc-desc { white-space: pre-line; }
.doc-totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; margin: 0 0 0 auto; min-width: min(100%, 320px); font-variant-numeric: tabular-nums; }
.doc-totals dt { color: var(--ink-700); }
.doc-totals dd { margin: 0; text-align: right; }
.doc-totals .doc-total { font-weight: 780; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink-900); border-top: 1px solid var(--line-strong); padding-top: 10px; }
.doc-section h3 { font-size: 0.95rem; margin: 0 0 6px; }
.doc-section p { margin: 0; color: var(--ink-700); }
.doc-foot { font-size: 0.8rem; color: var(--ink-500); margin: 0; }

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(60% 40% at 50% 0%, rgb(20 184 166 / 0.08) 0%, transparent 70%), var(--canvas); }
.portal-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 40px 20px; display: grid; gap: 22px; align-content: start; }
.portal-main:focus { outline: none; }
.portal-footer { text-align: center; padding: 24px; font-size: 0.8rem; color: var(--ink-500); }
.portal-head h1 { font-size: 1.6rem; margin: 0 0 6px; }
.portal-total { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.portal-total strong { font-size: 1.2rem; }
.portal-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
.portal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px; }
.portal-card-tools { display: flex; justify-content: flex-end; margin: -10px -10px 8px 0; }
.portal-decide { display: grid; gap: 16px; position: sticky; top: 20px; box-shadow: var(--shadow-md); }
.portal-decide h2 { font-size: 1.1rem; margin: 0; }
.portal-decide .checkbox { align-items: flex-start; }
.portal-decide .checkbox input { margin-top: 3px; }
.portal-decide .btn-primary { min-height: 48px; font-size: 1rem; }
.portal-decline summary { cursor: pointer; color: var(--ink-700); font-weight: 650; padding: 4px 0; }
.portal-decline summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.portal-decline form { margin-top: 12px; display: grid; gap: 12px; }
.portal-message { max-width: 560px; margin: 48px auto; text-align: center; }
.portal-message h1 { font-size: 1.45rem; }

@media (max-width: 900px) {
  .split-wide, .portal-layout { grid-template-columns: minmax(0, 1fr); }
  .portal-decide { position: static; }
  .portal-card { padding: 20px; }
}
@media (max-width: 760px) {
  .line-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .line-row .line-desc { grid-column: 1 / -1; }
  .line-amount { justify-items: start; }
  .line-remove { padding-top: 0; }
  .doc-meta { text-align: left; }
  .doc-dates { justify-content: start; }
}

@media print {
  .sidebar, .topbar, .page-header, .page-actions, .skip-link, .flash-region, .portal-decide, .portal-footer,
  .portal-card-tools, [data-print], .alert, .split-wide > .stack:last-child, .card:not(:has(.doc)) { display: none !important; }
  body, .portal-shell, .main-area, .content { background: #fff !important; }
  .portal-card, .card { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .card-header { display: none !important; }
  .split-wide, .portal-layout { display: block !important; }
  .portal-main, .content { padding: 0 !important; max-width: none !important; }
  .doc { break-inside: auto; }
  .doc-lines tr { break-inside: avoid; }
}

/* ---- Invoices (phase 4) ---- */
.balance-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.balance-row > div { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-muted); border: 1px solid var(--line); }
.balance-row dt { color: var(--ink-500); font-size: 0.8rem; font-weight: 600; }
.balance-row dd { margin: 2px 0 0; font-weight: 750; font-size: 1.08rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.dialog-form { display: grid; gap: 8px; min-width: min(320px, 100%); }
.plain-list li.is-voided strong { text-decoration: line-through; color: var(--ink-500); }
.portal-balance { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.portal-balance strong { font-size: 1.5rem; letter-spacing: -0.02em; }
@media (max-width: 640px) {
  .balance-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.next-step { border-left: 4px solid var(--brand-700); background: linear-gradient(90deg, var(--brand-50) 0%, var(--surface) 45%); }
.next-step h2 { margin-bottom: 4px; }

/* --- Follow-up (phase 5) ------------------------------------------------------------------ */
.response-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-muted); }
.response-message { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.reminder-list li { padding: 4px 0; }
.reminder-list li.is-done { color: var(--ink-500); }
.attention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.attention-list li { display: grid; gap: 2px; padding: 10px 12px 10px 14px; border-left: 3px solid var(--line-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-muted); }
.attention-list li a { font-weight: 650; }
.attention-list li.attention-response { border-left-color: var(--brand-600); }
.attention-list li.attention-overdue, .attention-list li.attention-failed { border-left-color: var(--danger-700); background: #fffafa; }
.attention-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 18px 8px; }
.attention-empty .empty-state-icon { width: 44px; height: 44px; border-radius: 12px; }
.attention-empty .empty-state-icon svg { width: 22px; height: 22px; }
.dashboard-note { margin-top: 18px; display: flex; align-items: center; gap: 8px; }
.dashboard-note svg { width: 16px; height: 16px; flex: none; color: var(--accent-700); }
.portal-respond { display: grid; gap: 8px; margin-bottom: 16px; }
.portal-respond details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; transition: border-color var(--dur) var(--ease); }
.portal-respond details[open] { padding-bottom: 12px; border-color: var(--line-strong); }
.portal-respond summary { cursor: pointer; padding: 10px 0; font-weight: 650; }
.portal-respond summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

/* --- Plans and team (phase 6) ------------------------------------------------------------- */
.seat-summary { margin: 0 0 16px; color: var(--ink-500); }
.role-hints { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.select-sm { width: auto; min-width: 7.5rem; padding-top: 6px; padding-bottom: 6px; min-height: 36px; }
.usage-list { display: grid; gap: 16px; }
.usage-label { display: flex; justify-content: space-between; gap: 12px; font-size: 0.93rem; margin-bottom: 6px; font-weight: 550; }
.usage-count { font-variant-numeric: tabular-nums; color: var(--ink-500); }
.usage[data-full="true"] .usage-count { color: var(--danger-700); font-weight: 650; }
.usage progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: #e9edf2; accent-color: var(--brand-600); }
.usage progress::-webkit-progress-bar { background: #e9edf2; border-radius: 999px; }
.usage progress::-webkit-progress-value { background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); border-radius: 999px; }
.usage progress::-moz-progress-bar { background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); border-radius: 999px; }
.usage[data-full="true"] progress::-webkit-progress-value { background: var(--danger-700); }
.usage[data-full="true"] progress::-moz-progress-bar { background: var(--danger-700); }
.plan-table th[aria-current="true"] { color: var(--brand-700); }
.plan-table thead th .badge { margin-left: 6px; }
.invite-list { margin: 0 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-muted); }
.invite-list h2 { font-size: 1.05rem; margin: 0 0 12px; }
.invite-list ul { list-style: none; margin: 0 0 8px; padding: 0; }
.invite-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.invite-item > div:first-child { display: grid; gap: 2px; }
.invite-facts { margin: 0 0 20px; }

/* Phase 7: two-step verification */
.input-code { max-width: 12ch; font-variant-numeric: tabular-nums; letter-spacing: 0.12em; font-weight: 650; }
.tfa-steps { display: grid; gap: 20px; padding-left: 1.25rem; margin: 0; }
.tfa-steps > li { display: grid; gap: 10px; }
.tfa-qr { width: 184px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.tfa-qr svg { display: block; width: 100%; height: auto; }
.tfa-key { font-size: 0.95rem; word-break: break-word; }
.recovery-codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 24px; }
.recovery-codes code { font-size: 1rem; }
@media print { .recovery-codes code { font-size: 12pt; } }
