/* assets/glass.css — the glass MATERIAL layer of the 9CXO app (CEO 2026-11-13).
 *
 * Loaded after app.css and agent-chat.css. app.css owns the tokens (one place)
 * and the structure of every component; this sheet says what the components
 * are MADE of: translucent layered surfaces, hairline borders with an inner
 * highlight, large soft radii, quiet depth, calm motion, strong focus.
 *
 * Rules of the material:
 *   · blur only on chrome and small floating things — rail, top bar, toolbars,
 *     tiles, popovers, drawer, dialog, palette, toast. Never on a card that
 *     holds a long list: cards are translucent, NOT blurred.
 *   · anything that must cover what scrolls beneath it (sticky table heads,
 *     sticky first columns) is opaque: --th-bg / --card-solid.
 *   · no colour literals for surfaces or ink here — tokens only, so light and
 *     dark stay one system. The few literals are white-on-teal and shadows.
 *   · without backdrop-filter the tokens themselves fall back to solid
 *     (see the @supports block at the end of the token set in app.css).
 */

/* ============================================================
   1. GROUND — the brand mesh the glass refracts
   ============================================================ */
html { background: var(--base); }
body {
  background: transparent; font-size: var(--fs-body); letter-spacing: -.003em;
  text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums;
}
/* Fixed, behind everything, never scrolls and never repaints with the content. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--mesh);
}
::selection { background: var(--focus-soft); }

/* One focus language everywhere: a strong two-layer ring. */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none; box-shadow: var(--ring);
}

