/*
 * App parts — the new design, Phase 2a (2026-11-18): buttons, icon buttons, inputs, drop-downs, checkboxes.
 * From design-demos/10-system.html (Colours & parts) and DECISIONS.md. Loaded last (after app-colors.css).
 * Rules: the main button in the accent; every other button neutral — the area colour marks where you are
 * (tab, menu item, page icon), never the buttons. Colours only through variables of app-colors.css.
 * To roll back: remove this file and its two links (index.html, sites/frontend/config/app.js).
 */

:root:not([data-theme="light"]) {
  --pt-btn-bg: var(--hover);
  --pt-btn-bg-hover: var(--sec-soft);
  --pt-btn-bd: var(--border-color);
  --pt-btn-bd-hover: var(--sec-line);
  --pt-btn-shadow: none;
  --pt-danger-bg: var(--err-soft);
  --pt-danger-bd: var(--err-line);
  --pt-danger-text: var(--err-strong);
  --pt-in-bg: var(--bg);
  --pt-in-bd: var(--border-color);
  --pt-on-accent: var(--on-accent);
}
html:root[data-theme="light"] {
  --pt-btn-bg: var(--side);
  --pt-btn-bg-hover: var(--hover);
  --pt-btn-bd: var(--drk-soft);
  --pt-btn-bd-hover: var(--drk-soft);
  --pt-btn-shadow: 0 1px 1px rgba(15,23,42,0.05);
  --pt-danger-bg: var(--side);
  --pt-danger-bd: var(--err-line);
  --pt-danger-text: var(--err-strong);
  --pt-in-bg: var(--side);
  --pt-in-bd: var(--drk-soft);
  --pt-on-accent: var(--side);
}

/* ── buttons ── */
.ts-btn, .btn.btn-secondary, .btn.btn-outline-secondary {
  border-radius: 7px; font-weight: 600;
  background: var(--pt-btn-bg) !important; border: 1px solid var(--pt-btn-bd) !important; color: var(--text) !important; box-shadow: var(--pt-btn-shadow) !important;
  transition: background-color 140ms ease, border-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.ts-btn:hover:not(:disabled), .btn.btn-secondary:hover, .btn.btn-outline-secondary:hover {
  background: var(--pt-btn-bg-hover) !important; border-color: var(--pt-btn-bd-hover) !important; color: var(--text) !important;
}
/* the main action: the accent, the same on every area */
.ts-btn.ts-btn-primary, .btn.btn-primary {
  background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--pt-on-accent) !important; box-shadow: none !important;
}
.ts-btn.ts-btn-primary:hover:not(:disabled), .btn.btn-primary:hover {
  background: var(--prim-strong) !important; border-color: var(--prim-strong) !important; color: var(--pt-on-accent) !important;
}
/* danger: red only in text and line, filled under the mouse */
.ts-btn.ts-btn-danger, .btn.btn-danger {
  background: var(--pt-danger-bg) !important; border-color: var(--pt-danger-bd) !important; color: var(--pt-danger-text) !important; box-shadow: none !important;
}
.ts-btn.ts-btn-danger:hover:not(:disabled), .btn.btn-danger:hover {
  background: var(--alert) !important; border-color: var(--alert) !important; color: var(--text) !important;
}
.ts-btn:active:not(:disabled), .ts-icon-btn:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.97); }
.ts-btn:focus-visible, .ts-icon-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: 2px; }
/* the chosen one of a group (kind filters, scopes) keeps its colour — set by the pages */

/* ── icon buttons ── */
.ts-icon-btn {
  border-radius: 7px; background: var(--pt-btn-bg) !important; border: 1px solid var(--pt-btn-bd) !important; color: var(--text-2) !important; box-shadow: var(--pt-btn-shadow);
  transition: background-color 140ms ease, border-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.ts-icon-btn:hover:not(:disabled) { background: var(--pt-btn-bg-hover) !important; border-color: var(--pt-btn-bd-hover) !important; color: var(--text) !important; }
.ts-icon-btn.ts-icon-btn-danger:hover:not(:disabled) { background: var(--alert) !important; border-color: var(--alert) !important; color: var(--text) !important; }

/* ── inputs and drop-downs ── */
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
html select, html textarea, html .form-control, html .form-select, html .ts-editor-input {
  background-color: var(--pt-in-bg) !important; border-color: var(--pt-in-bd) !important; color: var(--text) !important; border-radius: 7px !important;
}
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
html select:focus, html textarea:focus, html .form-control:focus, html .form-select:focus, html .ts-editor-input:focus {
  background-color: var(--pt-in-bg) !important; border-color: var(--vd-accent) !important;
  box-shadow: 0 0 0 3px var(--acc-line) !important; outline: none;
}
html input::placeholder, html textarea::placeholder { color: var(--text-muted) !important; opacity: 1; }
/* a problem is red, also when focused */
html .ts-editor-input.ts-input-invalid, html .ts-editor-input.is-invalid, html .is-invalid, html [aria-invalid="true"]:not([type="checkbox"]) {
  border-color: var(--alert) !important; background-color: var(--err-soft) !important;
}
html .ts-editor-input.ts-input-invalid:focus, html .ts-editor-input.is-invalid:focus, html .is-invalid:focus, html [aria-invalid="true"]:not([type="checkbox"]):focus {
  border-color: var(--alert) !important; box-shadow: 0 0 0 3px var(--err-line) !important;
}
html input:disabled, html select:disabled, html textarea:disabled { color: var(--disabled-text); background-color: var(--disabled); border-color: var(--border-color); cursor: not-allowed; }

/* ── checkboxes and radios: the accent; the drawn ones keep their square ── */
html input[type="checkbox"], html input[type="radio"] { accent-color: var(--vd-accent); color: var(--on-accent); }
.ts-wrap input[type="checkbox"], .td-form input[type="checkbox"] { border-color: var(--n-line); border-radius: 3px; }
:root[data-theme="light"] .ts-wrap input[type="checkbox"]:not(:checked), :root[data-theme="light"] .td-form input[type="checkbox"]:not(:checked) { border-color: var(--drk-line); background-color: var(--side); }
.ts-wrap input[type="checkbox"]:focus-visible, .td-form input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 2px var(--acc-line); }
.ts-check { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  .ts-btn:active, .ts-icon-btn:active, .btn:active { transform: none; }
}

/* ══ Phase 2b (2026-11-18): notifications, page alerts, dialogs, menus ══ */

/* the role tones: dark = tinted with the text in the colour; light = the fixed Soft / Line / Strong of Colours & parts */
:root:not([data-theme="light"]) {
  --r-ok: var(--c-ok); --r-err: var(--c-err); --r-warn: var(--c-warn); --r-info: var(--c-info); --r-prim: var(--primary); --r-sec: var(--c-sec);
}
:root:not([data-theme="light"]) :is(.notify-toast, .ts-alert, .modal-status) {
  --soft: var(--rc-soft); --line: var(--rc-line); --strong: var(--rc-strong); }
html:root[data-theme="light"] :is(.notify-toast, .ts-alert, .modal-status) { --soft: var(--sec-soft-x); --line: var(--sec-line-x); --strong: var(--sec-strong-x); }
html:root[data-theme="light"] {
  --ok-soft-x: var(--ok-soft); --ok-line-x: var(--ok-line); --ok-strong-x: var(--ok-strong);
  --err-soft-x: var(--err-soft); --err-line-x: var(--err-line); --err-strong-x: var(--err-strong);
  --warn-soft-x: var(--warn-soft); --warn-line-x: var(--warn-line); --warn-strong-x: var(--warn-strong);
  --info-soft-x: var(--info-soft); --info-line-x: var(--info-line); --info-strong-x: var(--info-strong);
  --prim-soft-x: var(--acc-soft); --prim-line-x: var(--acc-line); --prim-strong-x: var(--accent-text);
  --sec-soft-x: var(--hover); --sec-line-x: var(--drk-soft); --sec-strong-x: var(--sec-strong);
}
/* which role each one is */
.notify-toast.notify-success, .modal-status.status-success { --rc: var(--r-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); }
.notify-toast.notify-critical, .ts-alert.pa-alert, .modal-status.status-danger { --rc: var(--r-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); }
.notify-toast.notify-alert, .ts-alert, .modal-status.status-alert { --rc: var(--r-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); }
.notify-toast.notify-info, .modal-status.status-info { --rc: var(--r-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); }
.ts-alert.pa-note { --rc: var(--r-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); }
html:root[data-theme="light"] :is(.notify-toast.notify-success, .modal-status.status-success) { --soft: var(--ok-soft-x); --line: var(--ok-line-x); --strong: var(--ok-strong-x); }
html:root[data-theme="light"] :is(.notify-toast.notify-critical, .ts-alert.pa-alert, .modal-status.status-danger) { --soft: var(--err-soft-x); --line: var(--err-line-x); --strong: var(--err-strong-x); }
html:root[data-theme="light"] :is(.notify-toast.notify-alert, .ts-alert, .modal-status.status-alert) { --soft: var(--warn-soft-x); --line: var(--warn-line-x); --strong: var(--warn-strong-x); }
html:root[data-theme="light"] :is(.notify-toast.notify-info, .ts-alert.pa-note, .modal-status.status-info) { --soft: var(--info-soft-x); --line: var(--info-line-x); --strong: var(--info-strong-x); }
html:root[data-theme="light"] .ts-alert.pa-alert { --soft: var(--err-soft-x); --line: var(--err-line-x); --strong: var(--err-strong-x); }

/* ── notifications (bottom right): the card in its colour, title and x in the Strong tone, no left bar ── */
.notify-toast {
  background: var(--soft) !important; border: 1px solid var(--line) !important; border-radius: 8px !important;
  color: var(--text-2) !important; padding: 12px 40px 13px 16px !important;
  box-shadow: 0 10px 26px rgba(10,14,22,0.35) !important; }
:root:not([data-theme="light"]) .notify-toast { color: var(--strong) !important; }
html:root[data-theme="light"] .notify-toast { box-shadow: 0 2px 6px rgba(15,23,42,0.06), 0 12px 32px rgba(15,23,42,0.12) !important; }
.notify-toast .notify-title { color: var(--strong) !important; font-size: 0.9rem; font-weight: 700; }
.notify-toast .notify-message { color: inherit; font-size: 0.85rem; }
.notify-toast .notify-close { color: var(--strong) !important; border-radius: 6px; width: 26px; height: 26px; line-height: 1; top: 8px !important; right: 8px !important; }
.notify-toast .notify-close:hover { background: var(--soft); }

/* ── alerts on a page: one line, the role tone, normal-weight text ── */
.ts-alert {
  background: var(--soft) !important; border: 1px solid var(--line) !important; color: var(--strong) !important;
  border-radius: 6px !important; padding: 6px 12px !important; font-weight: 500; }
.ts-alert > .bi, .ts-alert > i { color: inherit !important; }
.ts-alert a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── dialogs ── */
.modal-content {
  background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 12px !important;
  box-shadow: 0 24px 60px rgba(10,14,22,0.5) !important; }
html:root[data-theme="light"] .modal-content { border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 6px 16px rgba(15,23,42,0.08), 0 28px 64px rgba(15,23,42,0.2) !important; }
.modal-header { background: var(--side) !important; border-bottom: 1px solid var(--border-color) !important; padding: 14px 16px 12px !important; }
.modal-title { font-size: 1.02rem !important; font-weight: 700 !important; color: var(--text) !important; }
.modal-footer { background: var(--bg) !important; border-top: 1px solid var(--border-color) !important; padding: 12px 16px !important; }
html:root[data-theme="light"] .modal-footer { background: var(--side) !important; }
.modal-overlay { background: rgba(10,14,22,0.62); backdrop-filter: blur(2px); }
html:root[data-theme="light"] .modal-overlay { background: rgba(15,23,42,0.36); }
/* the round status icon: the role tone */
.modal-status { background: var(--soft) !important; color: var(--strong) !important; }
/* dialog buttons: the same rules as every button (main = accent, others neutral, danger red line) */
.modal-btn { border-radius: 7px !important; background: var(--vd-accent) !important; border: 1px solid var(--vd-accent) !important; color: var(--text) !important; filter: none !important;
  transition: background-color 140ms ease, border-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.modal-btn:hover:not(:disabled) { background: var(--prim-strong) !important; border-color: var(--prim-strong) !important; }
.modal-btn:active:not(:disabled) { transform: scale(0.97); }
.modal-btn:is(.secondary, .modal-btn-secondary) { background: var(--pt-btn-bg) !important; border-color: var(--pt-btn-bd) !important; color: var(--text) !important; box-shadow: var(--pt-btn-shadow); }
.modal-btn:is(.secondary, .modal-btn-secondary):hover:not(:disabled) { background: var(--pt-btn-bg-hover) !important; border-color: var(--pt-btn-bd-hover) !important; }
.modal-btn.modal-btn-danger { background: var(--pt-danger-bg) !important; border-color: var(--pt-danger-bd) !important; color: var(--pt-danger-text) !important; }
.modal-btn.modal-btn-danger:hover:not(:disabled) { background: var(--alert) !important; border-color: var(--alert) !important; color: var(--text) !important; }

/* ── menus (drop-down, account, right-click, Planner, Designer) ── */
:is(.dropdown-menu, #vd-context-menu, .pl-menu, .vd-export-menu, .vd-group-menu, .vd-tools-menu, .vd-minimap-menu) {
  background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 9px !important; padding: 5px !important;
  box-shadow: 0 12px 32px rgba(10,14,22,0.45) !important; }
html:root[data-theme="light"] :is(.dropdown-menu, #vd-context-menu, .pl-menu, .vd-export-menu, .vd-group-menu, .vd-tools-menu, .vd-minimap-menu) {
  border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 2px 6px rgba(15,23,42,0.06), 0 12px 32px rgba(15,23,42,0.12) !important; }
:is(.dropdown-menu, #vd-context-menu, .pl-menu) :is(.dropdown-item, .ctx-item) { border-radius: 6px; padding: 7px 9px; color: var(--text-2); }
:is(.dropdown-menu, #vd-context-menu, .pl-menu) :is(.dropdown-item, .ctx-item):hover { background: var(--hover) !important; color: var(--text) !important; }
html:root[data-theme="light"] :is(.dropdown-menu, #vd-context-menu, .pl-menu) :is(.dropdown-item, .ctx-item):hover { background: var(--hover) !important; }
:is(.dropdown-menu, #vd-context-menu, .pl-menu) :is(.dropdown-item, .ctx-item) > :is(.bi, i) { color: var(--text-muted); }
:is(.dropdown-menu, #vd-context-menu, .pl-menu) :is(.dropdown-item, .ctx-item):hover > :is(.bi, i) { color: var(--text); }
/* a red item stays red, a soft red under the mouse */
:is(.dropdown-item.text-danger, .ctx-item.ctx-danger, .dbs-menu-signout) { color: var(--pt-danger-text) !important; }
:is(.dropdown-item.text-danger, .ctx-item.ctx-danger, .dbs-menu-signout) > :is(.bi, i) { color: inherit !important; }
:is(.dropdown-item.text-danger, .ctx-item.ctx-danger, .dbs-menu-signout):hover { background: var(--err-soft) !important; color: var(--pt-danger-text) !important; }
.dropdown-divider, .ctx-sep { margin: 5px 4px !important; border-color: var(--border-color) !important; background: var(--border-color); }
.notify-container { gap: 8px; display: flex; flex-direction: column; }

/* ══ Phase 2c (2026-11-18): page tabs, the database tree, tables and the data grid, the SQL editor ══ */

/* ── page tabs: a line, not boxes; normal case; the open tab = text + accent underline ── */
.nav.nav-tabs, ul.nav.nav-tabs { gap: 2px !important; padding: 0 12px !important; background: var(--side) !important; }
.nav.nav-tabs .nav-link {
  text-transform: none !important; letter-spacing: 0 !important; font-size: 0.8125rem !important; font-weight: 600 !important;
  color: var(--text-2) !important; background: transparent !important; border: 0 !important; border-bottom: 2px solid transparent !important;
  border-radius: 6px 6px 0 0 !important; padding: 9px 12px 8px !important; bottom: -1px; }
.nav.nav-tabs .nav-link:hover { background: var(--hover) !important; color: var(--text) !important; }
html:root[data-theme="light"] .nav.nav-tabs .nav-link:hover { background: var(--hover) !important; }
.nav.nav-tabs .nav-link.active { background: transparent !important; color: var(--text) !important; border-bottom-color: var(--vd-accent) !important; }
.nav.nav-tabs .nav-link.active::before { display: none !important; }
.nav.nav-tabs .nav-link.active > .bi { color: var(--vd-accent); }
/* side tabs (vertical): the chosen one tinted, a bar in the accent */
.tabs-component:is(.tabs-orientation-vertical-left, .tabs-orientation-vertical-right) .nav.nav-tabs .nav-link { border-bottom: 0 !important; border-radius: 6px !important; }
.tabs-component:is(.tabs-orientation-vertical-left, .tabs-orientation-vertical-right) .nav.nav-tabs .nav-link.active { background: var(--acc-soft) !important; }
html:root[data-theme="light"] .tabs-component:is(.tabs-orientation-vertical-left, .tabs-orientation-vertical-right) .nav.nav-tabs .nav-link.active { background: var(--hover) !important; }

/* ── the database tree: one font for every name, children under a guide line, the chosen row in a quiet tint ── */
.sbp-databases .db-header span, .sbp-databases .sidebar-group-header, .sbp-databases .sidebar-group-header.views-header,
.sbp-databases .sidebar-table-item .table-name-text, .sbp-databases .sidebar-table-item.view-item .table-name-text { font-size: 0.8125rem !important; }
.sbp-databases .sidebar-group-header { font-weight: 600 !important; }
.sbp-databases .db-content { padding-left: 12px !important; margin-left: 9px; border-left: 1px solid var(--border-color); }
.sbp-databases .sidebar-group-container { padding-left: 14px !important; margin-left: 10px !important; border-left: 1px solid var(--border-color); }
html:root[data-theme="light"] :is(.sbp-databases .db-content, .sbp-databases .sidebar-group-container) { border-left-color: var(--cl-line, var(--hover)); }
.sbp-databases :is(.db-header, .sidebar-group-header, .sidebar-table-item):hover { background: var(--hover) !important; }
html:root[data-theme="light"] .sbp-databases :is(.db-header, .sidebar-group-header, .sidebar-table-item):hover { background: var(--hover) !important; }
/* the chosen database / table: a quiet tint and the accent edge — the area colour stays on the tab bar */
.sbp-databases .db-group.user-db-group.active .db-header { background: var(--acc-soft) !important; }
.sbp-databases .db-group.user-db-group.active .db-header span { color: var(--text) !important; font-weight: 600; }
.sbp-databases .sidebar-table-item.active { background: var(--acc-soft) !important; box-shadow: inset 2px 0 0 var(--vd-accent); }
.sbp-databases .sidebar-table-item.active .table-name-text { color: var(--text) !important; font-weight: 600; }
html:root[data-theme="light"] .sbp-databases .db-group.user-db-group.active .db-header { background: var(--hover) !important; }
html:root[data-theme="light"] .sbp-databases .sidebar-table-item.active { background: var(--hover) !important; }
/* light: the tree's icons are plain (colour only with meaning) */
html:root[data-theme="light"] .sbp-databases :is(.db-header .db-icon, .sidebar-group-header .bi, .sidebar-table-item .table-icon) { color: var(--text-muted) !important; }
html:root[data-theme="light"] .sbp-databases :is(.db-group.active .db-header .db-icon, .sidebar-table-item.active .table-icon) { color: var(--text) !important; }

/* ── tables and the data grid: navy capitals on the box, hairlines, a clear row hover ── */
.ts-data-table thead th, .table thead th {
  background: var(--side) !important; color: var(--text) !important; font-size: 0.72rem !important; font-weight: 700 !important;
  letter-spacing: 0.06em !important; border-bottom: 1px solid var(--border-color) !important; }
.ts-data-table tbody tr { border-bottom-color: var(--cl-line, var(--border-color)) !important; }
.ts-data-table tbody tr:hover, .table tbody tr:hover { background: var(--hover) !important; }
html:root[data-theme="light"] .ts-data-table tbody tr:hover, html:root[data-theme="light"] .table tbody tr:hover { background: var(--side) !important; }
.ts-data-table td, .table tbody td { color: var(--text-2) !important; }
.ts-table-wrap { border-color: var(--border-color) !important; }
html:root[data-theme="light"] .ts-table-wrap { border-color: var(--cl-line, var(--hover)) !important; }
/* the column badges in the role tones: NOT NULL = Danger, PRIMARY = Gold, UNIQUE = Info, INDEX = Secondary; types quiet */
.ts-null-pill, .ts-key-pill { border: 0 !important; border-radius: 4px !important; }
:root:not([data-theme="light"]) .ts-null-no { background: var(--err-soft) !important; color: var(--err-strong) !important; }
:root:not([data-theme="light"]) .ts-key-pri { background: var(--gold-soft) !important; color: var(--gold-strong) !important; }
:root:not([data-theme="light"]) .ts-key-uni { background: var(--info-soft) !important; color: var(--info-strong) !important; }
:root:not([data-theme="light"]) .ts-key-mul { background: var(--sec-soft) !important; color: var(--text-2) !important; }
html:root[data-theme="light"] .ts-null-no { background: var(--err-soft) !important; color: var(--err-strong) !important; box-shadow: inset 0 0 0 1px #f7a6b8; }
html:root[data-theme="light"] .ts-key-pri { background: var(--gold-soft) !important; color: var(--gold-strong) !important; box-shadow: inset 0 0 0 1px #d8bd92; }
html:root[data-theme="light"] .ts-key-uni { background: var(--info-soft) !important; color: var(--info-strong) !important; box-shadow: inset 0 0 0 1px #87d0e3; }
html:root[data-theme="light"] .ts-key-mul { background: var(--hover) !important; color: var(--sec-strong) !important; box-shadow: inset 0 0 0 1px var(--cl-line, #c2cad5); }
html:root[data-theme="light"] .ts-null-yes { background: var(--hover) !important; color: var(--text-muted) !important; border-color: transparent !important; }
.ts-type-pill { border-color: transparent !important; }

/* ── SQL editor: the syntax colours of Colours & parts ── */
:root:not([data-theme="light"]) { --sx-k: #ff7b72; --sx-f: #d2a8ff; --sx-s: #7ee787; --sx-n: #79c0ff; --sx-i: #ffa657; --sx-c: #8b949e; --sx-v: #56d4dd; }
html:root[data-theme="light"] { --sx-k: #cf222e; --sx-f: #8250df; --sx-s: #116329; --sx-n: #0550ae; --sx-i: #953800; --sx-c: #6e7781; --sx-v: #0e7490; }
.sqle-kw { color: var(--sx-k) !important; } .sqle-fn { color: var(--sx-f) !important; } .sqle-str { color: var(--sx-s) !important; }
.sqle-num { color: var(--sx-n) !important; } .sqle-id { color: var(--sx-i) !important; } .sqle-var { color: var(--sx-v) !important; }
.sqle-op { color: var(--text-muted) !important; } .sqle-com { color: var(--sx-c) !important; }
.sqle { border-color: var(--pt-in-bd) !important; }
.sqle:focus-within { border-color: var(--vd-accent) !important; box-shadow: 0 0 0 3px var(--acc-line) !important; }
html:root[data-theme="light"] .sqle { background: var(--side) !important; }
.sqle .sqle-gutter { background: var(--side) !important; border-right-color: var(--border-color) !important; color: var(--text-muted) !important; }
.nav.nav-tabs .nav-link { bottom: 0 !important; }
.nav.nav-tabs .nav-link.active { box-shadow: inset 0 -2px 0 var(--vd-accent) !important; }
.tabs-component:is(.tabs-orientation-vertical-left, .tabs-orientation-vertical-right) .nav.nav-tabs .nav-link.active { box-shadow: inset 2px 0 0 var(--vd-accent) !important; }
.nav.nav-tabs .nav-link, .nav.nav-tabs .nav-link:hover { text-decoration: none !important; }

/* ══ Phase 3 (2026-11-18): the frame — header, logo, sidebar tab bar and panels, breadcrumbs, status bar ══ */
/* header: the box colour, one hairline, no heavy shadow */
#main-header { background: var(--side) !important; border-bottom: 1px solid var(--border-color) !important; box-shadow: none !important; }
html:root[data-theme="light"] #main-header { border-bottom-color: var(--cl-line, var(--hover)) !important; }
/* the new logo: the mark and the name */
.app-mark { display: inline-flex; align-items: center; gap: 9px; }
.app-mark img { width: 30px; height: 30px; display: block; flex: none; }
.app-name { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.app-brand { align-items: center !important; padding-bottom: 0 !important; }
/* header buttons (Quick open, organization, server, account): one look */
:is(.qo-btn, .acs-row, .dbs-account-btn) {
  height: 32px; border-radius: 8px !important; background: var(--pt-btn-bg) !important; border: 1px solid var(--pt-in-bd) !important; color: var(--text) !important; box-shadow: none !important;
  transition: border-color 140ms ease, background-color 140ms ease; }
:is(.qo-btn, .acs-row, .dbs-account-btn):hover { border-color: var(--pt-btn-bd-hover) !important; background: var(--pt-btn-bg-hover) !important; }
.qo-btn { color: var(--text-muted) !important; } .qo-btn:hover { color: var(--text) !important; }
.qo-btn kbd { background: var(--bg) !important; border: 1px solid var(--pt-in-bd) !important; color: var(--text-2) !important; }
html:root[data-theme="light"] .qo-btn kbd { background: var(--side) !important; }
/* "Add a server" (something to do) stays marked in the accent */
.acs-row.acs-need { background: var(--acc-soft) !important; border-color: var(--acc-line) !important; color: var(--vd-accent) !important; }
html:root[data-theme="light"] .acs-row.acs-need { background: var(--drk-soft) !important; border-color: var(--acc-line) !important; color: var(--accent-text) !important; }

/* the sidebar tab bar: dark keeps each area's colour; light = grey icons, the open tab in ink with the accent bar */
#sb-rail { background: var(--bg) !important; border-right-color: var(--border-color) !important; }
html:root[data-theme="light"] #sb-rail { background: var(--side) !important; border-right-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .sbr-tab { color: var(--text-muted) !important; }
html:root[data-theme="light"] :is(.sbr-tab, .sbr-home, .sbr-settings, .sbr-fold):hover { color: var(--text) !important; background: var(--hover) !important; }
html:root[data-theme="light"] .sbr-tab.sbr-on { color: var(--text) !important; background: var(--hover) !important; }
html:root[data-theme="light"] .sbr-tab.sbr-on::before { background: var(--vd-accent) !important; }
/* the panels: a clear hover; the item you are on keeps the area colour (Area colour rule) */
#main-sidebar { background: var(--side) !important; border-right-color: var(--border-color) !important; }
html:root[data-theme="light"] #main-sidebar { border-right-color: var(--cl-line, var(--hover)) !important; }
:is(.sbp-item, .sbp-area-head):hover { background: var(--hover) !important; }
html:root[data-theme="light"] :is(.sbp-item, .sbp-area-head):hover { background: var(--hover) !important; }

/* breadcrumbs: quiet links, the place you are in ink and bold */
.breadcrumb-item a { color: var(--text-2) !important; text-decoration: none !important; border-radius: 6px; padding: 2px 4px; }
.breadcrumb-item a:hover { background: var(--hover); color: var(--text) !important; }
.breadcrumb-item.active { color: var(--text) !important; font-weight: 600; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted) !important; }

/* the status bar: the box colour, one hairline, muted text */
#app-status-bar { background: var(--side) !important; border-top: 1px solid var(--border-color) !important; color: var(--text-muted) !important; }
html:root[data-theme="light"] #app-status-bar { border-top-color: var(--cl-line, var(--hover)) !important; }
.auth-mark { gap: 12px; } .auth-mark img { width: 52px !important; height: 52px !important; } .auth-mark .app-name { font-size: 1.6rem; }

/* ══ page alerts of every page (2026-11-18): solid role tones, no see-through backgrounds — colours only, sizes unchanged ══ */
:is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn) { --rc: var(--c-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); --pa-s: var(--warn-soft); --pa-l: var(--warn-line); --pa-t: var(--warn-strong); }
:is(.im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint) { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --pa-s: var(--info-soft); --pa-l: var(--info-line); --pa-t: var(--info-strong); }
:is(.bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success) { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --pa-s: var(--ok-soft); --pa-l: var(--ok-line); --pa-t: var(--ok-strong); }
:is(.ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) { --rc: var(--c-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); --pa-s: var(--err-soft); --pa-l: var(--err-line); --pa-t: var(--err-strong); }
:root:not([data-theme="light"]) :is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) {
  background: var(--rc-soft) !important; border-color: var(--rc-line) !important; color: var(--rc-strong) !important; }
html:root[data-theme="light"] :is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) { background: var(--pa-s) !important; border-color: var(--pa-l) !important; color: var(--pa-t) !important; }
:is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) > :is(.bi, i), :is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) code, :is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) b, :is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) strong { color: inherit !important; }
:is(.im-warn, .bk-warn, .bs-rs-warn, .ov-att-warn, .pl-try-warn, .rt-warn, .sq-summary-warn, .ts-sugg-warning, .alert-warning, .sv-dev, .tdg-warn, .im-warn:is(.do-note,.dp-note,.ds-note,.pf-note,.tps-note,.wz-note), .ag-note, .hm-hp-note, .pl-note, .sb-note, .ov-att-info, .ts-sugg-info, .alert-info, .sv-open-hint, .bk-ok, .bk-report-ok, .ov-att-ok, .pl-try-ok, .sq-summary-ok, .sv-ok, .alert-success, .ag-error, .ag-blocked, .bk-bad, .bk-report-bad, .dbs-lock-error, .ls-mini-danger, .ov-att-error, .ov-error, .pl-try-bad, .sb-note.sb-note-danger, .sq-summary-fail, .tdg-result-bad, .ts-editor-error, .alert-danger) code { background: var(--sec-soft) !important; }

/* more message boxes with their own names (2026-11-18) */
:is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note) { --rc: var(--c-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); --pa-s: var(--warn-soft); --pa-l: var(--warn-line); --pa-t: var(--warn-strong); }
:is(.bk-sch-setup, .og-kept) { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --pa-s: var(--info-soft); --pa-l: var(--info-line); --pa-t: var(--info-strong); }
:is(.sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result) { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --pa-s: var(--ok-soft); --pa-l: var(--ok-line); --pa-t: var(--ok-strong); }
:is(.ts-sugg-critical) { --rc: var(--c-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); --pa-s: var(--err-soft); --pa-l: var(--err-line); --pa-t: var(--err-strong); }
:root:not([data-theme="light"]) :is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note, .bk-sch-setup, .og-kept, .sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result, .ts-sugg-critical) {
  background: var(--rc-soft) !important; border-color: var(--rc-line) !important; color: var(--rc-strong) !important; }
html:root[data-theme="light"] :is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note, .bk-sch-setup, .og-kept, .sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result, .ts-sugg-critical) { background: var(--pa-s) !important; border-color: var(--pa-l) !important; color: var(--pa-t) !important; }
:is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note, .bk-sch-setup, .og-kept, .sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result, .ts-sugg-critical) > :is(.bi, i), :is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note, .bk-sch-setup, .og-kept, .sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result, .ts-sugg-critical) b, :is(.og-full, .pl-conflict, .sb-problem, .sv-mine-none, .acs-invite, .ac-codes, .hm-hp-note, .bk-sch-setup, .og-kept, .sv-mine, .sv-open-now, .oc-allgood, .bk-result, .tdg-result, .ts-sugg-critical) strong { color: inherit !important; }

/* ══ Phase 4 · Settings (2026-11-18): a menu of the groups with "Find a setting"; each group its own box with an icon
   in the title; boxes side by side on wide screens, 15 px between them; every control and text unchanged ══ */
.hm-find-none { padding: 6px 10px; font-size: 0.78rem; color: var(--text-muted); }
.hm-set-grid.xp-opt-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)) !important; gap: 15px !important; }
.hm-set-grid > .xp-opt-col { background: var(--side); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px 16px 16px; scroll-margin-top: 12px; }
html:root[data-theme="light"] .hm-set-grid > .xp-opt-col { border-color: var(--cl-line, var(--hover)); box-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 4px 14px rgba(15,23,42,0.045); }
.hm-set-grid > .xp-opt-col[hidden] { display: none !important; }
.hm-set-grid .xp-opt-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 0.9rem !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text) !important; }
.hm-set-grid .xp-opt-title > .bi { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 13px; background: var(--prim-soft); color: var(--prim-strong); }
html:root[data-theme="light"] .hm-set-grid .xp-opt-title > .bi { width: auto; height: auto; background: none; color: var(--text-muted); font-size: 16px; }
/* the outer box around all groups goes away: the groups are the boxes */
.hm-set-grid > .xp-opt-col .xp-opt-note { margin-top: 10px !important; }
.hm-set-grid .td-field-name { font-family: inherit !important; font-size: 0.8rem !important; font-weight: 600 !important; color: var(--text) !important; }

/* ══ Phase 4 · My account (2026-11-18): left menu, profile card, lines with the action next to the value, devices as a list, privileges by kind ══ */

/* status and privilege badges in the role tones (dark = tinted + coloured text, light = fixed Soft / Line / Strong) */
:is(.sv-priv, .sv-st-active, .pa-st-warn, .pa-st-info, .tg-ev-update, .ac-plan) { border: 1px solid transparent !important; }
:root:not([data-theme="light"]) :is(.sv-priv, .sv-st-active, .pa-st-warn, .pa-st-info, .tg-ev-update, .ac-plan) {
  background: var(--rc-soft) !important; color: var(--rc-strong) !important; border-color: var(--rc-line) !important; }
.sv-st-active { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --s: var(--ok-soft); --l: var(--ok-line); --t: var(--ok-strong); }
:is(.pa-st-warn, .tg-ev-update) { --rc: var(--c-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); --s: var(--warn-soft); --l: var(--warn-line); --t: var(--warn-strong); }
.pa-st-info { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
.sv-priv-data { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
:is(.sv-priv-structure, .ac-plan) { --rc: var(--c-gold); --rc-soft: var(--gold-soft); --rc-line: var(--gold-line); --rc-strong: var(--gold-strong); --s: var(--gold-soft); --l: var(--gold-line); --t: var(--gold-strong); }
.sv-priv-routine { --rc: var(--primary); --rc-soft: var(--prim-soft); --rc-line: var(--prim-line); --rc-strong: var(--prim-strong); --s: var(--acc-soft); --l: var(--acc-line); --t: var(--accent-text); --t-soft: var(--prim-soft); --t-line: var(--prim-line); --t-strong: var(--prim-strong); }
.sv-priv-admin { --rc: var(--c-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); --s: var(--warn-soft); --l: var(--warn-line); --t: var(--warn-strong); }
.sv-priv-all { --rc: var(--c-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); --s: var(--err-soft); --l: var(--err-line); --t: var(--err-strong); }
html:root[data-theme="light"] :is(.sv-priv, .sv-st-active, .pa-st-warn, .pa-st-info, .tg-ev-update, .ac-plan) {
  background: var(--s) !important; color: var(--t) !important; border-color: var(--l) !important; }

/* layout: the parts stacked (the My account side panel is the menu) */
.ac-set { min-width: 0; }
.ac-stack { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.ac-stack > .ts-section { margin: 0 !important; scroll-margin-top: 10px; }
.ac-stack .ts-section-header .ts-section-header-actions { display: flex; gap: 6px; flex-wrap: wrap; }


/* lines: label · value · action */
.ac-lines { display: flex; flex-direction: column; }
.ac-line { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--border-color); font-size: 0.85rem; color: var(--text-2); }
.ac-lines > .ac-line:first-child, .ac-lines > div:first-child > .ac-line:first-child { border-top: 0; padding-top: 2px; }
.ac-line-l { width: 160px; flex: none; color: var(--text-muted); }
.ac-line-v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ac-line-v b { color: var(--text); font-weight: 600; }
.ac-line-v small { color: var(--text-muted); font-size: 0.78rem; }
.ac-line-v small.ac-pending { display: block; margin-top: 3px; }
.ac-line-a { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.ac-dots { letter-spacing: 0.1em; color: var(--text-muted); }
.ac-line-form { padding: 4px 0 14px 174px; }
.ac-line-form .ac-inline { margin-top: 0; max-width: 420px; display: flex; flex-direction: column; }
.ac-line-form .ac-row input { max-width: 170px; }
.ac-box-body > .im-warn.ac-warn { margin: 0 0 4px; }
#ac-delete .ac-line { border-top: 0; padding: 0; }

/* devices: a list */
.ac-devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ac-device { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-color); }
.ac-device:first-child { border-top: 0; padding-top: 2px; }
.ac-device-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--text-muted); font-size: 1.05rem; }
.ac-device-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-device-tx b { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.ac-device-tx small { font-size: 0.76rem; color: var(--text-muted); }
.ac-device-end { flex: none; }
html:root[data-theme="light"] .ac-device-ic { background: var(--hover); color: var(--text-muted); }

/* privileges by kind */
.ac-priv { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; font-size: 0.82rem; }
.ac-priv-k { font-weight: 600; color: var(--text); }
.ac-priv .pf-privs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#ac-privileges .ts-table-wrap { margin-top: 2px; }

/* reports and the form buttons */
#ac-reports .ac-report-row { cursor: pointer; }

@media (max-width: 900px) {
  .ac-line { flex-wrap: wrap; } .ac-line-l { width: 100%; } .ac-line-form { padding-left: 0; }
  .ac-priv { grid-template-columns: 1fr; }
}
.ac-stack .ts-section-header .ts-btn { text-transform: none !important; letter-spacing: 0 !important; font-weight: 600 !important; }
html:root[data-theme="light"] .ac-stack .ts-section-header > .bi { color: var(--text-muted) !important; }
.ac-line-form .ac-rules { margin: 6px 0 2px !important; }
html:root[data-theme="light"] body[data-page-area] #content .ac-stack .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
.ac-priv-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* the My account side panel: Delete account in red */
.sbp-item[data-danger], .sbp-item[data-danger] .bi { color: var(--pt-danger-text) !important; }
.sbp-item[data-danger]:hover { background: var(--err-soft) !important; }
/* very wide screens: the parts in two columns, so no empty half */
@media (min-width: 1800px) { .ac-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
/* Settings: the groups listed in the My account side panel; Find in the toolbar; boxes in a row as tall as each other */
.hm-set-grid.xp-opt-grid { align-items: stretch !important; }
.hm-set-grid > .xp-opt-col { align-self: stretch !important; scroll-margin-top: 10px; }
.hm-saved-note { font-size: 0.8rem; color: var(--text-muted); margin-left: 4px; }
.hm-wrap .ts-toolbar-right { display: flex; gap: 8px; align-items: center; }
.hm-wrap .hm-find { width: 220px !important; }
.hm-find-none { padding: 18px 4px; color: var(--text-muted); font-size: 0.85rem; }
.hm-set-wrap { margin-bottom: 15px; }
@media (max-width: 700px) { .hm-saved-note { display: none; } .hm-wrap .hm-find { width: 140px !important; } }

/* ══ Phase 4 · Help (2026-11-18): plain icons in light, keys drawn as keys, readable article text ══ */
.hm-hp-card { border-radius: 10px !important; transition: border-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 140ms ease !important; }
html:root[data-theme="light"] .hm-hp-card { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 4px 14px rgba(15,23,42,0.045); }
html:root[data-theme="light"] .hm-hp-card:hover { border-color: var(--acc-line) !important; box-shadow: 0 2px 6px rgba(15,23,42,0.06), 0 10px 24px rgba(15,23,42,0.08); }
html:root[data-theme="light"] :is(.hm-hp-card, .hm-hp-head) > .bi:first-child { background: var(--hover) !important; color: var(--text-muted) !important; }
html:root[data-theme="light"] .hm-hp-guide { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .hm-hp-guide:hover { border-color: var(--ok-line) !important; }
html:root[data-theme="light"] .hm-hp-art { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .hm-hp-art-guide { border-left-color: var(--c-ok) !important; }
@media (prefers-reduced-motion: reduce) { .hm-hp-card:hover { transform: none !important; } }
/* reading: a little bigger, a comfortable line */
.hm-hp-text p, .hm-hp-steps li, .hm-hp-list li { font-size: 0.86rem !important; line-height: 1.65 !important; }
.hm-hp-art h3 { font-size: 1rem !important; }
.hm-hp-note { font-size: 0.84rem; }
/* area page: its articles as chips */
.hm-hp-toc-i { padding: 4px 12px !important; font-size: 0.78rem !important; transition: border-color 140ms ease, background-color 140ms ease; }
html:root[data-theme="light"] .hm-hp-toc-i { background: var(--side) !important; border-color: var(--cl-line, var(--drk-soft)) !important; color: var(--text-2) !important; }
html:root[data-theme="light"] .hm-hp-toc-i:hover { border-color: var(--acc-line) !important; background: var(--side) !important; }
/* keys drawn as keys */
.hm-keys-k { white-space: nowrap; }
.hm-k-combo { display: inline-flex; align-items: center; gap: 3px; }
.hm-keys-k kbd, .hm-k-combo kbd { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 5px; font: 600 0.72rem/1.5 'JetBrains Mono', Consolas, monospace;
  background: var(--side); color: var(--text); border: 1px solid var(--border-color); border-bottom-width: 2px; box-shadow: none; }
html:root[data-theme="light"] :is(.hm-keys-k kbd, .hm-k-combo kbd) { background: var(--side); color: var(--text); border-color: var(--cl-line, var(--drk-soft)); border-bottom-color: var(--cl-line, var(--drk-soft)); }
.hm-k-plus { color: var(--text-muted); font-size: 0.72rem; }
.hm-k-sep { color: var(--text-muted); font-size: 0.76rem; margin: 0 6px; }
.hm-k-word { font-size: 0.76rem; color: var(--text-2); font-style: italic; }
.hm-keys .hm-keys-group td { background: var(--bg) !important; color: var(--text) !important; font-weight: 700; font-size: 0.78rem; }
html:root[data-theme="light"] .hm-keys .hm-keys-group td { background: var(--hover) !important; }
.hm-keys .hm-keys-group td .bi { color: var(--text-muted); margin-right: 4px; }

/* ══ Phase 4 · About (2026-11-18): navy header with its actions, what's new as a time line, features in six groups ══ */
.hm-about { display: flex; flex-direction: column; gap: 15px; }
.hm-about > .ts-section, .hm-ab-grid .ts-section { margin: 0 !important; }
.hm-ab-hero { display: flex; align-items: center; gap: 22px; padding: 26px 28px; border-radius: 12px; background: var(--prim-line); color: var(--text); border: 1px solid var(--prim-line); }
:root:not([data-theme="light"]) .hm-ab-hero { background: var(--prim-line); border-color: var(--prim-line); }
.hm-ab-logo { width: 72px; height: 72px; flex: none; }
.hm-ab-hero-tx { flex: 1; min-width: 0; }
.hm-ab-hero h2 { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--text) !important; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.hm-ab-v { font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 10px; background: var(--prim-line); color: var(--text); border: 1px solid var(--c-prim); letter-spacing: 0; }
.hm-ab-hero p { margin: 8px 0 0; max-width: 78ch; color: var(--text); font-size: 0.86rem; line-height: 1.6; }
.hm-ab-up { margin-top: 10px; font-size: 0.8rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.hm-ab-acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.hm-ab-hero .ts-btn.hm-ab-btn { background: var(--text) !important; color: var(--text-muted) !important; border-color: var(--text) !important; }
.hm-ab-hero .ts-btn.hm-ab-btn:hover { background: var(--c-drk) !important; }
.hm-ab-hero .ts-btn.hm-ab-ghost { background: var(--prim-line) !important; color: var(--text) !important; border-color: var(--prim-strong) !important; box-shadow: none !important; }
.hm-ab-hero .ts-btn.hm-ab-ghost:hover { background: var(--prim-line) !important; color: var(--text) !important; }
.hm-ab-hero .ts-btn .bi { color: inherit !important; }
.hm-ab-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 15px; align-items: stretch; }
.hm-ab-col { display: flex; flex-direction: column; gap: 15px; }
/* what's new: a time line */
.hm-ab-tl { list-style: none; margin: 0; padding: 14px 18px 4px; display: flex; flex-direction: column; }
.hm-ab-tl li { position: relative; padding: 0 0 14px 24px; display: flex; flex-direction: column; gap: 2px; }
.hm-ab-tl li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--vd-accent); box-shadow: 0 0 0 3px var(--acc-line); }
.hm-ab-tl li:not(:last-child)::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 2px; border-left: 1px dashed var(--border-color); }
.hm-ab-tl b { font-size: 0.86rem; color: var(--text); font-weight: 600; }
.hm-ab-tl span { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; }
.hm-ab-tl small { font-size: 0.74rem; color: var(--text-muted); }
/* legal and credits */
.hm-ab-legal { display: flex; flex-direction: column; gap: 8px; font-size: 0.84rem; color: var(--text-2); }
.hm-ab-built { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-top: 4px; }
.hm-ab-legal .hm-tech { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 !important; }
/* what it does: six groups, the full text behind a click */
.hm-ab-feat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; }
.hm-ab-g h4 { margin: 0 0 6px; font-size: 0.88rem; font-weight: 700; color: var(--text); display: flex; gap: 8px; align-items: center; }
.hm-ab-g h4 .bi { color: var(--vd-accent); }
html:root[data-theme="light"] .hm-ab-g h4 .bi { color: var(--text-muted); }
.hm-ab-g ul { margin: 0; padding-left: 18px; font-size: 0.84rem; line-height: 1.65; color: var(--text-2); }
.hm-ab-more { margin-top: 14px; border-top: 1px solid var(--border-color); padding-top: 10px; }
.hm-ab-more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 600; color: var(--vd-accent); padding: 4px 0; }
.hm-ab-more > summary::-webkit-details-marker { display: none; }
.hm-ab-more > summary .bi { font-size: 0.75rem; transition: transform 160ms ease; }
.hm-ab-more[open] > summary .bi { transform: rotate(90deg); }
.hm-ab-more > .hm-list { margin-top: 10px; }
/* section icons: plain in light */
html:root[data-theme="light"] .hm-about .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
@media (max-width: 1000px) { .hm-ab-grid { grid-template-columns: 1fr; } .hm-ab-feat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hm-ab-hero { flex-direction: column; align-items: flex-start; } .hm-ab-acts { flex-direction: row; flex-wrap: wrap; } .hm-ab-feat { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .hm-ab-more > summary .bi { transition: none; } }
.hm-ab-news { display: flex; flex-direction: column; }
.hm-ab-news-body { flex: 1; }
.hm-ab-news-body .hm-ab-tl { padding: 2px 2px 0; }
/* About: Open a part in the accent (not the old blue), no underline; plain icons in light */
.hm-new .hm-action { text-decoration: none !important; border-radius: 10px !important; transition: border-color 140ms ease, background-color 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1) !important; }
.hm-new .hm-action :is(b, span) { text-decoration: none !important; }
.hm-new .hm-action > .bi { background: var(--prim-soft) !important; color: var(--prim-strong) !important; }
.hm-new .hm-action:hover { border-color: var(--prim-line) !important; background: var(--prim-soft) !important; transform: translateY(-1px); }
html:root[data-theme="light"] .hm-new .hm-action { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .hm-new .hm-action > .bi { background: var(--hover) !important; color: var(--text-muted) !important; }
html:root[data-theme="light"] .hm-new .hm-action:hover { border-color: var(--acc-line) !important; background: var(--side) !important; }
.hm-new .hm-action b { font-size: 0.84rem !important; } .hm-new .hm-action span { font-size: 0.76rem !important; color: var(--text-muted) !important; }
@media (prefers-reduced-motion: reduce) { .hm-new .hm-action:hover { transform: none; } }
/* About: Security as two columns of points with a check */
.hm-ab-sec { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px !important; padding: 0 !important; list-style: none; font-size: 0.84rem !important; line-height: 1.55 !important; }
.hm-ab-sec > li { position: relative; padding-left: 26px; }
.hm-ab-sec > li::before { content: "\f272"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem;
  background: var(--ok-soft); color: var(--ok-strong); }
html:root[data-theme="light"] .hm-ab-sec > li::before { background: var(--ok-soft); color: var(--ok-strong); box-shadow: inset 0 0 0 1px #95d8ad; }
@media (max-width: 900px) { .hm-ab-sec { grid-template-columns: 1fr; } }
/* About: Update history — rows like the other boxes, readable text, the current version a Primary badge */
.hm-hist { border-radius: 9px !important; transition: border-color 140ms ease; }
.hm-hist-head { padding: 10px 14px !important; }
.hm-hist-head:hover { background: var(--hover); border-radius: 9px; }
html:root[data-theme="light"] .hm-hist { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .hm-hist-head:hover { background: var(--side); }
.hm-hist-ver { font-size: 0.86rem !important; }
.hm-hist-date { font-size: 0.78rem !important; }
.hm-hist-sum { font-size: 0.82rem !important; }
.hm-hist-body { border-top-color: var(--border-color) !important; }
.hm-hist-day ul { font-size: 0.82rem !important; line-height: 1.6 !important; }
.hm-hist-day .hm-news-date { font-size: 0.76rem !important; color: var(--text) !important; }
.hm-hist-head .sv-pill { --rc: var(--primary); --rc-soft: var(--prim-soft); --rc-line: var(--prim-line); --rc-strong: var(--prim-strong); --s: var(--acc-soft); --l: var(--acc-line); --t: var(--accent-text); --t-soft: var(--prim-soft); --t-line: var(--prim-line); --t-strong: var(--prim-strong); border: 1px solid transparent; }
:root:not([data-theme="light"]) .hm-hist-head .sv-pill { background: var(--rc-soft) !important; color: var(--rc-strong) !important; border-color: var(--rc-line) !important; }
html:root[data-theme="light"] .hm-hist-head .sv-pill { background: var(--s) !important; color: var(--t) !important; border-color: var(--l) !important; }
/* Security: the points flow down two columns (no gaps beside a long point) */
.hm-ab-sec { display: block !important; columns: 2 340px; column-gap: 28px; }
.hm-ab-sec > li { break-inside: avoid; margin: 0 0 10px; }

/* ══ Phase 4 · Sign in (2026-11-18): the server room behind the sign-in pages and the lock screen; the brand side on Sign in;
      Forgot password? on the Password line, show password, Caps Lock, the 2-step code in six boxes ══ */
#auth-shell.auth-shell { position: relative; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg) !important; overflow: hidden; }
html:root[data-theme="light"] #auth-shell.auth-shell { background: var(--side) !important; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.auth-bg iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.auth-brand { display: none; }
.auth-main { position: relative; z-index: 1; display: flex; align-items: center; min-height: 100vh; padding: 40px 56px; }
.auth-inner { width: 100%; max-width: 420px; }
.auth-logo { text-align: left !important; margin-bottom: 20px !important; }

/* the card (every sign-in page) */
#auth-shell .ac-card, #auth-shell #content > .card { background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 14px !important; padding: 28px !important;
  box-shadow: 0 18px 44px rgba(10,14,22,.38), 0 2px 8px rgba(10,14,22,.2) !important; }
html:root[data-theme="light"] #auth-shell :is(.ac-card, #content > .card) { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 18px 44px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.06) !important; }
#auth-shell :is(.ac-card, #content > .card) h2 { font-size: 1.35rem !important; font-weight: 700; color: var(--text); margin-bottom: 4px !important; }
#auth-shell :is(.ac-card, #content > .card) h2 + p { font-size: 0.88rem; }
#auth-shell .form-label { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
#auth-shell :is(.form-control, .form-select) { height: 42px; font-size: 16px !important; padding: 0 12px; }
#auth-shell .auth-submit, #auth-shell form .btn-primary { height: 42px; font-size: 0.92rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
  background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--text) !important; border-radius: 8px !important; }
#auth-shell .auth-submit:hover, #auth-shell form .btn-primary:hover { background: var(--prim-strong) !important; }
#auth-shell .ac-links { justify-content: center; font-size: 0.86rem; color: var(--text-muted); }
#auth-shell .ac-links a, #auth-shell .auth-side-link, #auth-shell .auth-code-links a { color: var(--vd-accent); text-decoration: none; font-weight: 500; }
#auth-shell .ac-links a:hover, #auth-shell .auth-side-link:hover, #auth-shell .auth-code-links a:hover { text-decoration: underline; text-underline-offset: 2px; }
#auth-shell .auth-alt { gap: 5px; }
#auth-shell .ac-legal { margin-top: 14px; }
/* Password: Forgot password? on the label line, show / hide in the field, Caps Lock under it */
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.auth-side-link { font-size: 0.82rem; }
.auth-pw { position: relative; }
.auth-pw > input { padding-right: 44px !important; width: 100%; }
.auth-pw > .auth-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0 !important; background: transparent !important; color: var(--text-muted); box-shadow: none !important; }
.auth-pw > .auth-eye:hover { color: var(--text); background: var(--hover) !important; }
.auth-caps { margin-top: 6px; font-size: 0.8rem; display: flex; gap: 6px; align-items: center; color: var(--warn-strong); }
html:root[data-theme="light"] .auth-caps { color: var(--warn-strong); }
/* the 2-step code: six boxes */
.auth-sec-ic { width: 52px; height: 52px; margin: 2px auto 10px; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
  background: var(--info-soft); color: var(--info-strong); }
html:root[data-theme="light"] .auth-sec-ic { background: var(--info-soft); color: var(--info-strong); box-shadow: inset 0 0 0 1px #87d0e3; }
.auth-code-lead { text-align: center; font-size: 0.9rem; color: var(--text-2); margin: 0 0 14px; }
.auth-otp { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 16px; }
.auth-otp input { width: 46px; height: 56px; padding: 0 !important; text-align: center; font: 600 24px 'JetBrains Mono', Consolas, monospace !important; color: var(--text) !important;
  caret-color: var(--vd-accent); border-radius: 10px !important; border: 1.5px solid var(--pt-in-bd) !important; background: var(--pt-in-bg) !important;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.auth-otp input:focus { outline: none; border-color: var(--vd-accent) !important; box-shadow: 0 0 0 3px var(--acc-line) !important; }
.auth-otp input.filled { border-color: var(--n-line) !important; animation: auth-otp-pop 170ms cubic-bezier(0.23, 1, 0.32, 1); }
.auth-otp-dash { width: 10px; height: 2px; border-radius: 1px; background: var(--text-muted); }
.auth-otp.bad { animation: auth-otp-shake 380ms ease; } .auth-otp.bad input { border-color: var(--alert) !important; }
@keyframes auth-otp-pop { 50% { transform: scale(1.07); } }
@keyframes auth-otp-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .auth-otp input.filled, .auth-otp.bad { animation: none; } }
.auth-code-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 0.86rem; }

/* Sign in: the brand side (server room, logo, one sentence) on the left, the form on the right */
html[data-auth-page="login"] #auth-shell.auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
html[data-auth-page="login"] .auth-brand { display: flex; flex-direction: column; justify-content: space-between; position: relative; z-index: 1; padding: 40px 44px; color: var(--text); min-height: 100vh; }
html[data-auth-page="login"] .auth-bg { right: 50%; background: var(--bg); }
html[data-auth-page="login"] .auth-bg iframe { top: -100px; height: calc(100% + 100px); opacity: .55; }
.auth-brand-logo { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; }
.auth-brand-text h2 { margin: 0 0 10px; font-size: 1.9rem; line-height: 1.2; font-weight: 700; max-width: 18ch; letter-spacing: -0.01em; color: var(--text); }
.auth-brand-text p { margin: 0; max-width: 42ch; font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); }
html[data-auth-page="login"] .auth-main { justify-content: center; }
html[data-auth-page="login"] .auth-logo { display: none; }
html:root[data-theme="light"][data-auth-page="login"] .auth-bg { background: var(--drk-soft); }
html:root[data-theme="light"][data-auth-page="login"] .auth-brand { color: var(--prim-strong); }
html:root[data-theme="light"][data-auth-page="login"] .auth-brand-text h2 { color: var(--prim-strong); }
html:root[data-theme="light"][data-auth-page="login"] .auth-brand-text p { color: var(--prim-strong); }
html:root[data-theme="light"][data-auth-page="login"] #auth-shell.auth-shell { background: var(--side) !important; }
html:root[data-theme="light"][data-auth-page="login"] #auth-shell :is(.ac-card, #content > .card) { box-shadow: none !important; border-color: transparent !important; padding: 0 !important; }
html[data-auth-page="login"] #auth-shell :is(.ac-card, #content > .card) { background: transparent !important; box-shadow: none !important; border-color: transparent !important; padding: 0 !important; }

/* Create account, links from e-mails, forgot / reset: the card on the left, the server room on the right */
html[data-auth-page="card"] .auth-bg { background: var(--bg); }
html[data-auth-page="card"] .auth-bg iframe { left: 0; width: 136%; }
html:root[data-theme="light"][data-auth-page="card"] .auth-bg { background: var(--drk-soft); }

/* legal pages: plain, wide, no animation */
html[data-auth-page="doc"] .auth-bg { display: none; }
html[data-auth-page="doc"] .auth-main { justify-content: center; }
html[data-auth-page="doc"] .auth-inner { max-width: 860px; }
html[data-auth-page="doc"] .auth-logo { text-align: center !important; }

/* the lock screen: the same server room, the card on the left */
.dbs-lock { background: var(--bg) !important; justify-content: flex-start !important; padding: 24px 56px !important; }
html:root[data-theme="light"] .dbs-lock { background: var(--drk-soft) !important; }
.dbs-lock-bg iframe { left: 0; width: 136%; }
.dbs-lock-card { position: relative; z-index: 1; max-width: 400px !important; padding: 28px !important; border-radius: 14px !important; gap: 12px !important;
  box-shadow: 0 18px 44px rgba(10,14,22,.38), 0 2px 8px rgba(10,14,22,.2) !important; }
html:root[data-theme="light"] .dbs-lock-card { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 18px 44px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.06) !important; }
.dbs-lock-icon { background: var(--warn-soft) !important; color: var(--warn-strong) !important; border: 0 !important; }
html:root[data-theme="light"] .dbs-lock-icon { background: var(--warn-soft) !important; color: var(--warn-strong) !important; box-shadow: inset 0 0 0 1px #fcd57a; }
.dbs-lock-card h2 { font-size: 1.2rem !important; }
.dbs-lock-why { font-size: 0.84rem !important; }
.dbs-lock-label { font-size: 0.82rem !important; color: var(--text) !important; }
.dbs-lock-card .ts-editor-input { height: 42px; font-size: 16px !important; }
.dbs-lock-card .auth-caps { text-align: left; }
.dbs-lock-unlock { height: 42px; font-size: 0.92rem !important; font-weight: 600; }

@media (max-width: 900px) {
  html[data-auth-page="login"] #auth-shell.auth-shell { grid-template-columns: 1fr; }
  html[data-auth-page="login"] .auth-brand { display: none; }
  html[data-auth-page="login"] .auth-bg { right: 0; }
  html[data-auth-page="login"] .auth-logo { display: block; }
  .auth-main { padding: 28px 16px; justify-content: center; }
  .auth-bg iframe, .dbs-lock-bg iframe { left: 0 !important; width: 100% !important; opacity: .35 !important; }
  .dbs-lock { justify-content: center !important; padding: 16px !important; }
  html[data-auth-page="login"] #auth-shell :is(.ac-card, #content > .card) { background: var(--side) !important; padding: 24px !important; border-radius: 14px !important; }
}
/* one show-password button: the browser's own (Edge) hidden where ours is */
.auth-pw > input::-ms-reveal, .auth-pw > input::-ms-clear { display: none; }
/* side panel search boxes: one clear button (ours), at the right edge; the browser's own hidden */
.sbp-search input::-webkit-search-cancel-button, .sbp-search input::-ms-clear { -webkit-appearance: none; appearance: none; display: none; }
.sbp-search .sbp-search-x { right: 5px; }
[data-panel="settings"] .sbp-search[hidden], [data-panel="settings"] .sbp-foot[hidden] { display: none !important; }

/* ══ Phase 4 · Database servers (2026-11-18): each server a card — name and address, its state in plain words, its parts as tabs on a grey band ══ */
.sv-card .ts-section-header .sv-name { text-transform: none; letter-spacing: 0; font-size: 0.98rem; }
html:root[data-theme="light"] .sv-card .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
.sv-card .sv-addr { font: 500 0.78rem 'JetBrains Mono', Consolas, monospace; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.sv-card .sv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem !important; margin-bottom: 12px !important; }
.sv-tabs { display: flex; gap: 2px; margin: 0 -12px; padding: 6px 12px 0; background: var(--bg); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); overflow-x: auto; scrollbar-width: none; }
html:root[data-theme="light"] .sv-tabs { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.sv-tab { display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1px; padding: 8px 14px; border: 0; border-radius: 7px 7px 0 0; background: none; color: var(--text-2); font-family: inherit; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.sv-tab:hover:not(.on) { background: var(--n-mid); color: var(--text); }
html:root[data-theme="light"] .sv-tab:hover:not(.on) { background: var(--hover); }
.sv-tab.on { background: var(--side); color: var(--text); box-shadow: 0 -1px 0 var(--border-color), 1px 0 0 var(--border-color), -1px 0 0 var(--border-color), inset 0 2px 0 var(--vd-accent); }
html:root[data-theme="light"] .sv-tab.on { background: var(--side); box-shadow: 0 -1px 0 var(--cl-line, #e5e8ee), 1px 0 0 var(--cl-line, #e5e8ee), -1px 0 0 var(--cl-line, #e5e8ee), inset 0 2px 0 var(--vd-accent); }
.sv-tab.on > .bi { color: var(--vd-accent); }
.sv-tab-n { font-size: 0.7rem; font-weight: 700; padding: 0 7px; border-radius: 9px; background: var(--n-mid); color: var(--text-2); }
html:root[data-theme="light"] .sv-tab-n { background: var(--hover); color: var(--sec-strong); }
.sv-pane { padding-top: 12px; }
.sv-pane > .sv-panel:first-child { margin-top: 0; }
.sv-card .sv-body { padding: 12px 12px 14px !important; }
.sv-card .sv-mine { font-size: 0.86rem; }
@media (prefers-reduced-motion: reduce) { .sv-tab { transition: none; } }
/* the small state badges of servers and backups in the role tones */
.bk-badge { border-radius: 4px !important; font-size: 0.68rem !important; }
:root:not([data-theme="light"]) .bk-badge.bk-ok { background: var(--ok-soft) !important; color: var(--ok-strong) !important; border-color: var(--ok-line) !important; }
:root:not([data-theme="light"]) .bk-badge.bk-warn { background: var(--warn-soft) !important; color: var(--warn-strong) !important; border-color: var(--warn-line) !important; }
:root:not([data-theme="light"]) .bk-badge.bk-bad { background: var(--err-soft) !important; color: var(--err-strong) !important; border-color: var(--err-line) !important; }
html:root[data-theme="light"] .bk-badge.bk-ok { background: var(--ok-soft) !important; color: var(--ok-strong) !important; border-color: var(--ok-line) !important; }
html:root[data-theme="light"] .bk-badge.bk-warn { background: var(--warn-soft) !important; color: var(--warn-strong) !important; border-color: var(--warn-line) !important; }
html:root[data-theme="light"] .bk-badge.bk-bad { background: var(--err-soft) !important; color: var(--err-strong) !important; border-color: var(--err-line) !important; }
html:root[data-theme="light"] .bk-badge:not(.bk-ok):not(.bk-warn):not(.bk-bad) { background: var(--hover); color: var(--sec-strong); border-color: var(--cl-line, var(--drk-soft)); }

/* ══ Phase 4 · Scheduled backups (2026-11-18): the first time as three steps (Wizard step circles); badges in the role tones ══ */
.bs-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 16px; }
.bs-step { display: flex; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg); color: var(--text-muted); }
html:root[data-theme="light"] .bs-step { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* a step still to come is quiet: half way between the box and the page, faint text (it used to fade with opacity) */
html:root .bs-step:not(.active):not(.done) { background: var(--bg) !important; }
html:root .bs-step:not(.active):not(.done) :is(*, *::before) { color: var(--text-faint) !important; }
.bs-step.active { border-color: var(--prim-line); box-shadow: 0 0 0 3px var(--acc-mid); }
html:root[data-theme="light"] .bs-step.active { border-color: var(--acc-line); }
.bs-step-no { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  border: 1.5px solid var(--sec-line); color: var(--text-2); background: var(--side); }
html:root[data-theme="light"] .bs-step-no { border-color: var(--cl-line, var(--drk-soft)); color: var(--sec-strong); background: var(--side); }
.bs-step.active .bs-step-no { background: var(--vd-accent); border-color: var(--vd-accent); color: var(--text); }
.bs-step.done .bs-step-no { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-strong); }
html:root[data-theme="light"] .bs-step.done .bs-step-no { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-strong); }
.bs-step-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bs-step-tx b { font-size: 0.88rem; color: var(--text); }
.bs-step-tx span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.bs-step-act { margin-top: 8px; }
@media (max-width: 900px) { .bs-steps { grid-template-columns: 1fr; } }
/* the parts: no tinted box in light, a quiet one in dark */
html:root[data-theme="light"] .bs-part { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] #bs-card .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
:root:not([data-theme="light"]) .bs-part { background: var(--bg) !important; border-color: var(--border-color) !important; }
html:root[data-theme="light"] .bs-part-title > .bi { color: var(--text-muted); }
html:root[data-theme="light"] .bs-step.active .bs-step-no { background: var(--vd-accent); border-color: var(--vd-accent); color: var(--side); }

/* icon buttons beside normal buttons: the same size (31 px) — in box headers, table rows and button rows */
:is(.ts-section-header-actions, td, .bk-acts, .bs-actions, .bk-start-row, .sv-actions, .bs-part-head):has(> .ts-btn:not(.ts-btn-sm)) > .ts-icon-btn { width: 31px !important; height: 31px !important; font-size: 0.85rem !important; }
/* Backups: "Saved on this computer…" and the plan's limit as an info note, not loose code text */
.bk-settings { display: flex !important; align-items: center; gap: 6px 18px !important; padding: 6px 12px; border-radius: 7px; font-size: 0.82rem !important; font-weight: 500;
  background: var(--info-soft); border: 1px solid var(--info-line); color: var(--info-strong) !important; }
html:root[data-theme="light"] .bk-settings { background: var(--info-soft); border-color: var(--info-line); color: var(--info-strong) !important; }
.bk-settings span { font-family: inherit !important; }
.bk-settings i { color: inherit !important; }

/* Scheduled backups — running: name with when · what under it, where with the kind of storage, last run with why it failed */
.bs-kind { display: inline-flex; align-items: center; font-size: 0.66rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid transparent; text-transform: uppercase; letter-spacing: .03em; }
.bs-kind-sftp { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
.bs-kind-s3 { --rc: var(--c-gold); --rc-soft: var(--gold-soft); --rc-line: var(--gold-line); --rc-strong: var(--gold-strong); --s: var(--gold-soft); --l: var(--gold-line); --t: var(--gold-strong); }
.bs-kind-webdav { --rc: var(--primary); --rc-soft: var(--prim-soft); --rc-line: var(--prim-line); --rc-strong: var(--prim-strong); --s: var(--acc-soft); --l: var(--acc-line); --t: var(--accent-text); --t-soft: var(--prim-soft); --t-line: var(--prim-line); --t-strong: var(--prim-strong); }
:root:not([data-theme="light"]) .bs-kind { background: var(--rc-soft); color: var(--rc-strong); border-color: var(--rc-line); }
html:root[data-theme="light"] .bs-kind { background: var(--s); color: var(--t); border-color: var(--l); }
.bs-sched-table td { vertical-align: middle; }
.bs-name b { color: var(--text); font-size: 0.86rem; }
.bs-sub { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--text-muted); }
.bs-places { display: flex; flex-direction: column; gap: 4px; }
.bs-place { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.bs-place small { color: var(--text-muted); font-size: 0.74rem; }
.bs-sched-table tr.bs-failed td:first-child { box-shadow: inset 3px 0 0 var(--alert); }
.bs-actions { white-space: nowrap; }
.bs-actions > * + * { margin-left: 4px; }
/* Backups: the size against the plan's limit */
.bd-size { white-space: nowrap; }
.bd-bar { display: block; width: 90px; height: 4px; margin: 5px 0 0 auto; border-radius: 2px; background: var(--n-mid); overflow: hidden; }
html:root[data-theme="light"] .bd-bar { background: var(--hover); }
.bd-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--vd-accent); }
.bd-bar.over > span { background: var(--alert); }
.bs-place, .bs-sched-table td:nth-child(3) { white-space: nowrap; }
.bs-sched-table td:first-child .bs-sub { white-space: nowrap; }
.bs-sched-table td:nth-child(4) .bs-sub { max-width: 260px; }

/* ══ Page title and parts without boxes (2026-11-18, owner: fewer container levels; tried on Backups and Scheduled backups first) ══
   .pg-head = the page's title (icon, larger text, a badge), .pg-lead = one line under it; parts = a subtitle and their table, no box */
.pg-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; flex-wrap: wrap; }
.pg-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; flex: none;
  background: var(--prim-soft); color: var(--prim-strong); }
html:root[data-theme="light"] .pg-ic { background: var(--hover); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--cl-line, #e5e8ee); }
.pg-title { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
.pg-head .bk-badge { font-size: 0.74rem !important; padding: 2px 8px; }
.pg-lead { margin: 0 0 18px; font-size: 0.86rem; line-height: 1.55; color: var(--text-muted); }
/* the parts of Scheduled backups: a subtitle and its table */
.bs-page .bs-part { margin: 0 0 26px !important; padding: 0 !important; border: 0 !important; background: none !important; border-radius: 0; }
.bs-page .bs-part-head { margin-bottom: 10px; }
.bs-page .bs-part-title { font-size: 1.05rem !important; text-transform: none !important; letter-spacing: 0 !important; }
.bs-page .bs-part-title > .bi { color: var(--text-muted) !important; font-size: 1.05rem; }
.bs-page .bs-part .ts-table-wrap { background: var(--side) !important; }
html:root[data-theme="light"] .bs-page .bs-part .ts-table-wrap { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
.bs-page .bs-steps { margin-bottom: 26px; }
html:root[data-theme="light"] .bs-page .bs-step:not(.active) { background: var(--side); }
/* the last backup and the next one */
.bs-last { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 0 22px; border-radius: 10px; border: 1px solid; }
.bs-last > .bi { font-size: 1.3rem; }
.bs-last-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bs-last-tx b { font-size: 0.92rem; }
.bs-last-tx span { font-size: 0.82rem; color: var(--text-muted); }
.bs-last-next { display: flex; flex-direction: column; align-items: flex-end; text-align: right; padding-left: 16px; border-left: 1px solid currentColor; border-left-color: var(--sec-soft); }
.bs-last-next small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.bs-last-next b { font-size: 0.9rem; } .bs-last-next span { font-size: 0.78rem; color: var(--text-muted); }
.bs-last-ok { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --s: var(--ok-soft); --l: var(--ok-line); --t: var(--ok-strong); }
.bs-last-bad { --rc: var(--c-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); --s: var(--err-soft); --l: var(--err-line); --t: var(--err-strong); }
.bs-last-info { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
:root:not([data-theme="light"]) .bs-last { background: var(--rc-soft); border-color: var(--rc-line); color: var(--rc-strong); }
html:root[data-theme="light"] .bs-last { background: var(--s); border-color: var(--l); color: var(--t); }
/* history: the numbers, the filters, Show all */
.bs-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 14px; margin-bottom: 10px; border-radius: 9px; font-size: 0.84rem; color: var(--text-2);
  background: var(--side); border: 1px solid var(--border-color); }
html:root[data-theme="light"] .bs-stats { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.bs-stats b { color: var(--text); }
.bs-stat-ok .bi { color: var(--ok-strong); } .bs-stat-bad .bi { color: var(--c-err); }
html:root[data-theme="light"] .bs-stat-ok .bi { color: var(--c-ok); } html:root[data-theme="light"] .bs-stat-bad .bi { color: var(--c-err); }
.bs-stats-pct { margin-left: auto; font-weight: 600; color: var(--text); }
.bs-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.bs-filter select { width: auto; min-width: 170px; }
.bs-more { display: flex; justify-content: center; margin-top: 10px; }
/* Back up a database: the table without a box around it */
.bd-page .ts-table-wrap { background: var(--side); border: 1px solid var(--border-color); border-radius: 9px; }
html:root[data-theme="light"] .bd-page .ts-table-wrap { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.pg-lead + .bk-settings { margin-bottom: 16px !important; }
@media (max-width: 700px) { .bs-last { flex-wrap: wrap; } .bs-last-next { align-items: flex-start; text-align: left; border-left: 0; padding-left: 0; } }
/* Scheduled backups: New storage and A new schedule — the same box, edge, title, background and spacing as the parts around them */
.bs-page .bs-form { margin: 12px 0 0 !important; padding: 14px 16px 16px !important; border-radius: 9px !important;
  border: 1px solid var(--prim-line) !important; background: var(--side) !important; }
html:root[data-theme="light"] .bs-page .bs-form { background: var(--side) !important; border-color: var(--acc-line) !important; }
.bs-page #bs-editor-part:not(:empty) { margin: -14px 0 26px; }
.bs-page .bs-form .bs-part-head { margin-bottom: 12px; min-height: 0; }
.bs-page .bs-form .bs-part-title { font-size: 1rem !important; }
.bs-page .bs-form .bs-part-title > .bi { color: var(--vd-accent) !important; }
.bs-page .bs-form .bk-start-row { margin-top: 14px !important; }
.bs-page .bs-editor .bs-ed-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 12px !important; }
.bs-page .bs-editor .bs-name { width: calc((100% - 24px) / 3); margin-bottom: 12px; }
.bs-page .bs-where-note { margin-top: 10px; }
.bs-page .bs-form code, .bs-where-note code { font-size: 0.92em !important; padding: 1px 5px; border-radius: 4px; }
@media (max-width: 900px) { .bs-page .bs-editor .bs-ed-grid { grid-template-columns: 1fr !important; } .bs-page .bs-editor .bs-name { width: 100%; } }
/* titles, labels and notes start a little in from the edge: the boxes and fields under them have round corners */
.bs-page .bs-part-head, .pg-lead, .pg-head ~ .bk-hint { padding-left: 6px; }
.bs-page :is(.td-field-name, .bs-dnd-title, .bs-where-note, .bk-hint, .bk-muted.bk-small, .bk-sch-sub), .bs-page .xp-opt-col > .bk-muted { padding-left: 4px; }
.bs-page .bs-filter { padding-left: 0; }
.bd-page ~ .bk-hint, .pg-lead + .bk-settings { margin-left: 0; }

/* ══ Phase 4 · Platform admin — Reports (2026-11-18): page title; the summary without a box (its tiles are the boxes) ══ */
.pa-body > .pg-head { margin-top: 0; }
.rp-view-flat .rp-sum { padding: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; }
.rp-view-flat .rp-flat-head { margin: 2px 0 10px; padding-left: 6px; }
.rp-view-flat .bs-part-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text); }
.rp-view-flat .bs-part-title > .bi { color: var(--text-muted); }
.rp-view-flat .rp-tile { background: var(--side) !important; }
html:root[data-theme="light"] .rp-view-flat .rp-tile { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
.rp-view-flat .pf-good-sub { padding-left: 6px; }
.rp-view-flat .bs-part-title { text-transform: none !important; letter-spacing: 0 !important; }

/* ══ Phase 4 · Platform admin — Finance (2026-11-18): page title; five key numbers, four more; parts without boxes; charts in the role colours ══ */
.pa-body .pa-stats-bar { margin-bottom: 14px; }
.fi-key { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; margin-bottom: 10px; }
.fi-key .pa-tile { padding: 14px 16px; }
.fi-key .pa-tile b { font-size: 1.6rem; }
.fi-more { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; margin-bottom: 26px; }
.fi-more .pa-tile { padding: 9px 14px; }
.fi-more .pa-tile b { font-size: 1.15rem; }
html:root[data-theme="light"] .pa-body .pa-tile { background: var(--side); border-color: var(--cl-line, var(--hover)); box-shadow: 0 1px 2px rgba(15,23,42,0.04); }
.fi-part { margin-bottom: 26px; min-width: 0; }
.fi-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding-left: 6px; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.fi-head > .bi { color: var(--text-muted); }
/* Finance → Right now: its cards, then the table 12 px under them (the cards' own gap is 12 px too) */
.fi-part > .pa-tiles { gap: 12px; }
.fi-part > .pa-tiles + .fi-table { margin-top: 12px; }
.fi-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 0 16px; }
.fi-card, .fi-table { background: var(--side); border: 1px solid var(--border-color); border-radius: 9px; }
html:root[data-theme="light"] :is(.fi-card, .fi-table) { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.fi-card { padding: 12px 14px 10px; }
.fi-card .pa-chart { margin: 0; }
.fi-note { padding: 8px 4px 0; }
/* the chart colours: Primary for the main series, Info and Warning for the others, Danger for what was lost */
:root:not([data-theme="light"]) { --fi-prim: var(--vd-accent); --fi-info: var(--c-info); --fi-warn: var(--c-warn); }
html:root[data-theme="light"] { --fi-prim: var(--vd-accent); --fi-info: var(--c-info); --fi-warn: var(--c-warn); }
.pa-bar.fi-c-prim, .pa-key.fi-c-prim, .pa-dot.fi-c-prim { fill: var(--fi-prim); background: var(--fi-prim); } .pa-line.fi-c-prim { stroke: var(--fi-prim); }
.pa-bar.fi-c-info, .pa-key.fi-c-info, .pa-dot.fi-c-info { fill: var(--fi-info); background: var(--fi-info); } .pa-line.fi-c-info { stroke: var(--fi-info); }
.pa-bar.fi-c-warn, .pa-key.fi-c-warn, .pa-dot.fi-c-warn { fill: var(--fi-warn); background: var(--fi-warn); } .pa-line.fi-c-warn { stroke: var(--fi-warn); }
.fi-card .pa-line { stroke-width: 2; fill: none; }
.fi-card .pa-dot { r: 2.5; }
@media (max-width: 1100px) { .fi-key { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } .fi-more { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 700px) { .fi-key, .fi-more { grid-template-columns: 1fr 1fr !important; } .fi-charts { grid-template-columns: 1fr; } }
.pa-dot.pa-mark { stroke: var(--side); stroke-width: 1.5; }
html:root[data-theme="light"] .pa-dot.pa-mark { stroke: var(--side); }
.pa-key.pa-key-dot { width: 9px !important; height: 9px !important; border-radius: 50% !important; }
.fi-card .pa-dot.pa-mark { r: 4.5; }

/* ══ One search field everywhere (owner 2026-11-18): like the sidebar's — 32 px, the icon inside on the left, the clear x inside on the right ══ */
:is(.sbp-search, .td-search) { position: relative; }
:is(.sbp-search, .td-search) > .bi-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .78rem; color: var(--text-muted); pointer-events: none; z-index: 1; }
:is(.sbp-search, .td-search) > input { width: 100%; height: 32px !important; padding: 0 30px !important; font-size: .8rem !important; border-radius: 8px !important; }
:is(.sbp-search, .td-search) > input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
:is(.sbp-search, .td-search) > :is(.sbp-search-x, .ts-icon-btn) { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px !important; height: 24px !important;
  border: 0 !important; background: none !important; box-shadow: none !important; color: var(--text-muted); border-radius: 6px; font-size: .68rem; display: grid; place-items: center; padding: 0; z-index: 1; }
:is(.sbp-search, .td-search) > :is(.sbp-search-x, .ts-icon-btn):hover:not(:disabled) { color: var(--text) !important; background: var(--hover) !important; }
:is(.sbp-search, .td-search) > :is(.sbp-search-x, .ts-icon-btn):disabled { display: none !important; }
.td-search { gap: 0 !important; }
/* in a filter row */
.pa-filter .sbp-search.pa-q { flex: 0 1 300px; min-width: 180px; }
/* the kind filter: the same height as the search; marked while one kind is picked */
.pa-filter select.pa-kind { height: 32px; width: auto; min-width: 140px; border-radius: 8px !important; font-size: .8rem !important; font-family: inherit !important; }
.pa-filter select.pa-kind.on { border-color: var(--vd-accent) !important; background-color: var(--prim-soft) !important; color: var(--text) !important; font-weight: 600; }
html:root[data-theme="light"] .pa-filter select.pa-kind.on { border-color: var(--vd-accent) !important; background-color: var(--drk-soft) !important; }
.pa-filter .ts-btn:disabled { background: var(--button-disabled-bg); color: var(--button-disabled-text); border-color: var(--border-color); box-shadow: none; }
/* Reports, Privacy mail: the cards' colour edge soft until picked; the checkbox on the first line; more room before the summary */
.rp-split { gap: 22px !important; }
.rp-card { border-left-color: var(--s-line) !important; }
.rp-card.rp-on, .rp-card:hover { border-left-color: var(--s) !important; }
.rp-card { align-items: flex-start !important; }
.rp-card .rp-pick { margin-top: 2px !important; }
/* filter rows: every control the same height (32 px) — buttons, chip selects, search */
:is(.pa-filter, .pa-stats-bar) :is(.ts-btn, .cs-btn, .pf-step-n) { height: 32px !important; display: inline-flex; align-items: center; }
:is(.pa-filter, .pa-stats-bar) .ev-kind { align-items: stretch; }
:is(.pa-filter, .pa-stats-bar) input.ts-editor-input { height: 32px !important; }
/* the kind filter (a chip select): violet while one kind is picked */
select.pa-kind.on + .cs-wrap .cs-btn { border-color: var(--vd-accent) !important; background: var(--prim-soft) !important; font-weight: 600; }
html:root[data-theme="light"] select.pa-kind.on + .cs-wrap .cs-btn { border-color: var(--vd-accent) !important; background: var(--drk-soft) !important; color: var(--accent-text) !important; }
/* filter rows and the period bar in a strip of their own, as wide as the boxes under them */
.pa-body :is(.pa-filter, .pa-stats-bar) { padding: 8px 10px; margin-bottom: 14px; background: var(--side); border: 1px solid var(--border-color); border-radius: 9px; }
html:root[data-theme="light"] .pa-body :is(.pa-filter, .pa-stats-bar) { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* the summaries of Reports and Privacy mail: room around each subtitle */
.rp-sum .pf-good-sub { margin: 10px 0 0; padding-left: 6px; }
.rp-sum .pf-good-sub + * { margin-top: -4px; }
/* the filter inside every chip select's list: the same search field as the sidebar's */
.cs-filter { display: block !important; padding: 6px !important; }
.cs-filter > .sbp-search { width: 100%; }
.cs-menu .cs-filter .cs-filter-input, .cs-menu .cs-filter .cs-filter-input:focus { height: 32px !important; padding: 0 30px !important; font-size: .8rem !important; border-radius: 8px !important;
  background: var(--pt-in-bg) !important; border: 1px solid var(--pt-in-bd) !important; }
.cs-menu .cs-filter .cs-filter-input:focus { border-color: var(--vd-accent) !important; box-shadow: 0 0 0 3px var(--acc-line) !important; }
:is(.sbp-search, .td-search) > .bi-search { z-index: 3 !important; color: var(--text-muted) !important; }
:is(.sbp-search, .td-search) > :is(.sbp-search-x, .ts-icon-btn) { z-index: 3 !important; }
:is(.sbp-search, .td-search):focus-within > .bi-search { color: var(--vd-accent) !important; }
/* the other search fields (database Search, the Designer's Find and template search, the Wizard's template search): the same look */
:is(.se-term-wrap, .vd-find, .vd-tpl-search, .wz-at-search) { position: relative; }
:is(.se-term-wrap, .vd-find, .vd-tpl-search, .wz-at-search) > .bi-search { position: absolute; left: 10px !important; top: 50%; transform: translateY(-50%); font-size: .78rem !important; color: var(--text-muted) !important; pointer-events: none; z-index: 3; }
:is(.se-term-wrap, .vd-find, .vd-tpl-search, .wz-at-search):focus-within > .bi-search { color: var(--vd-accent) !important; }
:is(.se-term-wrap, .vd-find, .vd-tpl-search, .wz-at-search) > input { height: 32px !important; padding: 0 30px !important; font-size: .8rem !important; font-family: inherit !important; border-radius: 8px !important; }
:is(.se-term-wrap, .vd-find, .vd-tpl-search, .wz-at-search) > input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
:is(.sbp-search, .td-search) > input { font-family: inherit !important; }

/* ══ One combobox everywhere (owner 2026-11-18): every single-choice select is a chip select (core/ChipSelect.js) ══ */
select:not([multiple]):not([data-native]):not([data-chip-on]):not([size]) { animation: cs-found 1ms; }
.cs-wrap { min-width: 0 !important; }
.cs-wrap.cs-full { display: block !important; width: 100%; }
.cs-wrap .cs-btn { height: 32px !important; border-radius: 8px !important; font-size: .8rem !important; font-family: inherit !important; max-width: none !important;
  background: var(--pt-in-bg) !important; border: 1px solid var(--pt-in-bd) !important; color: var(--text) !important; padding: 0 10px 0 12px !important; gap: 8px; }
.cs-wrap .cs-btn:hover:not(:disabled) { border-color: var(--prim-line) !important; }
.cs-wrap .cs-btn[aria-expanded="true"] { border-color: var(--vd-accent) !important; box-shadow: 0 0 0 3px var(--acc-line) !important; }
.cs-wrap .cs-btn .acs-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-wrap .cs-btn .acs-chev { margin-left: auto; font-size: .7rem; color: var(--text-muted); flex: none; }
.cs-wrap .cs-btn:disabled { background: var(--button-disabled-bg) !important; color: var(--button-disabled-text) !important; border-color: var(--border-color) !important; box-shadow: none !important; cursor: not-allowed !important; }

/* ══ One field size and font (owner 2026-11-18: inputs, comboboxes, dates, searches the same; inputs not higher than buttons) ══
   text inputs, chip selects, date / time fields and searches: the app's font, 32 px, radius 8 — in table rows 30 px;
   code stays monospace (textareas, the SQL editor, .ts-mono); normal buttons 32 px too */
html input.ts-editor-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(.ts-mono),
html input.form-control:not(.ts-mono) { font-family: inherit !important; font-size: .8rem !important; height: 32px; border-radius: 8px !important; padding-top: 0; padding-bottom: 0; }
html td input.ts-editor-input:not([type="checkbox"]):not([type="radio"]), html td .cs-wrap .cs-btn { height: 30px !important; }
html .dt-input-field.ts-editor-input { height: 32px !important; padding: 0 30px 0 10px !important; font-size: .8rem !important; border-radius: 8px !important; }
html td .dt-input-field.ts-editor-input { height: 30px !important; }
.ts-btn:not(.ts-btn-sm):not(.ts-btn-lg) { min-height: 32px; }
.cs-wrap .cs-btn .acs-value { font-weight: 400; }
select.pa-kind.on + .cs-wrap .cs-btn .acs-value { font-weight: 600; }

/* ══ Phase 4 · Database → Overview (2026-11-18): page title; parts as subtitles; only the lists and tables boxed ══ */
.ov-body > .pg-head { margin-top: 0; }
.ov-panel { background: none !important; border: 0 !important; padding: 0 !important; margin-bottom: 26px !important; border-radius: 0 !important; }
.ov-panel-title, .ov-sec-head { font-size: 1.05rem !important; text-transform: none !important; letter-spacing: 0 !important; font-weight: 700 !important; color: var(--text) !important; padding-left: 6px !important; }
.ov-panel-title { margin-bottom: 10px !important; }
.ov-box { background: var(--side); border: 1px solid var(--border-color); border-radius: 9px; padding: 12px 14px; min-height: 64px; }
html:root[data-theme="light"] .ov-box { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.ov-two { gap: 0 16px !important; }
.ov-actions { margin-bottom: 26px !important; }
.ov-sec { background: none !important; border: 0 !important; border-radius: 0 !important; overflow: visible !important; margin-bottom: 26px !important; }
.ov-sec-head { padding: 0 6px !important; margin-bottom: 10px; }
.ov-sec-head:hover { background: none !important; }
.ov-sec-head:hover .ov-fold { color: var(--text); }
.ov-sec-body { border: 1px solid var(--border-color) !important; border-radius: 9px; background: var(--side); overflow: hidden; }
html:root[data-theme="light"] .ov-sec-body { background: var(--side); border-color: var(--cl-line, var(--hover)) !important; }
.ov-sec-link { font-size: .8rem !important; }
html:root[data-theme="light"] .ov-card { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.ov-cards { margin-bottom: 26px !important; }
html:root[data-theme="light"] .ov-cards .ov-card { box-shadow: 0 1px 2px rgba(15,23,42,0.04); }

/* ══ Reading pages (.pg-flat on the page's wrap): sections without a box — the header is a subtitle; cards, choices and tables keep theirs ══ */
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 0 26px !important; border-radius: 0 !important; overflow: visible !important; }
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > .ts-section-header { background: none !important; border: 0 !important; padding: 0 6px !important; margin: 0 0 10px !important; min-height: 32px;
  font-size: 1.05rem !important; font-weight: 700 !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text) !important; }
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > :is(.ts-editor-body, .bk-card-body, .ts-section-body) { background: none !important; border: 0 !important; padding: 0 !important; }
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > .ts-table-wrap,
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > :is(.ts-editor-body, .bk-card-body) > .ts-table-wrap { background: var(--side); border: 1px solid var(--border-color) !important; border-radius: 9px; overflow: hidden; }
html:root[data-theme="light"] .pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) :is(> .ts-table-wrap, > :is(.ts-editor-body, .bk-card-body) > .ts-table-wrap) { background: var(--side); border-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .pg-flat :is(.xp-opt-col, .xp-choice, .sv-kpi, .do-card) { background: var(--side); }
.pg-flat .ts-body > .pg-head { margin-top: 0; }
.pg-flat .ts-section:not(.xp-summary-card):not(.pg-keep) > .ts-ops-grid { background: none !important; border: 0 !important; padding: 0 !important; }
html:root[data-theme="light"] .pg-flat .ts-op-card { background: var(--side); }
.cmp-with :is(.ts-btn, .cs-btn) { height: 32px !important; }
/* the title row holds the page's actions on the right (moved from the bar the reading pages no longer have) */
.pg-head-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pg-head-acts .ts-btn { height: 32px; }
/* Backups / Scheduled backups: the bar goes when the page has its own title (the self-hosted Backups keeps it for its toggles) */
.bk-wrap:has(.pg-head) > .ts-toolbar:has(#bk-toggles:empty) { display: none; }
/* reading pages: the boxes inside a part keep their background (cards, option columns, choices) */
.pg-flat :is(.xp-opt-col, .ts-op-card, .xp-choice, .im-mode, .xp-radio-card) { background: var(--side) !important; border: 1px solid var(--border-color) !important; }
html:root[data-theme="light"] .pg-flat :is(.xp-opt-col, .ts-op-card, .xp-choice, .im-mode, .xp-radio-card) { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
/* Platform admin: no second bar — the title row has the section's name and Load again */
.pa-toolbar { display: none !important; }
/* Export: Views / Procedures & functions / Triggers / Events in a box like the other options */
.xp-objects { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 14px; margin-top: 10px; border-radius: 9px; background: var(--side); border: 1px solid var(--border-color); }
html:root[data-theme="light"] .xp-objects { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* the page title's icon in the page's area colour (My account orange, Organization teal, Server violet, Platform admin red…) — the same as the sidebar */
body[data-page-area] .pg-ic { background: var(--page-c-soft) !important; color: var(--page-c-strong) !important; box-shadow: none !important; }
html:root[data-theme="light"] body[data-page-area] .pg-ic { background: var(--page-c-soft) !important; color: var(--page-c-strong) !important; box-shadow: inset 0 0 0 1px var(--page-c-line) !important; }
/* the title keeps its distance from what follows it (its line under it stays close) */
.pg-head { margin-bottom: 18px !important; }
.pg-head + .pg-lead { margin-top: -12px !important; }
/* Export: Views … Events as high as the three choices above */
.xp-objects { min-height: 52px; align-items: center; }
.xp-choices:has(> .xp-objects) { grid-auto-rows: 1fr; }
.xp-choices > .xp-objects { grid-column: 1 / -1; margin-top: 0 !important; min-height: 0; }
.xp-choices:has(> .xp-objects) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 700px) { .xp-choices:has(> .xp-objects) { grid-template-columns: 1fr !important; } }
.pg-flat .xp-choices:not(.xp-choices-col) { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ts-section-header .ts-btn { text-transform: none !important; letter-spacing: 0 !important; }

/* ══ Phase 4 · Visual Designer (2026-11-18, as approved in design-demos/15-designer + DECISIONS 2026-11-17) ══ */
/* the column badges in the colour code: PK Gold, FK Primary, UNI Info, AI Success, NN Danger, INDEX Secondary */
:is(.badge-pk, .badge-fk, .badge-uni, .badge-ai, .badge-nn, .badge-idx) { border: 1px solid transparent !important; }
.badge-pk { --rc: var(--c-gold); --rc-soft: var(--gold-soft); --rc-line: var(--gold-line); --rc-strong: var(--gold-strong); --s: var(--gold-soft); --l: var(--gold-line); --t: var(--gold-strong); }
.badge-fk { --rc: var(--primary); --rc-soft: var(--prim-soft); --rc-line: var(--prim-line); --rc-strong: var(--prim-strong); --s: var(--acc-soft); --l: var(--acc-line); --t: var(--accent-text); --t-soft: var(--prim-soft); --t-line: var(--prim-line); --t-strong: var(--prim-strong); }
.badge-uni { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
.badge-ai { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --s: var(--ok-soft); --l: var(--ok-line); --t: var(--ok-strong); }
.badge-nn { --rc: var(--c-err); --rc-soft: var(--err-soft); --rc-line: var(--err-line); --rc-strong: var(--err-strong); --s: var(--err-soft); --l: var(--err-line); --t: var(--err-strong); }
.badge-idx { --rc: var(--c-sec); --rc-soft: var(--sec-soft); --rc-line: var(--sec-line); --rc-strong: var(--sec-strong); --s: var(--sec-soft); --l: var(--sec-line); --t: var(--sec-strong); }
:root:not([data-theme="light"]) :is(.badge-pk, .badge-fk, .badge-uni, .badge-ai, .badge-nn, .badge-idx) {
  background: var(--rc-soft) !important; color: var(--rc-strong) !important; border-color: var(--rc-line) !important; }
html:root[data-theme="light"] :is(.badge-pk, .badge-fk, .badge-uni, .badge-ai, .badge-nn, .badge-idx) { background: var(--s) !important; color: var(--t) !important; border-color: var(--l) !important; }
/* relations: calm lines (no glow, no pulse); pending stays yellow and dashed, the picked one in the accent */
.rel-line-real { stroke: var(--c-prim) !important; stroke-width: 1.8 !important; filter: none !important; animation: none !important;  }
html:root[data-theme="light"] .rel-line-real { stroke: var(--prim-strong) !important; }
/* a chosen tool: light = white, grey border, violet underline, the icon in ink (dark keeps its tinted look) */
html:root[data-theme="light"] :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on) { background: var(--side) !important; color: var(--text) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; }
html:root[data-theme="light"] :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on):hover { background: var(--side) !important; }
/* minimap: tables neutral (a group keeps its colour), the view in Primary */
.minimap-dot { background: var(--grp, var(--sec-line)) !important;  }
html:root[data-theme="light"] .minimap-dot { background: var(--grp, var(--drk-soft)) !important; }
.minimap-dot.selected { background: var(--vd-accent) !important; box-shadow: none !important; }
#minimap-viewport { border-color: var(--vd-accent) !important; background: var(--acc-soft) !important; }
/* the frame is solid (no see-through colours): the tables' dots sit above it, like the selection boxes under what they pick */
#minimap-viewport { z-index: 1 !important; } .minimap-dot { z-index: 2; }
html:root[data-theme="light"] #minimap-container { border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 2px 6px rgba(15,23,42,0.06), 0 12px 32px rgba(15,23,42,0.12) !important; }
/* changes on the canvas in the role tones (changed = Warning, new = Success, dropped = Danger) */
html:root[data-theme="light"] .column-item.col-st-new { background: var(--ok-soft) !important; box-shadow: inset 3px 0 0 #16a34a !important; }
html:root[data-theme="light"] .column-item.col-st-changed { background: var(--warn-soft) !important; box-shadow: inset 3px 0 0 #f59e0b !important; }
html:root[data-theme="light"] .vd-st-pill-new { background: var(--ok-soft) !important; color: var(--ok-strong) !important; box-shadow: inset 0 0 0 1px #95d8ad; }
html:root[data-theme="light"] .vd-st-pill-changed { background: var(--warn-soft) !important; color: var(--warn-strong) !important; box-shadow: inset 0 0 0 1px #fcd57a; }
html:root[data-theme="light"] .vd-st-pill-dropped { background: var(--err-soft) !important; color: var(--err-strong) !important; box-shadow: inset 0 0 0 1px #f7a6b8; }
#arrow-real path { fill: var(--c-prim) !important; }
html:root[data-theme="light"] #arrow-real path { fill: var(--prim-strong) !important; }
/* a chip select alone in a table cell fills the cell, like the inputs beside it */
td > select.cs-native:only-of-type + .cs-wrap { display: block !important; width: 100%; min-width: 0 !important; }
td > select.cs-native:only-of-type + .cs-wrap .cs-btn { width: 100%; }

/* ══ Phase 4 · Home (2026-11-18, design-demos/08-home.html): greeting, quick open, continue first, actions as a list, facts in one line ══ */
.hm-home .hm-where { color: var(--text-muted); }
.hm-home .hm-where b { color: var(--text-2); font-weight: 600; }
.hm-home .hm-bk-remind:not([hidden]) { margin-bottom: 14px; }
.hm-cmd { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; margin: 0 0 18px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--side); color: var(--text-muted); font: inherit; font-size: .9rem; text-align: left; cursor: text; transition: border-color 140ms ease, box-shadow 140ms ease; }
.hm-cmd > .bi { font-size: .9rem; }
.hm-cmd:hover { border-color: var(--prim-line); }
.hm-cmd:focus-visible { outline: 0; border-color: var(--vd-accent); box-shadow: 0 0 0 3px var(--acc-line); }
.hm-cmd kbd, .hm-recent-empty kbd { margin-left: auto; font: 11.5px 'JetBrains Mono', Consolas, monospace; padding: 2px 6px; border-radius: 4px; background: var(--hover); color: var(--text-2); box-shadow: none; }
.hm-recent-empty kbd { margin: 0 2px; }
html:root[data-theme="light"] .hm-cmd { background: var(--side); border-color: var(--cl-line, var(--drk-soft)); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
html:root[data-theme="light"] .hm-cmd:hover { border-color: var(--acc-line); }
html:root[data-theme="light"] :is(.hm-cmd, .hm-recent-empty) kbd { background: var(--hover); color: var(--text-2); border: 1px solid var(--cl-line, var(--hover)); }

.hm-cols2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 14px; }
.hm-col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hm-home .hm-box { margin: 0 !important; }
.hm-home .hm-box > .ts-section-header { text-transform: none !important; letter-spacing: 0 !important; font-size: .92rem !important; font-weight: 600 !important; }
.hm-rows { display: flex; flex-direction: column; border: 1px solid var(--border-color); border-top: 0; border-radius: 0 0 8px 8px; background: var(--side); overflow: hidden; }
.hm-li { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 9px 14px; border: 0; border-top: 1px solid var(--border-color); background: none; color: var(--text); font: inherit; font-size: .82rem; text-align: left; text-decoration: none !important; cursor: pointer; }
.hm-li:first-child { border-top: 0; }
.hm-li:hover { background: var(--hover); color: var(--text); }
.hm-li:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: -2px; }
.hm-li > .bi { flex-shrink: 0; width: 16px; font-size: .9rem; color: var(--text-muted) !important; }
.hm-li > small { color: var(--text-muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hm-li .hm-ri-name { font-family: 'JetBrains Mono', Consolas, monospace; font-size: .8rem; font-weight: 600; flex-shrink: 1; }
.hm-li:has(> .hm-ri-page) .hm-ri-name { font-family: inherit; font-size: .82rem; font-weight: 500; }
.hm-li .hm-ri-time { margin-left: auto; padding-left: 8px; font-size: .74rem; color: var(--text-muted); }
.hm-li .hm-fav-x { margin-left: auto; }
.hm-start .hm-li > span { white-space: nowrap; }
.hm-start .hm-li > small { margin-left: 2px; }
.hm-recent-empty { display: flex; gap: 12px; align-items: flex-start; padding: 16px; font-size: .82rem; color: var(--text-2); line-height: 1.55; }
.hm-recent-empty > .bi { font-size: 1.2rem; color: var(--text-muted); }
.hm-empty-how { color: var(--text-muted); }
.hm-empty-how a { color: var(--vd-accent); }
html:root[data-theme="light"] .hm-rows { background: var(--side); border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .hm-li { border-top-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .hm-li:hover { background: var(--side); }

.hm-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 0 4px; margin-bottom: 22px; font-size: .8rem; color: var(--text-muted); }
.hm-facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-facts a { margin-left: auto; color: var(--vd-accent); text-decoration: none; }
.hm-facts a:hover { text-decoration: underline; }
@media (max-width: 860px) { .hm-cols2 { grid-template-columns: minmax(0, 1fr); } }
/* Home boxes: header and rows run edge to edge, same header height in both boxes */
.hm-home .hm-box { padding: 0 !important; overflow: hidden; }
.hm-home .hm-box > .ts-section-header { min-height: 50px; padding: 8px 10px 8px 16px !important; margin: 0 !important; border-bottom: 1px solid var(--border-color) !important; }
.hm-home .hm-box > .hm-rows { border: 0; border-radius: 0; background: none; }
.hm-home .hm-li { padding: 10px 16px; }
html:root[data-theme="light"] .hm-home .hm-box > .ts-section-header { border-bottom-color: var(--cl-line, var(--hover)) !important; }

/* ══ Phase 4 · Visual Designer part 1 (2026-11-18, design-demos/15-designer.html): one bar, the canvas is the page,
      panels float over it and fold away (Objects, Suggestions, Not applied yet), minimap + zoom bottom left, n / 1 link ends ══ */
/* one bar: the Tools (docked at the top) are part of it — undo … note first, the view options, then Find, Export, Changes, Review SQL */
#vd-toolbar { gap: 4px !important; padding: 6px 10px !important; flex-wrap: wrap; }
#vd-toolbar > .vd-tools:not(.vd-tools-dragging) { display: contents !important; }
#vd-toolbar > .vd-toolbar-group, #vd-toolbar > .vd-toolbar-sep { order: 3; }
#vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip), #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) + .vd-toolbar-sep { order: 0; }
#vd-toolbar > .vd-tools > * { order: 2; }
#vd-toolbar > .vd-tools > .vd-tools-grip { order: 1; align-self: center; }
#vd-toolbar > .vd-find { order: 4; margin-left: auto; }
#vd-toolbar > .vd-export { order: 5; }
#vd-toolbar > .vd-tools > :is(#vd-changes-btn, [data-vd-edit="review"]) { order: 6; }
#vd-toolbar > .vd-tools > .vd-tools-sep:has(+ #vd-changes-btn) { display: none; }
#vd-toolbar > .vd-toolbar-sep:has(+ .vd-find), #vd-toolbar > .vd-toolbar-sep:has(+ .vd-export) { display: none; }
#vd-toolbar > .vd-tools > .vd-tools-sep { width: 1px; height: 22px; align-self: center; margin: 0 3px; }
/* icons with a tooltip in the bar; words only on New Table, Changes and Review SQL */
#vd-toolbar > .vd-tools .vd-tool { padding: 0 !important; width: 30px; height: 30px; justify-content: center; }
#vd-toolbar > .vd-tools .vd-tool > span { display: none; }
#vd-toolbar > .vd-tools :is([data-vd-edit="new-table"], #vd-changes-btn, [data-vd-edit="review"]) { width: auto !important; padding: 0 10px !important; }
#vd-toolbar > .vd-tools :is([data-vd-edit="new-table"], #vd-changes-btn, [data-vd-edit="review"]) > span { display: inline; }
#vd-toolbar .vd-lbl, #vd-toolbar .vd-compact { display: none; }
#vd-toolbar > .vd-toolbar-group > .vd-btn:not(:has(.vd-caret)) { width: 30px; min-width: 30px; height: 30px; padding: 0 !important; justify-content: center; }
#vd-toolbar .vd-find input { width: 150px !important; }
#vd-toolbar .vd-tool-badge { position: absolute; top: -4px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
#vd-toolbar #vd-changes-btn .vd-tool-badge { position: static; margin-left: 2px; }

/* the stage: everything else floats over the diagram */
#vd-stage .vd-fp, #vd-stage #suggestions-sidebar { position: absolute !important; z-index: 300; grid-area: auto !important;
  border: 1px solid var(--vd-border) !important; border-radius: 12px !important; overflow: hidden;
  background: var(--side) !important; backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0,0,0,.35) !important; }
html:root[data-theme="light"] #vd-stage :is(.vd-fp, #suggestions-sidebar) { background: var(--text-muted) !important; border-color: var(--cl-line, var(--hover)) !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 10px 28px rgba(15,23,42,.10) !important; }
.vd-fp-head { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 6px 4px 12px; font-size: .8rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--vd-border); }
.vd-fp-head > .bi { color: var(--text-muted); }
.vd-fp-fold { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.vd-fp-fold:hover { background: var(--hover); color: var(--text); }
.vd-fp-fold .bi { transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.vd-fp.vd-fp-closed .vd-fp-fold .bi { transform: rotate(180deg); }
.vd-fp.vd-fp-closed > .vd-fp-body { display: none; }
.vd-fp.vd-fp-closed > .vd-fp-head { border-bottom: 0; }
html:root[data-theme="light"] .vd-fp-head { border-bottom-color: var(--cl-line, var(--hover)); }

/* Objects (top left) */
.vd-objects { left: 12px; top: 12px; width: 222px; max-height: calc(100% - 200px); display: flex; flex-direction: column; }
.vd-objects > .vd-fp-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.vd-obj-search { margin: 8px; }
.vd-obj-list { overflow: auto; min-height: 0; padding: 0 6px 8px; scrollbar-width: thin; }
.vd-obj-sec { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.vd-obj-sec > b { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--hover); color: var(--text-2); font-size: .64rem; text-align: center; letter-spacing: 0; }
.vd-obj { display: flex; align-items: center; gap: 7px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.vd-obj:hover { background: var(--hover); color: var(--text); }
.vd-obj > .bi { flex-shrink: 0; font-size: .8rem; color: var(--text-muted); }
.vd-obj-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', Consolas, monospace; font-size: .74rem; }
.vd-obj > small { flex-shrink: 0; font-size: .66rem; color: var(--text-muted); }
.vd-obj > small.vd-obj-col { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: 'JetBrains Mono', Consolas, monospace; color: var(--vd-accent); }
.vd-obj.on { background: var(--acc-mid); color: var(--text); }
html:root[data-theme="light"] .vd-obj.on { background: var(--acc-soft); color: var(--accent-text); }
.vd-obj-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--c-warn); }
.vd-obj-new .vd-obj-dot { background: var(--c-ok); }
.vd-obj.vd-obj-new > .bi { color: var(--ok-strong); }
.vd-obj-dropped .vd-obj-dot { background: var(--c-err); }
.vd-obj-dropped .vd-obj-nm { text-decoration: line-through; color: var(--text-muted); }
html:root[data-theme="light"] .vd-obj-dot { background: var(--c-warn); }
html:root[data-theme="light"] .vd-obj-new .vd-obj-dot { background: var(--c-ok); }
html:root[data-theme="light"] .vd-obj.vd-obj-new > .bi { color: var(--c-ok); }
html:root[data-theme="light"] .vd-obj-dropped .vd-obj-dot { background: var(--c-err); }
.vd-obj .vd-obj-grp { color: var(--grp) !important; }
.vd-obj-empty { padding: 12px 8px; font-size: .74rem; color: var(--text-muted); }

/* Suggestions (right): over the diagram, as tall as it allows */
#vd-stage #suggestions-sidebar { right: 12px; top: 12px; bottom: 12px; width: 320px; display: none; flex-direction: column; }
#vd-stage #suggestions-sidebar.suggestions-open { display: flex; }
#vd-stage #suggestions-sidebar .suggestions-header { background: none; padding: 8px 8px 8px 14px; }

/* Not applied yet (bottom, centre): one line while there are changes; opens upward with the list */
#vd-stage .vd-dock { left: 50%; transform: translateX(-50%); bottom: 12px; width: min(760px, calc(100% - 440px)); min-width: 420px; display: none !important; flex-direction: column; }
#vd-stage .vd-dock.vd-dock-has, #vd-stage .vd-dock.suggestions-open { display: flex !important; }
.vd-dock-head { order: 2; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; }
.vd-dock-head .vd-fp-fold { margin-left: 0; }
.vd-dock.suggestions-open .vd-dock-head .vd-fp-fold .bi { transform: rotate(180deg); }
.vd-dock-title { font-size: .82rem; font-weight: 600; color: var(--text); }
.vd-dock-count { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 4px; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--warn-strong); background: var(--warn-soft); }
.vd-dock:not(.vd-dock-has) .vd-dock-count { color: var(--text-muted); background: var(--hover); }
html:root[data-theme="light"] .vd-dock-count { background: var(--warn-soft); color: var(--warn-strong); box-shadow: inset 0 0 0 1px #fcd57a; }
html:root[data-theme="light"] .vd-dock:not(.vd-dock-has) .vd-dock-count { background: var(--hover); color: var(--sec-strong); box-shadow: inset 0 0 0 1px var(--cl-line, #c2cad5); }
.vd-dock-sp { flex: 1; }
.vd-dock #vd-changes-list { order: 1; display: none; max-height: min(260px, 50vh); overflow: auto; padding: 10px 10px 4px; border-bottom: 1px solid var(--vd-border); }
.vd-dock.suggestions-open #vd-changes-list { display: block; }
html:root[data-theme="light"] .vd-dock #vd-changes-list { border-bottom-color: var(--cl-line, var(--hover)); }
.vd-dock .vd-change { margin-bottom: 4px; padding: 6px 8px; }

/* minimap and zoom: bottom left, one above the other (a corner picked for the minimap still applies) */
#minimap-container[data-corner="bl"] { left: 12px !important; bottom: 58px !important; }
#minimap-container[data-corner="tl"] { left: 246px !important; top: 12px !important; }
#vd-zoom-controls { left: 12px !important; bottom: 12px !important; flex-direction: row !important; align-items: center; gap: 2px !important; padding: 3px; border-radius: 9px;
  border: 1px solid var(--vd-border); background: var(--vd-surface); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
#vd-zoom-controls .vd-btn { width: 28px !important; height: 28px !important; min-height: 28px !important; border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 6px !important; }
#vd-zoom-controls .vd-btn:hover { background: var(--hover) !important; }
#vd-zoom-display { width: 46px; text-align: center; font: 12px 'JetBrains Mono', Consolas, monospace; color: var(--text-2); }
html:root[data-theme="light"] #vd-zoom-controls { background: var(--side); border-color: var(--cl-line, var(--hover)); box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 16px rgba(15,23,42,.08); }

/* links: plain lines, n / 1 in a circle at the ends */
.vd-rel-end circle { fill: var(--vd-canvas-bg, var(--bg)); stroke: var(--c-prim); stroke-width: 1.4; }
.vd-rel-end text { fill: var(--text); font: 700 10px 'Segoe UI', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.vd-rel-end-pending circle { stroke: var(--warn-strong); }
.vd-rel-end-suggested circle { stroke: var(--c-prim); stroke-dasharray: 2 2; }
html:root[data-theme="light"] .vd-rel-end circle { fill: var(--side); stroke: var(--prim-strong); }
html:root[data-theme="light"] .vd-rel-end-pending circle { stroke: var(--c-warn); }
:is(.vd-path-line, .vd-vb-line) .vd-rel-end circle { stroke: var(--vd-accent); }

/* column types in the colour of their kind: number info, text green, date amber, enum / set gold, json violet, binary grey */
.column-item .column-type { --rc: var(--text-muted); --rc-soft: var(--sec-soft); --rc-line: var(--sec-line); --rc-strong: var(--sec-strong); --s: var(--sec-soft); --l: var(--sec-line); --t: var(--sec-strong); padding: 0 5px; border-radius: 4px; line-height: 1.55;
  color: var(--rc-strong) !important; background: var(--rc-soft) !important; }
.column-item .column-type:is(.type-int, .type-decimal, .type-float, .type-bool) { --rc: var(--c-info); --rc-soft: var(--info-soft); --rc-line: var(--info-line); --rc-strong: var(--info-strong); --s: var(--info-soft); --l: var(--info-line); --t: var(--info-strong); }
.column-item .column-type:is(.type-varchar, .type-text) { --rc: var(--c-ok); --rc-soft: var(--ok-soft); --rc-line: var(--ok-line); --rc-strong: var(--ok-strong); --s: var(--ok-soft); --l: var(--ok-line); --t: var(--ok-strong); }
.column-item .column-type.type-date { --rc: var(--c-warn); --rc-soft: var(--warn-soft); --rc-line: var(--warn-line); --rc-strong: var(--warn-strong); --s: var(--warn-soft); --l: var(--warn-line); --t: var(--warn-strong); }
.column-item .column-type:is(.type-enum, .type-set) { --rc: var(--c-gold); --rc-soft: var(--gold-soft); --rc-line: var(--gold-line); --rc-strong: var(--gold-strong); --s: var(--gold-soft); --l: var(--gold-line); --t: var(--gold-strong); }
.column-item .column-type.type-json { --rc: var(--primary); --rc-soft: var(--prim-soft); --rc-line: var(--prim-line); --rc-strong: var(--prim-strong); --s: var(--acc-soft); --l: var(--acc-line); --t: var(--accent-text); --t-soft: var(--prim-soft); --t-line: var(--prim-line); --t-strong: var(--prim-strong); }
html:root[data-theme="light"] .column-item .column-type { color: var(--t) !important; background: var(--s) !important; box-shadow: inset 0 0 0 1px var(--l); }
/* the table card's icon tile: blue in dark, plain grey in light (colour only with meaning) */
.table-node:not([data-is-view="1"]) .table-icon-wrap { background: var(--prim-soft) !important; color: var(--prim-strong) !important; }
html:root[data-theme="light"] .table-node:not([data-is-view="1"]) .table-icon-wrap { background: var(--hover) !important; color: var(--text-muted) !important; }
.table-node:not([data-is-view="1"]) .table-icon-wrap .table-icon { color: inherit !important; }
html:root[data-theme="light"] #minimap-container { background: var(--side) !important; }
/* the one bar fits one line on a laptop: 28 px tools, 2 px gaps, Changes as an icon with its count (the bottom line names them) */
#vd-toolbar { gap: 2px !important; }
#vd-toolbar > .vd-tools .vd-tool, #vd-toolbar > .vd-toolbar-group > .vd-btn:not(:has(.vd-caret)) { width: 28px !important; min-width: 28px !important; height: 28px !important; }
#vd-toolbar > .vd-toolbar-group { gap: 2px !important; }
#vd-toolbar > .vd-toolbar-sep, #vd-toolbar > .vd-tools > .vd-tools-sep { margin: 0 4px !important; }
#vd-toolbar > .vd-tools #vd-changes-btn { width: auto !important; padding: 0 6px !important; }
#vd-toolbar > .vd-tools #vd-changes-btn > span { display: none !important; }
#vd-toolbar .vd-find input { width: 130px !important; }
#vd-toolbar .vd-tools-grip .bi-grip-vertical { display: none; }
/* Find in the bar: a 32 px search icon that widens over the bar to the left while it is used (nothing moves) */
#vd-toolbar > .vd-find { width: 28px; height: 28px; z-index: 5; }
/* Find beside a bar at the left or right (designer_tools.js): the button stays in the bar, marked as open, and the field's own magnifier shows only then */
#vd-toolbar > .vd-find > .vd-find-fic { display: none !important; }
#vd-toolbar > .vd-find.vd-find-out > .vd-find-fic { display: inline-block !important; color: var(--vd-accent) !important; }
#vd-toolbar > .vd-find.vd-find-out { border-radius: 8px; background: var(--side); box-shadow: inset 0 0 0 1px var(--vd-accent); }   /* a line inside, not a border: the icon stays centred */
#vd-toolbar > .vd-find > input { height: 28px !important; }
#vd-toolbar > .vd-find > input { position: absolute; right: 0; top: 0; width: 32px !important; padding: 0 0 0 30px !important; cursor: pointer; transition: width 180ms cubic-bezier(0.23, 1, 0.32, 1); }
#vd-toolbar > .vd-find > input::placeholder { color: transparent; }
#vd-toolbar > .vd-find:focus-within > input, #vd-toolbar > .vd-find > input:not(:placeholder-shown) { width: 220px !important; padding: 0 10px 0 30px !important; cursor: text; }
#vd-toolbar > .vd-find:focus-within > input::placeholder { color: var(--text-muted); }
#vd-toolbar > .vd-find .vd-find-list { right: 0; left: auto; min-width: 220px; }
@media (prefers-reduced-motion: reduce) { #vd-toolbar > .vd-find > input { transition: none; } }
@media (max-width: 1700px) {
  #vd-toolbar > .vd-tools [data-vd-edit="new-table"] { width: 28px !important; padding: 0 !important; }
  #vd-toolbar > .vd-tools [data-vd-edit="new-table"] > span { display: none !important; }
}
#vd-toolbar > .vd-find > .bi-search { left: auto !important; right: 8px; }   /* centred in the 28 px button (the icon is ~12.5 px) */
#vd-toolbar > .vd-find > input, #vd-toolbar > .vd-find:focus-within > input, #vd-toolbar > .vd-find > input:not(:placeholder-shown) { padding-left: 10px !important; padding-right: 30px !important; }
#vd-toolbar > .vd-find > input:not(:focus):placeholder-shown { padding: 0 !important; }
@media (max-width: 1700px) {
  #vd-toolbar > .vd-tools [data-vd-edit="review"] { width: 28px !important; padding: 0 !important; }
  #vd-toolbar > .vd-tools [data-vd-edit="review"] > span { display: none !important; }
}
#vd-toolbar > .vd-find > input::placeholder { color: transparent !important; }
#vd-toolbar > .vd-find:focus-within > input::placeholder { color: var(--text-muted) !important; }
#vd-toolbar > .vd-find > input:not(:focus) { width: 28px !important; padding: 0 !important; color: transparent !important; }
.vd-dock #vd-changes-list .suggestions-empty { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; text-align: left; font-size: .78rem; }
.vd-dock #vd-changes-list .suggestions-empty > .bi { font-size: 1.1rem; margin: 0; }
.vd-dock #vd-changes-list .suggestions-empty p { margin: 0; }
/* table designer: the way back to the whole diagram keeps its words; the table's name is in the breadcrumb already */
#vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) > .vd-btn { width: auto !important; min-width: 0 !important; padding: 0 10px !important; gap: 6px; }
#vd-toolbar .vd-focus-chip { display: none !important; }
@media (max-width: 1700px) {
  #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) > .vd-btn { width: 28px !important; padding: 0 !important; }
  #vd-toolbar .vd-lbl-w { display: none; }
}
/* Home boxes: one box each — background and border around header and body (Recently opened, Start something, Largest databases) */
.hm-home .hm-box { background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 10px !important; }
.hm-home .hm-box > .ts-section-header { background: none !important; border: 0 !important; border-bottom: 1px solid var(--border-color) !important; border-radius: 0 !important; }
html:root[data-theme="light"] .hm-home .hm-box { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05) !important; }
html:root[data-theme="light"] .hm-home .hm-box > .ts-section-header { border-bottom-color: var(--cl-line, var(--hover)) !important; }
.hm-home .hm-largest { margin: 0 0 18px !important; }
.hm-home .hm-largest > .ts-table-wrap { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; margin: 0 !important; }
.hm-home .hm-largest .ts-data-table th:first-child, .hm-home .hm-largest .ts-data-table td:first-child { padding-left: 16px !important; }
.hm-home .hm-largest .ts-data-table th:last-child, .hm-home .hm-largest .ts-data-table td:last-child { padding-right: 16px !important; }
.hm-home .hm-largest .ts-data-table tr:last-child td { border-bottom: 0 !important; }
/* Largest databases: the same rows as the lists above it (grey icon, name in the code font like Recently opened, 13 px text, 10 px 16 px rows) and the approved columns-table header */
.hm-home .hm-largest .ts-data-table { font-size: .82rem !important; font-family: inherit !important; }
.hm-home .hm-largest .ts-data-table th { font-size: .7rem !important; font-weight: 700 !important; letter-spacing: .06em !important; text-transform: uppercase !important; color: var(--text) !important; background: none !important; padding: 10px 16px !important; border-bottom: 1px solid var(--border-color) !important; }
.hm-home .hm-largest .ts-data-table td { padding: 10px 16px !important; color: var(--text-2) !important; font-size: .82rem !important; font-family: inherit !important; border-bottom: 1px solid var(--border-color) !important; font-variant-numeric: tabular-nums; }
.hm-home .hm-largest .ts-data-table td.ts-mono-sm { font-family: 'JetBrains Mono', Consolas, monospace !important; font-size: .74rem !important; color: var(--text-muted) !important; }
.hm-home .hm-largest .dt-name-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; text-decoration: none !important; font-family: 'JetBrains Mono', Consolas, monospace !important; font-size: .8rem !important; font-weight: 600 !important; }
.hm-home .hm-largest .dt-name-link:hover { color: var(--vd-accent) !important; }
.hm-home .hm-largest .hm-db-icon { width: 16px; font-size: .9rem !important; color: var(--text-muted) !important; }
.hm-home .hm-largest tbody tr:hover td { background: var(--hover) !important; }
html:root[data-theme="light"] .hm-home .hm-largest .ts-data-table :is(th, td) { border-bottom-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .hm-home .hm-largest tbody tr:hover td { background: var(--side) !important; }
.hm-home .hm-largest .ts-data-table tr:last-child td { border-bottom: 0 !important; }
.hm-home .hm-box > .ts-section-header > .bi:first-child { color: var(--text) !important; }
/* Home: the numbers belong to the databases box — beside its title; All databases is its button */
.hm-home .hm-largest > .ts-section-header .hm-facts { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 0 14px; padding: 0; font-size: .78rem; font-weight: 400; color: var(--text-muted); }
.hm-home .hm-largest > .ts-section-header .hm-facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Since your last visit */
.hm-since-when { font-size: .78rem; font-weight: 400; color: var(--text-muted); }
.hm-since-item .hm-since-who { font-weight: 600; white-space: nowrap; }
.hm-since-item .hm-since-what { white-space: nowrap; color: var(--text-2); }
.hm-since-item .hm-since-detail { flex: 1 1 auto; }
.hm-since-more > span { color: var(--vd-accent); font-size: .8rem; }
@media (max-width: 1100px) { .hm-home .hm-largest > .ts-section-header .hm-facts { display: none; } }
.hm-li.hm-since-bad > .bi { color: var(--c-err) !important; }
html:root[data-theme="light"] .hm-li.hm-since-bad > .bi { color: var(--c-err) !important; }

/* ══ Phase 4 · Visual Designer part 2 (2026-11-18, design-demos/15-designer.html): the table editor as a panel over the diagram on the right ══ */
#vd-stage .vd-inspector { right: 12px; top: 12px; bottom: 12px; width: 480px; max-width: calc(100% - 260px); display: flex; flex-direction: column; z-index: 310; }
.vd-inspector .vd-fp-head { flex-shrink: 0; }
.vd-inspector .vd-fp-head .vd-insp-btn { margin-left: 0; }
.vd-inspector .vd-fp-head .vd-insp-btn[data-insp="large"] { margin-left: auto; }
.vd-insp-st { padding: 0 7px; border-radius: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.7; }
.vd-insp-new { color: var(--ok-strong); background: var(--ok-soft); }
html:root[data-theme="light"] .vd-insp-new { color: var(--ok-strong); background: var(--ok-soft); box-shadow: inset 0 0 0 1px #95d8ad; }
.vd-insp-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 12px 4px; scrollbar-width: thin; }
.vd-insp-foot { flex-shrink: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--vd-border); }
html:root[data-theme="light"] .vd-insp-foot { border-top-color: var(--cl-line, var(--hover)); }
/* the form in the panel: name on its own line, the tabs, a compact grid */
.vd-inspector .vd-ed-top { display: flex; flex-direction: column; align-items: stretch !important; gap: 4px; margin-bottom: 10px; }
.vd-inspector .vd-ed-top .form-label { margin: 0 0 0 4px; font-size: .74rem; color: var(--text-muted); }
.vd-inspector #vd-ed-name { width: 100% !important; font-family: 'JetBrains Mono', Consolas, monospace !important; font-weight: 600; }
.vd-inspector .vd-ed-tabs { margin-bottom: 8px; }
.vd-inspector .vd-ed-table-wrap { max-height: none !important; overflow: visible !important; }
.vd-inspector .vd-ed-table { table-layout: fixed; width: 100%; }
.vd-inspector .vd-ed-table :is(th, td) { padding: 3px 3px !important; }
.vd-inspector .vd-ed-table th { font-size: .62rem !important; }
/* columns: grip · name · type · length · null · default · drop; unsigned, PK, AI, comment and the arrows are under the list */
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(1) { width: 16px; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(2) { width: 28%; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(3) { width: 27%; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(4) { width: 15%; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(6) { width: 34px; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(11) { width: 32px; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):is(:nth-child(5), :nth-child(8), :nth-child(9), :nth-child(10)) { display: none; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-act :is([data-ed="up"], [data-ed="down"]) { display: none; }
.vd-inspector .vd-ed-table .ts-editor-input { width: 100% !important; min-width: 0 !important; height: 28px !important; padding: 0 6px !important; font-size: .74rem !important; }
.vd-inspector .vd-ed-table [data-f="name"] { font-family: 'JetBrains Mono', Consolas, monospace !important; }
.vd-inspector .vd-ed-table .cs-btn { height: 28px !important; min-height: 28px !important; padding: 0 6px !important; font-size: .72rem !important; }
.vd-inspector .vd-ed-table .cs-btn .acs-chev { right: 5px !important; }
.vd-inspector tr.vd-ed-row.vd-insp-sel > td { background: var(--acc-soft); }
.vd-inspector tr.vd-ed-row.vd-insp-sel > td:first-child { box-shadow: inset 3px 0 0 var(--vd-accent); }
html:root[data-theme="light"] .vd-inspector tr.vd-ed-row.vd-insp-sel > td { background: var(--drk-soft); }
.vd-inspector .vd-ed-addrow { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vd-inspector .vd-ed-was { font-size: .64rem; }
.vd-inspector p.vd-small { font-size: .72rem; margin: 10px 4px 0 !important; }
/* the picked column's other fields */
.vd-insp-col { margin: 12px 0 4px; padding: 10px; border-radius: 8px; border: 1px solid var(--vd-border); background: var(--acc-soft); display: flex; flex-direction: column; gap: 8px; }
html:root[data-theme="light"] .vd-insp-col { border-color: var(--cl-line, var(--hover)); background: var(--side); }
.vd-insp-col-h { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-muted); }
.vd-insp-col-h b { color: var(--text); font-family: 'JetBrains Mono', Consolas, monospace; font-size: .76rem; }
.vd-insp-moves { margin-left: auto; display: inline-flex; gap: 4px; }
.vd-insp-chks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.vd-insp-chk { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-2); cursor: pointer; }
.vd-insp-chk:has(input:disabled) { color: var(--text-muted); cursor: default; }
.vd-insp-col .ts-editor-input { width: 100% !important; }
/* the table being edited, on the diagram */
.table-node.vd-insp-on { outline: 2px solid var(--vd-accent); outline-offset: 2px; }
/* with the editor open, the bottom line fits between the minimap and the editor */
#vd-stage:has(#vd-inspector) .vd-dock { left: 236px; right: 504px; width: auto; min-width: 0; transform: none; }
#vd-stage:has(#vd-inspector) #suggestions-sidebar { display: none !important; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(2) { width: 29%; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(3) { width: 23%; }
.vd-inspector [data-ed-pane="cols"] .vd-ed-table :is(th, td):nth-child(4) { width: 12%; }
.vd-inspector .vd-ed-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-inspector:has([data-ed-pane="cols"][hidden]) .vd-insp-col { display: none !important; }
.vd-inspector .vd-ed-table thead th { background: var(--vd-surface) !important; z-index: 2; }
html:root[data-theme="light"] .vd-inspector .vd-ed-table thead th { background: var(--side) !important; }
.vd-inspector .md-form.vd-ed { display: flex; flex-direction: column; }
.vd-inspector .vd-ed > .vd-ed-top { order: 0; } .vd-inspector .vd-ed > .vd-ed-tabs { order: 1; }
.vd-inspector .vd-ed > [data-ed-pane="cols"] { order: 2; } .vd-inspector .vd-ed > .vd-insp-col { order: 3; }
.vd-inspector .vd-ed > [data-ed-pane="ix"] { order: 4; } .vd-inspector .vd-ed > p { order: 5; } .vd-inspector .vd-ed > [data-ed-error] { order: 6; }
.vd-inspector .vd-ed-table thead th { position: sticky; top: -12px !important; }
#vd-stage:has(#vd-inspector) .vd-dock-title { display: none; }
#vd-stage:has(#vd-inspector) .vd-dock [data-vd-edit="discard"] { font-size: 0 !important; width: 32px; padding: 0 !important; justify-content: center; }
#vd-stage:has(#vd-inspector) .vd-dock [data-vd-edit="discard"] .bi { font-size: .9rem; }
.vd-dock-head > * { white-space: nowrap; }

/* ══ Phase 4 · Visual Designer part 3 (2026-11-18, owner): ONE bar that moves (top / bottom / left / right) and windows
      over the diagram that move (Objects, Table editor, Suggestions, View, minimap) ══ */
/* the old top bar lives inside the Tools bar: its parts are the bar's own items */
.vd-tools > #vd-toolbar { display: contents !important; }
.vd-tools { z-index: 350 !important; }
.vd-tools > .vd-tools-grip { order: 1; align-self: center; }
.vd-tools > :not(#vd-toolbar):not(.vd-tools-grip) { order: 2; }
.vd-tools > :is(#vd-changes-btn, [data-vd-edit="review"]) { order: 6; }
.vd-tools > .vd-tools-sep:has(+ #vd-changes-btn) { display: none; }
.vd-tools:not(.vd-tools-vertical) { gap: 2px !important; padding: 6px 10px !important; align-items: center; flex-wrap: wrap; }
.vd-tools .vd-tool { padding: 0 !important; width: 28px; height: 28px; justify-content: center; }
.vd-tools .vd-tool > span { display: none; }
.vd-tools:not(.vd-tools-vertical) :is([data-vd-edit="new-table"], [data-vd-edit="review"]) { width: auto !important; padding: 0 10px !important; }
.vd-tools:not(.vd-tools-vertical) :is([data-vd-edit="new-table"], [data-vd-edit="review"]) > span { display: inline; }
.vd-tools #vd-changes-btn { width: auto !important; padding: 0 6px !important; }
.vd-tools .vd-tool-badge { position: absolute; top: -4px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.vd-tools #vd-changes-btn .vd-tool-badge { position: static; margin-left: 2px; }
.vd-tools > .vd-tools-sep { width: 1px; height: 22px; align-self: center; margin: 0 4px !important; }
@media (max-width: 1700px) {
  .vd-tools:not(.vd-tools-vertical) :is([data-vd-edit="new-table"], [data-vd-edit="review"]) { width: 28px !important; padding: 0 !important; }
  .vd-tools:not(.vd-tools-vertical) :is([data-vd-edit="new-table"], [data-vd-edit="review"]) > span { display: none !important; }
}
/* at the left or right: one column (two when it doesn't fit), groups stacked, lines across */
.vd-tools-vertical #vd-toolbar > .vd-toolbar-group { flex-direction: column; }
.vd-tools-vertical #vd-toolbar > .vd-toolbar-sep, .vd-tools-vertical > .vd-tools-sep { width: auto !important; height: 1px !important; margin: 3px 2px !important; align-self: stretch; }
.vd-tools-vertical #vd-toolbar > .vd-find { margin-left: 0; }
.vd-tools-vertical #vd-toolbar > .vd-toolbar-group > .vd-btn:has(.vd-caret) { width: 28px; min-width: 28px; padding: 0 !important; justify-content: center; }
.vd-tools-vertical .vd-caret { display: none; }
.vd-tools[data-dock="left"] #vd-toolbar > .vd-find > input { left: 0; right: auto; }
.vd-tools[data-dock="left"] #vd-toolbar > .vd-find > .bi-search { right: auto !important; left: 8px !important; }
/* menus and the Find list open towards the diagram */

/* windows: move by the header */
.vd-win-handle { cursor: grab; user-select: none; }
.vd-win-handle :is(button, input) { cursor: pointer; }
.vd-win-dragging, .vd-win-dragging .vd-win-handle { cursor: grabbing !important; }
.vd-win-dragging { box-shadow: 0 20px 44px rgba(0,0,0,.42) !important; }
/* the View builder: a window over the diagram (was a column beside it) */
#vd-stage .vd-vb { position: absolute; right: 12px; top: 12px; bottom: 12px; width: 370px; grid-area: auto !important; z-index: 305; }
#vd-stage .vd-vb .vd-vb-head { background: none; }
/* Suggestions fold to their header (they stay in sight while the editor is open) */
#suggestions-sidebar .vd-sug-fold { margin-left: auto; }
#suggestions-sidebar .suggestions-header { gap: 4px; }
#suggestions-sidebar .suggestions-header > .suggestions-close { margin-left: 0; }
#suggestions-sidebar.vd-fp-closed > :not(.suggestions-header) { display: none !important; }
#suggestions-sidebar.vd-fp-closed { bottom: auto !important; height: auto !important; }
#suggestions-sidebar.vd-fp-closed .suggestions-header { border-bottom: 0; }
#suggestions-sidebar.vd-fp-closed .vd-sug-fold .bi { transform: rotate(180deg); }
#vd-stage:has(#vd-inspector) #suggestions-sidebar.suggestions-open { display: flex !important; }
#vd-stage:has(#vd-inspector:not(.vd-win-moved)) #suggestions-sidebar:not(.vd-win-moved) { right: 504px !important; }
/* the editor and Suggestions leave a minimap in a right corner uncovered */
#vd-stage:has(#minimap-container[data-corner="br"]:not(.vd-win-moved)) :is(.vd-inspector, #suggestions-sidebar, .vd-vb):not(.vd-win-moved) { bottom: 196px !important; }
#vd-stage:has(#minimap-container[data-corner="tr"]:not(.vd-win-moved)) :is(.vd-inspector, #suggestions-sidebar, .vd-vb):not(.vd-win-moved) { top: 196px !important; }
/* the minimap header is its handle */
#minimap-header.vd-win-handle { cursor: grab; }
.vd-tools > :is(#vd-changes-btn, [data-vd-edit="review"]) { order: 6 !important; }

/* ══ Phase 4 · Visual Designer part 4 (2026-11-18, owner's 10 points): one button look in the bar, open windows marked,
      every window the same (header, fonts, footer buttons): Objects, Table editor, New view, Suggestions, Add relation ══ */
/* 1. Find at the left / right: its list opens under the field, not over it */
/* 2. button groups stacked at the left / right: one block, round corners at its top and bottom */
.vd-tools-vertical .vd-seg { gap: 0 !important; }
.vd-tools-vertical .vd-seg .vd-btn { margin: -1px 0 0 0 !important; border-radius: 0 !important; }
.vd-tools-vertical .vd-seg .vd-btn:first-child { margin-top: 0 !important; border-radius: 7px 7px 0 0 !important; }
.vd-tools-vertical .vd-seg .vd-btn:last-child { border-radius: 0 0 7px 7px !important; }
/* 3. every button in the bar: no frame at rest, the same tint and frame on hover */
.vd-tools :is(.vd-tool, .vd-btn) { border: 1px solid transparent !important; background: none !important; box-shadow: none !important; border-radius: 7px; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.vd-tools .vd-seg .vd-btn { border-color: var(--vd-border) !important; }
.vd-tools :is(.vd-tool, .vd-btn):hover:not(:disabled) { background: var(--hover) !important; border-color: var(--vd-border) !important; color: var(--text) !important; }
html:root[data-theme="light"] .vd-tools :is(.vd-tool, .vd-btn):hover:not(:disabled) { background: var(--side) !important; border-color: var(--cl-line, var(--drk-soft)) !important; }
html:root[data-theme="light"] .vd-tools .vd-seg .vd-btn { border-color: var(--cl-line, var(--drk-soft)) !important; }
/* 4. a chosen tool in dark: filled with the accent (light: white, grey frame, violet underline — approved) */
:root:not([data-theme="light"]) .vd-tools :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on, .vd-tool.active, .vd-tool[aria-pressed="true"]) {
  background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--active-text, var(--text)) !important; }
:root:not([data-theme="light"]) .vd-tools :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on):hover { background: var(--prim-strong) !important; }
html:root[data-theme="light"] .vd-tools :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on) { background: var(--side) !important; color: var(--text) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; }
/* 5. Review SQL: the icon in the button's own colour */
.vd-tools [data-vd-edit="review"]:not(:disabled) { background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--active-text, var(--text)) !important; }
.vd-tools [data-vd-edit="review"]:not(:disabled) .bi { color: inherit !important; }
html:root[data-theme="light"] .vd-tools [data-vd-edit="review"]:not(:disabled) { background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--side) !important; }
/* 8. an open window: its button's icon in the accent colour, a small bar under it */
.vd-tools .vd-win-on { position: relative; }
.vd-tools .vd-win-on .bi { color: var(--vd-accent) !important; }
.vd-tools .vd-win-on::after { content: ''; position: absolute; left: 50%; bottom: 1px; width: 12px; height: 2px; margin-left: -6px; border-radius: 1px; background: var(--vd-accent); }
html:root[data-theme="light"] .vd-tools .vd-win-on .bi { color: var(--vd-accent) !important; }
html:root[data-theme="light"] .vd-tools .vd-win-on::after { background: var(--vd-accent); }
.vd-fp-x { margin-left: 0 !important; }
#vd-objects[hidden] { display: none !important; }

/* one window look: header 38 px, 13 px title, grey icon, 28 px header buttons; footer 32 px buttons on a line */
:is(.vd-vb-head, #suggestions-sidebar .suggestions-header) { display: flex !important; align-items: center !important; gap: 8px !important; min-height: 38px; padding: 4px 6px 4px 12px !important;
  font-size: .8rem !important; font-weight: 600 !important; color: var(--text) !important; background: none !important; border-bottom: 1px solid var(--vd-border) !important; }
:is(.vd-vb-head, .vd-fp-head) > .bi:first-child, #suggestions-sidebar .suggestions-title > .bi { color: var(--text-muted) !important; font-size: .9rem; }
#suggestions-sidebar .suggestions-title { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem !important; font-weight: 600 !important; color: var(--text) !important; }
:is(.vd-vb-x, #suggestions-sidebar .suggestions-close) { width: 28px; height: 28px; padding: 0 !important; display: grid !important; place-items: center; border: 0 !important; border-radius: 6px !important; background: none !important; color: var(--text-muted) !important; font-size: .8rem; }
:is(.vd-vb-x, #suggestions-sidebar .suggestions-close):hover { background: var(--hover) !important; color: var(--text) !important; }
#suggestions-sidebar .vd-sug-fold { margin-left: auto !important; }
html:root[data-theme="light"] :is(.vd-vb-head, #suggestions-sidebar .suggestions-header) { border-bottom-color: var(--cl-line, var(--hover)) !important; }
.vd-vb-head > span { flex: 1; }
.vd-insp-foot { align-items: center; }
.vd-insp-foot > :is(button, a) { height: 32px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; }
.vd-insp-sp { flex: 1; }
.vd-insp-foot .vd-insp-drop { width: 32px; justify-content: center; }
.vd-vb-foot.vd-insp-foot { padding: 10px 12px !important; }
/* 7. New view: the same fonts and labels as the Table editor */
.vd-vb-body { padding: 12px !important; font-size: .8rem !important; gap: 6px !important; }
.vd-vb-label { margin: 8px 0 0 4px !important; font-size: .74rem !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text-muted) !important; }
.vd-vb .ts-editor-input { font-size: .8rem !important; }
.vd-vb #vd-vb-name { font-family: 'JetBrains Mono', Consolas, monospace !important; font-weight: 600; }

/* 9. Add relation: a window over the diagram */
#vd-stage .vd-reldraw { position: absolute; left: 50%; bottom: 68px; transform: translateX(-50%); width: 520px; max-width: calc(100% - 24px); display: flex; flex-direction: column; animation: none !important; user-select: none; }
.vd-rdp-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.vd-rdp-slots { display: flex; align-items: stretch; gap: 8px; }
.vd-rdp-slot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border-radius: 8px; border: 1.5px dashed var(--vd-border); background: var(--n-soft); transition: border-color 160ms ease; }
.vd-rdp-k { font-size: .72rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.vd-rdp-v { font-size: .8rem; color: var(--text-muted); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-rdp-arrow { align-self: center; color: var(--text-muted); }
.vd-rdp-set { border-style: solid; }
.vd-rdp-set .vd-rdp-v { font-style: normal; font-weight: 600; font-family: 'JetBrains Mono', Consolas, monospace; }
.vd-rdp-from-set { border-color: var(--c-ok); } .vd-rdp-from-set .vd-rdp-v { color: var(--ok-strong); }
.vd-rdp-to-set { border-color: var(--primary); } .vd-rdp-to-set .vd-rdp-v { color: var(--accent-text); }
html:root[data-theme="light"] .vd-rdp-from-set { border-color: var(--c-ok); } html:root[data-theme="light"] .vd-rdp-from-set .vd-rdp-v { color: var(--ok-strong); }
html:root[data-theme="light"] .vd-rdp-to-set { border-color: var(--vd-accent); } html:root[data-theme="light"] .vd-rdp-to-set .vd-rdp-v { color: var(--accent-text); }
html:root[data-theme="light"] .vd-rdp-slot:not(.vd-rdp-set) { border-color: var(--cl-line, var(--drk-soft)); }
.vd-rdp-msg { min-height: 18px; font-size: .78rem; color: var(--text-muted); text-align: center; }
.vd-rdp-msg[data-state="ok"] { color: var(--ok-strong); } .vd-rdp-msg[data-state="bad"] { color: var(--c-err); }
html:root[data-theme="light"] .vd-rdp-msg[data-state="ok"] { color: var(--ok-strong); } html:root[data-theme="light"] .vd-rdp-msg[data-state="bad"] { color: var(--err-strong); }

/* 6. the Table editor as planned: name in the header row, tabs underlined, a quiet grid (fields show their frame on hover / focus) */
.vd-inspector .vd-ed-top { flex-direction: row !important; align-items: center !important; gap: 8px; margin: -12px -12px 0 !important; padding: 8px 12px; border-bottom: 1px solid var(--vd-border); }
.vd-inspector .vd-ed-top .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vd-inspector .vd-ed-top::before { content: '\F5AA'; font-family: bootstrap-icons; font-size: .95rem; color: var(--text-muted); }
.vd-inspector #vd-ed-name { flex: 1; height: 32px !important; border-color: transparent !important; background: transparent !important; box-shadow: none !important; font-size: .9rem !important; padding: 0 8px !important; }
.vd-inspector #vd-ed-name:hover { border-color: var(--vd-border) !important; }
.vd-inspector #vd-ed-name:focus { border-color: var(--vd-accent) !important; background: var(--bg) !important; }
.vd-inspector .vd-ed-tabs { display: flex !important; gap: 2px !important; margin: 0 -12px 6px !important; padding: 0 8px !important; border: 0 !important; border-bottom: 1px solid var(--vd-border) !important; border-radius: 0 !important; background: none !important; }
.vd-inspector .vd-ed-tabs > .ts-btn { height: auto !important; min-height: 0 !important; padding: 9px 8px 8px !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; color: var(--text-muted) !important; font-size: .78rem !important; font-weight: 500 !important; }
.vd-inspector .vd-ed-tabs > .ts-btn .bi { display: none; }
.vd-inspector .vd-ed-tabs > .ts-btn:hover { color: var(--text) !important; }
.vd-inspector .vd-ed-tabs > .ts-btn.active { color: var(--text) !important; font-weight: 600 !important; border-bottom-color: var(--vd-accent) !important; }
.vd-inspector .vd-ed-tabs .vd-ed-n { margin-left: 4px; padding: 0 6px; border-radius: 8px; background: var(--hover); color: var(--text-2); font-size: .66rem; }
html:root[data-theme="light"] .vd-inspector :is(.vd-ed-top, .vd-ed-tabs) { border-bottom-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] .vd-inspector .vd-ed-tabs > .ts-btn.active { border-bottom-color: var(--vd-accent) !important; }
.vd-inspector .vd-ed-table-wrap { border: 0 !important; border-radius: 0 !important; background: none !important; margin: 0 -12px !important; }
.vd-inspector .vd-ed-table { border-collapse: collapse; }
.vd-inspector .vd-ed-table th { text-transform: none !important; letter-spacing: 0 !important; font-size: .68rem !important; font-weight: 600 !important; color: var(--text-muted) !important; padding: 6px 3px !important; border-bottom: 1px solid var(--vd-border) !important; }
.vd-inspector .vd-ed-table td { padding: 2px 3px !important; border-bottom: 1px solid var(--border-color) !important; }
.vd-inspector .vd-ed-table :is(th, td):first-child { padding-left: 10px !important; }
.vd-inspector .vd-ed-table :is(th, td):last-child { padding-right: 10px !important; }
.vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn) { border-color: transparent !important; background: transparent !important; box-shadow: none !important; }
.vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn):hover:not(:disabled) { border-color: var(--vd-border) !important; background: var(--bg) !important; }
.vd-inspector .vd-ed-table .ts-editor-input:focus, .vd-inspector .vd-ed-table .cs-btn[aria-expanded="true"] { border-color: var(--vd-accent) !important; background: var(--bg) !important; }
.vd-inspector .vd-ed-table .cs-btn .acs-chev { color: var(--text-faint); }
.vd-inspector .vd-ed-table .cs-btn:hover .acs-chev { opacity: 1; }
.vd-inspector .vd-ed-table .vd-invalid { border-color: var(--c-err) !important; }
html:root[data-theme="light"] .vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn):hover:not(:disabled) { border-color: var(--cl-line, var(--drk-soft)) !important; background: var(--side) !important; }
html:root[data-theme="light"] .vd-inspector .vd-ed-table td { border-bottom-color: var(--cl-line, var(--side)) !important; }
html:root[data-theme="light"] .vd-inspector .vd-ed-table .vd-invalid { border-color: var(--c-err) !important; }
.vd-inspector .vd-ed-table .ts-icon-btn { border-color: transparent !important; background: none !important; }
.vd-inspector .vd-ed-table .ts-icon-btn:hover { background: var(--hover) !important; }
.vd-inspector .vd-ed-addrow { padding: 0 2px; }
.vd-inspector .vd-ed-addrow .ts-btn { border-color: transparent !important; background: none !important; box-shadow: none !important; }
.vd-inspector .vd-ed-addrow .ts-btn:hover:not(:disabled) { background: var(--hover) !important; border-color: var(--vd-border) !important; }
.vd-inspector .vd-ed-addrow [data-ed="add"] { color: var(--vd-accent) !important; font-weight: 600; }
/* the picked column: a part of the panel, not a box in it */
.vd-inspector .vd-insp-col { margin: 10px -12px 0 !important; padding: 10px 12px 12px !important; border: 0 !important; border-top: 1px solid var(--vd-border) !important; border-radius: 0 !important; background: none !important; }
html:root[data-theme="light"] .vd-inspector .vd-insp-col { border-top-color: var(--cl-line, var(--hover)) !important; }
.vd-inspector .vd-insp-col .ts-editor-input { height: 30px !important; }
#vd-stage .vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn) { border-color: transparent !important; background: transparent !important; box-shadow: none !important; }
#vd-stage .vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn):hover:not(:disabled) { border-color: var(--vd-border) !important; background: var(--bg) !important; }
#vd-stage .vd-inspector .vd-ed-table .ts-editor-input:focus, #vd-stage .vd-inspector .vd-ed-table .cs-btn[aria-expanded="true"] { border-color: var(--vd-accent) !important; background: var(--bg) !important; }
#vd-stage .vd-inspector .vd-ed-table .vd-invalid { border-color: var(--c-err) !important; }
html:root[data-theme="light"] #vd-stage .vd-inspector .vd-ed-table :is(.ts-editor-input, .cs-btn):hover:not(:disabled) { border-color: var(--cl-line, var(--drk-soft)) !important; background: var(--side) !important; }
html:root[data-theme="light"] #vd-stage .vd-inspector .vd-ed-table .vd-invalid { border-color: var(--c-err) !important; }
.vd-reldraw .vd-fp-head > span { flex: 1; }
.vd-tools[data-dock="left"] #vd-toolbar > .vd-find:focus-within > input { padding-left: 30px !important; padding-right: 10px !important; }

/* ══ Phase 4 · Visual Designer part 5 (2026-11-18, owner's 8 points) ══ */
/* 1. a chosen tool / Review SQL in dark: white icon and text on the violet */
:root:not([data-theme="light"]) .vd-tools :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on, .vd-tool.active, .vd-tool[aria-pressed="true"], [data-vd-edit="review"]:not(:disabled)) { color: var(--text) !important; }
:root:not([data-theme="light"]) .vd-tools :is(.vd-seg .vd-btn.active, .vd-btn.vd-btn-on, .vd-tool.active, .vd-tool[aria-pressed="true"], [data-vd-edit="review"]:not(:disabled)) :is(.bi, svg, span) { color: var(--text) !important; fill: currentColor; }
/* 2. a moved window keeps its height (a variable) — folded, it is only its header */
#vd-stage .vd-win-moved:not(.vd-fp-closed) { height: var(--win-h) !important; }
#vd-stage .vd-fp.vd-fp-closed { height: auto !important; bottom: auto !important; max-height: none !important; }
/* 3. + 5. no blur behind the windows: a blurred box keeps the lists that open from it (Type, Insert a column) inside itself */
#vd-stage :is(.vd-fp, #suggestions-sidebar) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--vd-surface) !important; }
html:root[data-theme="light"] #vd-stage :is(.vd-fp, #suggestions-sidebar) { background: var(--side) !important; }
/* 5. JOIN / LEFT JOIN: small choice buttons */
.vd-vb .vd-seg { align-self: flex-start; }
.vd-vb .vd-seg .vd-btn { height: 28px !important; min-height: 28px !important; padding: 0 10px !important; font-size: .74rem !important; font-weight: 600; }
/* 6. one header for every window and dialog: 44 px, 14 px title, grey icon, 28 px buttons */
:is(.vd-fp-head, .vd-vb-head, #suggestions-sidebar .suggestions-header) { min-height: 44px !important; padding: 0 8px 0 14px !important; font-size: .86rem !important; font-weight: 600 !important; }
#suggestions-sidebar .suggestions-title { font-size: .86rem !important; }
.modal-header { min-height: 44px !important; padding: 0 8px 0 16px !important; display: flex !important; align-items: center !important; }
.modal-title { font-size: .86rem !important; font-weight: 600 !important; line-height: 1.3 !important; }
.modal-title > .bi:first-child { color: var(--text-muted); font-size: .9rem; }
.modal-close { width: 28px !important; height: 28px !important; border-radius: 6px !important; }
/* 7. Objects as planned: 208 px, the picked one filled, short counts, the code section */
.vd-objects { width: 214px !important; }
.vd-objects .vd-obj-search { margin: 8px !important; }
.vd-obj { height: 27px !important; text-decoration: none !important; }
.vd-obj > small { font-variant-numeric: tabular-nums; }
.vd-obj.on { background: var(--vd-accent) !important; color: var(--text) !important; }
.vd-obj.on > :is(.bi, small) { color: var(--text) !important;  }
html:root[data-theme="light"] .vd-obj.on { background: var(--vd-accent) !important; color: var(--side) !important; }
/* New view: a picked column on one line — handle · name · AS · arrows · × */
.vd-vb-col { grid-template-columns: 14px minmax(0, 1fr) 110px auto auto !important; }
.vd-vb-col > button[data-vb-uncol], .vd-vb-move > button { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.vd-vb-col > button[data-vb-uncol]:hover, .vd-vb-move > button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.vd-vb-col > button[data-vb-uncol]:hover { color: var(--c-err); }
.vd-vb-move > button:disabled { color: var(--disabled-text); cursor: default; }

/* ══ Visual Designer part 6 (2026-11-18): Select / Move / Link, editor Links · Options · DDL, warnings in the bottom line ══ */
#workspace.vd-hand, #workspace.vd-hand * { cursor: grab !important; }
#workspace.vd-panning, #workspace.vd-panning * { cursor: grabbing !important; user-select: none; }
.vd-inspector .vd-ed > [data-ed-pane]:not([data-ed-pane="cols"]) { order: 4; }
.vd-ed-linklist { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.vd-ed-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 1px solid var(--vd-border); border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: .78rem; text-align: left; cursor: pointer; }
.vd-ed-link:hover { background: var(--hover); color: var(--text); }
.vd-ed-link > .bi { color: var(--text-muted); }
.vd-ed-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', Consolas, monospace; font-size: .74rem; }
.vd-ed-link > span b { color: var(--text); font-weight: 600; }
.vd-ed-link > span .bi { font-size: .7rem; color: var(--text-muted); margin: 0 2px; }
.vd-ed-link > small { color: var(--text-muted); font-size: .68rem; white-space: nowrap; }
.vd-ed-link-new { border-style: dashed; border-color: var(--c-warn); }
html:root[data-theme="light"] .vd-ed-link { border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .vd-ed-link-new { border-color: var(--c-warn); }
.vd-ed-opts { padding-top: 6px; }
.vd-ed-opt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border-color); font-size: .8rem; }
.vd-ed-opt > span { color: var(--text-muted); }
.vd-ed-opt > b { font-weight: 600; font-family: 'JetBrains Mono', Consolas, monospace; font-size: .76rem; color: var(--text); text-align: right; overflow-wrap: anywhere; }
.vd-ed-ddl { padding-top: 6px; }
.vd-ed-ddl-sql { margin: 6px 0 8px; padding: 10px 12px; max-height: 340px; overflow: auto; white-space: pre; border-radius: 8px; border: 1px solid var(--vd-border); background: var(--bg); color: var(--text-2); font: .74rem/1.6 'JetBrains Mono', Consolas, monospace; }
html:root[data-theme="light"] .vd-ed-ddl-sql { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* warnings beside the changes in the bottom line */
.vd-dock-warn[hidden] { display: none !important; }
.vd-dock .vd-dock-warn { color: var(--err-strong) !important; background: var(--err-soft) !important; }
html:root[data-theme="light"] .vd-dock .vd-dock-warn { color: var(--err-strong) !important; background: var(--err-soft) !important; box-shadow: inset 0 0 0 1px #f7a6b8 !important; }
.vd-dock-warns { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--vd-border); }
.vd-change-warn > i { color: var(--warn-strong); }
html:root[data-theme="light"] .vd-change-warn > i { color: var(--c-err); }
/* the bar on one line again with Select / Move / Link: tighter separators, 27 px tools */
.vd-tools:not(.vd-tools-vertical) > .vd-tools-sep, .vd-tools:not(.vd-tools-vertical) #vd-toolbar > .vd-toolbar-sep { margin: 0 2px !important; }
.vd-tools:not(.vd-tools-vertical) .vd-tool:not(#vd-changes-btn):not([data-vd-edit="new-table"]):not([data-vd-edit="review"]),
.vd-tools:not(.vd-tools-vertical) #vd-toolbar > .vd-toolbar-group > .vd-btn:not(:has(.vd-caret)) { width: 27px !important; min-width: 27px !important; }
.vd-tools:not(.vd-tools-vertical) .vd-tools-grip { gap: 0 !important; }
/* the note about unchanged columns: on Columns and Indexes only */
.vd-inspector:has(:is([data-ed-pane="links"], [data-ed-pane="opts"], [data-ed-pane="ddl"]):not([hidden])) .vd-ed > p.vd-small.mt-2 { display: none; }
html:root[data-theme="light"] .vd-tools :is(.vd-tool.active, .vd-tool[aria-pressed="true"]) { background: var(--side) !important; color: var(--text) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; }
html.vd-panning-all, html.vd-panning-all * { cursor: grabbing !important; user-select: none !important; }
/* table designer: the way back to the whole diagram is an icon like the other tools (its name is the tooltip),
   right after the grip — at every side and screen width */
#vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip), #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) + .vd-toolbar-sep { order: 1 !important; }
.vd-tools #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) > .vd-btn { width: 27px !important; min-width: 27px !important; height: 28px !important; padding: 0 !important; justify-content: center; }
.vd-tools #vd-toolbar .vd-lbl-w { display: none !important; }
.vd-tools-vertical #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) + .vd-toolbar-sep { width: auto !important; height: 1px !important; margin: 3px 2px !important; }
/* a side bar in two or three columns: every button is a cell (groups open up), lines and the grip across the row */
.vd-tools.vd-tools-vertical.vd-tools-2col { display: grid !important; grid-template-columns: repeat(2, 28px) !important; grid-auto-rows: 28px; gap: 3px !important; justify-content: center; align-content: start; padding: 8px 5px !important; }
.vd-tools.vd-tools-vertical.vd-tools-3col { grid-template-columns: repeat(3, 28px) !important; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group { display: contents !important; }
.vd-tools-2col :is(.vd-tools-sep, #vd-toolbar > .vd-toolbar-sep) { grid-column: 1 / -1; width: auto !important; height: 1px !important; margin: 2px 2px !important; align-self: center; }
.vd-tools-2col .vd-tools-grip { grid-column: 1 / -1; }
.vd-tools-2col :is(.vd-tool, .vd-btn) { width: 28px !important; min-width: 28px !important; height: 28px !important; padding: 0 !important; justify-content: center; margin: 0 !important; }
.vd-tools-2col .vd-seg .vd-btn, .vd-tools-2col #vd-toolbar .vd-btn { border-radius: 7px !important; }
.vd-tools-2col #vd-toolbar > .vd-find, .vd-tools-2col #vd-toolbar > .vd-export { width: 28px; height: 28px; }
.vd-tools-2col .vd-tool-badge { top: -5px !important; right: -6px !important; }
/* the opened groups keep their place: their buttons take the group's order; Find / Export stay one cell */
.vd-tools-2col #vd-toolbar > :is(.vd-find, .vd-export) { display: flex !important; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group:not(.vd-find):not(.vd-export) > * { order: 3; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group:has(.vd-focus-chip) > * { order: 1; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group > .vd-focus-chip { display: none !important; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group > .vd-layouts { display: contents; }
.vd-tools-2col #vd-toolbar > .vd-toolbar-group > .vd-layouts > .vd-btn { order: 3; }
/* still too tall (a very small screen): the bar scrolls — nothing is cut off */
.vd-tools.vd-tools-vertical { overflow-y: auto !important; scrollbar-width: thin; }
.vd-tools.vd-tools-vertical.vd-tools-2col { grid-auto-rows: auto !important; row-gap: 3px !important; }
.vd-tools-2col :is(.vd-tools-sep, #vd-toolbar > .vd-toolbar-sep) { margin: 1px 2px !important; }
/* Move the view while the diagram keeps the mouse: a hand drawn where the pointer would be */
.vd-pan-hand { position: fixed; z-index: 100000; pointer-events: none; transform: translate(-30%, -10%); font-size: 20px; color: var(--text); text-shadow: 0 0 2px var(--bg), 0 0 4px var(--bg); }
/* Move: the real pointer hidden while dragging; the drawn hand (placed by transform — no layout per frame) */
html.vd-pan-nocursor, html.vd-pan-nocursor * { cursor: none !important; }
.vd-pan-hand { left: 0 !important; top: 0 !important; margin: -4px 0 0 -7px; will-change: transform; }
/* past the edge: no real pointer anywhere (over the stronger "grabbing" rules too) */
html.vd-pan-nocursor, html.vd-pan-nocursor *, html.vd-pan-nocursor #workspace.vd-panning, html.vd-pan-nocursor #workspace.vd-panning * { cursor: none !important; }
.vd-pan-hand[hidden] { display: none !important; }

/* ══ Navigation (2026-11-18, design-demos/09-nav.html): the rail on the far left with words, one colour at a time;
      the server / organization card at the top of the panel; New database + Wizard at its foot ══ */
#sb-rail { --rail-w: 64px; width: var(--rail-w) !important; min-width: var(--rail-w) !important; padding: 8px 0 !important; gap: 2px !important; border-right: 1px solid var(--border-color) !important; }
:is(.sbr-home, .sbr-tab, .sbr-settings, .sbr-fold) { width: 54px !important; height: 46px !important; flex-direction: column; gap: 3px; border-radius: 8px !important; font-size: 1.02rem !important; color: var(--text-muted) !important; }
.sbr-w { font-size: .62rem; font-weight: 500; line-height: 1; letter-spacing: 0; color: inherit; }
.sbr-home { margin-bottom: 6px !important; }
.sbr-tabs { gap: 2px !important; }
/* grey at rest; the open one (and the one under the pointer) in its area's colour */
.sbr-tab { color: var(--text-muted) !important; }
.sbr-tab:hover { color: var(--tab) !important; background: var(--tab-soft) !important; }
.sbr-tab.sbr-on { color: var(--tab) !important; background: var(--tab-soft) !important; }
.sbr-tab.sbr-on .sbr-w { font-weight: 600; }
.sbr-tab.sbr-on::before { left: -5px !important; top: 9px !important; bottom: 9px !important; }
:is(.sbr-home, .sbr-settings, .sbr-fold):hover, :is(.sbr-home, .sbr-settings).sbr-on { color: var(--text) !important; background: var(--hover) !important; box-shadow: none !important; }
html:root[data-theme="light"] .sbr-tab:not(.sbr-on):not(:hover) { color: var(--text-muted) !important; }
/* the panel slides out beside the rail (the rail stays where it is) */
body.sb-drawer #main-sidebar { left: var(--rail-w, 64px) !important; }
body.sb-drawer.sb-open #sb-rail { transform: none !important; }
:root[data-sb-side="right"] body.sb-drawer #main-sidebar { left: auto !important; right: var(--rail-w, 64px) !important; }
:root[data-sb-side="right"] body.sb-drawer.sb-open #sb-rail { transform: none !important; }
:root[data-sb-side="right"] #sb-rail { border-right: 0 !important; border-left: 1px solid var(--border-color) !important; }
:root[data-sb-side="right"] .sbr-tab.sbr-on::before { left: auto !important; right: -5px !important; }
#main-sidebar { border-right: 1px solid var(--border-color) !important; }
html:root[data-theme="light"] #sb-rail { border-color: var(--cl-line, var(--hover)) !important; }

/* the context card: server (dot: open or not) and the organization under it */
.sb-ctx { flex-shrink: 0; display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg); overflow: hidden; }
.sb-ctx[hidden] { display: none !important; }
.sb-ctx > .dropdown + .dropdown .sbc-row { border-top: 1px solid var(--border-color); }
.sbc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px 9px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
button.sbc-row:hover { background: var(--hover); }
.sbc-static { cursor: default; }
.sbc-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 3px var(--n-line); }
.sbc-dot.sbc-on { background: var(--c-ok); box-shadow: 0 0 0 3px var(--ok-soft); }
html:root[data-theme="light"] .sbc-dot.sbc-on { background: var(--c-ok); }
.sbc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sbc-main > :is(b, span) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 600; }
.sbc-main > small { font-size: .7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbc-org { padding-top: 7px; padding-bottom: 7px; }
.sbc-org .sbc-main > span { font-size: .78rem; font-weight: 500; color: var(--text-2); }
.sbc-ico { flex-shrink: 0; width: 8px; display: grid; place-items: center; font-size: .8rem; color: var(--text-muted); }
.sbc-chev { flex-shrink: 0; font-size: .75rem; color: var(--text-muted); }
.sbc-row.acs-need .sbc-main > b { color: var(--vd-accent); }
.sbc-invite { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 10px; font-size: .68rem; font-weight: 700; color: var(--text); background: var(--vd-accent); }
html:root[data-theme="light"] .sb-ctx { background: var(--side); border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .sb-ctx > .dropdown + .dropdown .sbc-row { border-top-color: var(--cl-line, var(--hover)); }
.sb-ctx .acs-menu { min-width: 236px; }
/* New database and the Wizard at the foot of the Databases panel */
.sbp-db-foot { display: flex !important; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border-color); }
.sbp-db-foot > .ts-btn { flex: 1; justify-content: center; text-decoration: none !important; }
html:root[data-theme="light"] .sbp-db-foot { border-top-color: var(--cl-line, var(--hover)); }
.sb-ctx > .dropdown { display: block !important; width: 100%; }
.sb-ctx .sbc-row { justify-content: flex-start !important; }
/* the server is named in the card: the Databases title doesn't repeat it */
.sbp[data-panel="databases"] .sbp-title .sbp-title-name { display: none; }
.sb-ctx .acs-menu .dropdown-item.active, .sb-ctx .acs-menu .dropdown-item:active { background: var(--acc-mid) !important; color: var(--text) !important; }
.sb-ctx .acs-menu .dropdown-item.active > .bi { color: var(--vd-accent) !important; }
html:root[data-theme="light"] .sb-ctx .acs-menu .dropdown-item.active { background: var(--drk-soft) !important; color: var(--accent-text) !important; }
/* the card compact: one line a row (the dot says connected; the role is in the tooltip) */
.sb-ctx .sbc-row { padding: 6px 8px 6px 11px !important; gap: 9px !important; min-height: 32px; }
.sb-ctx .sbc-main > :is(b, span) { font-size: .8rem !important; }
.sb-ctx .sbc-org .sbc-main > span { font-size: .78rem !important; }
/* the logo column as wide as rail (64 px) + panel (260 px), so its line meets the panel's edge */
@media (min-width: 701px) { .app-brand { width: calc(260px + 64px - 16px) !important; } }
/* Databases: room between the server / organization card and the title under it */
.sbp-databases > .sb-ctx + .sbp-title { margin-top: 12px; }
/* the tree (design-demos/09-nav.html): each database with its size, Pinned first */
.db-header { display: flex; align-items: center; }
.db-header .db-name-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-size { flex-shrink: 0; margin-left: 8px; padding-right: 6px; font-size: .68rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.db-size:empty { display: none; }
.sb-pinned { flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px solid var(--border-color); }
.sb-pinned[hidden] { display: none !important; }
.sb-pinned-title { display: flex; align-items: center; gap: 6px; padding: 2px 8px 4px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.sb-pinned-title > .bi { color: var(--gold-strong); font-size: .62rem; }
.sb-pinned-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 8px; border-radius: 6px; color: var(--text-2); text-decoration: none !important; font-size: .82rem; }
.sb-pinned-item:hover { background: var(--hover); color: var(--text); }
.sb-pinned-item > .bi { flex-shrink: 0; font-size: .8rem; color: var(--text-muted); }
.sb-pinned-item > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-pinned-item > small { flex-shrink: 0; font-size: .66rem; color: var(--text-muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root[data-theme="light"] .sb-pinned { border-bottom-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .sb-pinned-title > .bi { color: var(--c-gold); }
/* the database size: at the right edge of its row, small */
.db-header { width: 100%; }
.db-header .db-size { margin-left: auto !important; padding-right: 8px !important; font-size: .62rem !important; color: var(--text-muted); }
#db-list .db-header > span.db-size { font-size: .66rem !important; font-weight: 400 !important; color: var(--text-muted) !important; }
/* the name takes the room, the size only its own width (an older rule gave every span of the row a share) */
#db-list .db-header > span.db-name-label { flex: 1 1 auto !important; min-width: 0; }
#db-list .db-header > span.db-size { flex: 0 0 auto !important; width: auto !important; min-width: 0 !important; text-align: right; }

/* ══ Phase 5 · Summaries (2026-11-18, design-demos/04-summary.html): Overview opens with one line of facts ══ */
.ov-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin: 2px 4px 22px; }
.ov-fact { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-muted); text-decoration: none !important; font-size: .84rem; }
.ov-fact > b { color: var(--text); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ov-fact > span { text-decoration: underline dotted var(--n-line); text-underline-offset: 3px; }
.ov-fact:hover > span { color: var(--vd-accent); text-decoration-color: var(--vd-accent); }
.ov-fact.ov-zero > b { color: var(--text-muted); font-weight: 600; }
.ov-fact.ov-zero { color: var(--text-muted); }
/* what to do next: three buttons and More */
.ov-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ov-action { height: 32px; padding: 0 12px !important; border-radius: 8px !important; }
.ov-action i { color: var(--text-muted) !important; }
.ov-action-main { background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; color: var(--text) !important; }
.ov-action-main i { color: var(--text) !important; }
html:root[data-theme="light"] .ov-action-main { background: var(--vd-accent) !important; border-color: var(--vd-accent) !important; }
.ov-more-acts > .ov-action { cursor: pointer; font: inherit; font-size: .8rem; }
.ov-more-acts > .ov-action > .bi { font-size: .7rem; margin-left: 2px; }
.ov-more-acts .dropdown-menu .dropdown-item { display: flex; align-items: center; gap: 8px; }
.ov-more-acts .dropdown-menu .dropdown-item > .bi { color: var(--text-muted); width: 16px; }
/* Structure (04-summary): the facts once — in Table details (no cards above them); section titles in normal case */
.ts-wrap:has(#ts-details-body) .ts-section-header { text-transform: none !important; letter-spacing: 0 !important; font-size: .92rem !important; font-weight: 600 !important; }

/* ══ Phase 5 · Summaries, round 2 (2026-11-18, owner): Overview statistics box, quiet Needs attention; Structure flat ══ */
/* statistics: four tiles in one box, the other objects in its foot */
.ov-stats { margin: 4px 0 26px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); overflow: hidden; }
.ov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ov-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 16px; border-left: 1px solid var(--border-color); color: var(--text); text-decoration: none !important; min-width: 0; }
.ov-tile:first-child { border-left: 0; }
.ov-tile:hover { background: var(--hover); }
.ov-tile-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.ov-tile-value { font-size: 1.6rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text); }
.ov-tile-sub { font-size: .76rem; color: var(--text-muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; }
.ov-tile-sub b { color: var(--text-2); font-weight: 600; }
.ov-tile-sub .ov-warn-t, .ov-tile-sub .ov-warn-t b { color: var(--warn-strong); }
.ov-sep { color: var(--text-muted); }
.ov-objs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 9px 18px; border-top: 1px solid var(--border-color); font-size: .8rem; }
.ov-objs-label { color: var(--text-muted); font-size: .74rem; margin-right: 2px; }
.ov-obj { color: var(--text-2); text-decoration: none !important; }
.ov-obj b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.ov-obj:hover span { color: var(--vd-accent); }
.ov-obj.ov-zero, .ov-obj.ov-zero b { color: var(--text-muted); font-weight: 500; }
html:root[data-theme="light"] .ov-stats { background: var(--side); border-color: var(--cl-line, var(--hover)); box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05); }
html:root[data-theme="light"] :is(.ov-tile, .ov-objs) { border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .ov-tile-sub .ov-warn-t, html:root[data-theme="light"] .ov-tile-sub .ov-warn-t b { color: var(--warn-strong); }
@media (max-width: 900px) { .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-tile:nth-child(3) { border-left: 0; } .ov-tile:nth-child(n+3) { border-top: 1px solid var(--border-color); } }

/* Needs attention: one quiet box, a compact row per finding (colour only on its icon); nothing found: one line */
.ov-panel:has(#ov-attention) { margin-bottom: 22px !important; }
.ov-panel-title { font-size: 1rem !important; }
#ov-attention { border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); overflow: hidden; }
#ov-attention .ov-att { display: flex; align-items: center; gap: 12px; margin: 0 !important; padding: 9px 12px 9px 14px !important; border: 0 !important; border-top: 1px solid var(--border-color) !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; }
#ov-attention .ov-att:first-child { border-top: 0 !important; }
#ov-attention .ov-att-icon { font-size: .95rem !important; margin: 0 !important; }
#ov-attention .ov-att-warn .ov-att-icon { color: var(--warn-strong) !important; }
#ov-attention .ov-att-error .ov-att-icon { color: var(--c-err) !important; }
#ov-attention .ov-att-info .ov-att-icon { color: var(--info-strong) !important; }
#ov-attention .ov-att-ok .ov-att-icon { color: var(--ok-strong) !important; }
#ov-attention .ov-att-text { font-size: .82rem !important; color: var(--text) !important; font-weight: 400 !important; }
#ov-attention .ov-att-ok .ov-att-text { color: var(--text-muted) !important; }
#ov-attention .ov-chips { margin-top: 4px; gap: 4px; }
#ov-attention .ov-att-btn { margin-left: auto; flex-shrink: 0; }
html:root[data-theme="light"] #ov-attention { background: var(--side); border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] #ov-attention .ov-att { border-top-color: var(--cl-line, var(--hover)) !important; }
html:root[data-theme="light"] #ov-attention .ov-att-warn .ov-att-icon { color: var(--c-err) !important; }
html:root[data-theme="light"] #ov-attention .ov-att-info .ov-att-icon { color: var(--info-strong) !important; }
html:root[data-theme="light"] #ov-attention .ov-att-ok .ov-att-icon { color: var(--c-ok) !important; }

/* Structure: the details box, each value right beside its name (two columns of pairs) */
.ts-structure.pg-flat .ts-section > .ts-info-grid { background: var(--side); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ts-structure .ts-info-row { display: flex !important; justify-content: flex-start !important; align-items: baseline; gap: 14px; padding: 8px 14px !important; border-bottom: 1px solid var(--cl-line, var(--border-color)); }
.ts-structure .ts-info-key { flex: 0 0 120px; color: var(--text-muted) !important; font-size: .78rem; }
.ts-structure .ts-info-val { text-align: left !important; color: var(--text) !important; font-size: .8rem; overflow-wrap: anywhere; }
.ts-structure .ts-info-row-full { grid-column: 1 / -1; }
html:root[data-theme="light"] .ts-structure.pg-flat .ts-section > .ts-info-grid { background: var(--side); border-color: var(--cl-line, var(--hover)); }
html:root[data-theme="light"] .ts-structure .ts-info-row { border-bottom-color: var(--cl-line, var(--hover)); }
/* the add / edit forms of the page keep their box */
.ts-structure.pg-flat .ts-section > .ts-editor-body { background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 10px; padding: 14px !important; margin-top: 10px; }
html:root[data-theme="light"] .ts-structure.pg-flat .ts-section > .ts-editor-body { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
.ts-idx-col-chip { padding: 1px 7px !important; }
/* each pair fills its cell (the old flex layout gave it 50 %); a value stays on one line */
.ts-structure .ts-info-grid > .ts-info-row { width: auto !important; flex: none !important; min-width: 0; }
.ts-structure .ts-info-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ts-structure .ts-info-row-full .ts-info-val { white-space: normal; }
/* Structure, round 3: "At a glance" like the Overview's statistics; boxes rounded all round, one border */
.ts-structure .ts-glance { margin: 0 0 26px; }
.ts-structure .ts-glance .ov-tile { cursor: default; }
.ts-structure .ts-glance .ov-tile:hover { background: none; }
.ts-structure .ts-glance .ov-tile-value { font-size: 1.45rem; }
.ts-glance-foot { color: var(--text-muted); font-size: .78rem; }
.ts-glance-foot b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-glance-comment { flex-basis: 100%; }
.ts-structure :is(.ts-suggestions-body, .ts-code-block) { border-radius: 10px !important; border: 1px solid var(--border-color) !important; }
.ts-structure .ts-code-block pre, .ts-structure .ts-code-block code { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; margin: 0 !important; }
.ts-structure .ts-create-section .ts-section-header .ts-btn-copy { margin-left: auto; }
html:root[data-theme="light"] .ts-structure :is(.ts-suggestions-body, .ts-code-block) { border-color: var(--cl-line, var(--hover)) !important; }
/* the open table in the tree: its highlight reaches the guide line (owner's values) */
.sbp-databases .sidebar-table-item.active { margin-left: -14px !important; padding-left: 22px !important; }

/* ══ Phase 5 · Data grid (2026-11-18, design-demos/03-grid.html) ══ */
/* the row buttons appear on the row under the pointer, the focused row and the ticked rows (always on touch screens) */
@media (hover: hover) {
  .td-table tbody tr .td-row-actions { opacity: 0; transition: opacity 120ms ease; }
  .td-table tbody tr:is(:hover, :focus-within, .ts-row-selected) .td-row-actions { opacity: 1; }
}
/* columns out of view: a fade at the right edge and how many */
.td-section { position: relative; }
.td-more-cols { position: absolute; top: 1px; right: 1px; bottom: 1px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 44px; border: 0; border-radius: 0 9px 9px 0; cursor: pointer;
  background: linear-gradient(90deg, transparent, var(--side) 55%); color: var(--vd-accent); font: inherit; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.td-more-cols[hidden] { display: none; }
.td-more-cols > span { padding: 3px 8px; border-radius: 6px; background: var(--prim-soft); }
html:root[data-theme="light"] .td-more-cols { background: linear-gradient(90deg, transparent, var(--side) 55%); color: var(--accent-text); }
html:root[data-theme="light"] .td-more-cols > span { background: var(--drk-soft); }
/* the header stays when the grid scrolls down */
.td-grid-wrap thead th { position: sticky; top: 0; z-index: 2; }
/* Row height: Comfortable / Compact */
.td-density { display: inline-flex; margin-left: 8px; }
.td-density > .ts-btn { border-radius: 0 !important; margin-left: -1px; height: 32px; }
.td-density > .ts-btn:first-child { border-radius: 8px 0 0 8px !important; margin-left: 0; }
.td-density > .ts-btn:last-child { border-radius: 0 8px 8px 0 !important; }
.td-density > .ts-btn.active { position: relative; z-index: 1; background: var(--prim-soft) !important; border-color: var(--vd-accent) !important; color: var(--text) !important; }
html:root[data-theme="light"] .td-density > .ts-btn.active { background: var(--side) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; }
/* a long table name in the page bar: shortened, the whole name on hover */
.td-wrap .ts-crumb-current, .ts-toolbar .ts-crumb-current { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.td-density > .ts-btn { width: 32px; padding: 0 !important; justify-content: center; }
/* Rows per page: room for its number (25, 100 …) beside the arrow */
[data-pagination-row] .cs-wrap { min-width: 70px !important; }
[data-pagination-row] .cs-wrap .acs-value { overflow: visible; text-overflow: clip; }
/* Data page (owner 2026-11-18): a page title instead of the bar — one breadcrumb (the header), one row of controls,
   paging under the grid */
.td-head { flex-shrink: 0; padding: 16px 20px 0; }
.td-head > .pg-head { margin-bottom: 14px !important; flex-wrap: nowrap; min-width: 0; }
.td-head .pg-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 1.3rem !important; }
.td-head .td-total-pill { flex-shrink: 0; }
.td-head .pg-head-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.td-head .td-search { width: 240px; }
.td-head .td-density { margin-left: 0; }
.td-wrap .td-body { padding-top: 0 !important; }
.td-pager { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-top: 1px solid var(--border-color); background: var(--bg); }
.td-pager .td-info { font-size: .78rem; color: var(--text-muted); }
.td-pager .td-paging { margin-left: auto; display: flex; align-items: center; gap: 10px; }
html:root[data-theme="light"] .td-pager { border-top-color: var(--cl-line, var(--hover)); background: var(--side); }
.td-head .pg-title { flex: 0 1 auto; min-width: 120px; }
.td-head .pg-head-acts { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
.td-head .td-search { flex: 0 1 240px; width: auto !important; min-width: 140px; }
@media (max-width: 1250px) { .td-head .td-lbl { display: none; } .td-head :is(#td-btn-export, [href*="test-data"]) { width: 32px; padding: 0 !important; justify-content: center; } }
[data-pagination-row] .cs-wrap .cs-btn { width: 100% !important; }
[data-pagination-row] .cs-wrap .acs-value { flex: 1 0 auto !important; min-width: 18px !important; width: auto !important; }
/* the list pages' title row: what to know (default collation …) small beside the counts */
.td-head .pg-head > .td-info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; color: var(--text-muted); margin-left: 4px; }
.td-head .pg-head-acts .rt-type-filter { display: inline-flex; }
@media (max-width: 1350px) { .td-head .pg-head > .td-info { display: none; } }
/* list pages: the title in the app's font (the code font only for a table's name on Data); the title keeps its room,
   and when the controls don't fit beside it they go to a line of their own */
.td-head .pg-title { font-family: inherit !important; }
.td-wrap:has(#td-grid) .td-head .pg-title { font-family: 'JetBrains Mono', Consolas, monospace !important; }
.td-head > .pg-head { flex-wrap: wrap !important; row-gap: 10px; }
.td-head .pg-title { flex-shrink: 0; max-width: 45%; }
.td-head .pg-head-acts { flex-wrap: wrap; row-gap: 6px; }
/* a choice group in the title row (Routines: All / Procedures / Functions) — the app's chosen look */
.td-head .rt-type-filter > .ts-btn { height: 32px; border-radius: 0 !important; margin-left: -1px; }
.td-head .rt-type-filter > .ts-btn:first-child { border-radius: 8px 0 0 8px !important; margin-left: 0; }
.td-head .rt-type-filter > .ts-btn:last-child { border-radius: 0 8px 8px 0 !important; }
.td-head .rt-type-filter > .ts-btn.active { position: relative; z-index: 1; background: var(--prim-soft) !important; border-color: var(--vd-accent) !important; color: var(--text) !important; }
html:root[data-theme="light"] .td-head .rt-type-filter > .ts-btn.active { background: var(--side) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; color: var(--text) !important; }
.td-head .pg-head-acts { flex: 0 1 auto !important; flex-wrap: nowrap !important; margin-left: auto !important; min-width: 0; }
.td-head .pg-title { min-width: 0 !important; }
.td-wrap:has(#td-grid) .td-head .pg-title { min-width: 120px !important; flex-shrink: 1; }
.td-head .td-search { flex: 1 1 240px !important; min-width: 150px !important; max-width: 280px; }

/* ══ List pages, version C (owner 2026-11-18, design-demos/24-list-variants.html) ══
   the facts under the title, aligned with its words (icon 38 px + gap 12 px); 20 px around; in dark the grid's box a
   shade lighter than the sidebar */
.td-head > .pg-head { margin-bottom: 4px !important; }
.td-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; margin: 0 0 14px 50px; font-size: .82rem; color: var(--text-muted); min-height: 1.2em; }
.td-lead > :is(.ts-flag-pill, .td-info) { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 0 !important;
  font-size: .82rem !important; font-weight: 500 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--text-2) !important; display: inline !important; margin: 0 !important; }
.td-lead > .td-info { color: var(--text-muted) !important; font-weight: 400 !important; }
.td-lead > :empty { display: none !important; }
.td-lead > :not(:empty) ~ :not(:empty)::before { content: '·'; margin: 0 8px; color: var(--text-muted); }
.td-lead > .vw-pill { color: var(--accent-text) !important; }
html:root[data-theme="light"] .td-lead > .vw-pill { color: var(--accent-text) !important; }
:root:not([data-theme="light"]) .td-wrap .td-grid-wrap { background: var(--sec-soft) !important; border-color: var(--sec-soft) !important; }
:root:not([data-theme="light"]) .td-wrap .td-grid-wrap thead th { background: var(--sec-soft) !important; }
/* Create ▾ */
.td-create-chev { font-size: .7rem; margin-left: 2px; }
.td-create .dropdown-item { display: flex; align-items: center; gap: 8px; }
.td-create .dropdown-item > .bi { width: 16px; color: var(--text-muted); }
/* owner 2026-11-18: the counts in the facts line are a badge (3 events · 2 enabled); the rest stays text */
.td-lead > .ts-flag-pill:not(.vw-pill) { display: inline-flex !important; align-items: center; padding: 1px 8px !important; border-radius: 4px !important; font-size: .7rem !important; font-weight: 700 !important; letter-spacing: .04em !important; text-transform: uppercase !important;
  color: var(--prim-strong) !important; background: var(--prim-soft) !important; }
html:root[data-theme="light"] .td-lead > .ts-flag-pill:not(.vw-pill) { color: var(--accent-text) !important; background: var(--acc-soft) !important; box-shadow: inset 0 0 0 1px var(--acc-line) !important; }
.td-lead > .ts-flag-pill:not(:empty) ~ :not(:empty)::before { content: ''; margin: 0 6px; }
/* a page's explanation (Events, Views …): an info notice in the approved colours, not a faint line */
.vw-hint { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px !important; margin: 0 0 14px !important; border-radius: 10px; font-size: .82rem; line-height: 1.5;
  color: var(--info-strong) !important; background: var(--info-soft) !important; border: 1px solid var(--info-line) !important; }
.vw-hint > .bi { flex-shrink: 0; margin-top: 2px; }
html:root[data-theme="light"] .vw-hint { color: var(--info-strong) !important; background: var(--info-soft) !important; border-color: var(--info-line) !important; }
.td-lead { gap: 6px 8px !important; }
.td-lead > :not(:empty) ~ :not(:empty)::before { content: none !important; margin: 0 !important; }
.td-lead > .td-info { margin-left: 4px !important; }
/* Events: the scheduler's state is a notice of the same shape as the page's explanation — ON green, OFF / DISABLED amber */
.ev-scheduler { gap: 10px !important; padding: 10px 14px !important; margin: 0 0 10px !important; border-radius: 10px !important; font-size: .82rem !important; line-height: 1.5; align-items: center !important; }
.ev-scheduler > .bi { font-size: .95rem !important; align-self: flex-start; margin-top: 2px; }
.ev-scheduler > span { flex: 1; min-width: 0; }
.ev-scheduler-on { color: var(--ok-strong) !important; background: var(--ok-soft) !important; border: 1px solid var(--ok-line) !important; }
.ev-scheduler-off { color: var(--warn-strong) !important; background: var(--warn-soft) !important; border: 1px solid var(--warn-line) !important; }
.ev-scheduler-on > .bi { color: var(--ok-strong) !important; } .ev-scheduler-off > .bi { color: var(--warn-strong) !important; }
.ev-scheduler strong { color: inherit; }
.ev-scheduler code { color: inherit; background: var(--sec-soft); padding: 0 4px; border-radius: 4px; }
html:root[data-theme="light"] .ev-scheduler-on { color: var(--ok-strong) !important; background: var(--ok-soft) !important; border-color: var(--ok-line) !important; }
html:root[data-theme="light"] .ev-scheduler-off { color: var(--warn-strong) !important; background: var(--warn-soft) !important; border-color: var(--warn-line) !important; }
html:root[data-theme="light"] .ev-scheduler-on > .bi { color: var(--c-ok) !important; } html:root[data-theme="light"] .ev-scheduler-off > .bi { color: var(--c-err) !important; }
html:root[data-theme="light"] .ev-scheduler .ts-btn { background: var(--side) !important; border-color: currentColor !important; color: inherit !important; }
/* a notice's text flows as one paragraph (its bold words and code stay inline); the icon sits in front of it */
.vw-hint { display: block !important; position: relative; padding-left: 38px !important; }
.vw-hint > .bi:first-child { position: absolute; left: 14px; top: 12px; margin: 0 !important; }
.vw-hint code { color: inherit; background: var(--sec-soft); padding: 0 4px; border-radius: 4px; }
.td-head .pg-head-acts :is(.ts-check, .cn-check) { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .8rem; color: var(--text-2); margin: 0 4px; }
.vw-hint[hidden] { display: none !important; }
.vw-hint.d-none { display: none !important; }

/* ══ Number cards everywhere → the Overview's statistics box (owner 2026-11-18): one box, 1 px lines between the tiles,
      the label above a bigger number, no coloured icon tiles ══ */
.sv-kpis { gap: 1px !important; background: var(--border-color) !important; border: 1px solid var(--border-color) !important; border-radius: 10px !important; overflow: hidden; margin-bottom: 22px !important; }
.sv-kpi { border: 0 !important; border-radius: 0 !important; background: var(--side) !important; padding: 14px 18px 16px !important; box-shadow: none !important; }
.sv-kpi .sv-kpi-icon { display: none !important; }
.sv-kpi > div:last-child { display: flex; flex-direction: column-reverse; gap: 4px; }
.sv-kpi .sv-kpi-label { margin: 0 !important; font-size: .7rem !important; font-weight: 700; letter-spacing: .06em !important; color: var(--text-muted) !important; }
.sv-kpi .sv-kpi-value { font-size: 1.45rem !important; font-weight: 700 !important; color: var(--text) !important; letter-spacing: -.01em; }
.sv-kpi .sv-kpi-value.sv-kpi-text { font-size: 1rem !important; }
html:root[data-theme="light"] .sv-kpis { background: var(--hover) !important; border-color: var(--cl-line, var(--hover)) !important; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05); }
html:root[data-theme="light"] .sv-kpi { background: var(--side) !important; }
/* a list page's line under the title: gone when it has nothing to say (Server → Databases: same gap as the others) */
.td-lead:not(:has(> :not(:empty))) { display: none !important; }
.td-head:not(:has(.td-lead:has(> :not(:empty)))) > .pg-head { margin-bottom: 18px !important; }
/* Organization pages: a part's box rounded all round (its title line may be gone, as on Own templates); 18 px under the page title */
.og-flat .og-sec > .og-body:first-child { border-radius: 10px !important; border: 1px solid var(--border-color) !important; }
html:root[data-theme="light"] .og-flat .og-sec > .og-body:first-child { border-color: var(--cl-line, var(--hover)) !important; }
.og-flat .pg-head + #og-page { margin-top: 18px; }
/* one gap under a page head everywhere: the content starts 14 px after the title row (or after the line under it);
   the body adds no padding of its own on top */
.td-head + .ts-body, .td-head ~ .ts-body { padding-top: 0 !important; }
.td-head > .pg-head { margin-bottom: 14px !important; }
.td-head > .pg-head:has(+ .td-lead:has(> :not(:empty))) { margin-bottom: 4px !important; }
.td-head:not(:has(.td-lead:has(> :not(:empty)))) > .pg-head { margin-bottom: 14px !important; }
.td-lead { margin-bottom: 14px !important; }
/* the box clips what is inside (a table's square header must not show over its rounded corners) */
.og-flat .og-sec > .og-body { overflow: hidden !important; }
.og-flat .og-sec > .og-body > .ts-table-wrap { border: 0 !important; border-radius: 0 !important; margin: 0 !important; }

/* ══ Table pages, round 2 (19c) ══ */
/* a flat page's section whose content is a form gets its box back: title above, box below; its note is the box's foot */
.pg-flat .ts-section:not(.xp-summary-card) > .ts-editor-body.pg-box { background: var(--side) !important; border: 1px solid var(--border-color) !important; border-radius: 10px; padding: 14px !important; }
html:root[data-theme="light"] .pg-flat .ts-section:not(.xp-summary-card) > .ts-editor-body.pg-box { background: var(--side) !important; border-color: var(--cl-line, var(--hover)) !important; }
.pg-box > :is(.pg-box-note, .sb-where-note) { margin: 14px -14px -14px !important; padding: 9px 14px !important; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: .8rem; }
html:root[data-theme="light"] .pg-box > :is(.pg-box-note, .sb-where-note) { border-top-color: var(--cl-line, var(--hover)); }
.pg-box > .pg-box-note > .bi { margin-right: 6px; }
/* Suggestions: no box around the list, each suggestion is its own card; the side colour is soft */
.pg-flat .ag-list { padding: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; }
.pg-flat .ag-card, .pg-flat .ag-empty { background: var(--side) !important; border: 1px solid var(--border-color); border-radius: 10px; }
html:root[data-theme="light"] .pg-flat :is(.ag-card, .ag-empty) { background: var(--side) !important; border-color: var(--cl-line, var(--hover)); }
.pg-flat .ag-card { border-left-width: 3px !important; }
.pg-flat .ag-card.ag-sev-high { border-left-color: var(--err-line) !important; }
.pg-flat .ag-card.ag-sev-medium { border-left-color: var(--warn-line) !important; }
.pg-flat .ag-card.ag-sev-low { border-left-color: var(--prim-line) !important; }
/* switches (File | Paste, Server | db | table …): one "on" look everywhere, the same as the list pages' density buttons */
.ts-wrap .ev-kind:not(.sb-kind) > .ts-btn.active:not(.perm-off) { position: relative; z-index: 1; background: var(--prim-soft) !important; border-color: var(--vd-accent) !important; color: var(--text) !important; }
html:root[data-theme="light"] .ts-wrap .ev-kind:not(.sb-kind) > .ts-btn.active:not(.perm-off) { background: var(--side) !important; border-color: var(--cl-line, var(--drk-soft)) !important; box-shadow: inset 0 -2px 0 var(--vd-accent) !important; color: var(--text) !important; }
.xp-summary[hidden] { display: none !important; }
/* a notice under a table or box in the same section keeps a gap to it */
.ts-section > * + .vw-hint { margin-top: 12px !important; }
/* page title facts: a hidden badge stays hidden; Template editor "not saved" is a warning */
.td-lead > [hidden], .td-lead > .d-none, .td-lead > .ts-flag-pill:is([hidden], .d-none):not(.vw-pill) { display: none !important; }
.td-lead > .ts-flag-pill.te-dirty { color: var(--warn-strong) !important; background: var(--warn-soft) !important; box-shadow: inset 0 0 0 1px var(--warn-line) !important; }
html:root[data-theme="light"] .td-lead > .ts-flag-pill.te-dirty { color: var(--warn-strong) !important; background: var(--warn-soft) !important; box-shadow: inset 0 0 0 1px #fcd57a !important; }
/* Template editor: a wide table scrolls inside its box instead of being cut off */
.te-wrap.og-flat .og-sec > .og-body { overflow-x: auto !important; }
.te-grid { grid-template-columns: 200px minmax(0, 1fr) !important; }
@media (max-width: 1100px) { .te-grid { grid-template-columns: 1fr !important; } }

/* ══ Planner — first screen (no plans yet): three ways to start and a sketch (design-demos/14-planner) ══ */
.pl-first { display: grid; grid-template-columns: 1fr 1.1fr; gap: 26px; align-items: center; padding: 28px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--side); }
html:root[data-theme="light"] .pl-first { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.pl-first h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.pl-first p { margin: 0 0 16px; color: var(--text-2); font-size: .875rem; max-width: 52ch; line-height: 1.55; }
.pl-starts { display: flex; flex-direction: column; gap: 8px; }
.pl-start { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg); cursor: pointer; text-align: left; color: var(--text); font: inherit; transition: border-color 140ms ease, background-color 140ms ease; }
.pl-start:hover, .pl-start:focus-visible { border-color: var(--n-line); background: var(--hover); }
.pl-start:active { transform: scale(.99); }
.pl-start > .bi:first-child { font-size: 1.25rem; color: var(--page-c, var(--vd-accent)); }
.pl-start b { display: block; font-size: .875rem; }
.pl-start span span { font-size: .78rem; color: var(--text-muted); }
.pl-start-go { margin-left: auto; color: var(--text-muted); }
.pl-sketch { position: relative; height: 260px; border-radius: 10px; background: radial-gradient(circle, var(--sec-soft) 1px, transparent 1px) 0 0 / 18px 18px, var(--bg); border: 1px dashed var(--border-color); overflow: hidden; }
.pl-sketch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pl-sketch path { stroke: var(--sec-line); fill: none; stroke-width: 1.5; }
.pl-sk-blk { position: absolute; padding: 8px 12px; border-radius: 10px; background: var(--side); border: 1px solid var(--border-color); border-left: 4px solid var(--g, var(--text-muted)); font: 700 .8rem var(--font-mono, monospace); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
html:root[data-theme="light"] .pl-sk-blk { background: var(--side); box-shadow: 0 4px 12px rgba(15,23,42,.08); }
.pl-sk-blk small { display: block; font-family: var(--font-sans, inherit); font-weight: 400; font-size: .72rem; color: var(--text-muted); }
@media (max-width: 900px) { .pl-first { grid-template-columns: 1fr; } }
/* the line under the title counts only what is shown (a hidden "draft saved" badge leaves no empty line) */
.td-lead:not(:has(> :not(:empty):not([hidden]):not(.d-none))) { display: none !important; }
.td-head:has(> .td-lead:not(:has(> :not(:empty):not([hidden]):not(.d-none)))) > .pg-head { margin-bottom: 14px !important; }

/* ══ States & motion (design-demos/07-states): move only when something changes ══ */
/* status dot: still when ready, no glow; it moves only while working */
.status-dot.status-ready, .status-dot.status-error, .status-dot.status-warning, .status-dot.status-success, .status-dot.status-loading { box-shadow: none !important; }
/* a found / new thing: an accent ring and a real shadow, no coloured glow */
@keyframes ui-flash {
  0%, 30% { box-shadow: 0 0 0 2px var(--vd-accent), 0 6px 16px rgba(0,0,0,.18); }
  100% { box-shadow: 0 0 0 2px transparent, 0 6px 16px transparent; }
}
.pf-flash { box-shadow: 0 0 0 1px var(--vd-accent), 0 1px 2px rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.18) !important; }
html:root[data-theme="light"] .pf-flash { box-shadow: 0 0 0 1px var(--vd-accent), 0 1px 2px rgba(15,23,42,.08), 0 6px 16px rgba(15,23,42,.08) !important; }
/* loading rows: their shape, a slow shimmer */
.ui-sk { display: block; height: 9px; width: 70%; border-radius: 4px; background: linear-gradient(90deg, var(--n-mid) 0, var(--n-line) 50%, var(--n-mid) 100%); background-size: 200% 100%; animation: ui-sk 1.4s ease-in-out infinite; }
td:nth-child(2n) > .ui-sk { width: 45%; } td:nth-child(3n) > .ui-sk { width: 85%; }
.td-skeleton { width: 100%; } .td-skeleton td { height: 38px; padding: 0 14px; border-bottom: 1px solid var(--border-color); }
@keyframes ui-sk { to { background-position: -200% 0; } }
/* a row just saved or added: green that fades in 1.4 s */
@property --td-saved { syntax: '<color>'; inherits: false; initial-value: transparent; }
.td-row-saved > td { background-image: linear-gradient(var(--td-saved), var(--td-saved)) !important; animation: td-row-saved 1.4s cubic-bezier(.23, 1, .32, 1); }
@keyframes td-row-saved { from { --td-saved: var(--ok-mid); } to { --td-saved: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .ui-sk, .status-dot.status-loading, .td-row-saved > td, .sv-live .bi, .do-busy .bi { animation: none !important; }
}

/* ══ Phone (below 768 px, 2026-11-22): the header always on top — the logo (☰) opens the whole sidebar (the rail and
      its panel) as a drawer; no bar at the bottom; the page scrolls as one document (no small scroll boxes inside it),
      a pull at the top doesn't reload; inputs at 16 px so iOS doesn't zoom (core/SidebarMode.js body.sb-phone) ══ */
.sbr-more { display: none !important; }
@media (max-width: 767.98px) {
  html { height: auto; overscroll-behavior-y: none; }
  body { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: visible; overscroll-behavior-y: none; }
  * { -webkit-tap-highlight-color: transparent; }
  /* the page is the document: every box above it grows with it */
  #app-shell { height: auto !important; min-height: 100dvh; width: 100% !important; display: block !important; }
  #main-area { display: block !important; overflow: visible !important; min-height: 0 !important; }
  #main-content { display: flex !important; flex-direction: column; min-height: calc(100dvh - var(--app-header-h)); width: 100% !important; min-width: 0 !important; overflow: visible !important; }
  #content { flex: 1 0 auto !important; height: auto !important; overflow: visible !important; }
  /* the page's own wrappers grow with their content too (on a wide screen they fill the window and scroll inside) */
  #content > *:not(.vd-page):not(.pl-page) { height: auto !important; max-height: none !important; overflow: visible !important; }
  .ts-wrap { height: auto !important; overflow: visible !important; }
  .ts-body { flex: none !important; min-height: 0 !important; overflow: visible !important; }
  /* a box the page scrolls inside on a wide screen grows with its content (core/PhoneFit.js) */
  #content .ph-grow { height: auto !important; max-height: none !important; overflow-y: visible !important; flex-basis: auto !important; }
  #content .ph-one-col { grid-template-columns: minmax(0, 1fr) !important; }
  #content .ph-one-col > * { grid-column: auto !important; min-width: 0; }
  /* a short page still fills the screen in its own colour */
  #content { display: flex !important; flex-direction: column; }
  #content > * { flex: 1 0 auto !important; }
  /* the header: fixed on top; the page's tab bar sticks under it */
  #main-header { position: fixed !important; top: 0; left: 0; right: 0; z-index: 2690; }   /* under dialogs (2701) */
  #main-area { padding-top: var(--app-header-h); }
  #tabs-manager { position: sticky; top: var(--app-header-h); z-index: 2500; background: var(--bg-dark); }
  /* the drawer: the rail and its panel side by side, from the left, on an iOS-like curve */
  #sb-rail { position: fixed !important; left: 0 !important; right: auto !important; top: var(--app-header-h) !important; bottom: 0 !important; height: auto !important;
    z-index: 2680; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    transform: translateX(-100%) !important; transition: transform 280ms cubic-bezier(.32, .72, 0, 1) !important; }
  body.sb-phone #main-sidebar { position: fixed !important; top: var(--app-header-h) !important; bottom: 0 !important; left: var(--rail-w, 64px) !important; right: auto !important;
    width: min(calc(100vw - var(--rail-w, 64px) - 28px), 320px) !important; height: auto !important; z-index: 2670; overscroll-behavior: contain;
    transform: translateX(calc(-100% - var(--rail-w, 64px))) !important; transition: transform 280ms cubic-bezier(.32, .72, 0, 1), box-shadow 280ms ease !important; }
  /* --sb-swipe: how far a finger has pulled the open drawer to the left (js/helpers/swipe.js); 0 otherwise */
  body.sb-phone.sb-open #sb-rail, body.sb-phone.sb-open #main-sidebar { transform: translateX(var(--sb-swipe, 0px)) !important; touch-action: pan-y; }
  /* the scroll boxes inside it too (the browser asks the nearest one): sideways is the swipe, up and down still scroll */
  body.sb-phone.sb-open :is(#sb-rail, #main-sidebar) :not(.ds-handle, .ds-handle *) { touch-action: pan-y; }
  body.sb-phone.sw-drag #sb-rail, body.sb-phone.sw-drag #main-sidebar { transition: none !important; }
  body.sb-phone.sw-anim #sb-rail, body.sb-phone.sw-anim #main-sidebar { transition: transform 220ms cubic-bezier(.32, .72, 0, 1) !important; }
  body.sb-phone.sb-open #main-sidebar { box-shadow: 8px 0 30px rgba(0, 0, 0, .35); }
  body.sb-phone.sb-open::after { z-index: 2660 !important; pointer-events: auto !important; }
  body.sb-phone.sb-open { overflow: hidden; }
  #sb-rail .sbr-fold { display: none !important; }
  /* the logo opens the drawer: ☰ beside the mark */
  #main-header .app-brand { cursor: pointer; }
  #main-header .app-brand::after { content: '\F479'; font-family: bootstrap-icons; font-size: 1.25rem; line-height: 1; margin-left: 6px; color: var(--text-muted); }
  body.sb-phone.sb-open #main-header .app-brand::after { content: '\F659'; }
  .ts-wrap, .ts-body { padding-left: 12px !important; padding-right: 12px !important; }
  .td-lead { margin-left: 0 !important; }
  .pg-head { flex-wrap: wrap; row-gap: 8px; }
  .pg-head-acts { flex-wrap: wrap; }
  #app-status-bar :is(.status-bar-center, .status-bar-right) { display: none !important; }
  /* inputs at 16 px: iOS zooms the page into any smaller field */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea, .ts-editor-input { font-size: 16px !important; }
  /* a box that scrolls sideways lets an up / down swipe go on to the page */
  .ts-table-wrap, .sbp-scroll { overscroll-behavior-x: contain; overscroll-behavior-y: auto; }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) { #sb-rail, body.sb-phone #main-sidebar { transition: none !important; } }
/* touch screens: buttons that show on hover are always there; 44 px targets for row buttons */
@media (hover: none) {
  .td-row-actions, .td-row-actions .ts-icon-btn { opacity: 1 !important; visibility: visible !important; }
}
@media (max-width: 767.98px) {
  /* header: the mark, where you are (the last crumb), search and the account */
  #main-header .app-name, #main-header .app-version { display: none !important; }
  #main-header .app-brand { width: auto !important; padding-right: 8px !important; margin-right: 8px !important; }
  #main-header .breadcrumb { flex-wrap: nowrap; min-width: 0; overflow: hidden; }
  #main-header .breadcrumb > li:not(:last-child) { display: none !important; }
  #main-header .breadcrumb > li:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 0 !important; }
  #main-header .breadcrumb > li:last-child::before { display: none !important; }
  #main-header #auth-account { margin-right: 8px !important; }
  /* a title row's controls: their own full row, a search takes what is left */
  .td-head .pg-head-acts { flex-basis: 100%; margin-left: 0 !important; justify-content: flex-start; }
  .td-head .pg-head-acts :is(.sbp-search, .td-search, .ts-search) { flex: 1 1 160px; min-width: 0; }
}
@media (max-width: 767.98px) { .td-head .pg-head-acts { flex-wrap: wrap !important; row-gap: 8px !important; } .td-head .pg-head-acts > * { flex-shrink: 0; } .td-head .pg-head-acts > :is(.sbp-search, .td-search) { flex: 1 1 100% !important; } }

/* ══ Visual Designer → Objects: a tree — a group with its tables under it; one icon size, the counts in one column ══ */
.vd-obj-sec > :is(b, small) { margin-left: auto !important; min-width: 0 !important; padding: 0 !important; background: none !important; border-radius: 0 !important; color: var(--text-muted) !important; font-size: .66rem !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.vd-obj-sec { padding-right: 8px !important; }
.vd-obj-sec > .bi, .vd-obj > .bi { font-size: .8rem !important; width: 14px; text-align: center; }
.vd-obj-gh { display: flex; align-items: center; }
.vd-obj-tw { flex-shrink: 0; width: 18px; height: 27px; padding: 0; border: 0; background: none; color: var(--text-muted); font-size: .66rem; cursor: pointer; border-radius: 4px; }
.vd-obj-tw:hover { color: var(--text); background: var(--hover); }
.vd-obj-gh > .vd-obj { padding-left: 4px !important; }
.vd-obj-gr .vd-obj-nm { font-family: inherit !important; font-weight: 600; color: var(--text); }
.vd-obj-kids { margin-left: 15px; padding-left: 6px; border-left: 2px solid var(--grp-line); }
.vd-obj-g + .vd-obj-g { margin-top: 2px; }
/* Changes: its count on the corner like Suggestions (not after the icon) */
:is(#vd-toolbar, .vd-tools) #vd-changes-btn { position: relative; }
:is(#vd-toolbar, .vd-tools) #vd-changes-btn .vd-tool-badge { position: absolute !important; top: -4px !important; right: -5px !important; margin-left: 0 !important; }
.vd-tools-2col #vd-changes-btn .vd-tool-badge { top: -5px !important; right: -6px !important; }

/* ══ Fill test data: "Rows to add" (and the database page's "Size") in a box; the columns' settings line up ══ */
.pg-flat .tdg-top { background: var(--side); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px; align-items: center !important; margin-bottom: 18px !important; }
html:root[data-theme="light"] .pg-flat .tdg-top { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* every control starts on the row's first line; a setting's name sits left of its field, From above To */
.tdg-cols td { vertical-align: top !important; padding-top: 10px !important; padding-bottom: 10px !important; }
.tdg-params { white-space: normal !important; min-width: 250px; }
.tdg-param { display: grid !important; grid-template-columns: 58px minmax(0, 190px); align-items: center; gap: 8px; margin: 0 !important; }
.tdg-param + .tdg-param { margin-top: 6px !important; }
.tdg-param > span { font-size: .72rem !important; color: var(--text-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdg-param :is(.ts-editor-input, .dti, .dt-has-icon) { width: 100% !important; min-width: 0; }
.tdg-param > :not(span):not([type="hidden"]) { min-width: 0; }
/* a notice after something has a gap to it (create dialogs and edit pages too); one without its own icon gets the info icon */
:not(.vw-hint) + .vw-hint { margin-top: 12px !important; }
.vw-hint:not(:has(> .bi:first-child))::before { content: "\f431"; font-family: "bootstrap-icons"; position: absolute; left: 14px; top: 10px; line-height: 1.5; font-size: .9em; }
/* a short note inside a line (a span) is plain muted text, not a box */
span.vw-hint { display: inline !important; padding: 0 !important; margin: 0 !important; background: none !important; border: 0 !important; color: var(--text-muted) !important; font-size: .78rem; }
span.vw-hint::before { content: none !important; }
html:root[data-theme="light"] span.vw-hint { background: none !important; color: var(--text-muted) !important; }
/* the trigger / routine guided editor: "Add a step…" keeps its gap below the steps (also as the styled dropdown) */
.st-list + * { margin-top: 10px !important; }
.st-list:empty + * { margin-top: 0 !important; }
/* Export: every table in the list (the flat page's box had cut the scrolling list off) */
.xp-tables { max-height: none !important; overflow: visible !important; }
.pg-flat .ts-section > .ts-table-wrap.xp-tables { overflow: hidden !important; }
/* Database settings: the tables and the bar that converts them are one box */
.pg-flat .ts-section > .ts-table-wrap:has(+ .ds-convert-bar) { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; border-bottom: 0 !important; }
.pg-flat .ts-section > .ds-convert-bar { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; margin-top: 0 !important; }
/* Performance: the tables list keeps its colour on the left, softer (like Suggestions) */
.pf-tile { border-left-color: var(--t-line) !important; }
.pf-tile:hover, .pf-tile.on, .pf-tile[aria-current], .pf-tile.pf-on { border-left-color: var(--t) !important; }
.td-lead > .ts-flag-pill { gap: .35em; }
/* Database Wizard: every step starts below the step bar with a gap; the database form is a box */
#wz-body.wz-body { padding-top: 18px !important; }
#wz-body > .wz-form { background: var(--side); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; }
html:root[data-theme="light"] #wz-body > .wz-form { background: var(--side); border-color: var(--cl-line, var(--hover)); }
/* Template editor: the title sits above its box, so the box is closed and rounded all round */
.te-wrap.og-flat .og-sec > .ts-section-header + .og-body { border: 1px solid var(--border-color) !important; border-radius: 10px !important; }
html:root[data-theme="light"] .te-wrap.og-flat .og-sec > .ts-section-header + .og-body { border-color: var(--cl-line, var(--hover)) !important; }
/* Scheduled backups → where they go: a place stays inside its column (long names end in …, the row may wrap) */
.bs-dnd > .bs-dnd-col { min-width: 0; }
.bs-drop { min-width: 0; overflow: hidden; }
.bs-place-row { flex-wrap: wrap !important; white-space: normal !important; min-width: 0; max-width: 100%; box-sizing: border-box; row-gap: 4px; }
.bs-place-row > b { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.bs-place-row.dragging, .bs-place-row[aria-grabbed="true"] { max-width: 100%; }
.bs-dnd { grid-template-columns: minmax(0, 1fr) !important; }
/* Database servers: "Shared: …" under a MySQL login is a small warning notice, not loose text */
.sv-warn { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px !important; padding: 6px 10px; border-radius: 8px; font-size: .76rem; line-height: 1.45;
  color: var(--warn-strong) !important; background: var(--warn-soft); border: 1px solid var(--warn-line); }
.sv-warn > .bi { flex-shrink: 0; margin-top: 2px; }
html:root[data-theme="light"] .sv-warn { color: var(--warn-strong) !important; background: var(--warn-soft); border-color: var(--warn-line); }
/* a part jumped to (My account, Organization …): on a flat page the box under the title lights up, with its own round corners */
:is(.pg-flat, .og-flat) .pf-flash { box-shadow: none !important; }
:is(.pg-flat, .og-flat) .pf-flash > :is(.og-body, .ts-editor-body, .bk-card-body, .ts-table-wrap, .ts-section-body) { box-shadow: 0 0 0 2px var(--vd-accent), 0 6px 16px rgba(0,0,0,.18) !important; transition: box-shadow .3s ease; }
/* the flash follows the box: a section whose header and body carry the round corners gets them too */
.ts-section.pf-flash { border-radius: 8px; }
/* Platform admin → Finance: one rhythm on top of the page's 12 px gap — 12 px inside the numbers (period bar, both rows
   of cards), 26 px between sections */
.pa-body:has(> .fi-key) > :is(.pa-stats-bar, .pa-tiles, .fi-part, .fi-charts) { margin-top: 0 !important; margin-bottom: 0 !important; }
.pa-body:has(> .fi-key) > .pa-tiles { gap: 12px !important; }
.pa-body:has(> .fi-key) > .pa-tiles:not(:has(+ .pa-tiles)), .pa-body:has(> .fi-key) > :is(.fi-part, .fi-charts):not(:last-child) { margin-bottom: 14px !important; }
.pa-body:has(> .fi-key) > .pg-lead { margin-bottom: 2px !important; }
.fi-charts > .fi-part { margin-bottom: 0 !important; }
/* Platform admin → Audit log filters: a fixed grid — who and what, then text and time, then the buttons */
form.pa-afilter[data-pa-audit] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px 12px !important; padding: 14px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); margin-bottom: 26px; }
html:root[data-theme="light"] form.pa-afilter[data-pa-audit] { background: var(--side); border-color: var(--cl-line, var(--hover)); }
form.pa-afilter[data-pa-audit] > label:nth-of-type(5) { grid-column: span 2; }
form.pa-afilter[data-pa-audit] > .pa-afilter-btns { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding-top: 4px; }
form.pa-afilter[data-pa-audit] > .pa-afilter-btns > [data-pa-last="1"] { margin-left: auto; }
form.pa-afilter[data-pa-audit] > .pa-afilter-btns > [data-pa-aclear] { order: 1; }
form.pa-afilter[data-pa-audit] > .pa-afilter-btns > [data-pa-last] { order: 2; }
@media (max-width: 900px) { form.pa-afilter[data-pa-audit] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ══ Help: articles without a box, their titles in the accent colour; the one picked in the sidebar gets the box ══ */
.hm-hp-art { background: none !important; border: 1px solid transparent !important; box-shadow: none !important; padding: 12px 18px !important; margin-bottom: 6px !important; }
.hm-hp-art h3 { color: var(--text) !important; }
.hm-hp-art :is(p, li) { color: var(--text-muted) !important; }
.hm-hp-art.hm-hp-art-on :is(p, li) { color: var(--text) !important; }
.hm-hp-art-guide { border-left: 3px solid var(--ok-line) !important; border-radius: 0 !important; }
.hm-hp-art.hm-hp-art-on { background: var(--side) !important; border-color: var(--prim-line) !important; border-radius: 10px !important; }
html:root[data-theme="light"] .hm-hp-art.hm-hp-art-on { background: var(--side) !important; border-color: var(--acc-line) !important; }
/* Objects tree: the top branches (Groups, Other tables, Views, Routines) fold too; their line is neutral */
.vd-obj-top { --grp: var(--text-muted); --grp-soft: var(--sec-soft); --grp-line: var(--sec-line); --grp-strong: var(--sec-strong); }
.vd-obj-top > .vd-obj-gh > .vd-obj-sec { flex: 1; min-width: 0; padding: 6px 8px 6px 4px !important; }
.vd-obj-top > .vd-obj-kids { border-left-color: var(--n-line); }
.vd-obj-top + .vd-obj-top { margin-top: 4px; }
.vd-obj-kids > .vd-obj-g { margin-left: -4px; }
/* a notice that warns: the approved amber (info stays teal) */
.vw-hint.vw-hint-warn { color: var(--warn-strong) !important; background: var(--warn-soft) !important; border-color: var(--warn-line) !important; }
html:root[data-theme="light"] .vw-hint.vw-hint-warn { color: var(--warn-strong) !important; background: var(--warn-soft) !important; border-color: var(--warn-line) !important; }
.vw-hint + .vw-hint { margin-top: 8px !important; }
/* the trigger's sentence ("Choose the table…", "Runs BEFORE …") is an info notice in the approved teal */
.tg-sentence { position: relative; padding: 10px 14px 10px 38px !important; margin-top: 12px; border-radius: 10px !important; font-size: .82rem !important; line-height: 1.5;
  color: var(--info-strong) !important; background: var(--info-soft) !important; border: 1px solid var(--info-line) !important; }
.tg-sentence > .bi:first-child { position: absolute; left: 14px; top: 12px; }
.tg-sentence b { color: inherit !important; }
html:root[data-theme="light"] .tg-sentence { color: var(--info-strong) !important; background: var(--info-soft) !important; border-color: var(--info-line) !important; }
/* guided steps: "Add a step…" (the styled dropdown after the hidden select) keeps its gap; the step's colour on the left is soft */
.st-list + .cs-native + .cs-wrap, .st-list + select.st-add + .cs-wrap { margin-top: 10px !important; }
.st-list:empty + .cs-native + .cs-wrap { margin-top: 0 !important; }
.st-step { border-left-color: var(--st-color-line, var(--prim-line)) !important; }
/* flat pages: a table's box scrolls (it still clips its corners) — a list with a height limit never hides rows */
.pg-flat .ts-section > .ts-table-wrap, .pg-flat .ts-section > :is(.ts-editor-body, .bk-card-body) > .ts-table-wrap { overflow: auto !important; }
/* Database settings: every table in the list */
.ds-table-wrap { max-height: none !important; }
/* Database servers: a MySQL login several members use — a small amber badge beside them, the reason in its tooltip */
.sv-shared { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 7px; border-radius: 4px; font-size: .7rem; font-weight: 600; vertical-align: middle; cursor: help;
  color: var(--warn-strong); background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); }
html:root[data-theme="light"] .sv-shared { color: var(--warn-strong); background: var(--warn-soft); box-shadow: inset 0 0 0 1px #fcd57a; }
/* Create a view / routine / trigger / event: a page (core/PageDialog.js) — the form in one box under the title */
.pd-wrap .pd-body { background: var(--side); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px; }
html:root[data-theme="light"] .pd-wrap .pd-body { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.pd-wrap .td-lead .td-info .bi { margin-right: 4px; }
/* Database Wizard step 2 with an existing database: a section without a title is a whole box */
#wz-body > .ts-section > .ts-editor-body:first-child { border: 1px solid var(--border-color) !important; border-radius: 10px !important; background: var(--side) !important; padding: 12px 16px !important; }
html:root[data-theme="light"] #wz-body > .ts-section > .ts-editor-body:first-child { border-color: var(--cl-line, var(--hover)) !important; background: var(--side) !important; }
#wz-body > .ts-section:has(> .ts-editor-body:first-child) { border: 0 !important; background: none !important; box-shadow: none !important; }
/* Objects window: room for the branch names on one line */
.vd-objects { width: 250px !important; }
.vd-obj-sec > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ Phone (2026-11-22): every list is a table — the same everywhere (no cards on some pages): it scrolls sideways
      inside its box, the first column (the name) stays in place; the page scrolls up and down ══ */
@media (max-width: 767.98px) {
  #td-more-cols { display: none !important; }
  .td-wrap, .td-wrap > .td-body, .td-body > .td-section { flex: none !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .td-wrap > .td-body, .td-body > .td-section { display: block !important; }
  .td-grid-wrap { max-height: none !important; overflow-x: auto !important; overflow-y: hidden !important; overscroll-behavior-x: contain; }
  .td-grid-wrap thead th { position: static; }
  .td-grid-wrap .td-row-actions { opacity: 1 !important; visibility: visible !important; }
  .td-pager { position: static !important; flex-wrap: wrap; padding: 10px 12px !important; }
  /* the name column stays when the table scrolls sideways */
  .td-grid-wrap table tr > :is(th, td):first-child:not(.ts-td-check):not(.ts-th-check):not(.ts-empty-row),
  .td-grid-wrap table tr > :is(.ts-td-check, .ts-th-check) + :is(th, td) { position: sticky; left: 0; z-index: 1; background: var(--side) !important; box-shadow: 1px 0 0 var(--border-color); }
  html:root[data-theme="light"] .td-grid-wrap table tr > :is(th, td):first-child:not(.ts-td-check):not(.ts-th-check):not(.ts-empty-row),
  html:root[data-theme="light"] .td-grid-wrap table tr > :is(.ts-td-check, .ts-th-check) + :is(th, td) { background: var(--side) !important; }
}
/* the header rule that hides .acs-value under 1100 px is for the account switcher; a styled select always shows its value */
@media (max-width: 1100px) { .cs-wrap .cs-btn .acs-value { display: block !important; } }
@media (max-width: 767.98px) { :is(.pa-filter, .pa-stats-bar) .ev-kind { max-width: 100%; overflow-x: auto; scrollbar-width: none; } :is(.pa-filter, .pa-stats-bar) .ev-kind > .ts-btn { flex-shrink: 0; } }

/* ══ Accent colour (Home → Settings → Appearance → Accent; <html data-accent>, core/Theme.js; design-demos/10-system) ══
   Violet is the default (no attribute). The parts use the accent variables only: --vd-accent (fills, rings),
   --primary (lighter accent on dark), --accent-text (text), --acc-soft (soft fill), --acc-line (soft border). */
/* dark: every accent colour (Primary Base, Soft, Line, Strong per accent) is in css/app-colors.css, THE 48 COLOURS */
html:root[data-theme="light"] { --acc-soft: var(--prim-soft); --acc-line: var(--prim-line); }
html:root[data-theme="light"][data-accent="blue"] { --primary: var(--c-prim); --vd-accent: var(--c-prim); --vd-border-glow: var(--c-prim); --accent-text: var(--prim-strong); --accent-text-2: var(--prim-strong); --accent-text-3: var(--text-2); --accent-text-4: var(--c-prim); --acc-soft: var(--drk-soft); --acc-line: var(--prim-line); }
html:root[data-theme="light"][data-accent="turquoise"] { --primary: var(--c-info); --vd-accent: var(--c-info); --vd-border-glow: var(--c-info); --accent-text: var(--sec-strong); --accent-text-2: var(--sec-strong); --accent-text-3: var(--sec-strong); --accent-text-4: var(--c-info); --acc-soft: var(--info-soft); --acc-line: var(--info-line); }
/* with a turquoise accent, information notices turn neutral (Secondary) so the two never mix */
:root[data-accent="turquoise"] :is(.vw-hint:not(.vw-hint-warn), .tg-sentence) { color: var(--text-2) !important; background: var(--sec-soft) !important; border-color: var(--sec-line) !important; }
html:root[data-theme="light"][data-accent="turquoise"] :is(.vw-hint:not(.vw-hint-warn), .tg-sentence) { color: var(--prim-strong) !important; background: var(--drk-soft) !important; border-color: var(--prim-strong) !important; }
/* Settings → Appearance → Accent: a swatch per accent */
.hm-accent-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hm-accent-opt { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; font-size: .82rem; color: var(--text-2); }
.hm-accent-opt input { position: absolute; opacity: 0; pointer-events: none; }
.hm-accent-opt i { width: 16px; height: 16px; border-radius: 50%; background: var(--sw); }
.hm-accent-opt:has(input:checked) { border-color: var(--vd-accent); color: var(--text); box-shadow: inset 0 0 0 1px var(--vd-accent); }
.hm-accent-opt:has(input:focus-visible) { outline: 2px solid var(--vd-accent); outline-offset: 2px; }

/* ── Platform admin → Staff (admin_staff.js): people left, the picked one right; roles, manager switch, actions ── */
.sf-cols { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; }
@media (max-width: 960px) { .sf-cols { grid-template-columns: 1fr; } }
.sf-people { display: flex; flex-direction: column; gap: 8px; }
.sf-person { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; row-gap: 4px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.sf-person:hover { border-color: var(--n-line); }
.sf-person[aria-current="true"] { border-color: var(--vd-accent); box-shadow: inset 0 0 0 1px var(--vd-accent); }
.sf-person .sf-av { grid-row: span 2; }
.sf-av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--c); background: var(--c-soft); flex-shrink: 0; }
.sf-nm { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; min-width: 0; }
.sf-nm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-nm small { margin-left: auto; font-weight: 400; color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.sf-rl { display: flex; flex-wrap: wrap; gap: 4px; }
.sf-mgr { color: var(--vd-yellow); } .sf-own-ic { color: var(--warning); } .sf-warn-ic { color: var(--alert); }
.sf-rchip { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 4px; font-weight: 600; font-size: 11px; line-height: 18px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-strong); background: var(--c-soft); }
.sf-r-admin { --c: var(--vd-red); --c-soft: var(--err-soft); --c-line: var(--err-line); --c-strong: var(--err-strong); } .sf-r-finance { --c: var(--vd-green); --c-soft: var(--ok-soft); --c-line: var(--ok-line); --c-strong: var(--ok-strong); } .sf-r-tech { --c: var(--vd-cyan); --c-soft: var(--info-soft); --c-line: var(--info-line); --c-strong: var(--info-strong); }
.sf-r-privacy { --c: var(--warning); --c-soft: var(--warn-soft); --c-line: var(--warn-line); --c-strong: var(--warn-strong); } .sf-r-templates { --c: var(--vd-purple); --c-soft: var(--prim-soft); --c-line: var(--prim-line); --c-strong: var(--prim-strong); } .sf-r-sales { --c: var(--orange); --c-soft: var(--gold-soft); --c-line: var(--gold-line); --c-strong: var(--gold-strong); }

.sf-card { border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); }
.sf-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.sf-card > header .sf-av { width: 40px; height: 40px; font-size: 13px; }
.sf-card > header h3 { margin: 0; font-size: 16px; color: var(--text); }
.sf-card > header p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-muted); }
.sf-2fa { margin-left: auto; display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--success); }
.sf-2fa-off { color: var(--alert); }
.sf-sec { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px 4px; font-weight: 700; font-size: 15px; color: var(--text); }
.sf-card .sf-sec { margin: 12px 14px 0; font-size: 13.5px; }
.sf-sec small { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }
.sf-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; padding: 12px 14px; }
.sf-roles-sm { padding: 0 0 12px; }
.sf-role { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg); cursor: pointer; margin: 0; }
.sf-role input { margin-top: 3px; accent-color: var(--vd-accent); }
.sf-role b { display: block; font-size: 13px; color: var(--text); } .sf-role span span { font-size: 12px; color: var(--text-muted); }
.sf-role:has(input:checked) { border-color: var(--c-line); background: var(--c-soft); }
.sf-role:has(input:disabled) { cursor: default; color: var(--text-muted); }
.sf-switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border-color); font-size: 13px; }
.sf-switch-row > div { flex: 1; } .sf-switch-row > div b { color: var(--text); } .sf-switch-row > div span { display: block; font-size: 12px; color: var(--text-muted); }
.sf-tg { position: relative; width: 38px; height: 22px; flex-shrink: 0; margin: 0; }
.sf-tg input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.sf-tg i { position: absolute; inset: 0; border-radius: 11px; background: var(--vd-surface-2); border: 1px solid var(--border-color); transition: background-color .15s; }
.sf-tg i::after { content: ''; position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform .15s ease-out, background-color .15s; }
.sf-tg input:checked + i { background: var(--vd-accent); border-color: var(--vd-accent); }
.sf-tg input:checked + i::after { transform: translateX(15px); background: var(--side); }
.sf-tg input:disabled { cursor: default; } .sf-tg input:disabled + i { color: var(--text-muted); }
.sf-tg input:focus-visible + i { outline: 2px solid var(--vd-accent); outline-offset: 2px; }
.sf-rights { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; padding: 12px 14px; }
.sf-rg { border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg); }
.sf-rg h4 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text); }
.sf-rg h4 .bi { color: var(--text-muted); } .sf-rg h4 .sf-n { margin-left: auto; font-weight: 500; font-size: 11.5px; color: var(--text-muted); }
.sf-dots > span + span::before, .sf-from > span + span::before { content: ', '; }
.sf-dots > span + span::before { content: ' · '; }
.sf-legend b + span::before { content: ' = '; }
.sf-sec .sf-own-n { font-weight: 700; color: var(--warning); }
.sf-act { display: flex; align-items: center; gap: 9px; padding: 6px 12px; font-size: 13px; margin: 0; color: var(--text); cursor: pointer; }
.sf-act input { accent-color: var(--vd-accent); width: 15px; height: 15px; flex-shrink: 0; }
.sf-act .sf-from { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.sf-act.sf-own { background: var(--warn-soft); }
.sf-act.sf-own .sf-from { color: var(--warning); font-weight: 600; }
.sf-act.sf-off { color: var(--text-muted); }
.sf-back { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0 2px; font-size: 13px; }
.sf-back:hover { color: var(--text); }
.sf-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 0 14px 12px; font-size: 12px; color: var(--text-muted); }
.sf-legend b { color: var(--warning); }
.sf-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--border-color); font-size: 12.5px; color: var(--text-muted); }
.sf-foot > span { margin-right: auto; }
.sf-add { display: flex; flex-direction: column; gap: 8px; }
.sf-add .sf-sec { margin: 10px 0 0; font-size: 13.5px; }
/* Platform admin: a form whose action the person's staff roles don't include */
.pa-locked { color: var(--text-muted); }
.sf-sec small + .sf-own-n::before { content: '· '; font-weight: 400; color: var(--text-muted); }

/* ── Home → widgets (home_board.js, home_widgets.js): a 12-column grid; Small = 3, Medium = 6, Wide = 12 ── */
/* places: rows of 4 (home_layout.js) — every widget and empty place has its row and columns inline; the 14 px gap below is its margin */
.hw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; column-gap: 14px; row-gap: 0; align-items: start; margin: 14px 0 4px; }
.hw-grid > .hw-w { margin-bottom: 14px; }
.hw-w { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); }
.hw-w > .hw-head, .hw-w > .hw-foot { flex: 0 0 auto; } .hw-w > .hw-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
html:root[data-theme="light"] .hw-w { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.hw-h-s { height: 220px; } .hw-h-m { height: 320px; } .hw-h-l { height: 460px; } .hw-h-auto { height: auto; }
@media (max-width: 860px) { .hw-grid { grid-template-columns: minmax(0, 1fr); } .hw-grid > * { grid-row: auto !important; grid-column: 1 / -1 !important; } .hw-grid > .hw-slot { display: none; } }
.hw-head { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: .86rem; color: var(--text); }
.hw-head > .bi { color: var(--vd-accent); }
.hw-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-cnt { font-size: .72rem; font-weight: 700; line-height: 18px; padding: 0 7px; border-radius: 9px; color: var(--text-2); background: var(--vd-surface-2); }
.hw-cnt.hw-hot { color: var(--alert); background: var(--err-soft); }
.hw-note { font-weight: 400; font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-r { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.hw-set { font-weight: 400; font-size: .74rem; color: var(--text-muted); white-space: nowrap; margin-right: 4px; }
.hw-live { color: var(--success); }
.hw-ib { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--text-muted); cursor: pointer; font-size: .85rem; }
.hw-ib:hover { background: var(--vd-surface-2); color: var(--text); }
.hw-ib:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: 1px; }
.hw-gear { color: var(--text-faint); } .hw-w:hover .hw-gear, .hw-gear[aria-expanded="true"], .hw-gear:focus-visible { color: var(--text); }
.hw-ed { display: none; }
.hw-editing .hw-ed { display: inline-grid; }
.hw-editing .hw-w { box-shadow: 0 0 0 1px var(--acc-line); }
.hw-editing .hw-w { cursor: grab; }
.hw-editing .hw-head::before { content: "\F3FE"; font-family: "bootstrap-icons"; color: var(--text-muted); margin-right: -2px; }
.hw-w.hw-dragging { opacity: .4; }
.hw-drop-ok { box-shadow: 0 0 0 2px var(--vd-accent) !important; background: var(--prim-soft) !important; } .hw-drop-no { box-shadow: 0 0 0 2px var(--err-line) !important; cursor: no-drop; }
.hw-w.hw-nothing { color: var(--text-muted); }
.hw-body { min-height: 40px; }
.hw-body.hw-flush .ts-table-wrap { border: 0 !important; border-radius: 0; }
.hw-loading { display: grid; place-items: center; padding: 18px; }
.hw-foot { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border-color); font-size: .76rem; color: var(--text-muted); }
.hw-foot[hidden] { display: none; }
.hw-foot > a:last-child { margin-left: auto; }
.hw-foot a { color: var(--vd-accent); text-decoration: none; font-weight: 500; } .hw-foot a:hover { text-decoration: underline; }
.hw-pad { padding: 12px 14px; }
.hw-muted { font-size: .78rem; color: var(--text-muted); }
.hw-muted b { color: var(--text); font-weight: 600; }
.hw-mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: .8rem; }
.hw-bad { color: var(--alert) !important; } .hw-warn { color: var(--warning) !important; } .hw-ok { color: var(--success); } .hw-info { color: var(--vd-cyan); } .hw-acc { color: var(--vd-accent) !important; } .hw-muted-ic { color: var(--text-muted); }
.hw-up { color: var(--success) !important; }
.hw-empty { display: flex; gap: 10px; align-items: flex-start; padding: 14px; font-size: .8rem; color: var(--text-muted); }
.hw-empty > .bi { color: var(--text-muted); margin-top: 1px; }
.hw-empty a { color: var(--vd-accent); }
/* rows */
.hw-li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border-color); font-size: .82rem; color: var(--text); text-decoration: none; min-width: 0; }
.hw-li:first-child { border-top: 0; }
a.hw-li:hover { background: var(--n-soft); }
.hw-li > .bi { width: 16px; flex-shrink: 0; color: var(--text-muted); }
.hw-li-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-li-main small { color: var(--text-muted); }
.hw-li .hw-m { margin-left: auto; flex-shrink: 0; font-size: .76rem; color: var(--text-muted); white-space: nowrap; }
.hw-new { font-size: .7rem; font-weight: 700; color: var(--vd-accent); text-transform: uppercase; letter-spacing: .03em; }
.hw-st { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: .7rem; font-weight: 600; line-height: 18px; text-transform: uppercase; letter-spacing: .03em; color: var(--c); background: var(--c-soft); }
.hw-st-wait { --c: var(--warning); --c-soft: var(--warn-soft); --c-line: var(--warn-line); --c-strong: var(--warn-strong); } .hw-st-ok { --c: var(--success); --c-soft: var(--ok-soft); --c-line: var(--ok-line); --c-strong: var(--ok-strong); } .hw-st-off { --c: var(--text-muted); --c-soft: var(--sec-soft); --c-line: var(--sec-line); --c-strong: var(--sec-strong); }
/* bars */
.hw-bars { padding: 6px 0; }
.hw-bar-row { display: grid; grid-template-columns: minmax(80px, 140px) minmax(0, 1fr) 72px; align-items: center; gap: 10px; padding: 6px 14px; font-size: .8rem; color: var(--text); text-decoration: none; }
a.hw-bar-row:hover { background: var(--n-soft); }
.hw-bar-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-bar { display: block; height: 8px; border-radius: 4px; background: var(--n-mid); overflow: hidden; }
.hw-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--vd-accent); }
.hw-bar-v { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* numbers */
.hw-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.hw-big b { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.hw-big span { font-size: .78rem; color: var(--text-muted); margin-right: 10px; }
.hw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--border-color); }
.hw-tile { background: var(--side); padding: 12px 14px; }
html:root[data-theme="light"] .hw-tile { background: var(--side); }
.hw-tile span { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.hw-tile b { display: block; font-size: 1.4rem; font-weight: 700; margin: 2px 0; color: var(--text); font-variant-numeric: tabular-nums; }
.hw-tile small { font-size: .74rem; color: var(--text-muted); }
/* charts */
.hw-spark { display: block; width: 100%; height: 44px; margin: 8px 0 6px; }
.hw-spark-fill { fill: var(--acc-soft); }
.hw-spark-line { fill: none; stroke: var(--vd-accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.hw-chart { display: block; width: calc(100% - 28px); height: 110px; margin: 12px 14px 4px; }
.hw-col-a { fill: var(--n-line); } .hw-col-b { fill: var(--vd-accent); }
.hw-axis { stroke: var(--border-color); }
.hw-legend { display: flex; gap: 14px; padding: 0 14px 10px; font-size: .74rem; color: var(--text-muted); }
.hw-key { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.hw-key-a { background: var(--n-line); } .hw-key-b { background: var(--vd-accent); }
/* plan usage */
.hw-prog { padding: 2px 0 10px; }
.hw-prog + .hw-prog { border-top: 1px solid var(--border-color); padding-top: 10px; }
.hw-prog-t { display: flex; font-size: .8rem; color: var(--text); margin-bottom: 6px; } .hw-prog-t b { margin-left: auto; font-variant-numeric: tabular-nums; }
.hw-prog .hw-bar { height: 9px; }
.hw-prog.hw-near .hw-bar > i { background: var(--warning); } .hw-prog.hw-full .hw-bar > i { background: var(--alert); }
.hw-prog small { display: block; margin-top: 4px; font-size: .72rem; color: var(--warning); }
/* backups */
.hw-sch { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: .82rem; color: var(--text); min-width: 0; }
.hw-sch .hw-m { margin-left: auto; font-size: .74rem; color: var(--text-muted); white-space: nowrap; }
/* team */
.hw-avs { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-av { position: relative; width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700; color: var(--c); background: var(--c-soft); }
.hw-av.hw-on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); border: 2px solid var(--side); }
.hw-av-more { --c: var(--text-muted); --c-soft: var(--sec-soft); --c-line: var(--sec-line); --c-strong: var(--sec-strong); }
.hw-ring { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: .8rem; color: var(--text-2); }
.hw-ring small { color: var(--text-muted); }
.hw-ring-bg { fill: none; stroke: var(--vd-surface-2); stroke-width: 5; } .hw-ring-on { fill: none; stroke: var(--success); stroke-width: 5; stroke-linecap: round; }
/* chips (favorites, hidden widgets) */
.hw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.hw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg); font: inherit; font-size: .8rem; color: var(--text); text-decoration: none; cursor: pointer; }
.hw-chip:hover { border-color: var(--vd-accent); }
.hw-chip > .bi { color: var(--text-muted); }
.hw-chip-x { border: 0; background: none; padding: 0 4px; color: var(--vd-yellow); cursor: pointer; font-size: .72rem; }
.hw-chip-x:hover { color: var(--text-muted); }
/* Start something */
.hw-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 12px 14px; }
.hw-start { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg); color: var(--text); text-decoration: none; font: inherit; font-size: .82rem; text-align: left; cursor: pointer; }
.hw-start:hover { border-color: var(--vd-accent); }
.hw-start > .bi { grid-row: span 2; color: var(--vd-accent); }
.hw-start small { color: var(--text-muted); font-size: .72rem; }
.hw-start:disabled, .hw-start.disabled { background: var(--button-disabled-bg); color: var(--button-disabled-text); border-color: var(--border-color); box-shadow: none; cursor: default; }
/* Alerts: a red line across the whole row */
.hw-w.hw-banner { border-color: var(--err-line); background: var(--err-soft); }
.hw-alert-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; font-size: .84rem; color: var(--text); }
.hw-alert-line > .bi { color: var(--alert); margin-top: 2px; }
/* the widget's settings (gear) */
.hw-pop { position: absolute; z-index: 30; right: 8px; top: 44px; width: 270px; padding: 12px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); font-size: .8rem; }
html:root[data-theme="light"] .hw-pop { background: var(--side); box-shadow: 0 10px 28px rgba(15, 23, 42, .14); }
.hw-pop-row { display: flex; flex-direction: column; gap: 5px; margin: 0; color: var(--text-muted); font-weight: 600; font-size: .74rem; }
.hw-pop-row select { height: 32px; }
.hw-seg { display: inline-flex; border: 1px solid var(--border-color); border-radius: 7px; overflow: hidden; align-self: flex-start; }
.hw-seg button { border: 0; border-left: 1px solid var(--border-color); background: var(--bg); color: var(--text-2); padding: 5px 12px; font: inherit; font-weight: 500; font-size: .8rem; cursor: pointer; }
.hw-seg button:first-child { border-left: 0; }
.hw-seg button[aria-pressed="true"] { background: var(--prim-soft); color: var(--text); }
/* Customize */
.hw-tray { margin-top: 14px; padding: 10px 14px; border: 1px dashed var(--border-color); border-radius: 10px; font-size: .82rem; color: var(--text); }
.hw-tray[hidden] { display: none; }
.hw-tray-how { color: var(--text-muted); margin-bottom: 8px; }
.hw-tray .hw-chips { padding: 8px 0 0; }
@media (prefers-reduced-motion: no-preference) { .hw-w { transition: box-shadow .15s ease, opacity .15s ease; } }
/* while customizing: only move and hide in the title (⚙ works outside Customize) */
.hw-editing .hw-gear, .hw-editing .hw-set, .hw-editing .hw-note, .hw-editing .hw-cnt { display: none; }
.hw-editing .hw-head { padding-left: 10px; gap: 6px; }
.hw-editing .hw-ib { width: 26px; }
.hw-banner .hw-head > .bi { color: var(--alert); }
.hw-dots > span + span::before { content: " · "; }
/* empty places: nothing outside Customize; dashed while customizing */
.hw-slot { min-width: 0; }
.hw-editing .hw-slot { min-height: 120px; margin-bottom: 14px; display: grid; place-items: center; border: 1px dashed var(--border-color); border-radius: 10px; font-size: .78rem; color: var(--text-muted); }
.hw-editing .hw-newrow { min-height: 64px; }
/* Customize: the pad over each widget (move, size, hide) */
.hw-pad-ed { position: absolute; inset: 42px 0 0 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-radius: 0 0 10px 10px; background: var(--side); text-align: center; }
html:root[data-theme="light"] .hw-pad-ed { background: var(--text-muted); }
.hw-pad-drag { font-size: .76rem; color: var(--text-muted); }
.hw-pad-arrows { display: inline-flex; gap: 2px; }
.hw-pad-ed .hw-seg button { padding: 4px 9px; font-size: .76rem; }
.hw-editing .hw-h-auto { min-height: 190px; }
.hw-editing .hw-slot { align-self: stretch; }
.hw-w.hw-nothing:not(.hw-dragging) { height: auto; color: var(--text-muted); }
.hw-w.hw-nothing .hw-body { flex: 0 0 auto; }
/* Home → per plan: the plans table, stacked money bars, the grouped columns */
.hw-scroll-x { overflow-x: auto; }
.hw-pt { width: 100%; border-collapse: collapse; font-size: .8rem; color: var(--text); }
.hw-pt th { text-align: right; font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.hw-pt td { text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--border-color); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hw-pt th:first-child, .hw-pt td:first-child { text-align: left; }
.hw-pt tfoot td { font-weight: 700; border-bottom: 0; }
.hw-pt small { font-size: .7rem; }
.hw-pt .hw-share { width: 180px; } .hw-pt .hw-share .hw-bar { display: inline-block; width: 100px; vertical-align: middle; margin-right: 6px; }
.hw-down { color: var(--alert) !important; }
.hw-pdot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--p); margin-right: 8px; }
.hw-bar.hw-stack { display: flex; } .hw-bar.hw-stack > i { border-radius: 0; } .hw-bar.hw-stack > i:first-child { border-radius: 4px 0 0 4px; } .hw-bar.hw-stack > i:last-child { border-radius: 0 4px 4px 0; }
.hw-bar > i.hw-lost, .hw-key-lost { background: var(--alert); }
.hw-mv-0, .hw-mv-k0 { fill: var(--success); background: var(--success); } .hw-mv-1, .hw-mv-k1 { fill: var(--vd-cyan); background: var(--info); } .hw-mv-2, .hw-mv-k2 { fill: var(--alert); background: var(--alert); }
.hw-mv-t { fill: var(--text-2); font-size: 11px; } .hw-mv-l { fill: var(--text-muted); font-size: 11.5px; }
.hw-chart.hw-mv { height: 130px; }
.hw-w.hw-s .hw-note { display: none; }

/* ── Platform admin → My reports (admin_myreports.js, myreport_chart.js) ── */
.mr-cols { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; }
@media (max-width: 960px) { .mr-cols { grid-template-columns: 1fr; } }
.mr-saved h4 { margin: 0 0 8px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.mr-saved h4 + * { margin-top: 0; } .mr-saved > h4:not(:first-child) { margin-top: 16px; }
.mr-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; margin-bottom: 6px; padding: 9px 11px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--side); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mr-item:hover { border-color: var(--n-line); }
.mr-item[aria-current="true"] { border-color: var(--vd-accent); box-shadow: inset 0 0 0 1px var(--vd-accent); }
.mr-item > .bi { color: var(--vd-accent); margin-top: 2px; }
.mr-item b { display: block; font-size: .84rem; } .mr-item small { font-size: .74rem; color: var(--text-muted); }
.mr-home { color: var(--success); }
.mr-none { padding: 4px 2px 8px; }
.mr-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mr-card { border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); }
html:root[data-theme="light"] .mr-card, html:root[data-theme="light"] .mr-item { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.mr-src { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.mr-src button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg); color: var(--text-2); font: inherit; font-size: .8rem; cursor: pointer; }
.mr-src button[aria-pressed="true"] { border-color: var(--vd-accent); color: var(--text); background: var(--prim-soft); }
.mr-src button:disabled { background: var(--button-disabled-bg); color: var(--button-disabled-text); border-color: var(--border-color); box-shadow: none; cursor: not-allowed; }
.mr-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; padding: 12px 14px 14px; }
.mr-fld { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.mr-lab { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--text-muted); }
.mr-lab small { font-weight: 400; }
.mr-n { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .66rem; font-weight: 700; color: var(--vd-accent); background: var(--acc-soft); }
.mr-steps .mr-fld:has(.mr-show), .mr-steps .mr-fld:has(.mr-chips) { grid-column: 1 / -1; }
.mr-show button { display: inline-flex; align-items: center; gap: 5px; }
.mr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mr-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg); font-size: .8rem; color: var(--text); cursor: pointer; }
.mr-chip:has(input:checked) { border-color: var(--acc-line); background: var(--prim-soft); }
.mr-chip input { accent-color: var(--vd-accent); margin: 0; }
.mr-chip:has(input:disabled) { color: var(--text-muted); cursor: default; }
.mr-pv-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.mr-pv-head h3 { margin: 0; font-size: 1rem; color: var(--text); } .mr-pv-head small { color: var(--text-muted); font-size: .78rem; }
.mr-r { margin-left: auto; display: flex; gap: 6px; }
.mr-pv { padding: 12px 14px; min-height: 190px; background: var(--side); }
.mr-save { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 12px 14px; padding: 12px 14px; border-top: 1px solid var(--border-color); align-items: end; }
.mr-save > .mr-fld:nth-child(2) { grid-row: span 2; align-self: start; }
.mr-save > .hw-muted { grid-column: 1 / -1; }
.mr-acts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mr-acts > .mr-chip { margin-right: auto; }
@media (max-width: 760px) { .mr-save { grid-template-columns: 1fr; } }
/* the drawing */
.mr-chart { position: relative; padding: 14px 0 22px; }
.mr-max { position: absolute; top: 0; left: 0; font-size: .7rem; color: var(--text-muted); }
.mr-svg { display: block; width: 100%; height: 170px; }
.hw-w .mr-svg { height: 120px; }
.mr-x { position: relative; height: 16px; margin-top: 4px; font-size: .7rem; color: var(--text-muted); }
.mr-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mr-legend { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; font-size: .74rem; color: var(--text-muted); }
.mr-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.mr-number { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 4px; }
.mr-number b { font-size: 2.4rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mr-number span { font-size: .8rem; color: var(--text-muted); }
/* Staff manager switch: its checkbox covers the whole switch and is never drawn (the app's checkbox look stays off it) */
html .sf-tg input[type="checkbox"] { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 0 !important; opacity: 0 !important; appearance: none !important; -webkit-appearance: none !important; border: 0 !important; background: none !important; box-shadow: none !important; cursor: pointer; z-index: 1; }
html .sf-tg input[type="checkbox"]:disabled { cursor: default; }
html .sf-tg input:focus-visible + i { outline: 2px solid var(--vd-accent); outline-offset: 2px; }
/* SQL Wizard staff without an organization (AuthManager.staffOnly): no databases, design, server or team in the sidebar */
body.sb-staff-only .sbr-tab[data-sb-tab="databases"], body.sb-staff-only .sbr-tab[data-sb-tab="design"], body.sb-staff-only .sbr-tab[data-sb-tab="server"], body.sb-staff-only .sbr-tab[data-sb-tab="org"], body.sb-staff-only #ac-switcher { display: none !important; }
/* Phone (as body.sb-phone, 768 px): sign in / create account / codes / lock screen without the moving background and
   without a box — the form straight on the plain page */
@media (max-width: 768px) {
  .auth-bg, .dbs-lock-bg { display: none !important; }
  #auth-shell.auth-shell, html[data-auth-page] #auth-shell.auth-shell { background: var(--bg) !important; }
  html:root[data-theme="light"] #auth-shell.auth-shell { background: var(--side) !important; }
  .auth-main { align-items: flex-start !important; padding: 40px 20px 28px !important; }
  html[data-auth-page] .auth-logo { display: block; margin-bottom: 24px !important; }
  #auth-shell :is(.ac-card, #content > .card), html[data-auth-page] #auth-shell :is(.ac-card, #content > .card),
  html:root[data-theme="light"] #auth-shell :is(.ac-card, #content > .card) {
    background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .dbs-lock, html:root[data-theme="light"] .dbs-lock { background: var(--bg) !important; align-items: flex-start !important; justify-content: center !important; padding: 56px 20px 24px !important; }
  html:root[data-theme="light"] .dbs-lock { background: var(--side) !important; }
  .dbs-lock-card, html:root[data-theme="light"] .dbs-lock-card {
    max-width: 420px !important; width: 100%; background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; }
}
/* sign-in pages, light theme: an unticked checkbox (I accept …) light like the app's others */
html:root[data-theme="light"] #auth-shell input[type="checkbox"]:not(:checked) { background-color: var(--side); border-color: var(--drk-line); }
/* Visual Designer windows with a height of their own (designer_windows.js resizable: Objects): the grip at the bottom */
#vd-stage .vd-win-sized:not(.vd-fp-closed) { height: var(--vd-user-h) !important; max-height: calc(100% - 8px) !important; }
.vd-win-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; z-index: 3; border-radius: 0 0 10px 10px; touch-action: none; }
.vd-win-grip::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 34px; height: 4px; margin-left: -17px; border-radius: 2px; background: var(--n-line); opacity: 0; transition: opacity .15s ease; }
.vd-objects:hover .vd-win-grip::after, .vd-win-grip:focus-visible::after, .vd-win-resizing .vd-win-grip::after { opacity: 1; }
.vd-win-grip:hover::after, .vd-win-resizing .vd-win-grip::after { background: var(--vd-accent); }
.vd-win-grip:focus-visible { outline: none; }
.vd-fp-closed > .vd-win-grip { display: none; }
.vd-win-resizing { user-select: none; }
@media (prefers-reduced-motion: reduce) { .vd-win-grip::after { transition: none; } }
/* the database tree: ★ pins a database to the top (Pinned); shown on hover, always while pinned */
.sbp-databases .db-header .db-pin { flex-shrink: 0; width: 22px; height: 22px; margin-left: 2px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--text-muted); font-size: .72rem; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
.sbp-databases .db-header:hover .db-pin, .sbp-databases .db-header .db-pin:focus-visible, .sbp-databases .db-header .db-pin.db-pinned { opacity: 1; }
.sbp-databases .db-header .db-pin:hover { background: var(--hover); color: var(--text); }
.sbp-databases .db-header .db-pin.db-pinned { color: var(--vd-yellow); }
.sbp-databases .db-header .db-pin:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: 1px; }
@media (hover: none) { .sbp-databases .db-header .db-pin { color: var(--text-muted); } }
@media (prefers-reduced-motion: reduce) { .sbp-databases .db-header .db-pin { transition: none; } }
/* Visual Designer: ⚡ triggers on a table (designer_triggers.js) — a line under Constraints, its list opens in the table */
.vd-trg-wrap { border-radius: 0 0 inherit inherit; }
.vd-trg-line .vd-trg-ic { color: var(--warning); font-size: .7rem; }
.vd-trg-n { min-width: 16px; padding: 0 5px; border-radius: 8px; font-size: .66rem; font-weight: 700; line-height: 15px; text-align: center; color: var(--warn-strong); background: var(--warn-soft); }
html:root[data-theme="light"] .vd-trg-n { color: var(--warn-strong); background: var(--warn-soft); }
.vd-trg-line .vd-trg-arrow { font-size: .7rem; transition: transform .2s ease; }
.vd-trg-line[aria-expanded="true"] .vd-trg-arrow { transform: rotate(180deg); }
.vd-trg-line:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: -2px; }
.vd-trg-panel { padding: 4px 6px 6px; border-top: 1px solid var(--vd-border); font-size: .76rem; }
.vd-trg-panel[hidden] { display: none; }
.vd-trg-item { display: flex; align-items: baseline; gap: 8px; padding: 5px 6px; border-radius: 6px; color: var(--text); text-decoration: none; }
.vd-trg-item:hover, .vd-trg-item:focus-visible { background: var(--hover); outline: none; }
.vd-trg-when { flex-shrink: 0; font-size: .64rem; font-weight: 700; letter-spacing: .03em; color: var(--text-muted); }
.vd-trg-name { font-family: var(--font-mono, ui-monospace, monospace); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-trg-all { display: block; padding: 5px 6px 2px; color: var(--vd-accent); text-decoration: none; font-weight: 500; }
.vd-trg-all:hover { text-decoration: underline; }
#zoom-wrapper.vd-cols-name .table-node .vd-trg-wrap { display: none; }
@media (prefers-reduced-motion: reduce) { .vd-trg-line .vd-trg-arrow { transition: none; } }
/* Visual Designer: a routine / trigger picked in Objects lights up the tables it uses (designer_uses.js) */
#zoom-wrapper.vd-uses-on .table-node:not(.vd-uses) { opacity: .22 !important; }
#zoom-wrapper.vd-uses-on .table-node.vd-uses { box-shadow: 0 0 0 2px var(--vd-accent), 0 8px 24px rgba(0, 0, 0, .25) !important; }
.vd-uses-tag { display: flex; justify-content: flex-end; gap: 4px; padding: 4px 10px; border-bottom: 1px solid var(--prim-line); background: var(--acc-soft); border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; pointer-events: none; }
.vd-uses-tag span { padding: 0 7px; border-radius: 5px; font-size: .64rem; font-weight: 700; letter-spacing: .04em; line-height: 18px; color: var(--c); background: var(--c-soft); border: 1px solid var(--c-line); }
html:root[data-theme="light"] .vd-uses-tag span { background: var(--c-soft); }
.vd-uses-reads { --c: var(--info); --c-soft: var(--info-soft); --c-line: var(--info-line); --c-strong: var(--info-strong); } .vd-uses-writes { --c: var(--warning); --c-soft: var(--warn-soft); --c-line: var(--warn-line); --c-strong: var(--warn-strong); } .vd-uses-on { --c: var(--vd-purple); --c-soft: var(--prim-soft); --c-line: var(--prim-line); --c-strong: var(--prim-strong); }
.vd-uses-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 40px); padding: 6px 8px 6px 14px;
  border: 1px solid var(--prim-line); border-radius: 10px; background: var(--side); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-size: .82rem; color: var(--text); }
html:root[data-theme="light"] .vd-uses-bar { background: var(--side); box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.vd-uses-bar[hidden] { display: none; }
.vd-uses-bar > .bi { color: var(--vd-accent); }
.vd-uses-bar small { color: var(--text-muted); }
/* the Objects list: routines and triggers pick (click), ↗ opens their page */
.vd-obj-code { cursor: pointer; }
.vd-obj-code .vd-obj-open { margin-left: auto; padding: 0 4px; color: var(--text-muted); opacity: 0; font-size: .72rem; }
.vd-obj-code:hover .vd-obj-open, .vd-obj-code:focus-within .vd-obj-open, .vd-obj-code.vd-obj-picked .vd-obj-open { opacity: 1; }
.vd-obj-code .vd-obj-open:hover { color: var(--vd-accent); }
.vd-obj-code.vd-obj-picked { background: var(--acc-soft); color: var(--text); }
.vd-obj-code:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: -2px; }
@media (hover: none) { .vd-obj-code .vd-obj-open { color: var(--text-muted); } }
/* the Designer bar on one row a little longer: thinner gaps between its groups (the Triggers switch made it one button wider) */
.vd-tools:not(.vd-tools-vertical) > .vd-tools-sep, #vd-toolbar > .vd-tools:not(.vd-tools-vertical) > .vd-tools-sep, #vd-toolbar > .vd-toolbar-sep { margin: 0 2px !important; }
.vd-tools:not(.vd-tools-vertical) > .vd-tools-grip > .bi-grip-vertical { display: inline-block; width: 9px; overflow: hidden; font-size: .85rem; }
.vd-uses-what > span + span::before { content: " · "; color: var(--text-muted); }

/* ── Planner: the tools bar attached to a side (a grid like the Visual Designer's), Details over the canvas (planner_tools.js) ── */
.pl-main { position: relative; display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "left top right" "left area right" "left bottom right"; }
.pl-area { grid-area: area; position: relative; min-width: 0; min-height: 0; display: flex; }
.pl-area > .pl-canvas { flex: 1 1 auto; min-width: 0; }
.pl-tools { position: relative; z-index: 250; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; padding: 5px 8px; background: var(--side); border: 0 solid var(--border-color); }
html:root[data-theme="light"] .pl-tools { background: var(--side); }
.pl-tools[data-dock="top"] { grid-area: top; border-bottom-width: 1px; }
.pl-tools[data-dock="bottom"] { grid-area: bottom; border-top-width: 1px; }
.pl-tools[data-dock="left"] { grid-area: left; border-right-width: 1px; }
.pl-tools[data-dock="right"] { grid-area: right; border-left-width: 1px; }
.pl-tools.pl-tools-vertical { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; padding: 8px 5px; overflow-y: auto; scrollbar-width: thin; }
.pl-tools.pl-tools-dragging { position: fixed; z-index: 1000; opacity: .92; cursor: grabbing; border-width: 1px; border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.pl-tools-ghost { z-index: 240; border: 2px dashed var(--vd-accent); background: var(--prim-soft); pointer-events: none; }
.pl-tools-ghost[data-dock="top"] { grid-area: top; height: 42px; }
.pl-tools-ghost[data-dock="bottom"] { grid-area: bottom; height: 42px; }
.pl-tools-ghost[data-dock="left"] { grid-area: left; width: 44px; }
.pl-tools-ghost[data-dock="right"] { grid-area: right; width: 44px; }
.pl-tools .pl-tool { height: 30px; min-width: 30px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text-2, var(--text)); font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; flex: 0 0 auto; }
.pl-tools .pl-tool:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.pl-tools .pl-tool:disabled { color: var(--disabled-text); cursor: default; }
.pl-tools .pl-tool:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: 1px; }
.pl-tools .pl-tool[aria-pressed="true"], .pl-tools .pl-tool.pl-toggle-on { color: var(--vd-accent); background: var(--acc-soft); }
.pl-tools .pl-tool-primary, .pl-tools .pl-tool-primary:hover:not(:disabled) { background: var(--vd-accent); color: var(--text); }
.pl-tools .pl-build-btn { color: var(--success); }
.pl-tools.pl-tools-vertical .pl-tool { width: 32px; padding: 0; }
.pl-tools.pl-tools-vertical .pl-tool-named > span, .pl-tools.pl-tools-vertical .pl-tool > .bi-chevron-down { display: none; }
.pl-tools-sep { width: 1px; height: 20px; margin: 0 3px; align-self: center; background: var(--border-color); flex: 0 0 auto; }
.pl-tools.pl-tools-vertical .pl-tools-sep { width: 20px; height: 1px; margin: 3px 0; }
.pl-tools-grip { position: relative; display: inline-flex; align-items: center; gap: 1px; padding: 0 2px; color: var(--text-muted); cursor: grab; flex: 0 0 auto; }
.pl-tools.pl-tools-vertical .pl-tools-grip { flex-direction: column; padding: 2px 0; }
.pl-tools-grip > .bi-grip-vertical { font-size: .9rem; }
.pl-tools.pl-tools-vertical .pl-tools-grip > .bi-grip-vertical { transform: rotate(90deg); }
.pl-tools-dock-btn { width: 22px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.pl-tools-dock-btn:hover, .pl-tools-dock-btn[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.pl-tools .dropdown { position: relative; flex: 0 0 auto; }
/* menus open beside their button, outside the bar (planner_tools.js placeMenu) */
.pl-tools-menu, .pl-tools .pl-export-menu { position: fixed; z-index: 2000; min-width: 150px; padding: 4px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--side); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
html:root[data-theme="light"] .pl-tools-menu, html:root[data-theme="light"] .pl-tools .pl-export-menu { background: var(--side); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); }
.pl-tools-menu[hidden] { display: none; }
.pl-tools-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.pl-tools-menu button:hover { background: var(--hover); }
.pl-tools-menu button.active { color: var(--vd-accent); font-weight: 600; }
/* zoom: its own small block at the bottom left of the canvas, like the Designer's */
.pl-zoombox { position: absolute; z-index: 300; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--side); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
html:root[data-theme="light"] .pl-zoombox { background: var(--side); box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.pl-zoombox .pl-tool { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-2, var(--text)); cursor: pointer; }
.pl-zoombox .pl-tool:hover { background: var(--hover); color: var(--text); }
.pl-zoombox .pl-zoom { min-width: 44px; text-align: center; font-size: .74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Details: a window over the canvas, top right */
.pl-win { position: absolute; z-index: 301; right: 12px; top: 12px; width: 320px; max-height: calc(100% - 24px); display: flex; flex-direction: column; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); box-shadow: 0 10px 28px rgba(0, 0, 0, .28); overflow: hidden; }
html:root[data-theme="light"] .pl-win { background: var(--side); box-shadow: 0 10px 28px rgba(15, 23, 42, .12); }
.pl-win[hidden] { display: none; }
.pl-win-head { display: flex; align-items: center; gap: 7px; padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border-color); font-size: .78rem; font-weight: 700; color: var(--text); cursor: grab; flex: 0 0 auto; }
.pl-win-head > .bi { color: var(--page-c, var(--vd-accent)); }
.pl-win-head > span { flex: 1; }
.pl-win-btn { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; }
.pl-win-btn:hover { background: var(--hover); color: var(--text); }
.pl-win > .pl-panel { width: auto !important; flex: 1 1 auto !important; min-height: 0; border: 0 !important; background: transparent !important; overflow-y: auto; }
.pl-win.vd-fp-closed > .pl-panel { display: none; }
.pl-win.vd-fp-closed { max-height: none; }
.pl-area .vd-win-sized:not(.vd-fp-closed) { height: var(--vd-user-h) !important; max-height: calc(100% - 8px) !important; }
@media (max-width: 820px) {
  .pl-main { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(0, 1fr) !important; grid-template-areas: "top" "area" !important; }
  .pl-tools, .pl-tools[data-dock], .pl-tools.pl-tools-vertical { grid-area: top !important; flex-direction: row !important; flex-wrap: wrap; justify-content: flex-start; border-width: 0 0 1px !important; overflow: visible; padding: 5px 8px; }
  .pl-tools .pl-tools-grip { display: none; }
  .pl-tools.pl-tools-vertical .pl-tool { width: auto; padding: 0 8px; }
  .pl-tools.pl-tools-vertical .pl-tools-sep { width: 1px; height: 20px; margin: 0 3px; }
  .pl-area { flex-direction: column; }
  .pl-win { position: static; width: auto !important; max-height: 45%; border-radius: 0; border-width: 1px 0 0; box-shadow: none; transform: none !important; }
  .pl-win-head { cursor: default; }
}
/* Select / Hand like the Visual Designer: an arrow to pick, the hand (or Space held) moves the view */
.pl-area > .pl-canvas, .pl-area > .pl-canvas:active { cursor: default; }
.pl-area > .pl-canvas.pl-hand { cursor: grab; }
.pl-area > .pl-canvas.pl-hand [data-block], .pl-area > .pl-canvas.pl-hand [data-note], .pl-area > .pl-canvas.pl-hand [data-view], .pl-area > .pl-canvas.pl-hand [data-rule] { cursor: grab; }
.pl-area > .pl-canvas.pl-panning, .pl-area > .pl-canvas.pl-panning * { cursor: grabbing !important; }
/* Visual Designer: the side menu and Export open beside their button, outside the bar (placeMenu), above everything */
.vd-tools-menu, .vd-export-menu { z-index: 2000; }
/* New view / New rule: the block first (a label above its field with the usual gap) */
.pl-help .pl-choose-block { margin: 12px 0 10px; }
.pl-help .pl-choose-hint { margin: 6px 0 10px; }
.pl-vdialog [data-pl-vbody] { display: flex; flex-direction: column; gap: 8px; }
.pl-vdialog [data-pl-vbody] > .td-field-error:empty, .pl-vdialog [data-pl-vbody] > [data-pl-vwritten]:empty { display: none; }
.pl-vdialog [data-pl-vbody] > [data-pl-vwritten] { margin-top: -4px; }

/* Planner → Objects (top left) and Minimap (bottom left, above the zoom), windows like Details (planner_panels.js) */
.pl-win .pl-win-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pl-win.vd-fp-closed > .pl-win-body { display: none; }
.pl-objwin { left: 12px; right: auto; top: 12px; width: 250px; max-height: min(460px, calc(100% - 250px)); }
.pl-obj-search { margin: 8px 8px 4px; flex: 0 0 auto; }
.pl-obj-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 6px 8px; scrollbar-width: thin; }
/* the tree is the Visual Designer's (.vd-obj …); the Planner adds + (new group), ⋯ (a group's menu) */
.pl-objwin .vd-obj-gh > .vd-obj-gr { flex: 1; min-width: 0; }
.pl-obj-add, .pl-obj-more { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; font-size: .78rem; }
.pl-obj-add:hover, .pl-obj-more:hover { background: var(--hover); color: var(--text); }
.pl-obj-add { margin-right: 4px; }
.pl-obj-more { opacity: 0; }
.vd-obj-gh:hover > .pl-obj-more, .pl-obj-more:focus-visible, .vd-obj-gh:has(.vd-obj.on) > .pl-obj-more { opacity: 1; }
.pl-obj-none { padding: 4px 8px 6px; font-size: .72rem; }
/* Tips: bottom right */
.pl-tipswin { left: auto; right: 344px; top: auto; bottom: 12px; width: 300px; max-height: min(420px, 45%); }
.pl-tips { overflow-y: auto; padding: 10px 12px 12px; scrollbar-width: thin; }
.pl-tips .pl-how { margin: 0 0 4px; padding-left: 18px; font-size: .78rem; }
.pl-tips .pl-how li + li { margin-top: 5px; }
/* a group's colour in Details */
.pl-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 3px solid var(--side); background: var(--pl); box-shadow: 0 0 0 1px var(--border-color); cursor: pointer; }
html:root[data-theme="light"] .pl-swatch { border-color: var(--side); }
.pl-swatch.on { box-shadow: 0 0 0 2px var(--pl); }
.pl-swatch:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: 2px; }
/* a new view / rule in Details */
.pl-draft-acts { margin-top: 10px; gap: 8px; }
.pl-panel .pl-choose-block { margin: 10px 0 8px; }
.pl-miniwin { left: 12px; right: auto; top: auto; bottom: 58px; width: 230px; }
.pl-miniwin .pl-win-body { padding: 6px; }
.pl-mini { display: block; width: 100%; height: 140px; cursor: pointer; border-radius: 6px; background: var(--n-soft); touch-action: none; }
.pl-mini .pl-m-lines line { stroke: var(--sec-line); stroke-width: 3; }
.pl-mini .pl-m-b { fill: var(--acc-mid); stroke: var(--vd-accent); stroke-width: 2; }
.pl-mini .pl-m-v { fill: var(--info-mid); stroke: var(--vd-cyan, var(--info)); stroke-width: 2; stroke-dasharray: 8 5; }
.pl-mini .pl-m-r { fill: var(--vio-mid); stroke: var(--vd-purple); stroke-width: 2; }
.pl-mini .pl-m-n { fill: var(--warn-line); stroke: none; }
.pl-mini .pl-m-on { fill: var(--vd-accent); }
.pl-mini .pl-m-view { fill: var(--acc-soft); stroke: var(--vd-accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@media (max-width: 820px) { .pl-objwin, .pl-miniwin, .pl-tipswin, .pl-tools [data-pl-win-toggle="tips"], .pl-tools [data-pl-win-toggle="objects"], .pl-tools [data-pl-win-toggle="mini"] { display: none !important; } }
/* the canvas and its windows in one layer under the bar: the bar's menus (Export) open over Details, Objects, Tips */
.pl-main > .pl-area { z-index: 1; }
.pl-main > .pl-tools:not(.pl-tools-dragging) { z-index: 2; }
/* Staff: invited (no password yet) */
.sf-inv-ic { color: var(--info); }
.sf-2fa-inv { color: var(--info); }
.sf-inv-note { margin: 4px 0 12px; align-items: center; }
.sf-inv-note > span { flex: 1; }

/* ══ Platform admin → Staff activity (admin_activity.js) and the audit log's Everyone / Customers / Staff ══ */
.sa-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--side); }
html:root[data-theme="light"] .sa-seg { background: var(--side); }
.sa-seg > button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text-2, var(--text)); font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; }
.sa-seg > button:hover { background: var(--hover); color: var(--text); }
.sa-seg > button[aria-pressed="true"] { background: var(--vd-accent); color: var(--text); }
.pa-who { margin: 0 0 12px; }
.pa-staff-ic { color: var(--vd-accent); font-size: .8rem; margin-left: 3px; }
.sa-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 4px 0 16px; }
.sa-filter > label { display: flex; flex-direction: column; gap: 5px; font-size: .74rem; color: var(--text-muted); min-width: 170px; }
.sa-deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 0 0 16px; }
.sa-dep { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--side); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
html:root[data-theme="light"] .sa-dep { background: var(--side); }
.sa-dep:hover { border-color: var(--prim-line); }
.sa-dep.on { border-color: var(--vd-accent); box-shadow: 0 0 0 2px var(--acc-line); }
.sa-dep-h { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* every card has the same four lines — the role with its "active" count under it, the number of changes, sign-ins and
   hours, the bar — and the cards of a row share them (subgrid), so each line sits at the same height in every card */
.sa-dep-h > *, .sa-dep-h small { white-space: nowrap; }
.sa-deps > .sa-dep { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 8px; align-content: start; }
.sa-deps > .sa-dep > :last-child { align-self: center; }
.sa-dep-h small { color: var(--text-muted); font-size: .72rem; }
.sa-dep-n { display: flex; align-items: baseline; gap: 6px; }
.sa-dep-n b { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.sa-dep-n span, .sa-dep-sub { color: var(--text-muted); font-size: .74rem; }
.sa-dep-sub { display: flex; gap: 12px; }
.sa-bar { display: flex; gap: 2px; height: 8px; width: 100%; min-width: 80px; border-radius: 4px; overflow: hidden; }
.sa-bar > i { background: var(--c); min-width: 3px; }
.sa-chart-box { margin-bottom: 16px; }
.sa-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 12px 14px 0; }
.sa-col { position: relative; flex: 1; min-width: 4px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sa-col > i { width: 100%; max-width: 34px; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--info); }
.sa-col:hover > i { background: var(--vd-cyan); }
.sa-col > span { position: absolute; bottom: -18px; font-size: .62rem; color: var(--text-muted); white-space: nowrap; }
.sa-col:nth-child(even) > span { display: none; }
.sa-chart:has(.sa-col:nth-child(-n+10):last-child) .sa-col > span { display: block; }
.sa-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--vd-accent); }
.sa-col > .sa-dot { position: absolute; top: -2px; }
.sa-legend { display: flex; gap: 16px; padding: 26px 14px 12px; font-size: .72rem; color: var(--text-muted); }
.sa-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sa-lg-bar { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--info); }
.sa-people .sa-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sa-people .sa-what { min-width: 120px; }
.sa-row { cursor: pointer; }
.sa-row.on > td { background: var(--acc-soft); }
.sa-row:focus-visible { outline: 2px solid var(--vd-accent); outline-offset: -2px; }
.sa-who { display: flex; align-items: center; gap: 10px; }
.sa-who > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.sa-roles { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .72rem; }
.sa-pick { margin: 4px 0 20px; }
.sa-one .ts-section-header { gap: 8px; }
.sa-one .ts-section-header .sf-av { width: 26px; height: 26px; font-size: 10px; border-radius: 7px; }
.sa-one-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); font-size: .78rem; color: var(--text-muted); }
.sa-one-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.sa-k { display: inline-flex; align-items: center; gap: 5px; }
.sa-day { padding: 10px 14px; }
.sa-day + .sa-day { border-top: 1px solid var(--border-color); }
.sa-day-h { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 6px; font-size: .78rem; color: var(--text-muted); }
.sa-day-h b { color: var(--text); font-size: .84rem; }
.sa-ev { display: grid; grid-template-columns: 48px 18px minmax(140px, auto) 1fr; gap: 8px; align-items: baseline; padding: 3px 0; font-size: .78rem; }
.sa-ev-t { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sa-ev-a { font-weight: 500; }
.sa-ev-session .sa-ev-a { color: var(--text-muted); font-weight: 400; }
.sa-ev-d { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .sa-ev { grid-template-columns: 44px 16px 1fr; } .sa-ev-d { display: none; } .sa-filter > label { min-width: 0; flex: 1 1 140px; } }
.pa-who { width: max-content; max-width: 100%; flex-wrap: wrap; }
.sa-ev { grid-template-columns: 56px 18px minmax(200px, auto) 1fr; }
/* My account → SQL Wizard staff (staff without an organization) */
.ac-staff-sub { margin: 14px 0 8px; font-weight: 600; font-size: .84rem; }
.ac-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; }
.ac-staff-h { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 4px; }
.ac-staff-a { display: flex; gap: 6px; font-size: .8rem; padding: 2px 0; }
.ac-staff-a > .bi { color: var(--success); }
/* Home: the staff line under the greeting */
.hm-where .sf-rchip { vertical-align: 1px; }
.hm-mgr { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--vd-yellow); }
/* Home: staff without 2-step sign-in — at the top, above the widgets */
.hm-2fa { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-soft); font-size: .86rem; }
.hm-2fa[hidden] { display: none; }
.hm-2fa > .bi { color: var(--warning); font-size: 1.1rem; }
.hm-2fa > span { flex: 1; }
html:root[data-theme="light"] .hm-2fa { background: var(--warn-soft); }

/* Home → Customize: Width and Height on each widget (2026-11-22) */
.hw-pad-segs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hw-pad-segs .hw-seg { align-self: center; }
.hw-editing .hw-h-auto, .hw-editing .hw-h-s { min-height: 236px; }
.hw-editing .hw-h-s .hw-pad-drag { display: none; }
.hw-editing .hw-w.hw-nothing:not(.hw-dragging) { min-height: 236px; }

/* Phone browsers (Chrome / Samsung "dark mode for websites"): each theme says its own colour scheme, so the browser doesn't
   darken the light theme into black (2026-11-22) */
:root[data-theme="dark"] { color-scheme: dark; }
html:root[data-theme="light"] { color-scheme: only light; }

/* ══ Phone (2026-11-22): headers in two lines — the title (and its count) on the first, the note and the buttons each on
      a full line below; nothing wider than the screen ══ */
@media (max-width: 767.98px) {
  #content { overflow-x: clip !important; }
  #content .ts-section-header { flex-wrap: wrap; row-gap: 8px; }
  #content .ts-section-header > .vw-section-note { flex: 1 1 100%; order: 5; margin-left: 0; }
  #content .ts-section-header-actions { order: 6; flex: 1 1 100%; margin-left: 0 !important; flex-wrap: wrap; justify-content: flex-start; row-gap: 6px; }
  #content .ts-section-header-actions > :is(.sbp-search, .ts-search, .td-search, input, select) { flex: 1 1 100%; min-width: 0; max-width: none; width: auto; }
  #content .ts-section-header-actions .sbp-search input { width: 100%; }
  #content .pg-head > .pg-head-acts { flex: 1 1 100%; margin-left: 0 !important; justify-content: flex-start; row-gap: 8px; }
  #content .pg-head > .pg-head-acts > :is(.sbp-search, .ts-search, .td-search) { flex: 1 1 100% !important; min-width: 0; }
  /* My account → My privileges: the count is a badge, not a bar */
  .ac-priv .ts-section-count { justify-self: start; }
  /* SQL Builder: the four statements share the first line; at the foot Run · Explain · Check, then the fields, then Save */
  .sb-kind { flex: 1 1 100%; display: flex; }
  .sb-kind > .ts-btn { flex: 1 1 0; justify-content: center; padding-left: 4px !important; padding-right: 4px !important; }
  .sb-run-bar { align-items: center; }
  .sb-run-bar > #sb-run, .sb-run-bar > #sb-explain, .sb-run-bar > #sb-check { order: 1; flex: 1 1 0; justify-content: center; }
  .sb-run-bar > .sb-rows-field { order: 2; flex: 0 0 auto; }
  .sb-run-bar > .sb-save { display: contents; }
  .sb-run-bar #sb-save-name { order: 2; flex: 1 1 140px; min-width: 0; align-self: flex-end; }
  .sb-run-bar #sb-share-wrap { order: 3; }
  .sb-run-bar #sb-save { order: 3; margin-left: auto; }
}
@media (max-width: 767.98px) {
  /* Database overview → Largest tables: the name and its bar on the first line, the size and the rows under it */
  .ov-bar-row { grid-template-columns: minmax(0, 42%) 1fr; row-gap: 3px; padding: 7px 6px; }
  .ov-bar-row .ov-bar-num { grid-row: 2; text-align: left; }
  .ov-bar-row .ov-bar-num:not(.ov-muted) { grid-column: 1; }
  .ov-bar-row .ov-bar-num.ov-muted { grid-column: 2; }
  .ov-recent-row { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 767.98px) {
  /* Performance: Findings / Slow queries on one line, Report and the table stepper on the next */
  .pf-main-bar { flex-wrap: wrap !important; row-gap: 8px; }
  .pf-main-bar > .pf-step { margin-left: auto; }
}
@media (max-width: 767.98px) {
  /* a box in a grid fits the screen (its table scrolls sideways inside it) instead of growing past the edge */
  #content [class*="grid"] > *, #content [class*="cols"] > *, .wz-rel-add > * { min-width: 0; }
  /* Wizard → Links: the diagram scrolls inside its box */
  .wz-diagram-body { max-width: 100%; }
}
@media (max-width: 767.98px) { .wz-rel-add-top { grid-template-columns: minmax(0, 1fr) !important; } }
/* Planner → Details on a phone: under the canvas, Larger makes it take most of the screen */
.pl-win-big-btn { display: none !important; }
@media (max-width: 820px) {
  .pl-win-big-btn { display: inline-flex !important; }
  .pl-win { max-height: 50% !important; }
  .pl-win.pl-win-big { max-height: 88% !important; min-height: 60%; }
  .pl-win > .pl-panel { overflow-y: auto; min-height: 0; }
}
/* ══ Phone: a dialog is never wider or taller than the screen — its header (×) and buttons stay in view, the body scrolls,
      long code (SQL) scrolls sideways inside its block ══ */
@media (max-width: 767.98px) {
  .modal-container { grid-template-columns: minmax(0, 1fr); }
  .modal-shell:not(.modal-full) { width: auto !important; max-width: calc(100vw - 16px) !important; margin: 0 8px !important; min-width: 0; }
  .modal-content { max-height: calc(100dvh - 16px); display: flex; flex-direction: column; min-width: 0; }
  .modal-header, .modal-footer { flex-shrink: 0; }
  .modal-body { max-height: none !important; flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; }
  .modal-body-content, .modal-body-content > * { min-width: 0; max-width: 100%; }
  .modal-footer { flex-wrap: wrap; row-gap: 8px; }
  .modal-body pre, .modal-body .ts-code-block { max-width: 100%; overflow-x: auto; }
}
@media (max-width: 767.98px) {
  /* Template editor → Indexes: each index a block — name, Unique and remove on one line, its columns below in a grid */
  .te-ix, .te-ix tbody { display: block; width: 100%; }
  .te-ix thead { display: none; }
  .te-ix tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
  .te-ix tr:last-child { border-bottom: 0; }
  .te-ix td { display: block; padding: 0 !important; border: 0 !important; }
  .te-ix td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .te-ix .te-ix-ulabel { display: inline; }
}
@media (max-width: 767.98px) {
  /* header: one line — a long page name shortens with … instead of pushing search and the account down */
  #main-nav { min-width: 0; flex: 1 1 auto; }
  #main-nav > .table-toolbar { flex-wrap: nowrap !important; min-width: 0; }
  #main-nav > .table-toolbar > .flex-grow-1 { min-width: 0; overflow: hidden; }
  #main-nav .breadcrumb-navi { min-width: 0; max-width: 100%; }
  #main-header #auth-account { flex-shrink: 0; }
}
@media (max-width: 767.98px) {
  /* My reports → Show as: the choices wrap onto a second line */
  .mr-show { flex-wrap: wrap; overflow: visible; }
  .mr-show > button { flex: 1 1 auto; }
}
@media (max-width: 767.98px) {
  /* Reports and Privacy mail → the answer: "To … as …" on its own line, then Close and Send */
  .rp-reply-row { flex-wrap: wrap !important; row-gap: 8px; }
  .rp-reply-to { flex: 1 1 100% !important; line-height: 1.5; overflow-wrap: anywhere; }
  .rp-reply-row > button[type="submit"] { margin-left: auto; }
  /* the Platform admin search: the field fills its line, the button beside it */
  .pa-filter > .pa-q { flex: 1 1 0 !important; min-width: 0 !important; width: auto !important; }
  .pa-filter > .pa-q input { width: 100%; }
}
/* ══ Phone, round 2 ══ */
@media (max-width: 767.98px) {
  /* a table wider than the box that cut it off scrolls sideways in that box (core/PhoneFit.js) */
  #content .ph-xscroll { overflow-x: auto !important; overscroll-behavior-x: contain; }
  /* Performance: the table list is above the findings, not stuck over them; picking a table goes down to its findings */
  .pf-side-list { position: static !important; max-height: none !important; }
}
@media (max-width: 820px) {
  /* Planner: Details is under the board — its fold arrow points down while it is open; the zoom sits at the board's top */
  .pl-win [data-pl-win-fold] > .bi { transform: rotate(180deg); }
  .pl-area > .pl-zoombox { top: 8px; bottom: auto; left: 8px; }
}
/* Template editor → Indexes: the columns to tick in even columns, so they line up from row to row */
.te-ixcols { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px 12px; }
.te-ixcols label { min-width: 0; }
.te-ixcols label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-ix-u { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: .74rem; color: var(--text-muted); }
.te-ix-ulabel { display: none; }
@media (max-width: 767.98px) {
  /* a dialog fits the box it is centred in (100vw can be wider than what a phone shows) */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .modal-container { width: 100%; height: 100dvh; justify-items: center; }
  .modal-shell:not(.modal-full) { box-sizing: border-box; width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important; margin: 0 !important; }
  .modal-shell:not(.modal-full) > .modal-content { box-sizing: border-box; width: 100%; max-width: 100%; }
  .modal-body-content { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 767.98px) {
  /* the page's own header stays in view under the app header: the Database Wizard's steps (Back / Next at the bottom),
     the page's top part on every page (class ph-stick, core/PhoneFit.js) */
  .wz-nav { position: sticky; bottom: 0; z-index: 60; }
  #content .ph-stick { position: sticky !important; top: var(--ph-top); z-index: 60; }
  #content .ph-stick-bg { background: var(--bg); }
  #content .ts-body .pg-head.ph-stick { padding-block: 6px; box-shadow: -24px 0 0 var(--bg), 24px 0 0 var(--bg); }
  /* Database Wizard: Start over as an icon on the title line, so the part that stays on top is short */
  .wz-wrap .td-head .pg-head { flex-wrap: nowrap; }
  .wz-wrap .td-head .pg-head-acts { flex: 0 0 auto !important; flex-basis: auto !important; margin-left: auto !important; }
  .wz-restart { font-size: 0 !important; width: 36px; padding: 0 !important; justify-content: center; }
  .wz-restart > .bi { font-size: 1rem; margin: 0; }
  .wz-wrap .td-lead:not(:has(> :not(.d-none))) { display: none; }
}
@media (max-width: 767.98px) {
  /* My account → My privileges: the count right after its caption (Data 4), the privileges below */
  .ac-priv { gap: 6px 8px; }
  .ac-priv > .ts-section-count { display: none; }
  .ac-priv-k > .ac-priv-kn { display: inline-flex; margin-left: 6px; vertical-align: 1px; }
  /* Your reports: each report two lines — number and subject, then answers, status and date — inside its box */
  #ac-reports .ac-reports, #ac-reports .ac-reports tbody { display: block; width: 100%; }
  #ac-reports .ac-reports thead { display: none; }
  #ac-reports .ac-report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 4px; border-bottom: 1px solid var(--border-color); }
  #ac-reports .ac-report-row > td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
  #ac-reports .ac-report-row > td:nth-child(2) { flex: 1 1 calc(100% - 64px); min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
  #ac-reports .ac-report-row > td:nth-child(3):empty { display: none; }
  .ac-report-open, .ac-report-ans-text { overflow-wrap: anywhere; min-width: 0; }
}
.ac-priv-kn { display: none; }
@media (max-width: 820px) {
  /* Planner: the board gives way to Details (up to half the area, Larger most of it) instead of squeezing it to a few rows */
  .pl-area > .pl-win { flex-shrink: 0; }
  .pl-area > .pl-canvas { flex: 1 1 auto; min-height: 120px; }
  .pl-win > .pl-panel { max-height: none !important; }
}
@media (min-width: 768px) { .te-ix th:nth-child(2), .te-ix td:nth-child(2) { width: 58%; } }
@media (max-width: 820px) {
  /* Planner: Details folded while Larger is on — only its title bar stays, like any folded window */
  .pl-win.pl-win-big.vd-fp-closed { min-height: 0 !important; max-height: none !important; }
}

/* Database servers: how safe the way to the server is (servers_page.js _tlsNote) — a warning when not encrypted,
   a hint to choose Verify when the certificate isn't checked */
.sv-card .sv-tls-note { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px; padding: 10px 14px; margin: -4px 0 14px; border-radius: 8px; font-size: 0.82rem; line-height: 1.5; }
.sv-card .sv-tls-note > .bi { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.sv-card .sv-tls-note > div { flex: 1 1 auto; min-width: 0; }
.sv-card .sv-tls-note .sv-tls-btn { flex-shrink: 0; align-self: center; white-space: nowrap; }
@media (max-width: 767.98px) {
  .sv-card .sv-tls-note { display: grid; grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .sv-card .sv-tls-note .sv-tls-btn { grid-column: 2; justify-self: start; }
}

/* The password again before a dangerous action (js/helpers/reauth.js) */
.reauth-form .reauth-lead { margin: 0 0 14px; color: var(--text-muted); line-height: 1.5; }
.reauth-form .reauth-row { display: flex; gap: 6px; align-items: center; }
.reauth-form .reauth-row .form-control { flex: 1 1 auto; min-width: 0; }
.reauth-form .reauth-error { margin-top: 10px; }

/* Database servers → MySQL logins → Read-only login… (servers_page.js readOnly) */
.sv-panel-head .sv-panel-btn + .sv-panel-btn2 { margin-left: 6px; }
.sv-ro-hint { margin: -4px 0 12px; }
.sv-ro-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 6px; font-weight: 600; font-size: 0.85rem; }
.sv-ro-dbs { max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; }
.sv-ro-lead { margin-bottom: 14px !important; }
/* Scheduled backups → Encryption (backup_key.js) */
.bs-key-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bs-key { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 10px; background: var(--side); border: 1px solid var(--border-color); }
html:root[data-theme="light"] .bs-key { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.bs-key > .bi { font-size: 1.3rem; color: var(--text-muted); line-height: 1.2; }
.bs-key-on > .bi { color: var(--success); }
.bs-key-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bs-key-tx b { font-size: 0.92rem; color: var(--text); }
.bs-key-tx > span { font-size: 0.82rem; color: var(--text-2); }
.bs-key-facts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; color: var(--text-muted) !important; }
.bs-key-facts code { font-size: 0.78rem; color: var(--text); }
.bs-key-secret { font-size: 0.86rem !important; user-select: all; }
.bs-key-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.bs-key-check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-weight: 600; cursor: pointer; }
.bs-run-file .bi-lock-fill { color: var(--success); }
.age-key-text { width: 100%; resize: vertical; font-family: var(--font-mono, monospace); font-size: 0.82rem; }
.age-key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 640px) { .bs-page .bs-part-key .bs-part-head { flex-wrap: wrap; gap: 8px; } }
/* Database servers → Security check (security_report.js) */
.sv-sec { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 10px; border-radius: 999px; border: 1px solid; font-size: 0.78rem; cursor: pointer; background: none; }
.sv-sec b { font-size: 0.86rem; } .sv-sec small { color: var(--text-muted); }
.sv-sec-ok { color: var(--success); border-color: var(--ok-line); background: var(--ok-soft); }
.sv-sec-warn { color: var(--warning); border-color: var(--warn-line); background: var(--warn-soft); }
.sv-sec-bad { color: var(--alert); border-color: var(--err-line); background: var(--err-soft); }
.sv-sec:hover { filter: brightness(1.1); }
.sv-meta .sv-sec-run { margin-left: auto; }
.sec-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.sec-ring { --c: var(--success); --c-soft: var(--ok-soft); --c-line: var(--ok-line); --c-strong: var(--ok-strong); flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) var(--deg), var(--c-soft) 0); }
.sec-warn { --c: var(--warning); --c-soft: var(--warn-soft); --c-line: var(--warn-line); --c-strong: var(--warn-strong); } .sec-bad { --c: var(--alert); --c-soft: var(--err-soft); --c-line: var(--err-line); --c-strong: var(--err-strong); }
.sec-ring-in { width: 68px; height: 68px; border-radius: 50%; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.sec-ring-in b { font-size: 1.6rem; color: var(--c); } .sec-ring-in span { font-size: 0.74rem; color: var(--text-muted); }
.sec-head-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sec-sum { font-size: 1rem; font-weight: 600; }
.sec-n-bad { color: var(--alert); } .sec-n-warn { color: var(--warning); } .sec-n-ok { color: var(--success); }
.sec-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sec-pt { display: flex; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-color); background: var(--side); }
html:root[data-theme="light"] .sec-pt { background: var(--side); border-color: var(--cl-line, var(--hover)); }
.sec-pt > .bi { font-size: 1.05rem; line-height: 1.35; }
.sec-pt-bad > .bi { color: var(--alert); } .sec-pt-warn > .bi { color: var(--warning); } .sec-pt-good > .bi { color: var(--success); } .sec-pt-info > .bi { color: var(--text-muted); }
.sec-pt-bad { border-color: var(--err-line) !important; }
.sec-pt-warn { border-color: var(--warn-line) !important; }
.sec-pt-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 0.86rem; }
.sec-pt-tx > b { font-size: 0.9rem; }
.sec-advice { color: var(--text-2); }
.sec-advice .bi { color: var(--text-muted); }
.sec-sql { position: relative; margin-top: 4px; }
.sec-sql pre { display: block; width: 100%; box-sizing: border-box; margin: 0; padding-right: 40px; }
.sec-copy { position: absolute; top: 4px; right: 4px; }
@media (max-width: 640px) { .sec-head { align-items: flex-start; } .sec-ring { width: 68px; height: 68px; } .sec-ring-in { width: 54px; height: 54px; } }

/* Home → Settings in groups (home_settings.tpl): a heading with an icon and a line, then its blocks */
.hm-group { margin-top: 26px; scroll-margin-top: 12px; }
.hm-group:first-of-type { margin-top: 6px; }
.hm-group[hidden] { display: none !important; }
.hm-group-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.hm-group-ic { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; font-size: 16px;
  background: var(--prim-soft); color: var(--prim-strong); }
html:root[data-theme="light"] .hm-group-ic { background: var(--prim-soft); color: var(--prim-strong); }
.hm-group-title { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--text); letter-spacing: 0; }
.hm-group-lead { margin: 1px 0 0; font-size: .78rem; color: var(--text-muted); }
.hm-group > .hm-sec { border-radius: 10px; }
/* the sidebar: the group as a heading, its blocks under it */
.sbp-set-group + .sbp-set-group { margin-top: 8px; }
.sbp-set-groups .sbp-set-head { font-weight: 700; color: var(--text); }
.sbp-set-groups .sbp-item:not(.sbp-set-head) { padding-left: 26px; }
.hm-set-grid .hm-org-work { margin: 0 0 8px; }

/* ══ charts fill their widget (2026-11-28): the line or the columns take the free height of the widget instead of a fixed 44 / 110 px ══ */
.hw-body:has(> .hw-pad > .hw-spark) { display: flex; flex-direction: column; }
.hw-body > .hw-pad:has(> .hw-spark) { flex: 1 1 auto; display: flex; flex-direction: column; }
.hw-pad > .hw-spark { flex: 1 1 44px; height: auto; min-height: 44px; }
.hw-body:has(> .hw-chart) { display: flex; flex-direction: column; }
.hw-body > .hw-chart { flex: 1 1 110px; height: auto; min-height: 110px; }
.hw-body > .hw-chart.hw-mv { flex-basis: 130px; min-height: 130px; }

/* ══ SQL that is only shown (core/SqlBlocks.js, 2026-11-28): the SQL Console's look — its colours, line numbers in a
   gutter, one frame with round corners (the box around it gives up its own edge, so there is never a double line) ══ */
html:root pre.sqlv {
  --sqlv-g: calc(var(--sqlv-d, 2) * 1ch + 18px);
  margin: 0 !important; padding: 10px 14px 10px 0 !important; counter-reset: sqlv;
  font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace !important; font-size: .8rem !important; line-height: 1.55em !important;
  color: var(--text-2) !important; white-space: pre !important; tab-size: 2; overflow: auto;
  border: 1px solid var(--pt-in-bd) !important; border-radius: 8px !important; box-shadow: none !important;
  background: linear-gradient(to right, var(--side) var(--sqlv-g), var(--border-color) var(--sqlv-g), var(--border-color) calc(var(--sqlv-g) + 1px), transparent calc(var(--sqlv-g) + 1px)), var(--bg) !important;
}
html:root[data-theme="light"] pre.sqlv {
  background: linear-gradient(to right, var(--side) var(--sqlv-g), var(--cl-line, var(--hover)) var(--sqlv-g), var(--cl-line, var(--hover)) calc(var(--sqlv-g) + 1px), transparent calc(var(--sqlv-g) + 1px)), var(--side) !important;
}
html:root pre.sqlv > code { font: inherit !important; color: inherit !important; background: none !important; padding: 0 !important; border: 0 !important; white-space: inherit !important; }
pre.sqlv .sqlv-l { counter-increment: sqlv; }
pre.sqlv .sqlv-l::before {
  content: counter(sqlv); position: sticky; left: 0; display: inline-block; box-sizing: border-box;
  width: var(--sqlv-g); margin-right: 13px; padding-right: 8px; text-align: right; color: var(--text-muted); background: var(--side); user-select: none;
}
:is(.ts-code-block, .wz-sql-block):has(> pre.sqlv) { border: 0 !important; background: none !important; border-radius: 0 !important; overflow: visible !important; max-height: none !important; padding: 0 !important; box-shadow: none !important; }
:is(.ts-code-block, .wz-sql-block) > pre.sqlv { max-height: 500px; }
.wz-sql-block > pre.sqlv { max-height: 420px; }
.ac-kv:last-child { border-bottom: 0; }

/* ══ 2026-11-28 · the same parts in every theme (moved here from app-coral.css: only colours differ per theme) ══
   Lists to pick from are List-group rows, button groups are joined with a line under the chosen one, boxes have all
   four edges. html:root:not(#pt) is stronger than any theme's own rule for these parts, so every theme shows the same. */
:root { --pt-line: var(--border-color); }
html:root[data-theme="light"] { --pt-line: var(--cl-line, var(--hover)); }
/* 2 · Service at a glance: the tiles' lines are real 1 px edges in the box colour (the 1 px gaps rounded to uneven widths) */
html:root:not(#pt) .hw-tiles { gap: 0; background: none; margin: -1px 0 0 -1px; }
html:root:not(#pt) .hw-tile { border-left: 1px solid var(--pt-line); border-top: 1px solid var(--pt-line); }
/* 5 · SQL Builder: SELECT / INSERT / UPDATE / DELETE like the Routines group — white, the chosen one marked by a line at the bottom in its colour */
html:root:not(#pt) .sb-kind { display: inline-flex; gap: 0; }
html:root:not(#pt) .sb-kind > .ts-btn { height: 32px; border-radius: 0 !important; margin-left: -1px; background: var(--side) !important; border-color: var(--pt-line) !important; color: var(--text-2) !important; box-shadow: none !important; }
html:root:not(#pt) .sb-kind > .ts-btn:first-child { border-radius: 8px 0 0 8px !important; margin-left: 0; }
html:root:not(#pt) .sb-kind > .ts-btn:last-child { border-radius: 0 8px 8px 0 !important; }
html:root:not(#pt) .sb-kind > .ts-btn:hover:not(:disabled) { background: var(--hover) !important; }
html:root:not(#pt) .sb-kind > .ts-btn.active { position: relative; z-index: 1; background: var(--side) !important; border-color: var(--pt-line) !important; color: var(--text) !important; --k: var(--vd-accent); box-shadow: inset 0 -2px 0 var(--k) !important; }
html:root:not(#pt) .sb-kind > .ts-btn.active[data-kind="insert"] { --k: var(--success); }
html:root:not(#pt) .sb-kind > .ts-btn.active[data-kind="update"] { --k: var(--warning); }
html:root:not(#pt) .sb-kind > .ts-btn.active[data-kind="delete"] { --k: var(--alert); }
html:root:not(#pt) .sb-kind > .ts-btn.active > .bi { color: var(--k) !important; }
/* 6 · Import: the drop box stands out from the page; under the mouse or a file it turns mint */
html:root:not(#pt) .im-drop { border-color: var(--text-faint); background: var(--side); }
html:root:not(#pt) :is(.im-drop:hover, .im-drop-over) { border-color: var(--vd-accent); background: var(--hover); }
/* 8 · 13 · 14 · lists to pick from (Performance tables, Reports, Privacy mail): rows in one white box as in Colours & parts → 12 · List group —
   a line between rows, mint under the mouse, the picked row tinted with a 3 px edge in its colour */
html:root:not(#pt) :is(.pf-tl, .rp-side > .rp-list) { gap: 0; padding: 0; background: var(--side); border-top: 1px solid var(--pt-line); }
html:root:not(#pt) :is(.pf-tl .pf-tile, .rp-list .rp-card) { margin: 0; border: 0 !important; border-bottom: 1px solid var(--pt-line) !important; border-radius: 0; background: var(--side); box-shadow: none; transform: none; }
html:root:not(#pt) :is(.pf-tl .pf-tile, .rp-list .rp-card):hover { background: var(--hover); }
html:root:not(#pt) .pf-tl .pf-tile.pf-tile-on { background: var(--vd-surface-2); box-shadow: inset 3px 0 0 var(--t); }
html:root:not(#pt) .rp-list .rp-card.rp-on { background: var(--vd-surface-2); box-shadow: inset 3px 0 0 var(--s); }
/* 13 · 14 · from "Waiting longest" to the end: the same white as the boxes around them */
html:root:not(#pt) :is(.rp-oldest, .rp-kind, .rp-page) { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) .rp-oldest { border-left-color: var(--warning); }
html:root:not(#pt) :is(.rp-kind, .rp-page):hover { border-color: var(--vd-accent); background: var(--hover); }
/* 9 · Planner tools like the Designer's: plain buttons, a switched-on one white with its edge and a mint line at the bottom */
html:root:not(#pt) .pl-tools :is(.pl-tool[aria-pressed="true"], .pl-tool.pl-toggle-on) { background: var(--side); color: var(--text); border-color: var(--pt-line); box-shadow: inset 0 -2px 0 var(--vd-accent); }
html:root:not(#pt) .pl-tools :is(.pl-tool[aria-pressed="true"], .pl-tool.pl-toggle-on) > .bi { color: var(--accent-text); }
html:root:not(#pt) .pl-tools .pl-tool-primary { background: none; color: var(--text-2); }
html:root:not(#pt) .pl-tools .pl-tool-primary > .bi { color: var(--accent-text); }
html:root:not(#pt) .pl-tools .pl-tool-primary:hover:not(:disabled) { background: var(--hover); color: var(--text); }
/* 10 · Database Wizard: the choices are white boxes with the box edge; the chosen one a solid tint of the page colour */
html:root:not(#pt) :is(.wz-mode-card, .wz-tpl) { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) :is(.wz-mode-card, .wz-tpl):hover { border-color: var(--page-c-line, var(--prim-line)); }
html:root:not(#pt) :is(.wz-mode-on, .wz-tpl-on) { background: var(--page-c-soft, var(--prim-soft)); border-color: var(--page-c, var(--c-prim)); }
html:root:not(#pt) .wz-step-on { background: var(--page-c-soft, var(--prim-soft)); border-color: var(--page-c-line, var(--prim-line)); }
/* 11 · Scheduled backups: Storage and Encryption sit on the page, no white box around them */
html:root:not(#pt) .bs-part { background: none !important; border-color: transparent !important; }
/* 12 · My reports: buttons, choices and drop-downs white with the box edge; "Show as" a group like the others */
html:root:not(#pt) :is(.mr-src button, .mr-chip) { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) .mr-src button[aria-pressed="true"] { background: var(--prim-soft); border-color: var(--vd-accent); color: var(--text); }
html:root:not(#pt) .mr-chip:has(input:checked) { background: var(--prim-soft); border-color: var(--prim-line); }
html:root:not(#pt) .mr-card :is(.cs-btn, .ts-btn:not(.ts-btn-primary)) { background: var(--side) !important; border-color: var(--pt-line) !important; }
html:root:not(#pt) .mr-n { background: var(--prim-soft); color: var(--accent-text); }
html:root:not(#pt) .hw-seg { border-color: var(--pt-line); border-radius: 8px; }
html:root:not(#pt) .hw-seg button { background: var(--side); color: var(--text-2); border-left-color: var(--pt-line); }
html:root:not(#pt) .hw-seg button:hover { background: var(--hover); }
html:root:not(#pt) .hw-seg button[aria-pressed="true"] { background: var(--side); color: var(--text); box-shadow: inset 0 -2px 0 var(--vd-accent); }
/* 15 · Staff roles and "What this person may do": white boxes, not the page colour */
html:root:not(#pt) :is(.sf-role, .sf-rg) { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) .sf-role:has(input:checked) { background: var(--c-soft); border-color: var(--c-line); }
html:root:not(#pt) .sf-act.sf-own { background: var(--warn-soft); }
html:root:not(#pt) .sf-av { background: var(--c-soft); }
/* 16 · Staff activity → Changes per day: the chart in its own white box */
/* Staff activity → Changes per day: one box like People — the title on top, then the chart and its key, no box inside the box */
html:root:not(#pt) .sa-chart-box > .pa-chart { background: var(--side); border: 1px solid var(--pt-line); border-top: 0; border-radius: 0 0 10px 10px; padding: 12px 14px 10px; margin: 0; }
html:root:not(#pt) .bk-table tbody tr:hover > td { background: var(--hover); }
/* Privacy mail → How it works: in a white box like the parts around it */
html:root:not(#pt) .pm-how { margin: -4px 0 0; padding: 10px 14px 10px 30px; background: var(--side); border: 1px solid var(--pt-line); border-radius: 8px; }
/* Database Wizard, steps 3 and 4: the table list, the options strip, the links and the suggestions are white boxes */
html:root:not(#pt) :is(.wz-tlist, .wz-opts, .wz-rel, .wz-sugg-item, .wz-at-chip) { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) .wz-titem:hover { background: var(--hover); }
html:root:not(#pt) .wz-titem-on { background: var(--page-c-soft, var(--prim-soft)); border-color: var(--page-c-line, var(--prim-line)); }
/* Scheduled backups: the groups in New storage / New schedule are white; History → Details one calm tint, also under the mouse */
html:root:not(#pt) .bs-form .xp-opt-col { background: var(--side); border-color: var(--pt-line); }
html:root:not(#pt) .bs-part .ts-data-table tbody tr.bs-run-more > td,
html:root:not(#pt) .bs-part .ts-data-table tbody tr.bs-run-more:hover > td { background: var(--vd-surface-2) !important; }
/* Organization pages (Members and invitations, Permissions, Audit log): every box has all four edges and round corners */
html:root:not(#pt) .og-flat .og-sec > .og-body { border: 1px solid var(--pt-line) !important; border-radius: 10px !important; }
/* Database servers → MySQL logins / Members: the table inside the panel has no edges of its own (no double line) */
html:root:not(#pt) .sv-panel > table.bk-table { border-left: 0 !important; border-right: 0 !important; border-bottom: 0 !important; border-radius: 0 !important; }
/* Staff: the people as rows of one white box (Colours & parts → 12 · List group) */
html:root:not(#pt) .sf-people { gap: 0; background: var(--side); border: 1px solid var(--pt-line); border-radius: 9px; overflow: hidden; }
html:root:not(#pt) .sf-person { border: 0; border-radius: 0; background: var(--side); box-shadow: none; }
html:root:not(#pt) .sf-person + .sf-person { border-top: 1px solid var(--pt-line); }
html:root:not(#pt) .sf-person:hover { background: var(--hover); }
html:root:not(#pt) .sf-person[aria-current="true"] { background: var(--vd-surface-2); box-shadow: inset 3px 0 0 var(--vd-accent); }

/* Staff activity: each day of one person's activities in a white box */
html:root:not(#pt) .sa-one > .sa-day { background: var(--side); border: 1px solid var(--pt-line); border-radius: 9px; margin: 0 0 10px; }
html:root:not(#pt) .sa-one > .sa-day + .sa-day { border-top: 1px solid var(--pt-line); }
html:root:not(#pt) .sa-one-sum + .sa-day { margin-top: 10px; }
/* Organization: every box under a subtitle has all four edges and round corners (also About / Your organizations) */
html:root:not(#pt) .og-flat :is(.og-sec, .ac-box) > .og-body { border: 1px solid var(--pt-line) !important; border-radius: 10px !important; overflow: hidden; }
/* a table inside such a box draws no line of its own on top (Audit log: no line under the filters) */
html:root:not(#pt) .og-flat .og-body table.bk-table { border-top: 0 !important; }
/* Reports / Privacy mail → Handling: one joined group like Routines; the status set is white with a line at the bottom in its colour */
html:root:not(#pt) .rp-status { display: inline-flex; gap: 0; }
html:root:not(#pt) #content .rp-status .ts-btn[data-rp-setstatus] { height: 32px; margin: 0 0 0 -1px; border-radius: 0 !important; color: var(--text-2) !important; border-color: var(--pt-line) !important; background: var(--side) !important; box-shadow: none !important; }
html:root:not(#pt) #content .rp-status .ts-btn[data-rp-setstatus]:first-child { margin-left: 0; border-radius: 8px 0 0 8px !important; }
html:root:not(#pt) #content .rp-status .ts-btn[data-rp-setstatus]:last-of-type { border-radius: 0 8px 8px 0 !important; }
html:root:not(#pt) #content .rp-status .ts-btn[data-rp-setstatus]:hover { background: var(--hover) !important; }
html:root:not(#pt) #content .rp-status .ts-btn[data-rp-setstatus].active { position: relative; z-index: 1; color: var(--text) !important; background: var(--side) !important; box-shadow: inset 0 -2px 0 var(--st) !important; }

/* Wizard → step 6 · SQL script: the header is a subtitle (like the parts of a reading page) and the code box sits under it */
html:root:not(#pt) .ts-section.wz-sql { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; overflow: visible; }
html:root:not(#pt) .ts-section.wz-sql > .ts-section-header { background: none; border: 0; padding: 0 6px; margin: 0 0 10px; min-height: 32px;
  font-size: 1.05rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--text); }
html:root:not(#pt) .ts-section.wz-sql > .ts-section-header > .bi:first-child { color: var(--text-muted) !important; }
html:root:not(#pt) .wz-sql > .wz-sql-block:has(> pre.sqlv) { padding: 0 !important; }
html:root:not(#pt) .wz-sql pre.sqlv { background-color: var(--side); }
html:root:not(#pt) .sa-chart-box > .pa-chart { border-top: 1px solid var(--pt-line); }
/* Organization → the intro: exactly the page alert of Colours & parts → 6 · Notifications and alerts (info): Soft card, Line edge,
   6 px corners, icon and text in the Strong tone, weight 500, the icon in its own column */
html:root:not(#pt) .og-intro { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 6px 12px; border: 1px solid var(--info-line-x, var(--info-line));
  border-radius: 6px; background: var(--info-soft-x, var(--info-soft)); color: var(--info-strong-x, var(--info-strong));
  font-size: .84rem; font-weight: 500; line-height: 1.5; }
html:root:not(#pt) .og-intro > .bi { flex: none; font-size: 15px; line-height: 1.35; color: inherit; }
html:root:not(#pt) .og-intro b { color: inherit; font-weight: 700; }

/* Staff activity → one person: header, the summary and the days in one box (no part on the page colour, no box in a box) */
html:root:not(#pt) .ts-section.sa-one { flex: none; background: var(--side); border: 1px solid var(--pt-line); border-radius: 10px; overflow: hidden; padding: 0; }
html:root:not(#pt) .sa-one > .ts-section-header { margin: 0; border: 0; border-bottom: 1px solid var(--pt-line); border-radius: 0; background: var(--side); }
html:root:not(#pt) .sa-one > .sa-one-sum { margin: 0; padding: 10px 14px; background: var(--side); border-bottom: 1px solid var(--pt-line); }
html:root:not(#pt) .sa-one > .sa-day { margin: 0; background: none; border: 0; border-radius: 0; }
html:root:not(#pt) .sa-one > .sa-day + .sa-day { border-top: 1px solid var(--pt-line); }
html:root:not(#pt) .sa-one > :is(.pa-empty, .pa-sub) { margin: 0; padding: 12px 14px; }

/* ══ Set up SQL Wizard (core/SetupGuide.js, 2026-11-28): the guide in the sidebar and the spotlight on the page ══ */
/* the page dimmed like behind a dialog; holes for the part and the sidebar let clicks through (clip-path, evenodd) */
.sg-dim { position: fixed; inset: 0; z-index: 2640; background: rgba(10,14,22,0.55); }   /* a dimmer: see-through on purpose (the guided part shows through) */
html:root[data-theme="light"] .sg-dim { background: rgba(15,23,42,0.36); }
.sg-ring { position: fixed; z-index: 2641; pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 2px var(--vd-accent), 0 0 0 6px var(--acc-line); }
@media (prefers-reduced-motion: no-preference) { .sg-ring { animation: sg-pulse 1.8s ease-in-out 2; } }
@keyframes sg-pulse { 50% { box-shadow: 0 0 0 2px var(--vd-accent), 0 0 0 12px var(--acc-mid); } }
/* the rail's Set up tab only while the guide runs */
.sbr-setup.d-none { display: none !important; }
/* the panel */
.sg-progress { display: flex; flex-direction: column; gap: 6px; margin: 4px 4px 12px; }
.sg-progress-t { font-size: .74rem; font-weight: 600; color: var(--text-muted); }
.sg-progress-bar { height: 6px; border-radius: 3px; background: var(--vd-surface-2); overflow: hidden; }
.sg-progress-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--vd-accent); transition: width .3s ease; }
.sg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sg-step { border: 1px solid var(--pt-line); border-radius: 9px; background: var(--side); }
.sg-step.sg-on { border-color: var(--vd-accent); box-shadow: inset 3px 0 0 var(--vd-accent); }
.sg-step-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; border-radius: 9px; }
button.sg-step-head:hover { background: var(--hover); }
.sg-step-head small { margin-left: auto; font-weight: 400; color: var(--text-muted); }
.sg-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 700;
  border: 1px solid var(--pt-line); background: var(--vd-surface-2); color: var(--text-2); }
.sg-on .sg-mark { background: var(--vd-accent); border-color: var(--vd-accent); color: var(--pt-on-accent, var(--text)); }
.sg-done .sg-mark { background: var(--ok-soft); border-color: var(--success); color: var(--success); }
.sg-skipped .sg-step-t { color: var(--text-muted); }
.sg-body { padding: 0 12px 12px 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.sg-body p { margin: 0 0 8px; }
.sg-here { display: flex; gap: 6px; align-items: baseline; color: var(--accent-text); font-weight: 500; }
.sg-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; }
.sg-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 600; }
.sg-link { font-size: .78rem; }
.sg-extra { margin: 6px 0 8px; padding: 9px 10px; border: 1px dashed var(--pt-line); border-radius: 8px; }
.sg-extra b { display: block; color: var(--text); margin-bottom: 2px; }
.sg-help { margin-top: 2px; }
.sg-help > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; list-style: none; padding: 2px 0; }
.sg-help > summary::-webkit-details-marker { display: none; }
.sg-help[open] > summary { margin-bottom: 6px; }
.sg-help-t { margin: 6px 0 4px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.sg-how { margin: 0 0 8px; padding-left: 16px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sg-intro { margin: 4px 4px 12px; font-size: .8rem; color: var(--text-2); line-height: 1.5; }
.sg-end .sg-mark { background: var(--vd-accent); border-color: var(--vd-accent); color: var(--pt-on-accent, var(--text)); }
/* a phone: the step in a bar at the bottom while the sidebar drawer is closed */
.sg-bar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 2645; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--pt-line); border-radius: 12px; background: var(--side); box-shadow: 0 10px 30px rgba(10,14,22,.3); }
.sg-bar[hidden] { display: none; }
.sg-bar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .78rem; color: var(--text-2); }
.sg-bar-t b { color: var(--text); font-size: .8rem; }
.sg-bar-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Settings → Getting around → Setup guide: SQL Wizard accounts only */
body:not(.ac-mode) #hm-setup-guide { display: none !important; }
.sg-body p, .sg-extra p { font-size: inherit; }
/* the setup guide (part 2): a step's parts as a small checklist, notes while something has to happen first, the help's SQL and links */
.sg-parts { list-style: none; margin: 2px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sg-parts li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.sg-p-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 700; border: 1px solid var(--pt-line); background: var(--vd-surface-2); color: var(--text-muted); }
.sg-parts li.sg-p-on { color: var(--text); font-weight: 600; }
.sg-parts li.sg-p-on .sg-p-mark { background: var(--vd-accent); border-color: var(--vd-accent); color: var(--pt-on-accent, var(--text)); }
.sg-parts li.sg-p-done .sg-p-mark { background: var(--ok-soft); border-color: var(--success); color: var(--success); }
.sg-p-text { margin: 0 0 8px; }
.sg-wait { display: flex; gap: 6px; align-items: baseline; color: var(--text-2); }
.sg-wait .ov-spin { width: 12px; height: 12px; }
html:root:not(#pt) pre.sg-code { margin: 4px 0 8px !important; font-size: 11px !important; max-height: 160px; }
.sg-links { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px; }
.sg-links a { display: inline-flex; gap: 6px; align-items: baseline; color: var(--accent-text); text-decoration: none; }
.sg-links a:hover { text-decoration: underline; }
/* the setup guide (part 3): Home → Finish setting up, and the end's list of steps still open */
.hw-foot .hw-link { border: 0; background: none; padding: 0; color: var(--vd-accent); font: inherit; font-weight: 500; cursor: pointer; }
.hw-foot .hw-link:hover { text-decoration: underline; }
.hw-setup-li { align-items: center; }
.hw-setup-li > .ts-btn { flex: none; margin-left: auto; }
.hw-setup-li small { display: block; }
.sg-left { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sg-left-b { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 1px solid var(--pt-line); border-radius: 7px; background: var(--side); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sg-left-b:hover { background: var(--hover); }
.sg-left-b > .bi:last-child { margin-left: auto; color: var(--text-muted); }

/* ══ One field for a period (core/dateRange.js, 2026-11-28): "01.11.2026. – 28.11.2026.", the picker with quick choices,
   From · To and a two-month calendar — the date field's own calendar look, in every theme ══ */
[data-date-range] { display: block; min-width: 0; }
.dr { position: relative; display: flex; align-items: center; min-width: 0; }
html .dr-field.ts-editor-input { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 220px; height: 32px; padding: 0 32px 0 10px !important; text-align: left; cursor: pointer;
  font-size: .8rem !important; border-radius: 8px !important; white-space: nowrap; overflow: hidden; }
.dr-field > .bi { color: var(--text-muted); flex: none; }
.dr-text { overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; color: var(--text); }
.dr-field.dr-empty .dr-text { color: var(--text-muted); }
.dr-field[aria-expanded="true"] { border-color: var(--vd-accent) !important; }
.dr-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; font-size: .7rem; }
.dr-clear:hover { background: var(--hover); color: var(--text); }
.dr-clear[hidden] { display: none; }
.dr-pop.dt-picker { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200; display: flex; gap: 12px; padding: 12px; min-width: 0; width: max-content; max-width: calc(100vw - 16px); }
.dr-quick { display: flex; flex-direction: column; gap: 2px; min-width: 128px; padding-right: 12px; border-right: 1px solid var(--dt-border); }
.dr-q { border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 6px; color: var(--text-2); font: inherit; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.dr-q:hover { background: var(--hover); color: var(--text); }
.dr-q.is-on { background: var(--dt-accent-light); color: var(--text); font-weight: 600; }
.dr-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dr-ends { display: flex; align-items: flex-end; gap: 8px; }
.dr-end { display: flex; flex-direction: column; gap: 3px; margin: 0; flex: 1; min-width: 0; font-size: .7rem; font-weight: 600; color: var(--text-muted); }
html .dr-in.ts-editor-input { height: 30px !important; font-size: .8rem !important; min-width: 0; width: 100%; }
html .dr-in.is-invalid { border-color: var(--alert) !important; }
.dr-sep { padding-bottom: 6px; color: var(--text-muted); }
.dr-pop .dt-picker-header { margin: 0; }
.dr-months { display: grid; grid-template-columns: repeat(2, 224px); gap: 16px; }
.dr-month .dt-range-month-title { margin: 0 0 6px; font-size: .74rem; font-weight: 700; color: var(--text-2); text-transform: capitalize; }
.dr-month .dt-picker-grid { gap: 2px; }
.dr-month .dt-picker-day { min-height: 30px; padding: 0; font-size: .76rem; border-radius: 6px; }
.dr-month .dt-picker-day.dr-today { box-shadow: inset 0 0 0 1px var(--dt-accent); }
.dr-month .dt-picker-day.is-start, .dr-month .dt-picker-day.is-end { background: var(--dt-accent); border-color: var(--dt-accent); color: var(--pt-on-accent, var(--text)); font-weight: 700; }
.dr-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.dr-err { margin-right: auto; color: var(--alert); font-size: .74rem; }
.pa-afilter-when, .sa-when { min-width: 240px; }
/* Organization → Audit log: Area, What, Who, Details and a wider When in one row that stays inside the box */
html:root:not(#pt) #og-page .pa-afilter { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(250px, 1.35fr); }
@media (max-width: 1100px) { html:root:not(#pt) #og-page .pa-afilter { grid-template-columns: repeat(2, minmax(0, 1fr)); } html:root:not(#pt) #og-page .pa-afilter-when { grid-column: 1 / -1; } }
.tdg-range [data-date-range] { min-width: 230px; }
/* a phone: the picker as a sheet at the bottom, quick choices in a row above */
@media (max-width: 700px) {
  .dr-pop.dt-picker { position: fixed; top: auto; left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; flex-direction: column; max-height: 85vh; overflow-y: auto; }
  .dr-quick { flex-direction: row; flex-wrap: wrap; min-width: 0; padding: 0 0 8px; border-right: 0; border-bottom: 1px solid var(--dt-border); }
  .dr-months { grid-template-columns: 1fr; }
}
/* the period field in the page's normal text (a button would take the code font of the inputs); one month name only — over each month, the arrows at the sides */
html .dr-field.ts-editor-input { font-family: inherit !important; }
.dr-pop .dt-picker-header { position: relative; height: 0; margin: 0; z-index: 1; }
.dr-pop .dt-picker-header .dt-picker-title { display: none; }
.dr-pop .dt-picker-header button { position: absolute; top: 2px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; }
.dr-pop .dt-picker-header button[data-m="-1"] { left: 0; }
.dr-pop .dt-picker-header button[data-m="1"] { right: 0; }
.dr-month .dt-range-month-title { text-align: center; line-height: 28px; margin-bottom: 4px; }

/* Scheduled backups → a restore under its copy: what it is doing, then the result (stays until the page is left) */
html:root:not(#pt) .bs-copies tr.bs-restore-row td { border-top: 0; padding-top: 0; }
html:root:not(#pt) .bs-restore { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .76rem; line-height: 1.4; color: var(--text); }
html:root:not(#pt) .bs-restore > .bi { flex: none; }
html:root:not(#pt) .bs-restore-ok > .bi { color: var(--success); }
html:root:not(#pt) .bs-restore-db { font-weight: 700; }
html:root:not(#pt) .bs-restore-bad > .bi, html:root:not(#pt) .bs-restore-bad .bs-restore-text { color: var(--alert); }
html:root:not(#pt) .bs-restore-error { flex-basis: 100%; padding-left: 22px; color: var(--text); }

/* ModalHelper.result: the result of something important — a sentence, label / value rows, a last line */
html:root:not(#pt) .md-result { display: grid; gap: 12px; }
html:root:not(#pt) .md-result-lead, html:root:not(#pt) .md-result-note { margin: 0; line-height: 1.5; }
html:root:not(#pt) .md-result-note { color: var(--text-muted); font-size: .85em; }
html:root:not(#pt) .md-result-error { margin: 0; }
html:root:not(#pt) .md-result-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; padding: 10px 12px; border: 1px solid var(--pt-line); border-radius: 8px; background: var(--side); font-size: .85em; }
html:root:not(#pt) .md-result-facts dt { font-weight: 600; color: var(--text-muted); }
html:root:not(#pt) .md-result-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* Dragged with a finger or a pen too (js/helpers/press.js): on these the browser doesn't scroll or zoom, the drag
   follows the finger. The empty diagram still scrolls with a finger, except in Hand mode (then the drag moves it). */
html:root:not(#pt) :is(#zoom-wrapper .table-node, .vd-group-head, .vd-note-head, .vd-tools-grip, .pl-tools-grip,
  .vd-fp-head, .vd-vb-head, #minimap-header, .suggestions-header, .pl-win-head, .cs-thumb, #workspace.vd-hand) { touch-action: none; }

/* Less motion (the system setting): nothing slides, grows, shrinks or bounces anywhere — opacity and colours still
   change, quickly, so a change is still seen; things that show work going on (spinners) keep turning */
@media (prefers-reduced-motion: reduce) {
  html:root:not(#pt) *, html:root:not(#pt) *::before, html:root:not(#pt) *::after {
    transition-property: opacity, color, background-color, border-color, outline-color, box-shadow, fill, stroke !important;
    transition-duration: .12s !important;
    transition-delay: 0s !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  /* dialogs and menus appear in place (a quick fade), they don't slide or zoom in */
  html:root:not(#pt) :is(.anim-slide, .anim-zoom) { transform: none !important; }
  /* busy: a spinner keeps turning, slowly — it says something is still working */
  html:root:not(#pt) :is(.ov-spin, .dtd-spin, .vd-spinner, .spinner-border) { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
}

/* Swiped away with a finger (js/helpers/swipe.js): while held it follows the finger with no delay; let go, it settles
   (to gone, or back) in 220 ms. The period sheet on a phone has a grab bar on top; a notification swipes sideways. */
html:root:not(#pt) .sw-drag { transition: none !important; }
html:root:not(#pt) .sw-anim { transition: transform 220ms cubic-bezier(.32, .72, 0, 1) !important; }
.dr-grab { display: none; }
@media (max-width: 700px) {
  html:root:not(#pt) .dr-pop .dr-grab { display: block; flex: none; height: 22px; margin: -6px -8px 2px; touch-action: none; cursor: grab; position: relative; }
  html:root:not(#pt) .dr-pop .dr-grab::before { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--pt-line); }
}
html:root:not(#pt) .notify-toast { touch-action: pan-y; }

/* Big numbers: tighter letters the bigger they are, figures of one width (like .ov-tile-value) */
html:root:not(#pt) :is(.hw-big b, .sa-dep-n b, .fi-key .pa-tile b, .sec-ring-in b) { letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
html:root:not(#pt) .mr-number b { letter-spacing: -.02em; }

/* A menu or a picker opens from where it was asked for: a quick grow from its button (designer and Planner menus:
   placeMenu sets --menu-origin to the button), from its top elsewhere. `scale` (not transform), so a position set with
   transform stays. Not with "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
  html:root:not(#pt) :is([role="menu"]:not([hidden]), .dropdown-menu.show, .dt-picker, .acs-menu, .pl-export-menu, .vd-export-menu, .qo-box) {
    animation: pt-menu-in 140ms cubic-bezier(.2, .8, .2, 1); transform-origin: var(--menu-origin, top center);
  }
  @media (max-width: 700px) { html:root:not(#pt) .dr-pop.dt-picker { --menu-origin: bottom center; } }
}
@keyframes pt-menu-in { from { opacity: 0; scale: .96; } }

/* Changing the theme: the colours cross over in a quarter of a second instead of flashing (Theme.js adds the class
   for a moment); not with "reduce motion" */
@media (prefers-reduced-motion: no-preference) {
  html.pt-theme-fade, html.pt-theme-fade *, html.pt-theme-fade *::before, html.pt-theme-fade *::after {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, fill .25s ease, stroke .25s ease !important;
  }
}

/* More contrast (the system setting): lines and edges in a clear grey instead of a faint one, badges and chips with an
   edge, a strong focus ring — in every theme, from its own colours */
@media (prefers-contrast: more) {
  html:root:not(#pt) { --pt-line: var(--text-muted); --border-color: var(--text-muted); --vd-border: var(--text-muted); --cl-line: var(--text-muted); }
  html:root:not(#pt) :is(.bk-badge, .ts-flag-pill, .mr-chip, .vw-pill, .sv-pill, .hw-chip, .vd-tool-badge, .badge-pk, .badge-fk, .badge-uni, .badge-nn, .badge-idx, .badge-ai) { box-shadow: inset 0 0 0 1px currentColor; }
  html:root:not(#pt) :focus-visible { outline: 2px solid var(--text) !important; outline-offset: 2px !important; }
  html:root:not(#pt) :is(.text-muted, .bk-muted, .ts-muted) { color: var(--text-2, var(--text)) !important; }
}
/* Windows high contrast (forced colours): boxes keep an edge where the colours are taken away */
@media (forced-colors: active) {
  html:root:not(#pt) :is(.ts-btn, .modal-btn, .btn, .ts-icon-btn, .bk-badge, .ts-flag-pill, .dr-field, .md-result-facts, .notify-toast, .modal-content) { border: 1px solid CanvasText !important; }
  html:root:not(#pt) :focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px !important; }
}

/* ══ Live data (design-demos/34-live-data.html, 29.11.2026; js/helpers/live.js): only what changes moves ══ */
@property --deg { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
/* a row or a value that just came in: lights up once and fades back (1.6 s); a row also gets a line on its left */
html:root:not(#pt) .lv-glow, html:root:not(#pt) tr.lv-glow > td { animation: lv-glow 1600ms ease-out; }
html:root:not(#pt) tr.lv-glow > td:first-child { animation: lv-glow 1600ms ease-out, lv-glow-line 1600ms ease-out; }
@keyframes lv-glow { from { background-color: var(--prim-soft); } }
@keyframes lv-glow-line { from, 70% { box-shadow: inset 3px 0 0 var(--vd-accent); } }
/* a badge whose number changed: one pulse */
html:root:not(#pt) .lv-bump { animation: lv-bump 150ms ease-out; }
@keyframes lv-bump { 50% { transform: scale(1.15); } }
/* a ✓ that was just earned (the setup guide): pops in with a small overshoot — the only bounce in the app */
html:root:not(#pt) .lv-pop { animation: lv-pop 220ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes lv-pop { from { transform: scale(.6); } }
/* a view that replaces a waiting one (the Performance report after the ring): fades in */
html:root:not(#pt) .lv-in { animation: lv-in 200ms ease; }
@keyframes lv-in { from { opacity: 0; } }
/* items one after another: fade in and rise 8 px, 350 ms each, 60 ms apart */
html:root:not(#pt) .lv-rows > *, html:root:not(#pt) .lv-rows tbody > tr { animation: lv-row 350ms cubic-bezier(.23, 1, .32, 1) both; animation-delay: calc(var(--lv-delay, 0ms) + var(--lv-i, 0) * var(--lv-gap, 60ms)); }
@keyframes lv-row { from { opacity: 0; transform: translateY(8px); } }
/* progress that moves on: the bar slides (300 ms) instead of jumping */
html:root:not(#pt) :is(.bk-bar span, .ci-progress-bar, .tdg-bar-in, .pf-progress-bar span, .sg-progress-bar > i) { transition: width 300ms cubic-bezier(.23, 1, .32, 1); }
/* the Security check score: the ring fills to the score (700 ms) when the check's result opens */
html:root:not(#pt) .sec-ring.lv-fill { transition: --deg 1400ms cubic-bezier(.65, 0, .35, 1); }
html:root:not(#pt) .sec-ring .lv-wait { opacity: 0; }
html:root:not(#pt) .sec-ring b { transition: opacity 150ms ease; }

/* My reports: the views coming in (mr_line.js chartIn) — Columns grow from the base one after another, Bars from the left */
html:root:not(#pt) .lv-cols .mr-svg rect { transform-box: view-box; transform-origin: 50% 100%; animation: lv-grow-y 1100ms cubic-bezier(.65, 0, .35, 1) both; animation-delay: calc(100ms + var(--lv-i, 0) * 60ms); }
html:root:not(#pt) .lv-hbars .hw-bar { animation: lv-grow-x 1100ms cubic-bezier(.65, 0, .35, 1) both; animation-delay: calc(100ms + var(--lv-i, 0) * 60ms); }
@keyframes lv-grow-y { from { transform: scaleY(0); } }
@keyframes lv-grow-x { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* My reports, Line (mr_line.js): a legend to switch lines, the chart at its own width, names at the ends, hover */
html:root:not(#pt) .mrl-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
html:root:not(#pt) .mrl-key { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--pt-line); background: var(--side); color: var(--text); border-radius: 14px; padding: 3px 10px 3px 8px; font-size: .78rem; font-weight: 500; cursor: pointer; }
html:root:not(#pt) .mrl-key i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
html:root:not(#pt) .mrl-key[aria-pressed="false"] { color: var(--text-muted); }
html:root:not(#pt) .mrl-key[aria-pressed="false"] i { background: var(--pt-line); }
html:root:not(#pt) .mrl-wrap { position: relative; }
html:root:not(#pt) .mrl-draw { width: 100%; min-width: 0; }
html:root:not(#pt) .mrl-svg { display: block; overflow: visible; }
html:root:not(#pt) .mrl-grid line { stroke: var(--pt-line); }
html:root:not(#pt) .mrl-ax text { fill: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
html:root:not(#pt) .mrl-ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
html:root:not(#pt) .mrl-lbl text { fill: var(--text); font-size: 12px; font-weight: 600; }
html:root:not(#pt) .mrl-lbl circle, html:root:not(#pt) .mrl-dot { stroke: var(--side); stroke-width: 2; }
html:root:not(#pt) .mrl-hair { stroke: var(--text-muted); stroke-dasharray: 3 3; }
html:root:not(#pt) .mrl-tip, html:root:not(#pt) .pa-tip { position: absolute; top: 8px; z-index: 2; pointer-events: none; min-width: 170px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--pt-line); background: var(--side); font-size: .78rem; }
html:root:not(#pt) .mrl-tip[hidden], html:root:not(#pt) .pa-tip[hidden] { display: none; }
html:root:not(#pt) .mrl-tip b, html:root:not(#pt) .pa-tip b { display: block; margin-bottom: 4px; color: var(--text); }
html:root:not(#pt) .mrl-tip div, html:root:not(#pt) .pa-tip div { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 6px; color: var(--text-2); }
html:root:not(#pt) .mrl-tip div i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); }
html:root:not(#pt) .mrl-tip div span:last-child, html:root:not(#pt) .pa-tip div span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); text-align: right; }
/* Home, a live widget refreshed (live.js carryLive): a bar that changed slides there in 0.9 s, gentle at both ends */
html:root:not(#pt) .hw-bar > i.lv-slow { transition: width 900ms cubic-bezier(.65, 0, .35, 1), background-color 600ms ease; }
html:root:not(#pt) :is(.hw-big b, .hw-prog-t b, .hw-bar-v).lv-glow { border-radius: 4px; }
/* Performance, previous / next table: the old picture leaves to one side (380 ms) while the new one comes in from the
   side you go to (650 ms, gentle at both ends, 40 px) — they overlap, so you see one replace the other */
html:root:not(#pt) .pf-main { position: relative; }
html:root:not(#pt) .lv-from-r { animation: lv-from-r 650ms cubic-bezier(.65, 0, .35, 1) 80ms both; }
html:root:not(#pt) .lv-from-l { animation: lv-from-l 650ms cubic-bezier(.65, 0, .35, 1) 80ms both; }
html:root:not(#pt) .lv-out-l { animation: lv-out-l 380ms cubic-bezier(.65, 0, .35, 1) forwards; }
html:root:not(#pt) .lv-out-r { animation: lv-out-r 380ms cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes lv-from-r { from { opacity: 0; transform: translateX(40px); } }
@keyframes lv-from-l { from { opacity: 0; transform: translateX(-40px); } }
@keyframes lv-out-l { to { opacity: 0; transform: translateX(-40px); } }
@keyframes lv-out-r { to { opacity: 0; transform: translateX(40px); } }

/* Home, Server load: the newest reading as a dot at the end of the small chart, with its value (slides with the chart) */
html:root:not(#pt) .hw-spark-wrap { position: relative; }
html:root:not(#pt) .hw-spark-dot { position: absolute; left: 100%; width: 9px; height: 9px; border-radius: 50%; background: var(--vd-accent); box-shadow: 0 0 0 2px var(--side); transform: translate(-50%, -50%); pointer-events: none; }
html:root:not(#pt) .hw-spark-val { position: absolute; right: 10px; transform: translateY(-140%); font-size: .72rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }
html:root:not(#pt) .hw-spark-wrap[data-spark] { padding-left: 34px; }
html:root:not(#pt) .hw-spark-ax { position: absolute; left: 0; width: 30px; transform: translateY(-50%); text-align: right; font-size: .66rem; color: var(--text-muted); font-variant-numeric: tabular-nums; pointer-events: none; }
html:root:not(#pt) .hw-spark-hov { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--vd-accent); box-shadow: 0 0 0 2px var(--side); transform: translate(-50%, -50%); pointer-events: none; }
html:root:not(#pt) .hw-spark-wrap > .pa-tip { top: auto; bottom: calc(100% + 4px); min-width: 140px; }

/* Platform admin → Demo data (admin_demo.js): the password to sign in with, and the customer search */
html:root:not(#pt) .dm-sign-body { padding: 12px 16px 14px; display: grid; gap: 10px; }
html:root:not(#pt) .dm-sign-body p { margin: 0; color: var(--text-2); font-size: .85rem; line-height: 1.5; max-width: 90ch; }
html:root:not(#pt) .dm-pass { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html:root:not(#pt) .dm-pass > span { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
html:root:not(#pt) .dm-pass code { padding: 4px 10px; border: 1px solid var(--pt-line); border-radius: 6px; background: var(--bg); color: var(--text); font-size: .9rem; }
html:root:not(#pt) .dm-find { padding: 10px 12px 6px; max-width: 420px; }
html:root:not(#pt) .dm-mail { font-family: var(--mono, monospace); font-size: .8rem; }
html:root:not(#pt) .pa-tiles + .ts-section, html:root:not(#pt) .dm-sign + .ts-section, html:root:not(#pt) .ts-section + .ts-section { margin-top: 14px; }
/* boxes side by side in a grid start at the same top (the gap between them is the grid's) */
html:root:not(#pt) :is(.pa-charts, .pa-cols) > .ts-section + .ts-section { margin-top: 0; }
html:root:not(#pt) .pa-tiles + .dm-sign, html:root:not(#pt) .pa-tiles + .pa-empty { margin-top: 14px; }

/* Platform admin → Staff activity: trends, What counts, People / Departments, ticks to compare, sorting, Compare */
html:root:not(#pt) .sa-tr { display: inline-block; margin-left: 6px; font-size: .68rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-muted); }
html:root:not(#pt) .sa-tr-up { color: var(--success); }
html:root:not(#pt) .sa-tr-down { color: var(--orange); }
html:root:not(#pt) td.sa-num .sa-tr { display: block; margin: 1px 0 0; }
html:root:not(#pt) .sa-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 16px; }
html:root:not(#pt) .sa-kinds-l { font-size: .74rem; color: var(--text-muted); margin-right: 4px; }
html:root:not(#pt) .sa-kind { --c: var(--vd-accent); --c-soft: var(--prim-soft); --c-line: var(--prim-line); --c-strong: var(--prim-strong); display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--pt-line); border-radius: 14px; background: var(--side); color: var(--text-2, var(--text)); font: inherit; font-size: .78rem; font-weight: 500; cursor: pointer; }
html:root:not(#pt) .sa-kind > .bi { color: var(--c); }
html:root:not(#pt) .sa-kind:hover { border-color: var(--c-line); color: var(--text); }
html:root:not(#pt) .sa-kind[aria-pressed="true"] { border-color: var(--c); background: var(--c-soft); color: var(--text); }
html:root:not(#pt) .sa-dep-n .sa-tr { margin-left: auto; }
html:root:not(#pt) .sa-tick-h, html:root:not(#pt) .sa-tick { width: 34px; padding-right: 0 !important; }
html:root:not(#pt) .sa-tick input { margin: 0; cursor: pointer; }
html:root:not(#pt) .sa-tick input:disabled { cursor: not-allowed; accent-color: var(--text-muted); filter: grayscale(1); }
html:root:not(#pt) .sa-row.picked > td { background: var(--prim-soft); }
html:root:not(#pt) .sa-picked { font-size: .76rem; font-weight: 500; color: var(--text-2, var(--text)); }
html:root:not(#pt) .sa-sort { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
html:root:not(#pt) .sa-sort > .bi { font-size: .7rem; color: var(--sec-line); }
html:root:not(#pt) .sa-sort:hover > .bi, html:root:not(#pt) .sa-sort.on > .bi { color: inherit; }
html:root:not(#pt) .sa-sort.on { color: var(--text); }
html:root:not(#pt) th.sa-num .sa-sort { flex-direction: row-reverse; }
html:root:not(#pt) .sa-cmp { margin-bottom: 16px; }
html:root:not(#pt) .sa-cmp-what { font-weight: 500; color: var(--text-muted); font-size: .8rem; }
html:root:not(#pt) .sa-cmp-t th[scope="row"] { font-weight: 500; color: var(--text-2, var(--text)); text-transform: none; letter-spacing: 0; font-size: .8rem; white-space: nowrap; }
html:root:not(#pt) .sa-cmp-t .sa-cmp-kind th[scope="row"] { font-weight: 400; color: var(--text-muted); padding-left: 22px; }
html:root:not(#pt) .sa-cmp-t td { font-variant-numeric: tabular-nums; }
html:root:not(#pt) .sa-cmp-t td.sa-top { background: var(--prim-soft); font-weight: 700; color: var(--text); }
html:root:not(#pt) .sa-cmp-h { display: inline-flex; align-items: center; gap: 7px; text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; }
html:root:not(#pt) .sa-cmp-h .sf-av { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
html:root:not(#pt) .sa-sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
html:root:not(#pt) .sa-cmp-per { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px; border-top: 1px solid var(--pt-line); font-size: .76rem; color: var(--text-muted); }
html:root:not(#pt) .sa-lines { padding: 6px 14px 14px; }
html:root:not(#pt) .sa-people .sa-roles .sf-rchip, html:root:not(#pt) .sa-people .sa-who b { white-space: nowrap; }
/* Staff activity: the period, Department and People / Departments one height (as the Department select, 32 px) */
html:root:not(#pt) .sa-filter .sa-seg { padding: 2px; }
html:root:not(#pt) .sa-filter .sa-seg > button { height: 26px; }
/* Compare: one box — header, table, Per day and the lines (as the one-person timeline: no part on the page colour) */
html:root:not(#pt) .ts-section.sa-cmp { flex: none; background: var(--side); border: 1px solid var(--pt-line); border-radius: 10px; overflow: hidden; padding: 0; }
html:root:not(#pt) .sa-cmp > .ts-section-header { margin: 0; border: 0; border-bottom: 1px solid var(--pt-line); border-radius: 0; background: var(--side); }
html:root:not(#pt) .sa-cmp > .ts-table-wrap { margin: 0; border: 0 !important; border-radius: 0 !important; background: var(--side); }
html:root:not(#pt) .sa-cmp-t :is(th, td):first-child { padding-left: 14px; }
/* every line of Compare one height: the trend beside the number, not under it */
html:root:not(#pt) .sa-cmp-t td.sa-num .sa-tr { display: inline-block; margin: 0 0 0 8px; }
html:root:not(#pt) .sa-cmp-t tbody :is(th, td) { height: 38px; padding-top: 6px; padding-bottom: 6px; vertical-align: middle; }

/* Graphs (2026-12-02): every chart shows its values on hover in a box like the Compare chart; the column's band is
   drawn BEHIND the bars (pa_chart.js), never over them */
html:root:not(#pt) .pa-chart { position: relative; }
html:root:not(#pt) .pa-band { fill: transparent; pointer-events: none; }
html:root:not(#pt) .pa-band.on { fill: var(--hover); }
html:root:not(#pt) .pa-tip div i.pa-key { display: block; width: 10px; height: 10px; border-radius: 2px; }
html:root:not(#pt) .pa-tip div i.pa-key-line { height: 3px; }
html:root:not(#pt) .pa-tip div i.pa-key-dot { width: 9px; height: 9px; border-radius: 50%; }
html:root:not(#pt) .pa-tip .pa-tip-sum { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--pt-line); }
html:root:not(#pt) .pa-tip .pa-tip-sum i { background: none; }
html:root:not(#pt) .pa-val { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
html:root:not(#pt) #monitor-page .monitor-chart { position: relative; }
html:root:not(#pt) #monitor-page .monitor-chart canvas { cursor: crosshair; }

/* A chart in a Home widget fills the widget (pa_chart.js fit: drawn again at its real size, text the normal size) */
html:root:not(#pt) .hw-body:has(.pa-fit), html:root:not(#pt) .hw-body .hw-pad:has(> .pa-fit) { display: flex; flex-direction: column; }
html:root:not(#pt) .hw-body .hw-pad:has(> .pa-fit) { flex: 1 1 auto; min-height: 0; }
html:root:not(#pt) .pa-fit { display: flex; flex-direction: column; flex: 1 1 170px; min-height: 170px; padding: 6px 10px 8px; }
html:root:not(#pt) .hw-pad > .pa-fit { padding: 6px 0 0; }
html:root:not(#pt) .pa-fit > svg { flex: 1 1 0; min-height: 0; width: 100%; height: auto; }
html:root:not(#pt) .pa-fit > .pa-legend { flex: none; padding-left: 0; justify-content: center; }

/* Dimmed rows and cards (no transparency, 2026-12-02): what used to fade with opacity now takes the faint text colour
   all the way down, and fields inside look switched off — so a dimmed row still reads as dimmed, in every theme. */
html:root :is(.sb-values tr.sb-v-off td:not(.ts-td-check), .xp-row-off td, .sv-qs-table tr.sv-dim > td, .se-tables-col.se-off,
  .wz-fill-off, .qo-locked, .wz-mode-off, .bs-place-row.bs-full, .pl-try-off, .pm-gone, .hw-w.hw-nothing,
  .table-node.vd-st-dropped, .column-item.col-st-dropped, .vd-ed-dropped td:not(:last-child), .vd-paste tr.vd-paste-off td:not(:first-child),
  .ag-dismissed, .sq-result-skip, .se-card-empty, .do-busy, .wz-ai.wz-ai-wait) :is(*, *::before) { color: var(--text-faint) !important; }
html:root :is(.sb-values tr.sb-v-off td:not(.ts-td-check), .xp-row-off td, .sv-qs-table tr.sv-dim > td, .se-tables-col.se-off,
  .wz-fill-off, .qo-locked, .wz-mode-off, .bs-place-row.bs-full, .pl-try-off, .vd-ed-dropped td:not(:last-child),
  .vd-paste tr.vd-paste-off td:not(:first-child), .perm-card-off) :is(input:not([type=checkbox]):not([type=radio]), select, textarea, .ts-editor-input, .cs-btn) {
  background-color: var(--disabled) !important; border-color: var(--border-color) !important; color: var(--text-faint) !important; }
/* Alerts with nothing in them: the banner's tint goes quiet (it used to fade with opacity) */
html:root .hw-w.hw-banner.hw-nothing { background: var(--err-soft) !important; border-color: var(--err-line) !important; }
html:root .hw-w.hw-banner.hw-nothing :is(.hw-head, .hw-foot) { border-color: var(--err-line) !important; }
html:root .hw-w.hw-banner.hw-nothing .hw-head > .bi { color: var(--text-faint) !important; }
/* a switched-off button (a filter with 0 in it, a primary button not ready yet): the disabled colours win over any colour
   the button has — it used to fade with opacity, which covered everything inside it */
html:root .ts-btn:disabled:not(.active) { background: var(--button-disabled-bg) !important; border-color: var(--border-color) !important; box-shadow: none !important; }
html:root .ts-btn:disabled:not(.active), html:root .ts-btn:disabled:not(.active) * { color: var(--button-disabled-text) !important; }

/* Home widgets like design-demos/27-home-widgets + 30-coral-home (2026-12-02): a quiet grey icon in the header, the
   period ("December 2026") on the right beside the gear, footer links underlined, the gear in a small box on light pages.
   Heights follow the content (Auto) unless the widget's Height is set in Customize. */
html:root .hw-w:not(.hw-banner):not(.hw-nothing) > .hw-head > .bi { color: var(--text-muted); }
html:root .hw-head > .hw-note:not(:empty) { margin-left: auto; padding-left: 8px; font-size: 12px; font-weight: 500; }
html:root .hw-head:has(> .hw-note:not(:empty)) > .hw-r { margin-left: 8px; }
html:root .hw-head > .hw-cnt + .hw-note:empty { display: none; }
html:root .hw-foot a, html:root .hw-foot .hw-link { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
html:root[data-theme="light"] .hw-head .hw-gear { border: 1px solid var(--border-color); background: var(--side); }
html:root[data-theme="light"] .hw-head .hw-gear:hover { background: var(--n-soft); }
html:root .hw-w.hw-s > .hw-head > .hw-r { margin-left: auto; }
/* widget content like the demos: people as initials on a solid colour, a list row's second part small, favourites as
   chips with the star first, Start something as one-line tiles two by two, bars in the widget bar colour */
html:root .hw-av { background: var(--c); color: var(--text); }
html:root .hw-av-li { width: 24px; height: 24px; flex-shrink: 0; font-size: 10px; }
html:root .hw-li-main small { font-size: 11.5px; margin-left: 4px; }
html:root .hw-li .hw-mono { font-size: 12.5px; font-weight: 600; }
html:root .hw-chip { padding: 4px 10px; gap: 6px; }
html:root .hw-chip > i.bi { display: none; }
html:root .hw-chip > span { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace); font-size: 12.5px; }
html:root .hw-chip > .hw-chip-x { order: -1; padding: 0; font-size: 11px; }
html:root .hw-starts { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
html:root .hw-start { grid-template-columns: 16px minmax(0, 1fr); padding: 9px 10px; font-size: 12.5px; }
html:root .hw-start > .bi { grid-row: auto; }
html:root .hw-start > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root .hw-bar > i { background: var(--hw-bar, var(--vd-accent)); }
html:root .hw-prog.hw-near .hw-bar > i { background: var(--warning); } html:root .hw-prog.hw-full .hw-bar > i { background: var(--alert); }
html:root .hw-bar > i.hw-lost { background: var(--alert); }
html:root .hw-w.hw-s .hw-starts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html:root .hw-foot > .hw-link:last-child { margin-left: auto; }

/* Home widgets: the demo's type, measured 2026-12-02 (design-demos/27 + 30): px sizes, the demo's mono font,
   the softer text colour (--text-2) for body text, --text only for list rows; nothing bold that isn't bold there */
html:root:not(#pt) .hw-w { --hw-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace; --hw-ink: var(--text); color: var(--hw-ink); }
html:root[data-palette="coral"]:not(#pt) .hw-w { --hw-ink: var(--text-2); }
html:root:not(#pt) .hw-head { padding: 10px 10px 10px 14px; font-size: 13.5px; font-weight: 600; }
html:root:not(#pt) .hw-w:not(.hw-banner) > .hw-head { color: var(--hw-ink); }
html:root:not(#pt) .hw-head .hw-cnt { font-size: 12px; padding: 0 6px; }
html:root:not(#pt) .hw-head .hw-note, html:root:not(#pt) .hw-head .hw-set { font-size: 12px; }
html:root:not(#pt) .hw-li { font-size: 13px; color: var(--text); }
html:root:not(#pt) .hw-li .hw-mono, html:root:not(#pt) .hw-bar-nm.hw-mono, html:root:not(#pt) .hw-chip > span, html:root:not(#pt) .hw-w .hw-mono { font-family: var(--hw-mono); font-size: 12.5px; font-weight: 400; }
html:root:not(#pt) .hw-li-main small { font-size: 10.8px; }
html:root:not(#pt) .hw-li .hw-m { font-size: 12px; }
html:root:not(#pt) .hw-foot { font-size: 12px; }
html:root:not(#pt) .hw-foot a, html:root:not(#pt) .hw-foot .hw-link { font-weight: 400; }
html:root:not(#pt) .hw-tile span { font-size: 10.5px; }
html:root:not(#pt) .hw-tile b { font-size: 22px; color: var(--hw-ink); }
html:root:not(#pt) .hw-tile small { font-size: 11.5px; }
html:root:not(#pt) .hw-pt { font-size: 12.5px; color: var(--hw-ink); }
html:root:not(#pt) .hw-pt th { font-size: 10.5px; color: var(--text-muted) !important; }
html:root:not(#pt) .hw-pt td { color: var(--hw-ink) !important; }
html:root:not(#pt) .hw-pt small { font-size: 11px; }
html:root:not(#pt) .hw-pdot { width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; }
html:root:not(#pt) .hw-bar-row { font-size: 12.5px; color: var(--hw-ink); grid-template-columns: 120px minmax(0, 1fr) 64px; }
html:root:not(#pt) .hw-big b { font-size: 26px; color: var(--hw-ink); letter-spacing: normal; }
html:root:not(#pt) .hw-big span { font-size: 12.5px; }
html:root:not(#pt) .hw-chip { color: var(--text); }
html:root:not(#pt) .hw-prog-t { font-size: 12.5px; color: var(--hw-ink); }
html:root:not(#pt) .hw-w .hw-muted { font-size: 12px; }
html:root:not(#pt) .hw-sch { font-size: 13px; }
html:root:not(#pt) .hw-sch .hw-m { font-size: 12px; }
html:root:not(#pt) .hw-empty { font-size: 12.5px; }
html:root:not(#pt) .hw-chip { font-size: 12.5px; }
html:root:not(#pt) .hw-starts { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
html:root:not(#pt) .hw-bar-row { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) 64px; }
/* Backups: the last 14 days (design-demos/27-home-widgets) — solid colours mixed with the box */
html:root:not(#pt) .hw-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 10px 0 2px; }
html:root:not(#pt) .hw-day { display: block; height: 18px; border-radius: 4px; background: var(--c); }
html:root:not(#pt) .hw-day-ok { --c: var(--success); --c-soft: var(--ok-soft); --c-line: var(--ok-line); --c-strong: var(--ok-strong); } html:root:not(#pt) .hw-day-bad { --c: var(--alert); --c-soft: var(--err-soft); --c-line: var(--err-line); --c-strong: var(--err-strong); }
html:root:not(#pt) .hw-day-run { --c: var(--info); --c-soft: var(--info-soft); --c-line: var(--info-line); --c-strong: var(--info-strong); } html:root:not(#pt) .hw-day-none { --c: var(--text-faint); --c-soft: var(--sec-soft); --c-line: var(--sec-line); --c-strong: var(--sec-strong); }
html:root:not(#pt) .hw-days-lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
html:root:not(#pt) .hw-sch { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
html:root:not(#pt) .hw-sch .hw-muted { font-size: 13px; }
/* Our plans: cards with a small sketch (design-demos/27-home-widgets); Registrations: grey new, green paying */
html:root:not(#pt) .hw-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px 14px; }
html:root:not(#pt) .hw-plan { display: block; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; background: var(--bg); color: var(--hw-ink); text-decoration: none; }
html:root:not(#pt) .hw-plan:hover { border-color: var(--vd-accent); }
html:root:not(#pt) .hw-sk { position: relative; height: 58px; background: radial-gradient(circle, var(--n-line) 1px, var(--n-soft) 1.4px) 0 0 / 12px 12px; }
html:root:not(#pt) .hw-sk > i { position: absolute; width: 34px; height: 14px; border-radius: 3px; border-left: 3px solid var(--pl, var(--vd-accent)); background: var(--side); box-shadow: 0 0 0 1px var(--border-color); }
html:root:not(#pt) .hw-plan > div:last-child { padding: 7px 9px; font-size: 12px; color: var(--text-muted); }
html:root:not(#pt) .hw-plan b { display: block; font-size: 12.5px; color: var(--hw-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-bar.pa-c-n, .pa-key.pa-c-n, .pa-dot.pa-c-n { fill: var(--n-line); background: var(--n-line); } .pa-line.pa-c-n { stroke: var(--n-line); }
html:root:not(#pt) .hw-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html:root:not(#pt) .hw-plan > div:last-child > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* "updated 2 s ago": grey with a green dot, like the demo */
html:root:not(#pt) .hw-head .hw-live { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
html:root:not(#pt) .hw-head .hw-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

/* ══ Platform admin → Mail (the mail desk, design-demos/36-mail-desk.html, 2026-12-03): tree | messages | the message.
   Structure here for every theme; colours only by their names (a mailbox's colour: --mb / --mb-soft / --mb-line / --mb-strong
   from mail_tree.js boxColour). ══ */
.mdk { display: grid; grid-template-columns: 230px minmax(300px, 380px) minmax(0, 1fr); height: 760px; margin-top: 12px; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: var(--side); }
.mdk > * { min-width: 0; min-height: 0; }
@media (max-width: 1280px) { .mdk { grid-template-columns: 200px minmax(260px, 320px) minmax(0, 1fr); } }
.mdk-col-tree { border-right: 1px solid var(--border-color); overflow: auto; padding: 8px 6px 12px; }
.mdk-col-list { border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.mdk-col-list > .ts-section-header { flex: none; margin: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border-color); border-radius: 0; background: none; font-weight: 600; }
.mdk-col-list > .ts-section-header > .bi { color: var(--text-muted); }
.mdk-filter { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.mdk-row { display: flex; gap: 6px; align-items: center; }
.mdk-row .sbp-search { flex: 1; min-width: 0; }
.mdk-filter .ev-kind { flex-wrap: wrap; }
.mdk-col-list > .mdk-bulk { flex: none; border-radius: 0; margin: 0; border-width: 0 0 1px; }
.mdk-col-list > .mdk-list { flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; gap: 0; padding: 0; }
.mdk-col-list > .rp-pager { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; border-top: 1px solid var(--border-color); }
.mdk-col-read { display: flex; flex-direction: column; overflow: hidden; }
.mdk-col-read > .mdk-sum { flex: 1; overflow: auto; padding: 16px 20px; }
.mdk-col-read > .rp-none, .mdk-col-read > .ts-alert, .mdk-col-read > .pa-loading { margin: 16px; }

/* the tree */
.mdk-tree ul { list-style: none; margin: 0; padding: 0; }
.mdk-tree ul ul { padding-left: 14px; }
.mdk-tree > ul > li + li { margin-top: 6px; }
.mdk-tn { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.mdk-tn:hover { background: var(--hover); }
.mdk-tn.on { background: var(--mb-soft, var(--acc-soft)); box-shadow: inset 3px 0 0 var(--mb, var(--vd-accent)); }
.mdk-tn-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: .82rem; text-align: left; cursor: pointer; border-radius: 6px; }
.mdk-tn.on .mdk-tn-go { color: var(--text); font-weight: 600; }
.mdk-tn-go > .bi { flex: none; color: var(--text-muted); }
.mdk-tn.on .mdk-tn-go > .bi { color: var(--mb-strong, var(--vd-accent)); }
.mdk-tn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdk-box-head .mdk-tn-go { font-weight: 600; color: var(--text); }
.mdk-tn-fold { flex: none; width: 22px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; border-radius: 4px; font-size: .7rem; }
.mdk-tn-acts { display: none; gap: 2px; padding-right: 4px; }
.mdk-tn:hover .mdk-tn-acts, .mdk-tn:focus-within .mdk-tn-acts { display: inline-flex; }
.mdk .mdk-ic { width: 26px; height: 26px; padding: 0; display: inline-grid; place-items: center; }
.mdk-tn-new { margin-right: 4px; }
.mdk-n { flex: none; margin-left: auto; }
.mdk-unseen { font-size: .72rem; font-weight: 700; color: var(--text); }
.mdk-tn-err { margin: 2px 8px 6px 30px; font-size: .74rem; color: var(--err-strong); overflow-wrap: anywhere; }
.mdk-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--mb, var(--c-sec)); display: inline-block; }

/* the list */
.mdk-list .rp-card { border-radius: 0; border-width: 0 0 1px; border-left-width: 3px; margin: 0; }
.mdk-list .rp-card .rp-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mdk-from { display: flex; gap: 8px; align-items: baseline; }
.mdk-from > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.mdk-from > span:last-child { flex: none; white-space: nowrap; }
.mdk-unread .mdk-from > span:first-child, .mdk-unread .rp-card-subj { font-weight: 700; color: var(--text); }
.mdk-list .rp-card-subj, .mdk-list .rp-card-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdk-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.mdk-tags > .bi { font-size: .78rem; color: var(--text-muted); }
.mdk-tags > .mdk-flag, .mdk .mdk-flag { color: var(--c-err); }
.mdk-chip { display: inline-flex; align-items: center; padding: 1px 7px; border: 1px solid var(--mb-line); border-radius: 4px; background: var(--mb-soft); color: var(--mb-strong); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mdk-report { color: var(--c-warn); flex: none; }

/* the message: toolbar, then the e-mail above and Reply · Handling · History below a line you can drag */
.mdk-read { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, var(--mdk-top, 58%)) 7px minmax(0, 1fr); }
.mdk-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
.mdk-toolbar .pf-step { margin-left: 0; }
.mdk-grow { flex: 1; }
.mdk .mdk-danger { color: var(--err-strong); }
.mdk-menu-wrap { position: relative; display: inline-flex; }
.mdk-menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 230px; max-height: 360px; overflow: auto; padding: 6px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--side); box-shadow: 0 8px 24px var(--bg); }
.mdk-menu-hd { padding: 6px 8px 4px; font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.mdk-menu-sep { height: 1px; margin: 6px 0; background: var(--border-color); }
.mdk-mi { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: .8rem; text-align: left; cursor: pointer; }
.mdk-mi:hover, .mdk-mi:focus-visible { background: var(--hover); outline: none; }
.mdk-mi > .bi { color: var(--text-muted); }
.mdk-mi-key { margin-left: auto; font-size: .7rem; color: var(--text-muted); }
.mdk-top { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.mdk-head { flex: none; padding: 14px 22px 12px; background: var(--hover); border-bottom: 1px solid var(--border-color); }
.mdk-subject { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.mdk-who { display: flex; align-items: baseline; gap: 10px; font-size: .84rem; color: var(--text); }
.mdk-who .mdk-from { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mdk-when { flex: none; font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.mdk-note { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 22px; border-bottom: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--text); font-size: .8rem; }
.mdk-note > .bi { color: var(--warn-strong); }
.mdk-note > span { flex: 1 1 220px; min-width: 0; }
.mdk-note > .ts-btn { flex: none; }
.mdk-note.pm-report-note { border-color: var(--info-line); background: var(--info-soft); }
.mdk-note.pm-report-note > .bi { color: var(--info-strong); }
.mdk-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.mdk-body > * { flex: none; }
.mdk-html { width: 100%; min-height: 320px; flex: 1 0 320px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--side); }
.mdk-text { margin: 0; max-width: 78ch; white-space: pre-wrap; font-size: .88rem; line-height: 1.65; color: var(--text); }
.mdk-files { display: flex; gap: 8px; flex-wrap: wrap; }
.mdk-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; max-width: 78ch; margin: 0; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--hover); font-size: .78rem; }
.mdk-facts dt { color: var(--text-muted); }
.mdk-facts dd { margin: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: .75rem; color: var(--text); overflow-wrap: anywhere; }
.mdk-hd { cursor: row-resize; background: var(--border-color); border: 0; touch-action: none; position: relative; }
.mdk-hd::after { content: ""; position: absolute; left: 50%; top: 2px; width: 36px; height: 3px; margin-left: -18px; border-radius: 2px; background: var(--text-muted); }
.mdk-hd:hover, .mdk-hd.on, .mdk-hd:focus-visible { background: var(--vd-accent); outline: none; }
.mdk-low { min-height: 0; display: flex; flex-direction: column; }
.mdk-tabs { flex: none; display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border-color); }
.mdk-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-bottom: 2px solid var(--side); margin-bottom: -1px; background: none; color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.mdk-tab:hover { color: var(--text); }
.mdk-tab.on { color: var(--text); border-bottom-color: var(--vd-accent); }
.mdk-dock { flex: 1; min-height: 0; overflow: auto; }
.mdk-dock > .rp-answers, .mdk-dock > .rp-handle, .mdk-dock > .rp-hist { border: 0; border-radius: 0; background: none; }
.mdk-sum .mdk-tile { border-left: 3px solid var(--mb); text-align: left; cursor: pointer; }
.mdk-sum .mdk-tile > .bi { color: var(--mb-strong); }
.mdk-sum .mdk-tile small { display: block; font-size: .7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .mdk { grid-template-columns: 1fr; height: auto; }
  .mdk-col-tree, .mdk-col-list { border-right: 0; border-bottom: 1px solid var(--border-color); max-height: 50vh; }
  .mdk-read { grid-template-rows: auto auto 0 auto; }
  .mdk-hd { display: none; }
}
