/* ==========================================================================
   Pomio CRM screens (UI foundation, 25-09-2026). Built on src/ui/pomio.css
   tokens + primitives; replaces the former inline <style> of crm.html.
   Class names are unchanged (screen modules render them); only the look moved
   to tokens. Every 375px tap-target / overflow fix from S2-S5 and the Kanban
   round is kept (see the mobile block at the end).
   ========================================================================== */

main > section { padding: 20px 24px 96px; }
main > section > main { display: block; }
#banner { display: none; background: var(--warning-soft); color: var(--warning-text); padding: 9px 20px; font-size: 13px; text-align: center; }

/* S11B: read-only trial banner in #banner -- always ONE line (short text on
   narrow screens, ellipsis as a last resort; the full sentence stays in the
   DOM for screen readers and as the tooltip). Tokens only: light/dark/auto. */
#banner.access-banner { display: flex; align-items: center; justify-content: center; gap: 12px; white-space: nowrap; min-width: 0; padding: 9px 16px; line-height: 1.4; }
#banner.access-banner .ab-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
#banner.access-banner .ab-ask { font-weight: 400; }
#banner.access-banner .ab-short { display: none; }
#banner.access-banner .ab-link { flex-shrink: 0; color: var(--warning-text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; padding: 2px 0; }
#banner.access-banner .ab-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: 0 0 0 1px var(--focus-edge, transparent); border-radius: 2px; }
/* S11B-P3: the trial countdown in the same slot. Calm (accent) while the bar
   can still be dismissed, the warning tone in the last 3 days and after
   expiry. The dismiss button is a 40 px tap target that does not grow the
   one-line bar (negative margins). */
#banner.access-banner .ab-link-short { display: none; }
#banner.access-banner.is-trial { background: var(--accent-soft); color: var(--text); }
#banner.access-banner.is-trial .ab-link { color: var(--accent-text); }
#banner.access-banner .ab-dismiss { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -11px -10px -11px -4px; padding: 0; border: 0; border-radius: var(--radius-control); background: none; color: inherit; cursor: pointer; }
#banner.access-banner .ab-dismiss svg { width: 16px; height: 16px; }
#banner.access-banner .ab-dismiss:hover { background: var(--surface); }
#banner.access-banner .ab-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: inset 0 0 0 3px var(--focus-edge, transparent); }
@media (max-width: 900px) {
  #banner.access-banner { justify-content: space-between; }
  #banner.access-banner .ab-long,
  #banner.access-banner .ab-link-long { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  #banner.access-banner .ab-short,
  #banner.access-banner .ab-link-short { display: inline; }
  #banner.access-banner .ab-text { flex: 1 1 auto; }
}

/* S11B: read-only explanations next to disabled controls + locked settings sections */
.ro-note { font-size: 13px; color: var(--warning-text); background: var(--warning-soft); border-radius: var(--radius-control); padding: 8px 12px; margin: 0 0 12px; }
fieldset.ro-lock { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.ro-lock[disabled] .settings-section { opacity: .85; }

/* S11B-P2: "Get started" card on the Deals landing (onboardingCard.js) --
   self-service tenant admins only. Tokens only (light/dark/auto). On mobile
   it is never stacked with the trial bar: hidden while #banner shows one. */
.onb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 14px 16px 12px; margin: 0 0 16px; min-width: 0; }
.onb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.onb-titles { min-width: 0; }
.onb-title { font-size: 16px; margin: 0; }
.onb-progress { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.onb-dismiss { flex-shrink: 0; }
.onb-bar { height: 4px; border-radius: 2px; background: var(--surface-2); margin: 10px 0 6px; overflow: hidden; }
.onb-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 16px; }
.onb-step { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; min-width: 0; }
.onb-check { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); position: relative; }
.onb-step.is-done .onb-check { background: var(--success); border-color: var(--success); }
.onb-step.is-done .onb-check::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.onb-label { min-width: 0; overflow-wrap: anywhere; }
.onb-link { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.onb-done-text { color: var(--muted); text-decoration: line-through; }
.onb-opt { color: var(--muted); font-size: 12.5px; }
@media (max-width: 820px) {
  .onb-card { padding: 12px 14px 10px; }
  .onb-steps { grid-template-columns: 1fr; }
  body:has(#banner.access-banner) .onb-card { display: none !important; }
}

/* ---------------------------------------------------------------- toolbars */
.toolbar, .table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.search-input { min-width: 220px; }

/* ---------------------------------------------------------------- stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-tile .stat-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1.15; }
.stat-tile .stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-tile.warn .stat-value { color: var(--warning-text); }
.stat-tile .stat-sub.alert { color: var(--danger-text); font-weight: 700; }
.deal-stats { margin-bottom: 14px; }
.deal-stats .stat-tile { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; transition: border-color .12s ease, box-shadow .12s ease; }
.deal-stats .stat-tile:hover { border-color: var(--border-strong); }
.deal-stats .stat-tile.is-active { border-color: var(--accent-text); box-shadow: inset 0 3px 0 var(--accent), var(--shadow-sm); }
.progress-track { background: var(--surface-3); border-radius: var(--radius-pill); height: 8px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12); }

/* ---------------------------------------------------------------- deal filters */
.deal-filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.deal-filterbar .search-input { flex: 1 1 260px; min-width: 0; width: auto; }
.deal-filterbar select, .bulk-row select {
  min-height: var(--tap); padding: 6px 30px 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-control);
  font-size: 13px; background: var(--input-bg); color: var(--text); max-width: 100%; min-width: 0;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 600; max-width: 100%; }
.filter-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; padding: 0 4px; min-width: 24px; min-height: 24px; }
.chip-clear { border: none; background: none; cursor: pointer; color: var(--accent-text); font-size: 13px; font-weight: 600; text-decoration: underline; padding: 2px 4px; }
.filter-count { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- pipeline board */
#board-view { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; align-items: flex-start; }
#board-view[hidden] { display: none; }
.col {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px;
  min-width: 248px; flex: 1; max-width: 300px; scroll-snap-align: start; transition: outline .1s ease;
}
.col.dragover { outline: 2px dashed var(--accent-text); outline-offset: -2px; }
.col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 13px; font-weight: 700; color: var(--text); }
.col-head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-count { flex: none; background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: var(--radius-pill); padding: 0 8px; font-size: 12px; font-weight: 700; }
.col-total { display: block; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 10px; margin-top: -6px; }
.col-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 16px 6px; border: 1.5px dashed var(--border-strong); border-radius: 10px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:focus-within { border-color: var(--accent-text); }
.card[draggable="true"] { cursor: grab; }
.card[draggable="true"]:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card-top { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
/* long names take their own line and wrap at spaces; badges move below */
.card-top .card-name { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.card-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.card-company { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-team { font-size: 12px; color: var(--faint); margin-top: 1px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 6px; }
.card-value { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-value small { font-weight: 600; color: var(--muted); }
.card-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.card-stale { flex: none; font-size: 11px; font-weight: 700; color: var(--warning-text); background: var(--warning-soft); border-radius: var(--radius-pill); padding: 1px 8px; white-space: nowrap; }
.card-labels { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.label-pill { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; color: #FFFFFF; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.card-stage-select { margin-left: auto; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; padding: 3px 4px; background: var(--input-bg); color: var(--muted); max-width: 120px; }
.card-foot .card-stage-select { min-width: 0; flex: 0 1 auto; }
/* manual Kanban order: drop marker + up/down (pre-staging hardening) */
.drop-marker { height: 3px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-text); margin: -2px 0 6px; pointer-events: none; }
.card-move-group { display: inline-flex; gap: 2px; flex: none; margin-left: auto; }
.card-move {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; width: 26px; height: 24px; padding: 0;
  font-size: 9px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.card-move:hover:not(:disabled) { border-color: var(--accent-text); color: var(--text); background: var(--accent-soft); }
.card-move:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  /* mouse: floats in the corner on hover/focus, takes no layout space */
  .card { position: relative; }
  .card-move-group {
    position: absolute; top: 6px; right: 6px; margin: 0; padding: 2px; border-radius: 8px;
    background: var(--surface-raised); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .12s ease;
  }
  .card:hover .card-move-group, .card:focus-within .card-move-group { opacity: 1; }
}

/* ---------------------------------------------------------------- lists / tables */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sortable .sort-ind { font-size: 10px; margin-left: 3px; }
th.sel-col, td.sel-col { width: 40px; }
.sel-col input, .select-all-mobile input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent-text); }
tr.is-selected td { background: var(--accent-soft); }
.select-all-mobile { display: none; }
.archive-note { font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 12px; margin: 0 0 12px; }
.archived-banner { font-size: 13px; color: var(--text); background: var(--warning-soft); border-radius: var(--radius-control); padding: 8px 12px; margin-bottom: 12px; }
.task-group { margin-bottom: 24px; }
.task-group table { margin-top: 8px; }
.task-group h3, .task-group h4 { font-size: 14px; margin: 0 0 6px; }

/* ---------------------------------------------------------------- bulk actions */
.bulkbar { position: sticky; top: calc(var(--header-h) + 4px); z-index: 20; background: var(--surface-raised); border: 1px solid var(--accent-text); border-radius: var(--radius-card); padding: 8px 10px; margin-bottom: 12px; box-shadow: var(--shadow); }
.bulk-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bulk-count { font-weight: 700; font-size: 14px; margin-right: 4px; }
.bulk-danger { color: var(--danger-text); }
.bulk-busy { font-size: 12px; color: var(--muted); }
.bulk-report { position: relative; font-size: 13px; margin-top: 6px; padding: 6px 28px 6px 10px; border-radius: var(--radius-control); background: var(--success-soft); }
.bulk-report.has-failed { background: var(--danger-soft); }
.bulk-report ul { margin: 4px 0 0; padding-left: 18px; }
.bulk-report-close { position: absolute; top: 2px; right: 4px; border: none; background: none; cursor: pointer; font-size: 16px; color: inherit; }
.overlay.over-drawer { z-index: 105; }

/* ---------------------------------------------------------------- drawers: deal / company / person / task */
.drawer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.company-select-wrap select { margin-bottom: 6px; }
.notes-list { margin-top: 8px; }
.notes-list .note, .legacy-notes .note { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.note-meta { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--text); }
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.add-note { display: flex; gap: 8px; margin-top: 8px; }
.add-note textarea, .note.is-editing textarea {
  flex: 1; width: 100%; min-height: 48px; resize: vertical; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-control); font-size: 14px; font-family: inherit; background: var(--input-bg); color: var(--text);
}
.note.is-editing textarea { min-height: 64px; }
.legacy-notes { margin-top: 8px; font-size: 13px; }
.legacy-notes summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.activity-row { font-size: 13px; color: var(--muted); padding: 4px 0; border-bottom: 1px dashed var(--border); }
.deal-task-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); padding: 6px 0; border-bottom: 1px dashed var(--border); }
.deal-task-row input[type=checkbox] { width: 18px; height: 18px; flex: none; cursor: pointer; accent-color: var(--accent-text); }
.deal-task-row .t-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.deal-task-row .t-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.deal-task-row .t-due.overdue { color: var(--danger-text); font-weight: 700; }
.task-quickadd { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.task-quickadd input { min-height: var(--tap); padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); font-size: 13px; background: var(--input-bg); color: var(--text); min-width: 0; }
.task-quickadd input[type=text] { flex: 1 1 160px; }