/* A reusable material, for markup that wants it explicitly. */
.glass, .rail, .topbar, .toolbar, .tile, .bulk-bar {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* ============================================================
   2. SHELL — floating glass rail + floating glass top bar
   ============================================================ */
:root { --rail-w: 264px; --rail-gap: 12px; --tb-ml: 12px; --tb-mr: 20px; }

.rail {
  background: var(--side-bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.rail-head { padding: 14px 12px 8px 14px; }
.rail-brand { border-radius: 12px; }
.rail-brand:hover { background: var(--side-hover); }
/* The mint "9" mark of 9cxo.com. */
.rail-logo {
  width: 34px; height: 34px; border-radius: 50%; font-family: var(--font); font-weight: 700; font-size: 17px;
  color: #fff; background: radial-gradient(circle at 34% 28%, var(--mint-hi), var(--mint) 55%, var(--mint-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px -4px rgba(40, 120, 70, .55);
  text-shadow: 0 1px 1px rgba(20, 70, 40, .35);
}
.rail-logo::after { display: none; }
.rail-brand-txt b { font-family: var(--font); font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.rail-brand-txt b .dot { color: var(--lime-700); }
.rail-brand-txt small { font-size: 11.5px; color: var(--side-ink-dim); }
.rail-btn { border-radius: 9px; color: var(--side-ink-dim); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.rail-btn:hover { background: var(--side-hover); color: var(--ink); }

.rail-search { margin: 2px 14px 10px; }
.rail-search input { height: 36px; border-radius: var(--radius-sm); background: var(--soft); border-color: transparent; }
.rail-search input:focus { background: var(--field-bg); border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft); }
.rail-kbd, .tb-search kbd, .palette-in kbd { background: var(--card); border-color: var(--line); border-radius: 6px; }

.rail-nav { padding: 2px 12px 14px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nav-sec { margin-top: 16px; }
.nav-sec::before { display: none; }
.nav-sec-head { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--side-ink-faint); min-height: 28px; }
.nav-sec-head:hover { background: transparent; color: var(--ink); }
.nav-sec-head .notch { width: 3px; height: 12px; }
.rail .nav-item { border-radius: var(--radius-sm); color: var(--side-ink); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.rail .nav-item:hover { background: var(--side-hover); }
.rail .nav-item.active { background: var(--petrol-50); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.rail .nav-item .ic { color: var(--side-icon); }
.rail .nav-item.sub { color: var(--side-ink-dim); }
.rail .nav-item.sub.active { box-shadow: none; background: transparent; color: var(--ink); }
.nav-item.active .dot-mark { background: var(--lime-700); box-shadow: 0 0 0 3px var(--petrol-50); }
.nav-children { border-left-color: var(--side-line); }
.nav-chev:hover { background: var(--side-hover); }
.nav-badge { border-color: var(--line-2); color: var(--side-ink-dim); }
.rail-foot { border-top-color: var(--side-line); padding: 12px 14px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.lang-pill { background: var(--soft); border-color: transparent; }
.lang-pill button.on { background: var(--card-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.credit-mini { background: var(--soft); border-color: transparent; border-radius: var(--radius-sm); transition: border-color var(--dur) var(--ease); }

/* The top bar: a floating glass strip — burger, breadcrumbs, balance, search. */
.main { padding-top: var(--rail-gap); }
.topbar {
  top: var(--rail-gap); margin: 0 var(--tb-mr) 0 var(--tb-ml); min-height: 52px; padding: 6px 8px 6px 18px; gap: 8px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
/* The bar floats; what scrolls past must not peek through the gap above it. */
/* The strip repaints the very same ground (fixed attachment = same pixels as the mesh behind). */
.topbar::before { content: ""; position: absolute; left: calc(-1px - var(--tb-ml)); right: calc(-1px - var(--tb-mr)); bottom: 100%; height: calc(var(--rail-gap) + 2px);
  background: var(--mesh), var(--base); background-attachment: fixed; pointer-events: none; }
.topbar .burger { border-radius: var(--radius-sm); }
.topbar .tb-mark { font-family: var(--font); font-weight: 700; letter-spacing: -.01em; color: var(--ink); }

.crumb { gap: 4px; font-size: var(--fs-sub); flex: 0 1 auto; }
.crumb a, .crumb .crumb-txt { color: var(--muted); text-decoration: none; padding: 5px 7px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumb a:hover { background: var(--soft); color: var(--ink); }
.crumb .here { color: var(--ink); font-weight: 600; }
.crumb .crumb-home { display: inline-flex; padding: 6px; flex: 0 0 auto; }
.crumb .crumb-home svg { width: 15px; height: 15px; }
.crumb .sep { opacity: .55; }

.tb-credit {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; flex: 0 0 auto;
  background: var(--soft); color: var(--muted); font-size: var(--fs-sub); text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease);
}
.tb-credit[hidden] { display: none; }
.tb-credit b { color: var(--accent-ink); font-weight: 600; }
.tb-credit.low b { color: var(--danger); }
.tb-credit:hover { background: var(--petrol-50); }
.tb-credit .tb-credit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-700); flex: 0 0 auto; }
.tb-credit.low .tb-credit-dot { background: var(--danger); }
.tb-search { height: 36px; border-radius: 999px; background: var(--soft); border-color: transparent; transition: background var(--dur) var(--ease); }
.tb-search:hover { background: var(--petrol-50); border-color: transparent; }

/* E-Mail-Bestätigung: a calm glass strip under the top bar, not an alarm. */
.verify-banner { margin: 10px var(--tb-mr) 0 var(--tb-ml); border-radius: var(--radius); }

/* Page header: the large title. */
.page-head { padding: 22px 32px 18px; }
.page-head h1 { font-size: var(--fs-large); font-weight: 700; letter-spacing: -.022em; line-height: 1.18; margin: 0 0 6px; }
.page-head p { font-size: 14.5px; line-height: 1.5; color: var(--muted); max-width: 68ch; }
.content { padding: 0 32px 64px; }
/* Each page settles in instead of snapping — one short fade, no travel. */
#view > .page-head, #view > .content { animation: glass-in .22s var(--ease) both; }
@keyframes glass-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   3. SURFACES — cards, tiles, panels, notices
   ============================================================ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.card.pad { padding: 22px; }
.card-head { margin-bottom: 14px; }
.card-head h3 { font-size: var(--fs-head); font-weight: 600; letter-spacing: -.008em; }
.card-head .count { background: var(--soft); color: var(--muted); font-weight: 600; font-size: var(--fs-cap); padding: 2px 9px; }
.section-title { font-size: 17px; font-weight: 600; letter-spacing: -.012em; }
.hint { font-size: var(--fs-sub); line-height: 1.5; }

.tiles { gap: 14px; margin-bottom: 22px; }
.tile {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); color: var(--ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tile:hover { border-color: var(--line-2); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float); }
.tile.is-static:hover { border-color: var(--line); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
.tile-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--petrol-50); display: grid; place-items: center; margin-bottom: 8px; }
.tile-ic svg { width: 16px; height: 16px; }
.tile-label { font-size: var(--fs-cap); text-transform: none; letter-spacing: 0; font-weight: 500; }
.tile-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }

.panel-inline, .picker, .score-card, .imp-box, .tg-code { background: var(--soft); border-color: var(--line); border-radius: var(--radius-sm); }
.score-card { border-width: 1px; }
.notice { border-radius: var(--radius); background: var(--card); box-shadow: inset 0 1px 0 var(--glass-hi); }
.next-step, .fr-card { border-width: 1px; border-radius: var(--radius-sm); background: var(--card); }
.fr-card:hover, .fr-card:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft); }

.empty { padding: 52px 20px; }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--petrol-50); box-shadow: inset 0 1px 0 var(--glass-hi); }
.empty h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.empty p { font-size: 14px; max-width: 420px; }

/* ============================================================
   4. CONTROLS — buttons, fields, tabs, pills, chips
   ============================================================ */
.btn {
  min-height: 40px; padding: 9px 15px; font-size: var(--fs-body); font-weight: 600; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 2px rgba(11, 68, 80, .06);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--petrol) 88%, #fff), var(--petrol)); border-color: var(--petrol); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px -8px var(--petrol); }
.btn.primary:hover { background: var(--petrol-700); border-color: var(--petrol-700); color: #fff; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 18px -10px var(--lime-700); }
.btn.lime:hover { background: var(--lime-700); border-color: var(--lime-700); color: var(--lime-ink); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: var(--card-solid); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: var(--fs-sub); border-radius: 9px; }
.btn.block { min-height: 46px; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn.sm { min-height: 44px; } }

.field, .form-field input, .form-field select, .form-field textarea, textarea.field {
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--field-bg); color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field { padding: 9px 12px; font-size: var(--fs-body); min-height: 40px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, textarea.field:focus, .field:focus {
  border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft);
}
/* Native widgets speak the app's typeface, and a select gets one calm chevron. */
input, select, textarea, button { font-family: inherit; }
select.field, .form-field select, .dt-size select, .status-control select {
  -webkit-appearance: none; appearance: none; padding-right: 34px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f8388' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
}
.dt-size select { padding-right: 28px; background-position: right 7px center; }
.field::placeholder, .form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: .8; }
.form-field label { font-size: var(--fs-sub); font-weight: 600; }
.filter-field .filter-label { font-size: var(--fs-cap); font-weight: 500; letter-spacing: 0; }
.chk input, .check-row input, .row-select input[type="checkbox"], .pw-plan input, .pw-terms input { accent-color: var(--petrol); }
.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft) !important; }

/* Tabs: quiet pills in one row, the active one a raised chip. */
.tabs { gap: 4px; border-bottom: 0; padding: 0; margin-bottom: 18px; }
.tab { padding: 7px 13px; border-radius: 999px; font-size: var(--fs-sub); font-weight: 600; min-height: 34px; display: inline-flex; align-items: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tab:hover { background: var(--soft); }
.tab.active { background: var(--petrol); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 14px -8px var(--petrol); }

.pill { font-size: var(--fs-cap); font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill .d { width: 6px; height: 6px; }
.chip, .tag { background: var(--petrol-50); border-radius: 999px; }
.tag { border-radius: 7px; background: var(--soft); }

/* The page toolbar: one glass strip, primary action left, filters right. */
.toolbar {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.toolbar:empty, .toolbar-main:empty { display: none; }
.content > * + .toolbar, .content > * + .tiles, .content > * + .tabs { margin-top: 18px; }
.bulk-bar { background: var(--glass); border: 1px solid var(--accent-ink); border-radius: var(--radius); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float); }
.preset-bar .preset-label { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ============================================================
   5. TABLES — see the table kit (js/core/table.js) for the structure
   ============================================================ */
.table-wrap { border-radius: 12px; }
table.tbl { font-size: var(--fs-body); border-collapse: separate; border-spacing: 0; }
table.tbl th {
  font-size: var(--fs-cap); letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--th-bg);
}
table.tbl th:first-child { border-top-left-radius: 10px; }
table.tbl th:last-child { border-top-right-radius: 10px; }
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.tbl tbody tr { transition: background var(--dur) var(--ease); }
table.tbl tbody tr:hover td { background: var(--soft); }
table.tbl tbody tr.row-click:hover td { background: var(--tint); }
table.tbl tbody tr.blocked td { background: var(--danger-soft); }
.cell-name small, .rc-title small { font-size: var(--fs-cap); }
.row-card { border-radius: var(--radius-sm); background: var(--card); box-shadow: inset 0 1px 0 var(--glass-hi); }
.pager-state { font-size: var(--fs-sub); }

/* ── the kit: toolbar ── */
.dt { min-width: 0; }
.dt-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  position: relative; z-index: 2;
}
.dt-search { position: relative; flex: 1 1 200px; max-width: 320px; min-width: 0; display: flex; }
.dt-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.dt-q {
  width: 100%; height: 36px; padding: 0 12px 0 33px; font: inherit; font-size: var(--fs-sub); color: var(--ink);
  background: var(--field-bg); border: 1px solid var(--line); border-radius: 999px; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.dt-q::placeholder { color: var(--muted); }
.dt-q::-webkit-search-cancel-button { display: none; }
.dt-q:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft); }
.dt-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.dt-chip-label { font-size: var(--fs-cap); color: var(--muted); padding: 0 2px 0 6px; white-space: nowrap; }
.dt-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-cap); font-weight: 600; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dt-chip:hover { background: var(--soft); color: var(--ink); }
.dt-chip.on { background: var(--petrol-50); border-color: var(--accent-ink); color: var(--accent-ink); }
.dt-chip b { font-weight: 500; opacity: .75; }
.dt-spacer { flex: 1 1 0; }
.dt-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.dt-tool {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 999px; cursor: pointer; list-style: none;
  border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: var(--fs-sub); font-weight: 600; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.dt-tool::-webkit-details-marker { display: none; }
.dt-tool:hover, .dt-pop[open] > .dt-tool, .dt-tool[aria-pressed="true"] { background: var(--soft); color: var(--ink); }
.dt-tool svg { width: 16px; height: 16px; flex: 0 0 auto; }
.dt-tool .dt-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--petrol); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.dt-badge[hidden] { display: none; }
.dt-pop { position: relative; }
.dt-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown); width: max-content; min-width: 230px; max-width: min(320px, calc(100vw - 32px));
  max-height: min(420px, 60vh); overflow-y: auto; padding: 8px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 14px; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  animation: glass-in .16s var(--ease) both;
}
.dt-menu h5 { margin: 4px 8px 6px; font-size: var(--fs-cap); font-weight: 600; color: var(--muted); }
.dt-menu-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--ink); font: inherit; font-size: var(--fs-sub); text-align: left; cursor: pointer;
}
.dt-menu-row:hover { background: var(--soft); }
.dt-menu-row input { width: 16px; height: 16px; accent-color: var(--petrol); flex: 0 0 auto; }
.dt-menu-row.on { color: var(--accent-ink); font-weight: 600; }
.dt-menu-row .dt-menu-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-menu-row[disabled] { opacity: .55; cursor: default; }
.dt-menu-x { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.dt-menu-x:hover { background: var(--danger-soft); color: var(--danger); }
.dt-menu-x svg { width: 13px; height: 13px; }
.dt-menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dt-save { display: flex; gap: 6px; padding: 4px; }
.dt-save input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font: inherit; font-size: var(--fs-sub); color: var(--ink); background: var(--field-bg); border: 1px solid var(--line-2); border-radius: 9px; outline: none; }
.dt-save input:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft); }
.dt-save .btn { min-height: 34px; }
.dt-menu-note { margin: 4px 8px; font-size: var(--fs-cap); color: var(--muted); }