/* S3 activity timeline */
.timeline { min-width: 0; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tl-list { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--border); }
.tl-item { position: relative; display: flex; gap: 8px; padding: 0 0 14px 14px; min-width: 0; }
.tl-dot { position: absolute; left: -8px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface-raised); }
.tl-deals .tl-dot { background: var(--accent); box-shadow: 0 0 0 1px var(--accent-text); }
.tl-tasks .tl-dot { background: var(--success); }
.tl-notes .tl-dot { background: var(--warning); }
.tl-body { min-width: 0; flex: 1; }
.tl-text { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.tl-empty { list-style: none; font-size: 13px; color: var(--muted); padding: 4px 0 8px 14px; }
.tl-foot { margin-top: 4px; }
.tl-history-note { margin: 6px 0 0; }

/* relations (company/person drawers) */
.rel-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 14px; }
.rel-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.rel-stats span { font-size: 11px; font-weight: 600; color: var(--muted); }
.rel-stats b { font-family: var(--font-display); font-size: 16px; }
.rel-stats small { font-size: 11px; color: var(--muted); }
.rel-teams { margin: -4px 0 12px; }
.rel-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px dashed var(--border); padding: 8px 4px; cursor: pointer; font: inherit; color: var(--text); min-height: var(--tap); }
.rel-row:hover, .rel-row:focus-visible { background: var(--surface-2); }
.rel-main { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.rel-sub { font-size: 12px; color: var(--muted); }
/* URGENT FIX 13-10-2026: company drawer person row = open button + archive
   action side by side (never a button inside a button); tokens only. */
.rel-person { display: flex; align-items: stretch; gap: 4px; border-bottom: 1px dashed var(--border); }
.rel-person .rel-row { border-bottom: none; flex: 1 1 auto; min-width: 0; }
.rel-person-archive { flex: none; align-self: center; min-height: var(--tap); min-width: var(--tap); color: var(--danger-text); }
.rel-archived-link { margin-top: 6px; }
/* duplicate warning in the "new contact person" modal */
.pp-dup { background: var(--warning-soft); color: var(--text); border-radius: var(--radius-control); padding: 10px 12px; margin: 4px 0 10px; font-size: 13px; }
.pp-dup-title { margin: 0 0 4px; color: var(--warning-text); font-weight: 700; }
.pp-dup p { margin: 4px 0; }
.pp-dup ul { list-style: none; margin: 4px 0 8px; padding: 0; }
.pp-dup li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.pp-dup li > span { min-width: 0; overflow-wrap: anywhere; }
.pp-dup li .btn-sm { min-height: var(--tap); flex: none; }
.pp-dup .modal-actions { margin-top: 8px; }

/* ---------------------------------------------------------------- scoreboard / sales management */
.sb-wrap { max-width: 1100px; }
.sb-periods { margin-bottom: 16px; }

/* ---------------------------------------------------------------- settings */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1180px; }
.settings-nav { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; min-height: var(--tap); padding: 8px 10px; border-radius: var(--radius-control); color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-nav a.active { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.settings-sections { min-width: 0; }
.settings-section { margin-bottom: 20px; max-width: 880px; scroll-margin-top: calc(var(--header-h) + 16px); }
.settings-section h3 { margin: 0 0 12px; font-size: 16px; }
.settings-section .field-row { align-items: flex-end; flex-wrap: wrap; }
.settings-section input[type=text], .settings-section input:not([type]), .settings-section input[type=number], .settings-section input[type=file], .settings-section select {
  min-height: var(--tap); padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); font-size: 14px; background: var(--input-bg); color: var(--text);
}
.settings-list-row { align-items: center; margin-bottom: 6px; }
.settings-list-row input { flex: 1; }

/* Settings activity log (audit presentation, UI foundation) */
.audit-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.audit-item { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); padding: 10px 12px; min-width: 0; }
.audit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.audit-title { font-weight: 600; font-size: 14px; }
.audit-meta { font-size: 12px; color: var(--muted); }
.audit-summary { font-size: 13px; color: var(--text); margin-top: 2px; overflow-wrap: anywhere; }
.audit-item details { margin-top: 6px; }
.audit-item summary { cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.tech-block {
  margin: 6px 0 0; padding: 8px 10px; max-width: 100%; max-height: 220px; overflow: auto; border-radius: var(--radius-control);
  background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; color: var(--text);
}

/* S4 Users & access */
.ua-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ua-head h3 { margin-bottom: 4px; }
.ua-head .hint { margin: 0 0 4px; max-width: 560px; }
.ua-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 12px; }
.ua-toolbar .search-input { flex: 1 1 220px; min-width: 0; width: auto; }
.ua-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ua-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.ua-chip.active .ua-count { background: var(--surface); color: var(--text); }
.ua-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.ua-card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; background: var(--surface); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ua-card.is-busy { opacity: .6; }
.ua-card.ua-st-disabled { background: var(--surface-2); }
.ua-card.ua-st-disabled .ua-name { color: var(--muted); }
.ua-card-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ua-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.ua-ident { min-width: 0; }
.ua-name { font-weight: 600; overflow-wrap: anywhere; }
.ua-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ua-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ua-role-tenantAdmin { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ua-role-salesManager { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.ua-role-salesRep { background: transparent; color: var(--text); border-color: var(--border-strong); }
.ua-role-viewer { background: var(--surface-2); color: var(--muted); }
.ua-status-active { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.ua-status-invited { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.ua-status-expired { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.ua-status-disabled { background: var(--surface-3); color: var(--muted); border-color: transparent; }
.ua-platform { background: var(--trust-soft); color: var(--trust-text); border-color: transparent; }
.ua-teams { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ua-k { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.ua-team { padding: 1px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.ua-meta { font-size: 12px; color: var(--muted); }
.ua-lock { font-size: 12px; }
.ua-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ua-danger, .ua-actions .btn-sm.ua-danger { color: var(--danger-text); }
.ua-state { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card); }
.ua-state-error { color: var(--danger-text); }
.ua-state .btn-sm { margin-top: 8px; }
.ua-devlink { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--warning-soft); color: var(--text); font-size: 13px; }
.ua-devlink-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ua-devlink-row input { flex: 1 1 200px; min-width: 0; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12px; background: var(--input-bg); color: var(--text); font-family: var(--font-mono); }
.ua-modal .ua-sub { margin: -4px 0 12px; }
.ua-confirm-text { font-size: 14px; color: var(--muted); margin: 0; }
.ua-roles { display: flex; flex-direction: column; gap: 6px; }
.ua-role-opt { display: flex !important; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; font-size: 14px !important; font-weight: 400 !important; color: var(--text) !important; margin: 0 !important; }
.ua-role-opt input { width: auto !important; margin-top: 3px; accent-color: var(--accent-text); }
.ua-role-opt.is-selected { border-color: var(--accent-text); background: var(--accent-soft); }
.ua-role-opt .hint { display: block; margin-top: 1px; }
.ua-team-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ua-check { display: inline-flex !important; align-items: center; gap: 8px; font-size: 14px !important; font-weight: 400 !important; color: var(--text) !important; margin: 0 !important; min-height: 32px; }
.ua-check input { width: auto !important; accent-color: var(--accent-text); }
.ua-readonly { background: var(--surface-2) !important; color: var(--muted) !important; }
.ua-field-error { color: var(--danger-text); font-size: 12px; margin-top: 3px; }
.ua-field-error:empty { display: none; }
.ua-form-error { color: var(--danger-text); font-size: 13px; background: var(--danger-soft); padding: 8px 10px; border-radius: var(--radius-control); margin: 4px 0 0; }

/* S5 Privacy & Compliance */
.pc-section { max-width: 1000px; }
.pc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 12px 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.pc-tabs::-webkit-scrollbar { display: none; }
.pc-tab { flex: none; padding: 10px 14px; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pc-tab:hover { color: var(--text); }
.pc-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.pc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pc-tile { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; background: var(--surface); }
.pc-tile-value { font-size: 22px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.03em; }
.pc-tile-label { font-size: 12px; color: var(--muted); }
.pc-tile.is-alert { border-color: var(--danger); background: var(--danger-soft); }
.pc-tile.is-alert .pc-tile-value { color: var(--danger-text); }
.pc-tile.is-warn { border-color: var(--warning); background: var(--warning-soft); }
.pc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pc-card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; background: var(--surface); min-width: 0; }
.pc-card h4, .pc-holds h4 { margin: 0 0 6px; font-size: 14px; }
.pc-card .hint { margin: 0 0 10px; }
.pc-planned { margin-top: 16px; border-color: var(--trust-soft); background: var(--trust-soft); }
.pc-planned ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.pc-disclaimer { padding: 10px 12px; border-radius: var(--radius-control); background: var(--trust-soft); color: var(--text); font-size: 13px; margin-bottom: 12px; border-left: 3px solid var(--trust); }
.pc-subhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.pc-subhead .hint { margin: 0; max-width: 580px; }
.pc-policies, .pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-policy { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; background: var(--surface); min-width: 0; }
.pc-policy.is-on { box-shadow: inset 3px 0 0 var(--accent); }
.pc-policy.is-busy { opacity: .6; }
.pc-policy-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pc-policy-title { font-weight: 600; overflow-wrap: anywhere; }
.pc-policy-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; align-items: end; }
.pc-policy-fields label, .pc-modal label, .pc-form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 10px 0 0; }
.pc-policy-fields label { margin: 0; }
.pc-policy-fields input, .pc-policy-fields select, .pc-modal input:not([type=checkbox]):not([type=radio]), .pc-modal select, .pc-modal textarea {
  display: block; width: 100%; margin-top: 4px; min-height: var(--tap); padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-control); font-size: 14px; background: var(--input-bg); color: var(--text); font-family: inherit;
}
.pc-policy-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-switch { font-size: 14px !important; }
.pc-holds { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 14px; }
.pc-hold, .pc-dsar { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; background: var(--surface); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; min-width: 0; }
.pc-hold.is-removed { background: var(--surface-2); color: var(--muted); }
.pc-hold-main, .pc-dsar-main { flex: 1 1 260px; min-width: 0; }
.pc-hold-reason { font-size: 13px; overflow-wrap: anywhere; margin: 2px 0; }
.pc-hold-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.pc-dsar.pc-due-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.pc-dsar.pc-due-soon { box-shadow: inset 3px 0 0 var(--warning); }
.pc-st-open { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.pc-st-in_progress, .pc-st-awaiting_verification { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.pc-st-completed { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.pc-st-rejected, .pc-st-cancelled { background: var(--surface-3); color: var(--muted); border-color: transparent; }
.pc-due-badge { background: var(--surface-2); color: var(--text); }
.pc-due-overdue.pc-due-badge, .pc-dsar.pc-due-overdue .pc-due-badge { background: var(--danger-soft); color: var(--danger-text); }
.pc-hold-badge { background: var(--trust-soft); color: var(--trust-text); border-color: transparent; }
.pc-flag { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.pc-chips { margin-bottom: 12px; }
.pc-details { margin-top: 12px; font-size: 13px; }
.pc-details summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.pc-history { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.pc-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 12px 0; }
.pc-dl dt { color: var(--muted); font-weight: 600; }
.pc-dl dd { margin: 0; overflow-wrap: anywhere; }
.pc-hash { font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.pc-dsar-actions { margin: 6px 0 4px; }
.pc-ext { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.pc-danger { padding: 10px 12px; border-radius: var(--radius-control); background: var(--danger-soft); color: var(--danger-text); font-size: 13px; margin: 10px 0; }
.pc-ack { margin-top: 8px !important; }
.pc-search-row { display: flex; gap: 6px; align-items: center; }
.pc-search-row input { flex: 1 1 auto; min-width: 0; }
.pc-subj-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.pc-subj .ua-badge { margin-left: 4px; }
.pc-review-list { max-height: 320px; overflow-y: auto; font-size: 12px; padding-left: 18px; }
.pc-review-list code { overflow-wrap: anywhere; }
.pc-table { margin-top: 12px; }
.pc-table td { vertical-align: top; overflow-wrap: break-word; word-break: normal; }
.pc-table td .hint { overflow-wrap: anywhere; }
.pc-section button:disabled, .pc-modal button:disabled { opacity: .45; cursor: not-allowed; }
.pc-sec-icon { color: var(--trust-text); }

/* ==========================================================================
   Mobile (<= 820px) -- keep every S2-S5 / Kanban 375px fix
   ========================================================================== */
@media (max-width: 820px) {
  main > section { padding: 14px 12px 104px; }
  .field-row { flex-direction: column; gap: 0; }
  .col { min-width: 82vw; max-width: 320px; }
  .card-move { width: 40px; height: 40px; font-size: 12px; }

  /* compact cards instead of wide tables */
  table.table-responsive, table.table-responsive thead, table.table-responsive tbody,
  table.table-responsive th, table.table-responsive td, table.table-responsive tr { display: block; }
  table.table-responsive { background: none; border: none; }
  table.table-responsive thead tr { position: absolute; top: -9999px; left: -9999px; }
  table.table-responsive tr { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
  table.table-responsive td { border: none; padding: 4px 0 4px 44%; position: relative; min-height: 22px; font-size: 14px; background: none !important; }
  table.table-responsive td:empty { display: none; }
  table.table-responsive td[data-label]:before { content: attr(data-label); position: absolute; left: 0; top: 5px; width: 40%; font-weight: 600; color: var(--muted); font-size: 12px; }
  table.table-responsive td[data-label=""]:before { content: none; }
  table.table-responsive td[data-label=""] { padding-left: 0; }
  table.table-responsive td.sel-col { position: absolute; top: 8px; right: 8px; padding: 0; min-height: 0; z-index: 2; width: auto; }
  table.table-responsive td.sel-col input { width: 24px; height: 24px; margin: 0; }
  table.table-responsive tr.is-selected { border-color: var(--accent-text); background: var(--accent-soft); }
  table.table-responsive td.sel-col + td { padding-right: 36px; }
  main table:not(.table-responsive) { display: block; max-width: 100%; overflow-x: auto; }

  .deal-filterbar select, .deal-filterbar .filter-toggle { flex: 1 1 calc(50% - 8px); }
  .deal-filterbar .search-input { flex: 1 1 100%; min-width: 0; }
  .deal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .deal-stats .stat-tile { padding: 10px 12px; }
  .deal-stats .stat-tile .stat-value { font-size: 18px; }
  .select-all-mobile { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 2px 10px; min-height: var(--tap); }
  .bulk-row select { flex: 1 1 calc(50% - 6px); }
  .bulk-count { flex: 1 1 100%; }
  .toolbar .btn-primary, .table-toolbar .btn-primary { min-height: var(--tap-primary); }
  .table-toolbar .toolbar-left { flex: 1 1 100%; min-width: 0; }
  .table-toolbar .search-input, .toolbar .search-input { flex: 1 1 100%; min-width: 0; width: 100%; }
  .filter-tabs button, .filter-toggle, .chip, .tl-filter, .ua-chip { min-height: var(--tap); padding: 7px 12px; font-size: 13px; }
  .note-actions .btn-sm { min-height: var(--tap); padding: 8px 12px; }
  .tl-more { padding: 10px 16px; font-size: 14px; min-height: var(--tap); }
  .add-note { flex-direction: column; }
  .btn-sm { min-height: var(--tap); }

  /* settings: section nav becomes a horizontal scroller inside the page */
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav a { flex: none; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
  .settings-section { padding: 16px; }

  /* S4 Users & access at 375px */
  .ua-head .btn-primary { width: 100%; }
  .ua-list { grid-template-columns: minmax(0, 1fr); }
  .ua-actions .btn-sm { padding: 9px 12px; min-height: var(--tap); flex: 1 1 auto; justify-content: center; }
  .ua-modal .modal-actions button { width: 100%; min-height: 42px; }
  .ua-check { min-height: 36px; }

  /* S5 Privacy & Compliance at 375px */
  .pc-tabs { flex-wrap: wrap; overflow-x: visible; }
  .pc-tab { padding: 10px 12px; min-height: var(--tap); }
  .pc-section .btn-sm, .pc-modal .btn-sm, .pc-section .btn-primary, .pc-chips .ua-chip { min-height: var(--tap); }
  .pc-section .btn-link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 4px; }
  .pc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-policy-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-policy-foot .ua-actions { width: 100%; }
  .pc-policy-foot .ua-actions .btn-sm, .pc-dsar .btn-sm, .pc-hold .btn-sm { flex: 1 1 auto; min-height: var(--tap); justify-content: center; }
  .pc-subhead .btn-primary { width: 100%; }
  .pc-dl { grid-template-columns: minmax(0, 1fr); }
  .pc-dl dt { margin-top: 4px; }
  .pc-ext { grid-template-columns: minmax(0, 1fr); }
  .pc-modal .ua-actions .btn-sm { min-height: 42px; }
}
.form-error { color: var(--danger-text) !important; }

/* signed in without a tenant (e.g. platform admin): no tenant navigation,
   but the account area with sign-out stays (UI foundation) */
body.no-tenant .navlist,
body.no-tenant .sheet-nav,
body.no-tenant .bottom-nav .nav-tab { display: none !important; }
body.no-tenant .bottom-nav { justify-content: flex-end; }
.settings-layout.no-nav { grid-template-columns: minmax(0, 1fr); }
.st-anchor { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Scoreboard / Sales Management: same panels, wider + compact rows */
#tab-scorebord .settings-section, #tab-salesmanagement .settings-section { max-width: 1100px; }
#tab-scorebord table td, #tab-salesmanagement table td, #tab-scorebord table th, #tab-salesmanagement table th { padding: 8px 12px; }
#tab-scorebord tbody tr:first-child td:first-child, #tab-salesmanagement tbody tr:first-child td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sb-period-switcher { margin: 0; }
.sb-progress { height: 10px; }

/* Privacy "Access & security" table: readable user/date columns on desktop;
   the table scrolls inside its panel instead of crushing emails */
@media (min-width: 821px) {
  .pc-section .pc-table { display: block; overflow-x: auto; }
  .pc-table th:first-child, .pc-table td:first-child { min-width: 240px; }
  .pc-table td:first-child .hint { overflow-wrap: break-word; word-break: normal; }
  .pc-table th:nth-child(5), .pc-table td:nth-child(5) { min-width: 120px; }
}

/* 375px acceptance (UI foundation): flexible rows in settings wrap, file
   inputs shrink, segmented controls and colour pickers reach 40px */
.settings-section .field-row > *, .settings-list-row > * { min-width: 0; }
.settings-section input[type=file] { max-width: 100%; }
.settings-section input[type=color] { min-height: var(--tap); min-width: 48px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--input-bg); }
@media (max-width: 820px) {
  .settings-section .field-row, .settings-list-row, .settings-section > div[style*="display:flex"] { flex-wrap: wrap; }
  .views button, .segmented button { min-height: var(--tap); }
  .theme-seg button { min-height: var(--tap); padding: 6px 12px; }
}
@media (max-width: 820px) { .settings-section .field-row { align-items: stretch; } }

/* ---------------------------------------------------------------------
   S6 Commercial platform: tenant section (Abonnement & gebruik) + the
   platform-admin console (tab Commercieel). Pomio tokens only.
   --------------------------------------------------------------------- */
/* a platform admin without a tenant still gets the commercial console */
body.no-tenant.is-platform-admin .navlist,
body.no-tenant.is-platform-admin .sheet-nav { display: flex !important; }
body.no-tenant.is-platform-admin .navlist .nav-tab:not([data-tab="commercieel"]),
body.no-tenant.is-platform-admin .sheet-nav .nav-tab:not([data-tab="commercieel"]) { display: none !important; }

.cm-section { max-width: 1100px; }
.cm-console { max-width: 1200px; }
.cm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.cm-card { min-width: 0; }
.cm-wide { margin: 12px 0; }
.cm-card h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-h5 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.cm-big { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 8px; }
.cm-warn { color: var(--warning-text); }
.cm-actions, .cm-row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* position: relative makes the scrollers the containing block of the
   absolutely positioned .sr-only column headers -- otherwise those escape the
   table's own overflow and widen the whole page at 375px (staging finding) */
.cm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; position: relative; }
.cm-table-wrap > table { position: relative; }
.cm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cm-table th, .cm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cm-table th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.cm-table td.num, .cm-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cm-table tfoot td { font-weight: 700; border-bottom: none; }
.cm-bar { width: 96px; height: 8px; border-radius: 999px; background: var(--surface-2, var(--border)); overflow: hidden; margin-top: 6px; }
.cm-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.cm-bar-fill.cm-fu-warning { background: var(--warning); }
.cm-bar-fill.cm-fu-critical, .cm-bar-fill.cm-fu-limit_reached { background: var(--danger); }
.cm-feat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.cm-feat-list .is-off { color: var(--muted); }
.cm-feat-list .is-on span[aria-hidden] { color: var(--success-text); font-weight: 700; }
.cm-list { list-style: none; padding: 0; margin: 0; }
.cm-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.cm-list li:last-child { border-bottom: none; }
.cm-copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cm-copy-row .section-label { margin: 0; min-width: 64px; }
.cm-code { font-family: var(--font-mono, ui-monospace, monospace); background: var(--surface-2, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 4px 8px; font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.cm-link { flex: 1 1 200px; }
.cm-preview { margin-top: 12px; }
.cm-lines { width: 100%; max-width: 480px; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.cm-lines td { padding: 4px 0; border-bottom: 1px dashed var(--border); }
.cm-lines td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.cm-lines .cm-sub td { font-weight: 700; border-bottom: none; }
.cm-details summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 4px; }
.cm-disclaimer { background: var(--trust-soft); color: var(--trust-text); border-radius: var(--radius-control); padding: 10px 12px; font-size: 13px; margin: 0 0 12px; }
.cm-filterbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.cm-filterbar .field { margin-bottom: 0; }
.cm-tenant-pick { max-width: 420px; }
.cm-inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.cm-inline-form .field { margin-bottom: 0; min-width: 200px; }
.cm-modal-wide { width: min(760px, calc(100vw - 32px)); }
.cm-modal { max-height: calc(100vh - 48px); overflow-y: auto; }
.cm-fieldset { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 12px; margin: 0 0 14px; min-width: 0; }
.cm-fieldset legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
.cm-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; }
.cm-price-row { margin-bottom: 8px; }
.cm-fu-row { align-items: flex-end; }
.cm-fu-name { flex: 0 0 160px; font-size: 13px; padding-bottom: 22px; }

@media (max-width: 820px) {
  .cm-grid { grid-template-columns: minmax(0, 1fr); }
  .cm-section .btn-sm, .cm-console .btn-sm, .cm-modal .btn-sm { min-height: var(--tap); }
  .cm-console .pc-tab { min-height: var(--tap); }
  .cm-fu-row { flex-wrap: wrap; }
  .cm-fu-name { flex-basis: 100%; padding-bottom: 0; }
  .cm-inline-form .field { min-width: 0; flex: 1 1 100%; }
  .cm-inline-form button { width: 100%; }
}

/* S7 -- Prestaties (Sales Performance / Commission / Bonus) */
.pf-periodnav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-periodstep { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-periodlabel { min-width: 130px; text-align: center; }
.pf-hist-reason { display: block; overflow-wrap: anywhere; }
.pf-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.pf-table tr.is-selected td { background: var(--accent-soft, var(--surface-2)); }
.pf-achcell { min-width: 120px; }
.pf-achcell span { font-size: 12.5px; color: var(--muted); }
.pf-bar { margin-bottom: 3px; }
.pf-bar .progress-fill.is-done { background: var(--success, var(--accent)); }
.pc-tile.is-good { border-color: var(--success, var(--accent)); }
.pf-detail { margin: 14px 0; }
.pf-detail:focus { outline: none; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.pf-h4 { margin: 18px 0 6px; font-size: 14px; }
.pf-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; }
.pf-toggle { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; min-height: 40px; }
.pf-toggle input { margin-top: 3px; }
.pf-card-grid { margin-top: 10px; }
.pf-trend { list-style: none; padding: 0; margin: 0 0 8px; }
.pf-trend li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.pf-trend-bars { position: relative; height: 10px; background: var(--surface-3); border-radius: var(--radius-pill); }
.pf-trend-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: var(--radius-pill); }
.pf-trend-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.pf-trend-value { white-space: nowrap; text-align: right; }
@media (max-width: 600px) {
  .pf-periodnav { flex-direction: column; align-items: stretch; }
  .pf-periodstep { justify-content: space-between; }
  .pf-periodlabel { min-width: 0; flex: 1; }
  .pf-trend li { grid-template-columns: minmax(0, 1fr) auto; }
  .pf-trend-bars { grid-column: 1 / -1; order: 3; }
  .pf-tools .btn-sm, .pf-actions .btn-sm { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------------
   Platform console: Organisaties (organisations.js) + suspended /
   archived organisation screen (session.js). Pomio tokens only.
   --------------------------------------------------------------------- */
/* a platform admin without a tenant also keeps Organisaties next to
   Commercieel (the S6 rule above hides every other nav item) */
body.no-tenant.is-platform-admin .navlist .nav-tab[data-tab="organisaties"]:not([hidden]),
body.no-tenant.is-platform-admin .sheet-nav .nav-tab[data-tab="organisaties"]:not([hidden]) { display: flex !important; }

.org-console { max-width: 1280px; }
.org-head { margin-bottom: 4px; }
.org-head .cm-actions .btn-primary { min-height: var(--tap); }
.org-tiles { margin: 14px 0 10px; }
.org-filterbar { align-items: center; }
.org-filterbar .search-input { flex: 1 1 240px; min-width: 0; width: auto; }
.org-filterbar select { min-height: var(--tap); width: auto; max-width: 100%; }
.org-warn-toggle { min-height: var(--tap); }
.org-table .org-name-cell { min-width: 180px; }
.org-table .org-name-cell .badge { margin-left: 4px; vertical-align: middle; }
.org-table td .ua-badges { margin-top: 4px; }
.org-table code, .org-console dd code, .org-result code { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.org-email { overflow-wrap: anywhere; min-width: 140px; }
.org-nowrap { white-space: nowrap; }
.org-generated { margin-top: 8px; }
.org-back { margin-bottom: 12px; min-height: var(--tap); }
.org-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.org-detail-id { min-width: 0; }
.org-detail-id h3 { margin: 0 0 6px; overflow-wrap: anywhere; }
.org-detail-id h3:focus { outline: none; }
.org-detail-id .hint { margin: 6px 0 0; }
.org-detail-actions { justify-content: flex-end; }
.org-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.org-card h4 { margin-top: 0; }
.org-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.org-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.org-step-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.org-steps li.is-done .org-step-mark { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.org-steps li.is-open .org-step-label { color: var(--muted); }
.org-step-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.org-step-text .hint { font-size: 12.5px; overflow-wrap: anywhere; }
.org-warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.org-warnings li { padding: 8px 10px; border-radius: var(--radius-control); background: var(--warning-soft); color: var(--warning-text); overflow-wrap: anywhere; }
.org-subhead { align-items: center; margin-top: 14px; }
.org-subhead h4, .org-h4 { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; font-size: 14px; }
.org-note { margin: 12px 0 0; }
.org-modal .cm-fieldset .hint { margin: 0 0 10px; }
.org-radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-height: var(--tap); font-size: 14px; cursor: pointer; color: var(--text); }
.org-radio input { width: auto; margin-top: 3px; flex: none; accent-color: var(--accent-text); }
.org-radio > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.org-radio .hint { margin: 0; }
.org-cm-config { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.org-slug-status { margin: 4px 0 0; min-height: 1em; }
.org-slug-status:empty { display: none; }
.org-slug-status.is-good { color: var(--success-text); }
.org-slug-status.is-bad { color: var(--danger-text); }
.org-type-hint { margin: -6px 0 12px; }
.org-price-hint { margin: 0; }
.org-result p { margin: 6px 0; }
.org-result .btn-sm { min-height: var(--tap); }
.org-res-dev { margin: 10px 0; }

@media (max-width: 820px) {
  .org-head .cm-actions { width: 100%; }
  .org-head .cm-actions .btn-primary { flex: 1 1 auto; min-height: var(--tap-primary); }
  .org-filterbar .search-input { flex: 1 1 100%; }
  .org-filterbar select { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .org-detail-actions { justify-content: flex-start; width: 100%; }
  .org-detail-actions .btn-sm { flex: 1 1 auto; }
  .org-grid { grid-template-columns: minmax(0, 1fr); }
  .org-subhead .btn-primary { width: 100%; min-height: var(--tap); }
  .org-console .cm-row-actions .btn-sm { min-height: var(--tap); }
}

/* suspended / archived organisation: full-page notice instead of the CRM */
.org-blocked { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg); color: var(--text); box-sizing: border-box; }
.org-blocked-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 28px 24px; text-align: center; }
.org-blocked-card h1 { font-family: var(--font-display); font-size: 22px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.org-blocked-card p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.org-blocked-card .org-blocked-name { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.org-blocked-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: var(--warning-soft); color: var(--warning-text); }
.org-blocked-icon svg { width: 28px; height: 28px; }
.org-blocked-actions { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.org-blocked-actions .btn-primary { min-height: var(--tap-primary); padding: 0 20px; }
.org-blocked-actions select { min-height: var(--tap); }
.org-table .cm-row-actions { flex-wrap: nowrap; }
.org-table .cm-row-actions .btn-sm, .org-table .cm-row-actions .hint { white-space: nowrap; }
.org-table th:nth-child(4), .org-table td:nth-child(4) { min-width: 150px; }
.org-result .badge { white-space: normal; }

/* S8 automations ---------------------------------------------------------
   Instellingen -> Automatiseringen / Integraties (automations.js), the
   automation marker in the timeline and the "Automatisch" task badge.
   Tokens only; dark mode follows the existing variables. */
.am-section { max-width: 1200px; }
.am-head { margin-bottom: 4px; }
.am-head .cm-actions .btn-primary { min-height: var(--tap); }
.am-filterbar { align-items: center; margin-top: 10px; }
.am-notice { margin-top: 10px; }
.am-table .am-name-cell { min-width: 180px; overflow-wrap: anywhere; }
.am-table .am-actions-cell { min-width: 200px; }
.am-table .cm-row-actions { justify-content: flex-end; }
.am-table .badge { white-space: nowrap; }
.am-url { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.am-runs code { font-family: var(--font-mono); font-size: 12px; }
.am-run-actions { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.am-run-actions .badge { margin-left: 4px; }
.am-sig { margin-top: 14px; }
.am-sig-list { margin: 6px 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.am-sig-list code, .am-secret { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.am-secret { flex: 1 1 220px; user-select: all; }
.am-secret-warn { background: var(--warning-soft); color: var(--warning-text); }

/* builder */
.am-modal .field select, .am-modal .field input, .am-modal .field textarea { max-width: 100%; }
.am-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.am-step { width: 100%; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.am-step-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border-strong); }
.am-step-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }
.am-step.done .am-step-n { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.am-step.active { border-color: var(--accent-text); color: var(--text); background: var(--accent-soft); }
.am-step.active .am-step-n { border-color: var(--accent-text); color: var(--text); }
.am-step-body { min-height: 120px; }
.am-trigger-hint { margin: -6px 0 12px; }
.am-drop-note { background: var(--warning-soft); color: var(--warning-text); padding: 6px 10px; border-radius: var(--radius-control); }
.am-days { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.am-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.am-row-n { flex: none; min-width: 34px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 10px; }
.am-row-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.am-row-fields .am-inline { flex: 1 1 160px; min-width: 0; margin: 0; }
.am-row-fields select, .am-row-fields input { width: 100%; min-height: var(--tap); }
.am-row .btn-sm { flex: none; margin-top: 4px; }
.am-multi { flex: 1 1 100%; border: 1px solid var(--border); border-radius: var(--radius-control); padding: 6px 10px; margin: 0; max-height: 180px; overflow-y: auto; display: grid; gap: 2px; min-width: 0; }
.am-action-head { display: flex; align-items: flex-end; gap: 8px; }
.am-action-head .field { flex: 1 1 auto; min-width: 0; }
.am-action-head .btn-sm { margin-bottom: 14px; }
.am-gap { display: block; height: 6px; }
.am-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.am-chip { font-family: var(--font-mono); font-size: 11.5px; padding: 3px 8px; min-height: 28px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.am-chip:hover, .am-chip:focus-visible { border-color: var(--accent-text); background: var(--accent-soft); }
.am-summary { margin-bottom: 10px; }
.am-sentence { font-size: 15px; line-height: 1.55; margin: 6px 0 0; overflow-wrap: anywhere; }

/* timeline + tasks */
.tl-via { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--text); }
.tk-auto { margin-left: 6px; vertical-align: middle; font-size: 11px; }

@media (max-width: 820px) {
  .am-head .cm-actions { width: 100%; }
  .am-head .cm-actions .btn-primary { flex: 1 1 auto; min-height: var(--tap-primary); }
  .am-section .cm-row-actions .btn-sm, .am-modal .btn-sm { min-height: var(--tap); }
  .am-chip { min-height: 32px; }
}
@media (max-width: 640px) {
  /* list tables become cards: one block per row, each cell labelled */
  .am-section .cm-table-wrap, .am-modal .cm-table-wrap { overflow-x: visible; }
  .am-table, .am-table tbody, .am-table tr, .am-table td { display: block; width: 100%; box-sizing: border-box; }
  .am-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .am-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  .am-table td.am-name-cell, .am-table td.am-actions-cell, .am-runs td:nth-child(n+5) { grid-column: 1 / -1; }
  .am-table td { border-bottom: none; padding: 4px 0; min-width: 0 !important; }
  .am-table td.num { text-align: left; }
  .am-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
  .am-table td.am-name-cell::before { display: none; }
  .am-table .am-actions-cell { padding-top: 8px; border-top: 1px solid var(--border); margin-top: 6px; }
  .am-table td.am-actions-cell:empty { display: none; }
  .am-table .cm-row-actions { justify-content: flex-start; }
  .am-table .cm-row-actions .btn-sm { flex: 1 1 auto; }
  .am-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-row { flex-wrap: wrap; }
  .am-row-n { padding-top: 0; flex-basis: 100%; }
  .am-row-fields .am-inline { flex-basis: 100%; }
  .am-row .btn-sm { margin-left: auto; }
  .am-action-head { flex-wrap: wrap; }
  .am-action-head .btn-sm { margin: -6px 0 10px auto; }
}

/* ==========================================================================
   S11B-P3: trial lifecycle -- Instellingen -> Abonnement (subscriptionLifecycle.js),
   the conversion / action dialogs (<dialog class="st9-dialog lc-dialog">)
   and the platform console "Proefomgevingen" (trialConsole.js). Tokens only
   (light/dark/auto); 375 px: no horizontal page scroll, 40 px tap targets.
   ========================================================================== */
.lc-card { display: flex; flex-direction: column; gap: 10px; }
.lc-status-line { margin: 0; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lc-keep { margin: 0; font-size: 14px; color: var(--text); }
.lc-request { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-2); padding: 10px 12px; }
.lc-request .hint { margin: 4px 0 8px; }
.lc-request-line { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lc-check { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--success); position: relative; }
.lc-check::after { content: ''; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lc-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lc-cta .hint { margin: 0; }
.lc-cta .btn-primary, .lc-request .btn-sm { min-height: var(--tap); }
.lc-dialog form { margin: 0; }
.lc-dialog .lc-dlg-sub { font-size: 14px; margin: 14px 0 0; }
.lc-dialog .lc-contact { grid-template-columns: 90px minmax(0, 1fr); margin: 8px 0 4px; }
.lc-dialog .field { margin: 12px 0 0; }
.lc-dialog .ua-form-error { margin-top: 10px; }
.lc-dialog .modal-actions { margin-top: 16px; }
.lc-count { margin: 4px 0 0; }
.lc-count.is-over { color: var(--danger-text); font-weight: 600; }
.lc-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-control); background: var(--warning-soft); color: var(--text); border-left: 3px solid var(--warning); font-size: 13px; }
.lc-console .pc-subhead { flex-wrap: wrap; gap: 8px; }
.lc-filter { margin: 0; min-width: 200px; }
.lc-table td { vertical-align: top; }
.lc-table .badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.lc-table code, .lc-hash { font-size: 12px; overflow-wrap: anywhere; }
.lc-actions { margin: 4px 0 8px; }
.lc-actions .btn-sm { min-height: var(--tap); }
.lc-msg { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--border-strong); color: var(--text); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lc-alerts li { gap: 8px; flex-wrap: wrap; }
.lc-fieldset { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px 2px; margin: 0 0 14px; min-width: 0; }
.lc-fieldset legend { font-size: 13px; font-weight: 700; padding: 0 6px; }
.lc-switch { margin-bottom: 10px; }
.lc-switch .hint { margin: 2px 0 0 26px; }
.lc-switch input:disabled { cursor: not-allowed; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 14px; }
@media (max-width: 640px) {
  .lc-filter { min-width: 0; flex: 1 1 100%; }
  .lc-console .cm-table-wrap { overflow-x: visible; }
  .lc-table, .lc-table tbody, .lc-table tr, .lc-table td { display: block; width: 100%; box-sizing: border-box; }
  .lc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .lc-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  .lc-table td { border-bottom: none; padding: 4px 0; min-width: 0 !important; }
  .lc-table td:first-child, .lc-table td:last-child:not([data-label]) { grid-column: 1 / -1; }
  .lc-table td.num { text-align: left; }
  .lc-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
  .lc-table td:last-child:not([data-label]) .btn-sm { width: 100%; min-height: var(--tap); }
  .lc-actions .btn-sm { flex: 1 1 auto; }
  .lc-switch .hint { margin-left: 0; }
}

/* ==========================================================================
   SUBS-1: paid subscription term, deadlines + scheduled change
   (subscriptionChanges.js), its confirmation dialogs (<dialog class="st9-dialog
   sub-dialog">) and the platform-console term card / overrides
   (commercialAdmin.js). Tokens only (light/dark/auto); 375 px: one column,
   no horizontal scroll, 40 px tap targets.
   ========================================================================== */
.sub-card { display: flex; flex-direction: column; gap: 10px; }
.sub-dl { grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); margin: 0; }
.sub-row-hint { display: block; margin-top: 2px; font-size: 12px; }
.sub-sched { border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius-control); background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.sub-sched h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.sub-sched-title { margin: 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.sub-sched-line { margin: 0; font-size: 14px; color: var(--text); }
.sub-sched-line.is-effective { font-weight: 600; }
.sub-sched .btn-sm { align-self: flex-start; margin-top: 6px; min-height: var(--tap); }
.sub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-actions .btn-sm { min-height: var(--tap); }
.sub-cancel-btn { color: var(--danger-text); }
.sub-notice { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-control); font-size: 13px; color: var(--text); border-left: 3px solid var(--border-strong); background: var(--surface-2); }
.sub-notice.is-warn { background: var(--warning-soft); border-left-color: var(--warning); }
.sub-notice.is-danger { background: var(--danger-soft); border-left-color: var(--danger); }
.sub-blockers { margin: 8px 0 0; padding-left: 20px; font-size: 14px; font-weight: 600; color: var(--danger-text); }
.sub-blockers li { margin: 2px 0; overflow-wrap: anywhere; }
.sub-dialog { width: min(560px, calc(100vw - 32px)); }
.sub-dialog form { margin: 0; }
.sub-dialog .field { margin: 12px 0 0; }
.sub-dialog select { width: 100%; }
.sub-dlg-dl { grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); margin: 12px 0 0; }
.sub-dialog .ua-form-error { margin-top: 10px; }
.sub-dialog .modal-actions { margin-top: 16px; }
@media (max-width: 640px) {
  .sub-dl, .sub-dlg-dl { grid-template-columns: minmax(0, 1fr); }
  .sub-dl dt, .sub-dlg-dl dt { margin-top: 4px; }
  .sub-actions .btn-sm { flex: 1 1 100%; }
  .sub-sched .btn-sm { align-self: stretch; }
  .sub-dialog .modal-actions { flex-wrap: wrap; }
  .sub-dialog .modal-actions button { flex: 1 1 auto; }
}

/* ==========================================================================
   SCALE-1 (13-10-2026): boot skeleton + boot status (slow notice, error card).
   <html data-boot="loading|slow|error|ready|blocked|leaving"> is set by
   session.js (static "loading" in crm.html, so the skeleton is there from the
   first paint). The board skeleton stays until #board-view has content (or
   the list view is shown) -- also after the boot, while the pipeline/deals
   are still loading, so the board is never a blank area. Tokens only
   (light/dark/auto); no motion with prefers-reduced-motion.
   ========================================================================== */
.boot-status { padding: 0 24px; }
.boot-status[hidden] { display: none; }
.boot-status.is-loading { padding: 0; }
.boot-status.is-slow { padding: 16px 24px 0; }
.boot-slow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--muted); font-size: 14px; }
.boot-slow > span:not(.boot-spinner) { flex: 1 1 200px; min-width: 0; }
.boot-spinner { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent-text); animation: boot-spin .9s linear infinite; }
.boot-status.is-error { display: flex; justify-content: center; padding: 48px 16px 96px; }
.boot-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 28px 24px; text-align: center; color: var(--text); box-sizing: border-box; }
.boot-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--warning-soft); color: var(--warning-text); }
.boot-card-icon svg { width: 24px; height: 24px; }
.boot-card h2 { font-family: var(--font-display); font-size: 20px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.boot-card h2:focus, .boot-card h2:focus-visible { outline: none; box-shadow: none; } /* programmatic focus target (announced via role=alert), not an interactive control */
.boot-card p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.boot-card .boot-code { font-size: 13px; }
.boot-card .boot-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }
.boot-card .btn-primary { margin-top: 8px; min-height: var(--tap, 44px); }
/* while the boot failed only the card is shown (no skeleton, no empty panels) */
html[data-boot="error"] main > .tab-panel { display: none; }

/* skeleton shapes */
.skel-line, .skel-card, .skel-col-head .skel-line { display: block; border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; }
.skel-line { height: 10px; margin: 4px 0 8px; }
.skel-line.skel-lg { height: 20px; margin-bottom: 2px; }
.skel-w40 { width: 40%; }
.skel-w60 { width: 60%; }
.stat-tile.skel-tile { min-height: 72px; }
.boot-skel { display: none; }
.boot-skel-board { gap: 12px; overflow: hidden; padding-bottom: 12px; align-items: flex-start; }
.skel-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px; min-width: 248px; flex: 1; max-width: 300px; }
.skel-col-head { padding: 2px 4px 10px; }
.skel-col .skel-card { height: 64px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.skel-col .skel-card.skel-short { height: 40px; }
.skel-line::after, .skel-card::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--surface-3, rgba(127, 127, 127, 0.12)), transparent);
  animation: boot-shimmer 1.4s ease-in-out infinite;
}
@supports selector(:has(*)) {
  html:not([data-boot="error"]):not([data-boot="blocked"]) #tab-deals .section-body:not(:has(> #board-view > *)):not(:has(> #list-view:not([hidden]))) > .boot-skel-board { display: flex; }
}
@supports not selector(:has(*)) {
  html[data-boot="loading"] .boot-skel-board, html[data-boot="slow"] .boot-skel-board { display: flex; }
}
/* list screens: a shimmer block while the module has rendered nothing yet */
html:not([data-boot="error"]) #companies-view:empty,
html:not([data-boot="error"]) #people-view:empty,
html:not([data-boot="error"]) #tk-list-view:empty:not([hidden]) {
  display: block; min-height: 240px; border-radius: var(--radius-card);
  background: repeating-linear-gradient(180deg, var(--surface-2) 0 44px, transparent 44px 56px);
  opacity: .7;
}
@keyframes boot-shimmer { to { transform: translateX(100%); } }
@keyframes boot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .skel-line::after, .skel-card::after { animation: none; display: none; }
  .boot-spinner { animation: none; }
}
@media (max-width: 820px) {
  .boot-status { padding: 0 16px; }
  .boot-status.is-slow { padding: 12px 16px 0; }
  .boot-status.is-error { padding: 32px 16px 96px; }
  .boot-skel-board { scroll-snap-type: none; }
  .skel-col { min-width: 78vw; }
  .boot-card .btn-primary { width: 100%; }
}

/* D-SEAT-1: every paid seat taken (Instellingen -> Gebruikers & toegang) */
.ua-seat-notice { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-control); background: var(--warning-soft); color: var(--text); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ua-seat-notice p { margin: 0; flex: 1 1 240px; }
.ua-seat-cta { margin: 8px 0 0; }