/* ── the kit: grid ── */
.dt .table-wrap { max-height: max(380px, calc(100vh - 250px)); max-height: max(380px, calc(100dvh - 250px)); overflow: auto; border: 1px solid var(--line); border-radius: 12px; overscroll-behavior-x: contain; }
.dt table.tbl thead th { position: sticky; top: 0; z-index: 1; }
.dt table.tbl tbody tr:last-child td { border-bottom: 0; }
.dt-sort { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; white-space: nowrap; }
.dt-sort:hover { color: var(--ink); background: var(--soft); }
.dt-sort svg { width: 12px; height: 12px; opacity: 0; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.dt-sort:hover svg { opacity: .5; }
th[aria-sort] .dt-sort { color: var(--accent-ink); }
th[aria-sort] .dt-sort svg { opacity: 1; }
th[aria-sort="descending"] .dt-sort svg { transform: rotate(180deg); }
.dt-compact table.tbl td { padding: 6px 12px; }
.dt-compact table.tbl th { padding: 7px 12px; }
.dt-compact .row-card { padding: 10px 12px; margin-bottom: 8px; }
.dt-none { text-align: center; padding: 36px 16px; color: var(--muted); font-size: var(--fs-body); }
.dt-none .btn { margin-top: 12px; }

/* ── the kit: footer ── */
.dt-foot, .pager { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 12px; font-size: var(--fs-sub); color: var(--muted); justify-content: flex-end; }
.dt-count { margin-right: auto; }
.dt-count b { color: var(--ink); font-weight: 600; }
.dt-size { display: inline-flex; align-items: center; gap: 8px; }
.dt-size select { height: 32px; padding: 0 8px; font: inherit; font-size: var(--fs-sub); color: var(--ink); background: var(--field-bg); border: 1px solid var(--line-2); border-radius: 9px; outline: none; }
.dt-size select:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--focus-soft); }
.dt-pager { display: inline-flex; align-items: center; gap: 6px; }
.dt-page { min-width: 84px; text-align: center; }
.dt-nav { width: 32px; height: 32px; padding: 0; border-radius: 9px; border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.dt-nav:hover:not(:disabled) { border-color: var(--accent-ink); color: var(--accent-ink); }
.dt-nav:disabled { opacity: .4; cursor: default; }
.dt-nav svg { width: 14px; height: 14px; }
.dt-nav.prev svg { transform: rotate(180deg); }
@media (pointer: coarse) { .dt-nav { width: 44px; height: 44px; } .dt-chip, .dt-tool, .dt-q { height: 40px; } .dt-size select { height: 40px; } }
@media (max-width: 620px) {
  .dt .table-wrap { display: none; }
  .dt-search { flex: 1 1 100%; max-width: none; }
  .dt-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .dt-tool span.dt-tool-lbl { display: none; }
  .dt-tool-cols { display: none; }
  .dt-menu { right: auto; left: 0; }
  .dt-tools .dt-pop:last-of-type .dt-menu { left: auto; right: 0; }
  .dt-foot, .pager { justify-content: space-between; }
  .dt-count { flex: 1 1 100%; }
}

/* ============================================================
   6. OVERLAYS — drawer, dialog, palette, dropdowns, toast
   ============================================================ */
.drawer-back, .dialog-back, .palette-back, .backdrop { background: var(--scrim); }
.drawer-back, .dialog-back, .palette-back { animation: fade-in .18s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  top: 10px; right: 10px; bottom: 10px; width: min(500px, calc(100vw - 20px)); border-radius: var(--radius-lg);
  background: var(--glass-strong); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); overflow: hidden;
  animation: drawer-in .26s var(--ease) both;
}
@keyframes drawer-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.drawer-head { padding: 20px 20px 14px; border-bottom-color: var(--line); }
.drawer-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.drawer-body { padding: 18px 20px; }
.drawer-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top-color: var(--line); background: var(--soft); }
.drawer-section h4 { text-transform: none; letter-spacing: 0; font-size: var(--fs-sub); font-weight: 600; }
.dialog, .palette {
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.dialog { padding: 26px; animation: dialog-in .2s var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.dialog h2 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.palette-in { border-bottom-color: var(--line); }
.pal-item { border-radius: var(--radius-sm); }
.pal-item.on, .pal-item:hover { background: var(--petrol-50); }
.ac-list {
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 12px; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.toast {
  border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.toast.err { background: var(--danger); color: var(--card-solid); }

/* ============================================================
   7. BOARD (pipeline kanban)
   ============================================================ */
.board { gap: 14px; align-items: start; }
.board-col { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: inset 0 1px 0 var(--glass-hi); }
.board-head { margin-bottom: 12px; padding: 0 2px; }
.board-card {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(11, 68, 80, .05), 0 8px 18px -14px rgba(11, 68, 80, .35);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.board-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.board-card:last-child { margin-bottom: 0; }

/* ============================================================
   8. LOGIN + full-screen cards
   ============================================================ */
.auth-wrap { background: transparent; }
.auth-card {
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.auth-mark, .boot-mark { font-family: var(--font); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.auth-mark .dot { color: var(--lime-700); }
.auth-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* ============================================================
   9. PIECES that live in other sheets but must cover what scrolls under them
   ============================================================ */
.content .pg-sticky, .ac-composer {
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* The composer covers the thread it floats over: opaque, so nothing reads through it. */
.ac-composer { background: var(--card-solid); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line); border-radius: 20px; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-float); }
.ac-composer:focus-within { border-color: var(--accent-ink); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 3px var(--focus-soft), var(--shadow-float); }
.ac-agent .ac-bubble { background: var(--card); border-color: var(--line); box-shadow: inset 0 1px 0 var(--glass-hi); }
.ac-user .ac-bubble { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 18px -12px var(--petrol); }
.ac-avatar { font-family: var(--font); font-weight: 700; color: #fff; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--mint-hi), var(--mint) 55%, var(--mint-lo)); }
.ac-avatar.lg { border-radius: 50%; }
.ac-idea { border-color: var(--line); box-shadow: inset 0 1px 0 var(--glass-hi); transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.ac-approve, .ac-byo { border-color: var(--line); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
.today-panel { box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
.today-panel .tile { background: var(--soft); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Wissen: its toolbar is the same glass strip as every other page toolbar. */
.content .kb-toolbar {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px;
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* Things that stick while the page scrolls must clear the floating top bar. */
:root { --stick-top: 76px; }
.ibx .ibx-detail, .ibx .ibx-filters, .home-agent .home-today, .content .pg-preview-col { top: var(--stick-top); }
@media (min-width: 900px) { .ibx .ibx-detail { max-height: calc(100vh - var(--stick-top) - 16px); max-height: calc(100dvh - var(--stick-top) - 16px); } }
@media (min-width: 1180px) { .home-agent .home-today { max-height: calc(100vh - var(--stick-top) - 16px); max-height: calc(100dvh - var(--stick-top) - 16px); } }

/* Small all-caps headings read as shouting on glass: sentence case, one weight. */
.ibx .ibx-filters > summary, .ibx .ibx-grp h4, .ibx .ibx-card h3, .field-label-inline, .preset-label, .drawer-section h4, .soon-view .tag {
  text-transform: none; letter-spacing: 0; font-size: var(--fs-cap); font-weight: 600;
}

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (min-width: 861px) {
  /* The balance sits in the top bar at this width; the rail keeps it for the phone drawer. */
  .rail .credit-mini { display: none; }
  body.rail-collapsed { --rail-w: 84px; }
  body.rail-collapsed .rail .nav-item.in-path, body.rail-collapsed .rail .nav-item.active { background: var(--petrol-50); }
}
@media (min-width: 861px) and (max-width: 1100px) {
  :root { --tb-mr: 16px; }
  .page-head { padding-left: 24px; padding-right: 24px; }
  .content { padding-left: 24px; padding-right: 24px; }
  .tb-credit .tb-credit-lbl { display: none; }
}
@media (max-width: 860px) {
  :root { --rail-gap: 8px; --tb-ml: 8px; --tb-mr: 8px; }
  .topbar { padding: 4px 6px 4px 8px; min-height: 52px; gap: 4px; }
  .topbar .burger { margin-left: 0; }
  .topbar .tb-mark { display: none; }
  .crumb { display: flex; flex: 1 1 auto; overflow: hidden; }
  .crumb > :not(.here) { display: none; }
  .crumb .here { font-size: 15px; padding-left: 4px; }
  .tb-credit { padding: 0 10px; height: 40px; }
  .tb-credit .tb-credit-lbl { display: none; }
  .tb-search { width: 44px; height: 44px; }
  .rail { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; background: var(--glass-strong); }
  .rail.open { box-shadow: var(--shadow-float); }
  .page-head { padding: 18px 16px 14px; }
  .page-head h1 { font-size: 24px; }
  .content { padding: 0 16px 48px; }
  .card.pad { padding: 16px; }
  .toolbar { padding: 10px; }
}
@media (max-width: 520px) {
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; border: 0; }
  .page-head h1 { font-size: 22px; }
  .dialog { padding: 20px; border-radius: 18px; }
}
@media (max-width: 620px) {
  .btn, .btn.sm, .field, select.field, .tab { min-height: 44px; }
  .tiles { gap: 10px; }
  .tile { padding: 13px 14px; }
  .tile-value { font-size: 21px; }
}

/* Windows high-contrast / forced colours: give the glass real edges back. */
@media (forced-colors: active) {
  .card, .rail, .topbar, .toolbar, .tile, .drawer, .dialog, .palette, .dt-bar, .dt-menu { border: 1px solid CanvasText; }
}
/* More contrast requested: thicker lines, no translucency. */
@media (prefers-contrast: more) {
  :root { --card: var(--card-solid); --glass: var(--card-solid); --glass-strong: var(--card-solid); --side-bg: var(--card-solid); --line: var(--line-2); }
}
@media (prefers-reduced-motion: reduce) {
  #view > .page-head, #view > .content, .drawer, .dialog, .dt-menu, .drawer-back, .dialog-back, .palette-back { animation: none; }
}
