/* ============================================================
   Nevian — UI refinements

   Loaded after tailwind.css so these win without touching the
   generated layer. Everything here reads from the tokens in
   theme.css; there are no hard-coded colours.

   Goal: more air, softer elevation, real corner radii, and type
   that has a hierarchy instead of everything being 11px grey.
   ============================================================ */

/* ── Typography baseline ─────────────────────────────────────── */

body {
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  letter-spacing: -0.006em;
}

::selection { background: var(--accent-soft); color: var(--accent-deep); }

:focus-visible {
  outline: none;
  box-shadow: none;
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(17, 34, 51, .14);
  border-radius: var(--radius-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(17, 34, 51, .24); background-clip: content-box; }

/* ── Icons (Lucide, via <lucide-icon name="…">, shared/lucide-icon.js) ──
   1em square like text, so font-size sets the size. Stroke weight comes from
   --icon-stroke (Lucide units on a 24px grid); set it on the icon or a parent. */
lucide-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  line-height: 0;
  box-sizing: content-box;
}
lucide-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke-width: var(--icon-stroke, 1.75);
}

/* Workspace org menu + What's new modal — one solid card shell (no blur). */
:root {
  --float-edge:   rgba(198, 210, 226, .13);
  --float-edge-2: rgba(198, 210, 226, .26);
  --float-hover:  rgba(255, 255, 255, .05);
}

.wsp-menu,
.nws-panel {
  background: var(--card);
  border: 1px solid var(--float-edge-2);
  border-radius: 20px;
  box-shadow: none;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

#sidebar { width: 15.5rem; background: var(--bg); }

/* App bar. Layout is baked in here (not via Tailwind utilities) because the
   prebuilt tailwind.css is purged — classes like pl-4 aren't present — so the
   bar must not depend on them to lay out. */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 64px;
  padding: 0 12px;
}

/* The date-range / period controls slot. The prebuilt tailwind.css locks this
   to 23rem which crowds the top bar. Let it shrink-to-fit and push right. */
#admin-topbar-extra {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: auto !important;
  margin-left: auto;
}

/* The product mark now lives inside the workspace pill (.wsp-logo), so the top
   bar has no separate branding slot and no collapse toggle. */

/* Top-nav "+" that opens the Onboard-a-device modal. */
.topbar-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--dim);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.topbar-add-btn:hover { background: var(--hover-fade); color: var(--text); border-color: var(--border-2); }
.topbar-add-btn lucide-icon { display: block; font-size: 19px; --icon-stroke: 1.88; }
.admin-search lucide-icon, .fl-search lucide-icon, .admin-search-icon { font-size: 15px; --icon-stroke: 1.88; }

/* The icons-only rail that went with the collapse toggle is gone too: nothing
   sets .sidebar-collapsed any more, so those rules could never match. */

/* ── Project selector as a breadcrumb scope ──────────────────────
   A static "all projects" root, a slash, then the project dropdown rendered
   inline as the active crumb rather than a bordered pill. */
.proj-scope { display: flex; align-items: center; gap: 6px; min-width: 0; }
.proj-scope-root {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--radius);
  color: var(--dim);
  flex-shrink: 0;
}
.proj-scope-root lucide-icon { font-size: 15px; --icon-stroke: 1.88; }
.proj-scope-sep { color: var(--muted); font-size: 13px; opacity: .5; user-select: none; }
.proj-scope-static {
  min-width: 0;
  padding: 0 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Borderless breadcrumb crumb: only the chevron and a faint hover plate hint
   that it opens a menu. Overrides the bordered pill from theme.css. */
#project-selector .cs-menu .cs-trigger,
#project-selector .cs-menu .cs-trigger:hover,
#project-selector .cs-menu .cs-trigger[aria-expanded="true"] {
  min-width: 0;
  height: 30px;
  padding: 0 7px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  border-radius: var(--radius);
}
#project-selector .cs-menu .cs-trigger:hover,
#project-selector .cs-menu .cs-trigger[aria-expanded="true"] {
  background: var(--hover-fade);
  color: var(--text);
}

/* ── Display type ────────────────────────────────────────────
   Hanken Grotesk, the face the marketing site uses for h1–h4. Only the
   page titles that actually reach display size get it; the site's rule is
   "the bigger the type, the tighter the tracking", and below ~20px the
   difference from Inter stops being legible while the cost stays. Every
   selector here is a title, never a number — figures keep Inter for its
   tabular digits.
   ──────────────────────────────────────────────────────────── */

.idb-title,
.kbb-title,
.kbb-article .kb-title-input,
.tkt-title,
.nvo-h1,
.idg-h,
.idc-word {
  font-family: var(--font-display);
  letter-spacing: -.03em;
}
/* Utility for one-off titles that reach the same size. */
.font-display { font-family: var(--font-display); }

/* ── Sidebar brand ───────────────────────────────────────────── */

.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* A custom console logo replaces this row. Tailwind's `.hidden` has the same
   specificity and loads earlier, so `display: flex` above was winning and both
   the logo and the Nevian fallback rendered — overlapping inside the branding
   block's fixed height. */
.brand-row.hidden { display: none; }

/* 24px, the same size the marketing site's nav mark uses.
   The mark is a full-bleed glyph on transparency, so it gets no plate at
   all: no fill, no border, no shadow, and crucially no border-radius —
   border-radius clips replaced content, which was slicing the corners off
   the N. `contain` rather than `cover` for the same reason. */
.brand-logo {
  width: 18px;
  height: 18px;
  border-radius: 0;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.brand-text { min-width: 0; }
.brand-name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
.brand-sub {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
  margin-top: 1px;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  padding: 14px 12px 6px;
}
/* The first header sits right under the branding, so it needs no lead-in. */
.nav-group-label:first-child { padding-top: 2px; }

/*
 * Console sidebar: the first header ("Monitor") lines up with the top edge of
 * the content cards beside it. The cards start 12px down (the content column's
 * pt-3); 9px of nav padding plus the label's own half-leading and the space
 * above Inter's capitals puts the top of the "M" on that line (measured in a
 * browser against the card's border, at 3x zoom).
 *
 * :first-of-type, not :first-child: the sliding highlight <span> is the nav's
 * first child, so the :first-child rule above never reached this label and it
 * kept the full 14px lead-in meant for the headers further down.
 *
 * Scoped to aside#sidebar so the employee portal's rail (a div.sidebar-nav in
 * nav#sidebar, with its own spacing) is unaffected.
 */
aside#sidebar > .sidebar-nav { padding-top: 9px; }
aside#sidebar > .sidebar-nav > .nav-group-label:first-of-type { padding-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  margin-bottom: 1px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: color .16s var(--ease), background .16s var(--ease);
}
.nav-item svg,
.nav-item lucide-icon { flex-shrink: 0; opacity: .8; transition: opacity .16s; }
.nav-item lucide-icon { font-size: 18px; --icon-stroke: 1.59; }
.nav-item:hover { color: var(--text); }
.nav-item:hover svg,
.nav-item:hover lucide-icon { opacity: 1; }
.nav-item.active { color: var(--text); font-weight: 600; }
.nav-item.active svg,
.nav-item.active lucide-icon { color: var(--accent-bright); opacity: 1; }

/* Ticket dashboards: a connected sub-tree under the Tickets nav item. A single
   grey line runs down the left and curves right at the bottom toward the last
   dashboard, matching the tree connector in the mock. */
.nav-sub { position: relative; margin: 0 0 6px; padding-left: 34px; }
.nav-sub:empty { display: none; }
.nav-sub::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 5px;
  bottom: 15px;
  width: 12px;
  border-left: 2.5px solid var(--border-2);
  border-bottom: 2.5px solid var(--border-2);
  border-bottom-left-radius: 10px;
  pointer-events: none;
}
.nav-sub-item {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-sub-item:hover { color: var(--text); background: var(--hover-fade); }
.nav-sub-item.active { color: var(--text); font-weight: 500; }
/* Above the sliding indicator, which can now sit under a dashboard row. */
.nav-sub { z-index: 1; }
.nav-sub-item { position: relative; z-index: 1; }
.nav-sub-item:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }

/* Tickets row: the link plus the chevron that folds its dashboards away. The
   chevron is a sibling of the link (a button inside an <a> is invalid), laid
   over the row's right edge; the link leaves room for it only while it shows. */
.nav-item-row { position: relative; }
.nav-tree:has(.nav-sub-toggle:not([hidden])) .nav-item.has-sub-toggle { padding-right: 34px; }
.nav-sub-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-sub-toggle[hidden] { display: none; }
.nav-sub-toggle:hover { color: var(--text); background: var(--hover-fade); }
.nav-sub-toggle:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.nav-sub-toggle lucide-icon { font-size: 14px; --icon-stroke: 2; transition: transform .18s var(--ease); }
.nav-tree.is-collapsed .nav-sub-toggle lucide-icon { transform: rotate(-90deg); }
.nav-tree.is-collapsed .nav-sub { display: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-sub-toggle lucide-icon { transition: none; }
}

/* Manage dashboards: a pencil just after the "Tickets" label, shown while the
   row is hovered or holds keyboard focus. Hidden by opacity, not display, so it
   stays in the tab order and appears when tabbed to. `--nav-label-end` is the
   label's measured right edge (admin-shell.js). */
.nav-row-actions {
  position: absolute;
  top: 50%;
  left: calc(var(--nav-label-end, 72px) + 6px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s var(--ease);
}
.nav-item-row:hover .nav-row-actions,
.nav-item-row:focus-within .nav-row-actions,
.nav-row-actions:has(.is-active) { opacity: 1; pointer-events: auto; }
/* Pointing at an icon leaves the link, so keep the row looking hovered. */
.nav-item-row:hover > .nav-item:not(.active) { background: var(--hover-fade); color: var(--text); }
.nav-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav-row-action:hover,
.nav-row-action.is-active { color: var(--text); background: var(--hover-fade); }
.nav-row-action:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.nav-row-action lucide-icon { font-size: 14px; --icon-stroke: 2; }
/* No hover on touch screens: always show them there. */
@media (hover: none) {
  .nav-row-actions { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-row-actions { transition: none; }
}

/* Selected state: a flat, semi-transparent green fill. No outline and no side
   bar — just the wash sliding under the active row. */
.nav-indicator {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
  /* theme.css's motion plus `left`: a ticket dashboard row is indented, so the
     wash slides in sideways as well as down when it lands on one. */
  transition:
    transform var(--nav-travel) var(--seg-ease),
    height var(--seg-resize) var(--seg-ease),
    left var(--nav-travel) var(--seg-ease),
    opacity var(--view-in) ease;
}

.nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.agent-build-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 11px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.agent-build-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}

.sidebar-profile > .relative > .flex {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.sidebar-profile-card {
  position: relative;
  overflow: hidden;
}
.sidebar-profile-actions {
  position: absolute;
  top: 50%;
  right: 7px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 16px;
  background: linear-gradient(90deg, transparent, var(--card) 22%);
  opacity: 0;
  pointer-events: none;
  transform: translate(16px, -50%);
  transition: opacity .18s var(--ease), transform .22s var(--ease);
}
.sidebar-profile-card:hover .sidebar-profile-actions,
.sidebar-profile-card:focus-within .sidebar-profile-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}
.sidebar-profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.sidebar-profile-action:hover {
  background: var(--hover-fade);
  color: var(--text);
}
.sidebar-profile-action[data-profile-signout]:hover { color: var(--red); }
.sidebar-profile-action:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: -2px;
}
.sidebar-profile-action:disabled { opacity: .5; cursor: default; }
.sidebar-profile-action lucide-icon {
  font-size: 16px;
  --icon-stroke: 1.78;
}

/* ── Content frame, topbar ───────────────────────────────────── */

/* Same radius as every other card and drawer. It used to sit a step
   above them, which read as a soft frame around sharper content.
   No elevation: the hairline is the only thing separating it from the
   page, which is how the site frames its panels. */
.admin-content-frame {
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: 1px solid var(--border);
}

/* Even up left/right spacing around the content frame. */
.admin-content-col { padding-left: 4px; padding-right: 4px; }

/* Keep wheel, touch and keyboard scrolling, but remove redundant visual
   scrollbars anywhere inside the encapsulated admin content. Views use nested
   scroll containers, so targeting only <main> leaves a second bar at the far
   right on pages such as AI spend. */
.admin-content-frame,
.admin-content-frame * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.admin-content-frame::-webkit-scrollbar,
.admin-content-frame *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.admin-content-frame > .border-b {
  background: var(--surface);
  border-color: var(--border);
}

#admin-content-head-title,
.admin-content-head-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.022em;
}
#admin-content-head-sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

.glass-search {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: border-color .16s, box-shadow .16s;
}
.glass-search:focus-within { box-shadow: none; }

/* ── Cards ───────────────────────────────────────────────────── */

.admin-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* Card header: consistent rhythm wherever a card has a title strip */
.admin-card > .flex.items-center.justify-between:first-child,
.admin-card > .border-b:first-child {
  padding: 14px 18px;
  border-color: var(--border);
}

.admin-empty {
  padding: 44px 22px;
  text-align: center;
  color: var(--muted);
}
.admin-empty-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}

/* ── Tables ──────────────────────────────────────────────────── */

.admin-table { font-size: 12.5px; }

.admin-table th {
  padding: 9px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th:first-child { border-top-left-radius: var(--radius-lg); }
.admin-table th:last-child  { border-top-right-radius: var(--radius-lg); }

.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background .13s; }
.admin-table tbody tr:hover td { background: var(--hover-fade); }

.admin-table-sticky thead th { position: sticky; top: 0; z-index: 2; }

/* ── Buttons ─────────────────────────────────────────────────── */

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.admin-btn:hover:not(:disabled) {
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}
.admin-btn:active:not(:disabled) { box-shadow: none; }
.admin-btn:disabled { opacity: .5; cursor: not-allowed; }
.admin-btn-sm { padding: 5px 10px; font-size: 11.5px; }

.admin-btn-primary,
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}
.admin-btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: none;
}

/* ── Inputs ──────────────────────────────────────────────────── */

.admin-input,
.admin-select,
input[type="text"].admin-input,
input[type="search"].admin-input {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  transition: border-color .16s, box-shadow .16s;
}
.admin-input:focus,
.admin-select:focus {
  outline: none;
  box-shadow: none;
}

.cs-trigger {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: border-color .16s, box-shadow .16s;
}
.cs-trigger:hover { border-color: var(--border-2); }
.cs-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: none;
  overflow: hidden;
  padding: 4px;
}
.cs-option { border-radius: var(--radius-sm); font-size: 12.5px; padding: 6px 9px; }

/* ── Checkbox ────────────────────────────────────────────────
   Shared control: the native box can't be styled consistently across
   browsers, so the real input is visually hidden and the adjacent span
   is drawn instead. Checked and indeterminate states both handled.
   Used by the tickets table and the fleet list.
   ──────────────────────────────────────────────────────────── */

.ui-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.ui-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ui-check span {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--card-2);
  transition: background .15s ease, border-color .15s ease;
}
.ui-check:hover span { border-color: var(--metal-hi); }
.ui-check input:checked + span {
  background: var(--accent-deep);
  border-color: var(--accent);
}
.ui-check input:checked + span::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--on-accent);
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(45deg);
}
/* Partial selection: a short grey dash, not a full-width white bar. It means
   "some of these", so it should read quieter than a checked box, not louder.
   `inset: 0` + `margin: auto` centres it exactly on both axes — the box is
   border-box, so hand-picked offsets have to account for the 1px border and
   were landing a fraction off. */
.ui-check input:indeterminate + span {
  background: var(--card-2);
  border-color: var(--border-2);
}
.ui-check input:indeterminate + span::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 7px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--muted);
}
.ui-check input:focus-visible + span {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}
.ui-check input:disabled + span { opacity: .4; }
.ui-check:has(input:disabled) { cursor: not-allowed; }

/* ── Segmented control ───────────────────────────────────────────
 *
 * The component itself — structure, the sliding indicator and its motion — is in
 * theme.css. This block is the console's skin for it: a squarer well than the
 * round pill the marketing pages use, and a chip that reads as a lifted surface
 * rather than an accent fill. It loads after theme.css, so these win.
 *
 * The indicator's own `transition` is deliberately not restated here. One curve for
 * everything that travels, defined once, next to the reasoning for it.
 */
.seg {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-2);
  padding: 3px;
  box-shadow: none;
}
.seg-btn {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  /* Matched to the travel, not a quick .16s snap: the label has to hand over to
     the other one while the chip is still moving, otherwise the colour changes
     before the chip arrives and the two read as separate events. */
  transition: color var(--seg-travel) var(--seg-ease);
}
.seg-btn.active { color: var(--text); }
.seg-slider {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}
/*
 * Repeated from theme.css on purpose. A media query adds no specificity, so the
 * plain `.seg-btn` rule above — in a sheet that loads later — would otherwise beat
 * the reduced-motion override and leave the label fading while the chip does not
 * move. Somebody who asked the system for less motion gets the state, not the
 * journey.
 */
@media (prefers-reduced-motion: reduce) {
  .seg-slider, .seg-btn { transition: none; }
}

/* ── View transition (switching views from the left rail) ────────
 *
 * Switching used to be a cut. The old markup was emptied in the same tick the new
 * view was asked to mount, so the content area blinked and the new page arrived at
 * full opacity. An entrance existed, but nothing on the way out — and an entrance
 * on its own reads as a pop rather than a transition.
 *
 * Out is a plain fade, with no travel. The entrance already rises a few pixels;
 * moving on the way out as well makes a nav click look busy, and the point of the
 * out-half is only to stop the cut from registering as one.
 *
 * Both halves sit here rather than in theme.css because tailwind.css also declares
 * `.admin-view-in` and loads after theme.css, so theme.css could not win. The
 * tailwind file is generated from src/tailwind.css, and that build is currently not
 * reproducible: running it drops 77 utility classes pages still use, so
 * regenerating it just to delete the duplicate would break unrelated styles.
 * Repairing the content globs is its own job. Until then this sheet loads last and
 * is the one place that reliably wins.
 *
 * `admin-view-in`'s keyframes are the ones tailwind.css already defines — keyframes
 * are global, so only the timing is restated, not the animation.
 */
.admin-view-in { animation: admin-view-in var(--view-in) var(--seg-ease) both; }
.admin-view-out { animation: admin-view-out var(--view-out) ease-in both; }
@keyframes admin-view-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-view-in, .admin-view-out { animation: none; }
}

/* ── A row that just arrived ──────────────────────────────────────
 *
 * Put on an element by `arrive.js`, and only ever on one that was not in the list
 * at the previous paint. It is not on the rows themselves in this stylesheet on
 * purpose: these views repaint by rewriting their markup, so every row is a new
 * element after every update, and a plain entrance rule would flash the whole
 * list each time a colleague approved something.
 *
 * Same curve and the same distance as a view arriving — an order appearing in a
 * queue is the same kind of event at a smaller scale, and giving it its own
 * timing would just be a second thing to keep in sync.
 */
.is-arriving { animation: nv-arrive var(--view-in) var(--seg-ease) both; }
@keyframes nv-arrive {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .is-arriving { animation: none; }
}

/* ── Pills, badges, status ───────────────────────────────────── */

[class^="admin-prio-"],
[class*=" admin-prio-"],
.admin-esc-tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.admin-esc-tag {
  margin-left: 7px;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .06em;
  background: rgba(210, 65, 65, .1);
  color: var(--red);
  border-color: rgba(210, 65, 65, .22);
}

/* ── Reusable list rows (used by Identity, Departments, KB) ──── */

.n-list { display: flex; flex-direction: column; }

.n-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .13s;
}
.n-row:last-child { border-bottom: 0; }
.n-row:hover { background: var(--hover-fade); }

.n-row-main { min-width: 0; flex: 1; }
.n-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.n-row-sub {
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.45;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.n-row-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.n-row-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

/* Leading avatar / icon tile */
.n-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid var(--accent-line);
  overflow: hidden;
}
.n-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Section header inside a card ────────────────────────────── */

.n-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.n-card-head-main { flex: 1; min-width: 0; }
.n-card-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.n-card-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; line-height: 1.45; }

/* ── Notices ─────────────────────────────────────────────────── */

.n-notice {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--card);
}
.n-notice-ok   { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); }
.n-notice-warn { border-color: rgba(176, 119, 15, .28); background: rgba(176, 119, 15, .07); color: var(--yellow); }
.n-notice-err  { border-color: rgba(210, 65, 65, .28); background: rgba(210, 65, 65, .06); color: var(--red); }
/* Only a notice that carries an action (e.g. collecting a pending password)
   changes layout, so plain notices keep their existing icon + text flow. */
.n-notice:has(> button) { align-items: center; }
.n-notice:has(> button) > span { flex: 1 1 auto; min-width: 0; }
.n-notice > button { flex: none; margin-left: auto; }

/* ── Modals ──────────────────────────────────────────────────── */

.shadow-panel { box-shadow: var(--shadow-panel) !important; }

.modal, .admin-modal {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
  border: 1px solid var(--border);
}

/* ── Motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ── Identity view specifics ─────────────────────────────────── */

.id-row-active { background: var(--accent-soft); }
.id-row-active:hover { background: var(--accent-soft); }

.id-active-tag,
.id-disabled-tag {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  vertical-align: 1px;
}
.id-active-tag {
  background: var(--accent);
  color: var(--on-accent);
}
.id-disabled-tag {
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.id-row-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.id-row-note::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.id-selfbar {
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
.id-selflink {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-deep);
  cursor: pointer;
}
.id-selflink:hover { text-decoration: underline; }

/* Reset-method chooser rows */
.id-choice {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.id-choice:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.id-choice-title { font-size: 13px; font-weight: 650; color: var(--text); }
.id-choice-sub { font-size: 11.5px; color: var(--dim); margin-top: 3px; line-height: 1.5; }
.id-choice-rec {
  background: var(--accent-soft);
}
.id-choice-rec .id-choice-title { color: var(--accent-deep); }

/* ============================================================
   Devices page — the marketing site's device window, with real data

   Lifted one-to-one from the site's `.device-window` + `.bento-cms`
   (website/src/scratch.css). Same 54px rows, same source tree, same
   brand OS marks. Colour is held back for the things that need a
   decision: a device that is fine reads silver, and only its health
   dot carries the mint.

   The list is the whole page. There is no summary strip above it — the
   figures it showed (total, online, at risk) are already in the source
   tree's live counts, so it was a second reading of the same data.
   ============================================================ */

/* ── Layout: the window fills the content frame ──────────────
   In-app the content frame already supplies the border, radius and
   elevation. So the window drops its own — no nested frame, no gap
   between the two, no glow or drop shadow. Internal hairlines do all
   the separating, which is the site's discipline anyway.

   The chain below is what lets the table area absorb the leftover
   height instead of stopping at min-height and leaving dead space:
   root (.admin-view-fill) → stage → window → shell → main. */

/* ── Fleet-shaped loading state ─────────────────────────────
   This uses the real Fleet geometry so direct reloads never flash the
   generic Overview frame or jump from a centered spinner into a table. */
#fleet-loading {
  min-height: 0;
  padding: 0;
  text-align: initial;
}
#fleet-loading:not(.hidden),
.fl-loading-view {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
}
.fl-loading-view { align-self: stretch; }
.fl-loading-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.fl-loading-view .skeleton,
.tpd-skeleton-view .skeleton,
.tkt-loading-view .skeleton,
.usr-loading-view .skeleton,
.kbb-loading-view .skeleton {
  display: block;
  background: linear-gradient(90deg, var(--border) 20%, var(--border-2) 50%, var(--border) 80%);
  background-size: 220% 100%;
  animation: fl-skeleton-shimmer 1.35s ease-in-out infinite;
}
@keyframes fl-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.fl-skeleton-toolbar { flex-wrap: nowrap; }
.fl-skeleton-search { width: min(260px, 25vw); height: 30px; border-radius: var(--radius); }
.fl-skeleton-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fl-skeleton-tools i { width: 104px; height: 30px; border-radius: var(--radius); }
.fl-skeleton-tools i:first-child { width: 96px; }
.fl-skeleton-tools i:last-child { width: 76px; }
.fl-skeleton-tree { display: flex; flex-direction: column; gap: 12px; }
.fl-skeleton-tree-row { width: 76%; height: 9px; margin: 5px 8px; }
.fl-skeleton-tree-row.is-2 { width: 58%; margin-left: 28px; }
.fl-skeleton-tree-row.is-3 { width: 68%; }
.fl-skeleton-tree-row.is-4 { width: 50%; margin-left: 28px; }
.fl-skeleton-main { overflow: hidden; }
.fl-skeleton-head,
.fl-skeleton-row {
  display: grid;
  grid-template-columns: 38px minmax(190px, 2.2fr) minmax(120px, 1.5fr) 90px 120px 108px;
  align-items: center;
}
.fl-skeleton-head { height: 34px; border-bottom: 1px solid var(--border); }
.fl-skeleton-head i { width: 48px; height: 7px; }
.fl-skeleton-row { height: 54px; border-bottom: 1px solid var(--hairline); }
.fl-skeleton-row > * { margin-left: 16px; }
.fl-skeleton-check { width: 14px; height: 14px; margin-left: 16px; border-radius: 4px; }
.fl-skeleton-device {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: 9px 7px;
  gap: 7px 10px;
  align-items: center;
}
.fl-skeleton-os { grid-row: 1 / 3; width: 18px; height: 18px; border-radius: 4px; }
.fl-skeleton-name { width: 62%; height: 9px; }
.fl-skeleton-sub { width: 44%; height: 7px; }
.fl-skeleton-health { width: 82px; height: 9px; }
.fl-skeleton-risk { width: 44px; height: 20px; border-radius: 6px; }
.fl-skeleton-disk { width: 72px; height: 8px; }
.fl-skeleton-seen { width: 48px; height: 8px; }
.fl-skeleton-row.is-2 .fl-skeleton-name { width: 48%; }
.fl-skeleton-row.is-2 .fl-skeleton-sub { width: 58%; }
.fl-skeleton-row.is-3 .fl-skeleton-name { width: 70%; }
.fl-skeleton-row.is-3 .fl-skeleton-health { width: 66px; }

@media (max-width: 1100px) {
  .fl-skeleton-toolbar { flex-wrap: wrap; }
  .fl-skeleton-tools { margin-left: 0; }
  .fl-skeleton-tree { flex-direction: row; max-height: 58px; overflow: hidden; }
  .fl-skeleton-tree-row { width: 74px !important; margin: 5px 4px !important; flex: none; }
}

/* `:not(.hidden)` because the id would otherwise outrank Tailwind's
   `.hidden` and the view would show while it is still loading. */
#fleet-content:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.fl-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.fl-window {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--card);
}

/* The window's top bar. On the site the table's own toolbar doubles as
   this bar, so it carries the bar's 54px height and its darker fill.
   `min-height` rather than `height` plus wrapping: the bar holds the
   site's exact 54px while the controls fit on one line, and grows only
   when they genuinely have to wrap. That beats guessing a breakpoint,
   because the usable width here depends on the sidebar, not the
   viewport. */
.fl-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
.fl-bar-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ── Toolbar controls ───────────────────────────────────────── */

.fl-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.fl-btn:hover:not(:disabled) { color: var(--text); border-color: var(--metal-hi); }
.fl-btn:disabled { opacity: .4; cursor: not-allowed; }
.fl-btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.fl-btn-icon svg { flex: none; }
.fl-btn-icon lucide-icon { flex: none; font-size: 16px; --icon-stroke: 1.59; }

/* Reusable square action for Fleet toolbar icons. All current and future
   buttons using this class inherit one fill, border, size, and icon tone. */
.fl-toolbar-icon-btn {
  width: 30px;
  min-width: 30px;
  padding: 0;
  justify-content: center;
  color: var(--dim);
  background: var(--well);
  border-color: var(--border);
}
.fl-toolbar-icon-btn lucide-icon {
  color: inherit;
  opacity: 1;
  --icon-stroke: 1.59;
}
.fl-toolbar-icon-btn .fl-compare-icon { transform: rotate(90deg); }

/* Fleet filter: the trigger keeps the shared square-action treatment while
   the menu floats outside the clipped Fleet window. */
.fl-filter-trigger { position: relative; }
.fl-filter-trigger.is-active {
  color: var(--text);
  border-color: var(--metal-hi);
  background: var(--hover);
}
.fl-filter-trigger.is-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--well);
}
.fl-filter-menu {
  position: fixed;
  z-index: 490;
  width: min(296px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .48);
  color: var(--dim);
  animation: fl-filter-in .12s ease;
}
@keyframes fl-filter-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.fl-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.fl-filter-head strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.fl-filter-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.fl-filter-close:hover { background: var(--hover); color: var(--text); }
.fl-filter-picker {
  padding: 10px 12px 0;
}
.fl-filter-search.admin-search {
  display: flex;
  width: 100%;
  max-width: none;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  box-shadow: none;
  font-size: 12px;
}
.fl-filter-search.admin-search:focus-within {
  border-color: var(--metal-hi);
  box-shadow: none;
}
.fl-filter-search input {
  height: 100%;
  padding: 0;
  background: transparent;
  font-size: 12px;
}
.fl-filter-criteria {
  margin-top: 6px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
}
.fl-filter-criteria button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 29px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.fl-filter-criteria button:hover { background: var(--hover); color: var(--text); }
.fl-filter-criteria button.is-on { background: var(--hover); color: var(--text); }
.fl-filter-criteria small {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.fl-filter-criteria p {
  margin: 0;
  padding: 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.fl-filter-editor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.fl-filter-editor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}
.fl-filter-editor-head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.fl-filter-editor-head span {
  color: var(--muted);
  font-size: 10.5px;
}
.fl-filter-field {
  display: block;
  padding: 10px 12px 0;
}
.fl-filter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.fl-filter-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
}
.fl-filter-mode button {
  height: 26px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.fl-filter-mode button:hover { color: var(--text); }
.fl-filter-mode button.is-on {
  background: var(--hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-2);
}
.fl-filter-options {
  max-height: 176px;
  overflow-y: auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
}
.fl-filter-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 29px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.fl-filter-options button:hover { background: var(--hover); color: var(--text); }
.fl-filter-options button.is-on { color: var(--text); }
.fl-filter-options button i {
  display: none;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.fl-filter-options button.is-on i { display: block; }
.fl-filter-options p {
  margin: 0;
  padding: 10px 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.fl-filter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
}
.fl-filter-foot span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-filter-foot button {
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.fl-filter-foot button:hover:not(:disabled) { color: var(--text); }
.fl-filter-foot button:disabled { opacity: .4; cursor: default; }

/* The single primary action keeps the brand green. Nothing else does. */
.fl-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  letter-spacing: -.01em;
}
.fl-btn-primary:hover:not(:disabled) {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--on-accent);
}

/* ── Shell: source tree + table ─────────────────────────────── */

.fl-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  flex: 1;
  min-height: 260px;
}

.fl-tree {
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  font-size: 12px;
  overflow-y: auto;
}

.fl-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  padding-left: calc(8px + var(--d, 0) * 12px);
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.fl-tree-row:hover { background: var(--hover-fade); color: var(--text); }

/* The selected source is a soft fill, no outline. */
.fl-tree-row.is-on {
  background: var(--well-hi);
  color: var(--text);
}

/* Parent rows read as the group they open, in sentence case like the
   site's tree, not as shouty uppercase section labels. */
.fl-tree-row.is-group {
  color: var(--text);
  font-weight: 500;
  margin-top: 8px;
}
.fl-tree-all { margin-bottom: 2px; }

.fl-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-tree-count {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fl-tree-row.is-on .fl-tree-count { color: var(--dim); }

.fl-tree-caret {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .16s ease;
}
.fl-tree-caret.is-open { transform: rotate(90deg); }
.fl-tree-caret-sp { width: 11px; flex-shrink: 0; }

/* ── Table ──────────────────────────────────────────────────── */

/* Now that the frame no longer scrolls, the list scrolls here — which is
   also what makes the sticky header stick to the top of the table rather
   than the top of the page. */
.fl-main { position: relative; min-width: 0; overflow: auto; }

.fl-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.fl-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
.fl-table thead th.cursor-pointer:hover { color: var(--dim); }

.fl-table tbody td {
  height: 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.fl-table tbody tr:last-child td { border-bottom: 1px solid var(--hairline); }

/* The row itself isn't clickable — only the device name is — so it carries no
   pointer cursor. It still highlights on hover, because the hover tells you
   which row a checkbox or name belongs to across a wide table. */
.fl-row { transition: background .16s ease; }
.fl-row:hover td { background: var(--hover-fade); }
/* The open device is marked the way the site marks the selected row:
   a mint wash plus an inset rule down the leading edge. */
.fl-row.is-open td { background: var(--live-soft); }
.fl-row.is-open td:first-child { box-shadow: inset 2px 0 0 var(--live); }

.fl-c-check {
  width: 38px;
  padding: 0 !important;
  text-align: center !important;
}
.fl-table .fl-c-check .ui-check {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}
.fl-table thead .fl-c-check .ui-check { height: 34px; }
.fl-table tbody .fl-c-check .ui-check { height: 54px; }
.fl-c-risk { width: 90px; }
.fl-c-disk { width: 120px; }
.fl-c-seen { width: 108px; }

.fl-empty {
  height: auto !important;
  padding: 52px 20px !important;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.fl-muted { color: var(--muted); }

/* ── Device cell ─────────────────────────────────────────────
   Two rows sharing one 26px mark column, exactly like the site's
   `.bento-cms-cell-device` grid. */

.fl-dev {
  display: grid;
  grid-template-columns: 3px 26px minmax(0, auto);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-width: 0;
}
.fl-presence {
  grid-row: 1 / 3;
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: transparent;
}
/* Online devices get the bar, coloured by health; offline devices get none. */
.fl-presence.is-on,
.fl-presence.is-on.is-ok { background: var(--live); }
.fl-presence.is-on.is-warn { background: var(--yellow); }
.fl-presence.is-on.is-crit { background: var(--red); }
.fl-os {
  grid-row: 1 / 3;
  width: 26px;
  height: 26px;
  font-size: 18px;
  color: var(--dim);
}

/* The one hit target in the row. Justified to its own width so the clickable
   area stops at the end of the text rather than spanning the column. */
.fl-dev-name {
  justify-self: start;
  grid-column: 3;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: none;
  text-align: left;
}
.fl-dev-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.fl-dev-name:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}
.fl-dev-sub {
  grid-column: 3;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-dev-lower {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}
.fl-dev-lower .fl-dev-sub { min-width: 0; }
.fl-device-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.fl-device-tag {
  --device-tag-color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--device-tag-color) 35%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--device-tag-color) 12%, transparent);
  color: var(--device-tag-color);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
}
.fl-device-tag-more {
  --device-tag-color: var(--muted);
  flex-shrink: 0;
}

/* Reusable tag assignment in the Fleet drawer. */
.fl-tag-editor {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
}
.fl-tag-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 24px;
}
.fl-tag-choice {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}
.fl-tag-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fl-tag-choice .fl-device-tag {
  padding: 4px 9px;
  font-size: 10.5px;
  opacity: .48;
  transition: opacity .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.fl-tag-choice:hover .fl-device-tag { opacity: .78; }
.fl-tag-choice input:checked + .fl-device-tag {
  opacity: 1;
  border-color: color-mix(in srgb, var(--device-tag-color) 60%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--device-tag-color) 12%, transparent);
}
.fl-tag-choice input:focus-visible + .fl-device-tag { box-shadow: none; }
.fl-tag-choice input:disabled + .fl-device-tag { cursor: wait; opacity: .55; }
.fl-tag-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px auto;
  gap: 7px;
  align-items: center;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.fl-tag-create .admin-input { width: 100%; min-width: 0; }
.fl-tag-create input[type="color"] {
  width: 34px;
  height: 30px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
}
.fl-tag-empty, .fl-tag-status { font-size: 11px; color: var(--muted); }
.fl-tag-status { min-height: 15px; margin-top: 7px; }
.fl-tag-status.is-error { color: var(--red); }

/* ── Health ──────────────────────────────────────────────────
   A glowing dot plus a plain-language verdict. Healthy devices stay
   grey so the eye can still scan the column for the ones that aren't. */

.fl-health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--dim);
}
.fl-health i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  box-shadow: 0 0 8px color-mix(in srgb, currentColor 55%, transparent);
}
.fl-h-ok { color: var(--dim); }
.fl-h-ok i { background: var(--live); box-shadow: 0 0 8px var(--live-glow); }
.fl-h-warn { color: var(--yellow); }
.fl-h-bad  { color: var(--red); }
.fl-h-off  { color: var(--muted); }
.fl-h-off i { box-shadow: none; }

/* ── Risk ────────────────────────────────────────────────────
   Flat tinted chips, no outline — the site's `.bento-cms-cell-risk`. */

.fl-risk {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 0;
  background: var(--well-hi);
  color: var(--dim);
}
/* The tint is the whole signal — no outline, no uppercase. */
.fl-r-ok   { color: var(--live);   background: var(--live-soft); }
.fl-r-warn { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.fl-r-bad  { color: var(--red);    background: color-mix(in srgb, var(--red) 14%, transparent); }

/* ── Disk ────────────────────────────────────────────────────── */

.fl-disk { display: flex; align-items: center; gap: 9px; }
.fl-disk-n {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}
.fl-disk-bar {
  flex: 1;
  height: 4px;
  min-width: 40px;
  border-radius: 999px;
  background: var(--well-hi);
  overflow: hidden;
}
/* Two-stop gradients, the same treatment the site gives its share bars. */
.fl-disk-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--live));
}
.fl-disk-bar i.is-warn { background: linear-gradient(90deg, color-mix(in srgb, var(--yellow) 70%, #000), var(--yellow)); }
.fl-disk-bar i.is-bad  { background: linear-gradient(90deg, color-mix(in srgb, var(--red) 70%, #000), var(--red)); }

.fl-seen {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fl-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.fl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
}
/* `.chat-header-status` is the end-user ticket page's status select; it shares
   the Fleet filter dropdown look so the two stay identical. */
.fl-filters .cs,
.chat-header-status .cs { min-width: 0; }
.fl-filters .cs-trigger,
.chat-header-status .cs-trigger {
  height: 34px;
  min-width: 128px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.fl-filters .cs-trigger:hover,
.fl-filters .cs-trigger[aria-expanded="true"],
.chat-header-status .cs-trigger:hover,
.chat-header-status .cs-trigger[aria-expanded="true"] {
  background: var(--hover-fade);
  color: var(--text);
  border-color: var(--border-2);
}
.fl-filters .cs-chevron,
.chat-header-status .cs-chevron { color: inherit; }
.fl-view .fl-search {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 260px;
  height: 34px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: none;
}
.fl-view .fl-search:focus-within {
  border-color: var(--border-2);
  box-shadow: none;
}
.fl-view .fl-search input {
  height: 100%;
  padding: 0;
  background: transparent;
  font-size: 12.5px;
}
.fl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px 8px;
  color: var(--muted);
  font-size: 12px;
}
.fl-pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fl-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.fl-pager-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.fl-pager-btn:disabled { opacity: .35; cursor: default; }
.fl-pager-btn lucide-icon { font-size: 16px; }
.fl-meta-refresh { margin-left: auto; font-variant-numeric: tabular-nums; }
.fl-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.fl-head-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--dim);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.fl-head-icon-btn:hover {
  background: var(--hover-fade);
  color: var(--text);
  border-color: var(--border-2);
}
.fl-head-icon-btn lucide-icon {
  font-size: 18px;
  --icon-stroke: 1.97;
}
.fl-add-wrap { position: relative; }
.fl-add-menu {
  position: fixed;
  z-index: 520;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 8px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.fl-add-head {
  padding: 6px 10px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.fl-add-menu .ob-types { gap: 0; }
.fl-add-menu .ob-type {
  font-family: inherit;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
}
.fl-add-menu .ob-type:not(.is-off):hover {
  background: var(--hover);
  border-color: transparent;
}
.fl-add-menu .ob-type-icon { font-size: 20px; }
.fl-add-menu .ob-type-title { font-size: 13px; }
.fl-add-menu .ob-type-sub { font-size: 11px; }

/* ── Device page (full-bleed when a row is opened) ───────────── */

.fl-view.is-device-open > :not(.fl-device):not(.fl-term-overlay) {
  visibility: hidden;
  pointer-events: none;
}

/* ── Remote terminal overlay ───────────────────────────────── */

.fl-term-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .58);
}
.fl-term {
  display: flex;
  flex-direction: column;
  width: min(920px, 92vw);
  height: min(580px, 86vh);
  overflow: hidden;
  border: 1px solid var(--border-2, var(--border));
  border-radius: 12px;
  background: #0d0d0d;
  box-shadow: none;
}
.fl-term-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 10px 12px;
  border-bottom: 1px solid #242424;
  background: #161616;
}
.fl-term-title {
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 650;
}
.fl-term-shell-label {
  padding: 2px 8px;
  border: 1px solid #333333;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.fl-term-status {
  display: none;
}
.fl-term-close { flex: none; margin-left: auto; }

.fl-term-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 16px;
  outline: none;
  cursor: text;
  font: 12.5px/1.45 ui-monospace, Consolas, monospace;
  color: #d4d4d4;
}
.fl-term-screen:focus,
.fl-term-screen:focus-visible {
  outline: none;
  box-shadow: none;
}
.fl-term-out {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  /* The global `code, pre { background: var(--card-2) }` rule would otherwise
     tint the output block bluish-grey while the empty area below it stays the
     panel colour. Force it flat so the whole terminal is one surface. */
  background: transparent;
  border: 0;
  padding: 0;
}
/* Terminal selection: the app's default ::selection is a green accent, which
   looks wrong on a console. Neutral grey here. */
.fl-term ::selection { background: #3a3f43; color: #fff; }
.fl-term ::-moz-selection { background: #3a3f43; color: #fff; }
.fl-term-out .is-err { color: #f6a5a5; }
.fl-term-out .is-sys { color: #9a9a9a; }
.fl-term-out .is-cmd { color: #f0f0f0; }

/* Prompt + draft + caret sit inline after shell output. Prompt text is the
   real cwd from the shell probe — not a hardcoded path. */
.fl-term-prompt {
  color: #9a9a9a;
}
.fl-term-draft {
  white-space: pre-wrap;
  word-break: break-word;
  color: #f0f0f0;
}
.fl-term-caret {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: #cccccc;
  animation: fl-term-blink 1s step-end infinite;
}
@keyframes fl-term-blink {
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .fl-term-caret { animation: none; }
}

.fl-device {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.fl-device[hidden] { display: none !important; }

.fl-device-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  min-height: 64px;
  padding: 12px 18px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.fl-device-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.fl-device-back:hover { color: var(--text); background: var(--hover-fade); }
.fl-device-back lucide-icon { font-size: 20px; }

.fl-device-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}
.fl-device-os {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--text);
}
.fl-device-os lucide-icon { font-size: 26px; }
.fl-device-copy { min-width: 0; }
.fl-device-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fl-device-name {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display, inherit);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-device-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}
.fl-device-presence i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.fl-device-presence.is-on { color: var(--live, #3dd68c); }
.fl-device-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fl-device-sub span { color: var(--border-2); }

/* Icon toolstrip — NinjaOne-style */
.fl-toolstrip {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  margin-left: 10px;
}
.fl-tool-wrap { position: relative; }
.fl-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .14s ease, color .14s ease, opacity .14s ease;
}
.fl-tool:hover:not(:disabled):not(.is-off) {
  background: var(--hover-fade);
  color: var(--text);
}
.fl-tool-wrap.is-open > .fl-tool {
  background: var(--hover-fade);
  color: var(--accent-bright, var(--accent));
}
.fl-tool.is-off,
.fl-tool:disabled {
  color: var(--muted);
  opacity: .4;
  cursor: not-allowed;
}

.fl-fly {
  position: absolute;
  top: 0;
  left: calc(100% + 2px);
  z-index: 30;
  min-width: 188px;
  padding: 4px;
  border: 1px solid var(--border-2, var(--border));
  border-radius: 10px;
  background: var(--card);
  box-shadow: none;
}
.fl-fly-root {
  top: calc(100% + 6px);
  left: 0;
  right: auto;
}
.fl-fly-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.fl-fly-item:hover:not(.is-off):not(:disabled),
.fl-fly-item.is-hot { background: rgba(255, 255, 255, .06); }
.fl-fly-item.is-off,
.fl-fly-item:disabled {
  color: var(--dim);
  opacity: .55;
  cursor: default;
}
.fl-fly-chev { color: var(--muted); flex: none; }
.fl-fly-item.has-sub > .fl-fly { display: none; }
.fl-fly-item.has-sub:hover > .fl-fly,
.fl-fly-item.has-sub.is-hot > .fl-fly { display: block; }

.fl-device-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  min-height: 38px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.fl-device-tabs span {
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
}
.fl-device-tabs .is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.fl-device-tabs .is-off { opacity: .4; }

.fl-device-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 28px;
}
.fl-device-osline {
  margin: 0 0 14px;
  color: var(--dim);
  font-size: 12.5px;
}
.fl-device-panel {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.fl-device-panel h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
}
.fl-device-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.fl-device-panel-head h2 { margin: 0; }
.fl-device-panel-acts { display: flex; flex-wrap: wrap; gap: 6px; }

.fl-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  overflow: auto;
  padding: 16px 18px 24px;
  border-left: 1px solid var(--border);
  background: var(--card);
  z-index: 4;
  box-shadow: none;
}
.fl-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.fl-drawer-title { font-size: 15px; font-weight: 650; }
.fl-drawer-sub { color: var(--muted); font-size: 12px; word-break: break-all; }
.fl-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.fl-btn-danger {
  border-color: color-mix(in srgb, var(--red) 55%, var(--border));
  color: var(--red);
}
.fl-drawer-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin-top: 14px;
  font-size: 13px;
}
.fl-drawer-label {
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fl-disk-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
}
.fl-action-out {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}
.fl-view .fl-main { flex: 1; min-height: 0; }
/* Device-type rail beside the table: the grid fills the view, and the table
   scrolls inside its own column rather than pushing the rail down. */
.fl-view > .fl-shell { min-height: 0; border-top: 1px solid var(--border); }
.fl-view > .fl-shell > .fl-main { min-height: 0; }
.fl-view .fl-table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  font-weight: 500;
}

/* ── Controls on the window bar ──────────────────────────────
   Every control is the same 30px chip: hairline border, faint inset
   fill, brighter border on hover. Nothing on the bar is filled except
   the one primary action. */

#fleet-content .admin-search {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  font-size: 12px;
}
#fleet-content .admin-search:focus-within {
  border-color: var(--metal-hi);
  box-shadow: none;
}
.fl-search { flex: 1 1 auto; min-width: 140px; max-width: 300px; }

/* Presence pill, matched to the other chips on the bar. */
#fleet-content .fleet-live-indicator {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius);
  border-color: var(--border);
  background: var(--well);
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}
#fleet-content .fleet-live-pulse { background: var(--live); }

@media (max-width: 1100px) {
  .fl-bar-tools { margin-left: 0; }
  .fl-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .fl-tree {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .fl-tree-item { display: contents; }
  .fl-tree-row { width: auto; padding-left: 10px !important; margin-top: 0 !important; }
  .fl-tree-row.is-group { display: none; }
  .fl-tree-caret, .fl-tree-caret-sp { display: none; }
  .fl-c-disk { display: none; }
}
@media (max-width: 760px) {
  .fl-c-risk { display: none; }
}

/* ════════════════════════════════════════════════════════════
   Identity — tenant as a data set

   Follows the reference exactly: breadcrumb with a copyable id, title
   with a consent badge, record chips, a tab strip, then a real grid with
   ruled columns. Categorical values get a tinted pill with a solid dot,
   states get a tick or a cross. Colour carries meaning here, so this is
   the one page where the palette is more than silver.
   ════════════════════════════════════════════════════════════ */

/* Shared by the data-heavy pages so the tones are defined once. */
.idb,
.kbb,
.tkt {
  --t-green:  #4ec98a;
  --t-orange: #dd9040;
  --t-red:    #e2686b;
  --t-blue:   #5590e2;
  --t-violet: #a98ce0;
  --t-teal:   #4fbcc0;
  --t-slate:  #8b95a1;
}

/*
 * Entrance for the connected directory view.
 *
 * Not `.admin-view-in`: the console removes that class on the first mount so the
 * boot skeleton does not flash — and returning from Microsoft's consent screen is
 * always a first mount, which is exactly when this view should ease in instead of
 * snapping into place.
 */
.idb {
  animation: idb-in .5s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes idb-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .idb { animation: none; }
}

/* ── Header ──────────────────────────────────────────────────── */

.idb-head {
  flex: none;
  padding: 18px 22px 0;
}

.idb-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.idb-crumb { white-space: nowrap; }
.idb-crumb-sep { color: var(--metal-mid); }
.idb-crumb-id {
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--dim);
  user-select: all;
}
.idb-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.idb-copy:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--card-2);
}
.idb-copy.is-done {
  color: var(--t-green);
  border-color: rgba(78, 201, 138, .3);
}

.idb-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}
.idb-title {
  margin: 0;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--text);
}
.idb-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  flex: none;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: var(--card-2);
  color: var(--dim);
}

.idb-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.idb-btn,
.idb-select {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--dim);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.idb-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.idb-btn:disabled {
  opacity: .55;
  cursor: default;
}
.idb-btn.is-primary {
  background: var(--accent-deep);
  color: var(--on-accent);
  font-weight: 600;
}
.idb-btn.is-primary:hover:not(:disabled) {
  background: var(--accent);
  color: var(--on-accent);
}
/* Destructive action (disconnect a tenant). Tinted rather than filled: it sits
   next to the primary button and must not compete with it for attention. */
.idb-btn.is-danger {
  color: var(--red);
  border-color: rgba(217, 106, 106, .35);
}
.idb-btn.is-danger:hover:not(:disabled) {
  background: rgba(217, 106, 106, .1);
  border-color: rgba(217, 106, 106, .55);
  color: var(--red);
}
.idb-select { padding-right: 8px; }

.idb-sub {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── Record chips ────────────────────────────────────────────── */

.idb-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
a.idb-chip-link { text-decoration: none; color: inherit; cursor: pointer; }
a.idb-chip-link:hover { border-color: var(--border-2); color: var(--text); }
.idb-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: #d9a300; flex: none; }
.idb-chip-dot.is-ok { background: var(--live, #3dd68c); }
.idb-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}
.idb-chip svg { color: var(--muted); }
.idb-chip b {
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.idb-chip-note {
  color: var(--muted);
  font-size: 11px;
}

.idb-stack {
  display: inline-flex;
  align-items: center;
}
.idb-av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  margin-left: -6px;
  border: 1px solid var(--card);
  border-radius: 50%;
  background: var(--hover);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--dim);
}
.idb-av:first-child { margin-left: 0; }

/* ── Tabs ────────────────────────────────────────────────────── */

/*
 * The chip is a sliding indicator now, not a background on the active button.
 *
 * It looked identical to the segmented control in Procurement and moved
 * differently — one snapped, one glided. Two tab strips three clicks apart that
 * behave differently is the kind of thing that makes a product feel assembled.
 * So this strip *is* a `.seg` group (see `seg.js`): the shared component supplies
 * the well, the chip and the motion, and the rules below only set this strip's
 * quieter size.
 *
 * Deliberately nothing here about the chip's colour, the well's fill or the
 * active label. Those live in `theme.css` and are re-stated per skin in
 * `theme-dark.css`; a copy in this file would be a second source of truth that
 * only one theme was ever checked against — an accent-coloured chip under a
 * `var(--text)` label in the light skin, for instance, is unreadable.
 *
 * The old background on `.idb-tab.is-active` has to go either way: the slider
 * draws it, and leaving both would paint a second chip that jumps ahead of the
 * one that travels.
 */
.idb-tabs { margin-top: 18px; padding: 3px; }
.idb-tab {
  height: 26px;
  padding: 0 13px;
  font-size: 12.5px;
  font-weight: 550;
}

/* ── Selection bar ───────────────────────────────────────────── */

.idb-selbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 9px 22px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.idb-selbar[hidden] { display: none; }
/*
 * Present but inert while nothing is selected.
 *
 * The bar used to appear on the first click, which pushed the table down and moved
 * the row out from under the pointer. So it is always drawn on the tabs that
 * select, with the same controls, and this is what "not usable yet" looks like.
 * Dimmed rather than removed: the height of the page must not depend on the
 * selection, which is the whole point.
 */
.idb-selbar.is-idle { color: var(--muted); }
.idb-selcount {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.idb-selbar.is-idle .idb-selcount { color: var(--muted); }
/*
 * Only the buttons are dimmed here.
 *
 * NOT the selects. `custom-select.js` keeps the real `<select>` in the DOM as the
 * source of truth and hides it with `.cs-native { position: absolute; opacity: 0 }`,
 * drawing its own trigger on top. A rule like `.idb-selbar .idb-pick:disabled
 * { opacity: .45 }` outranks that `.cs-native` by specificity, so it un-hid the
 * native control — and the bar showed every label twice, offset, with a second
 * chevron floating over the next button. It looked broken because two controls
 * really were on screen.
 *
 * The disabled look for an enhanced select already exists and belongs to the
 * component: `.cs-disabled .cs-trigger` in theme.css. Nothing to add.
 */
.idb-selbar .idb-mini:disabled {
  opacity: .45;
  cursor: default;
}

/* ── Panel ───────────────────────────────────────────────────── */

.idb-panel {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
}
.idb-loading {
  padding: 40px 22px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.idb-loading.is-err { color: var(--red); }

.idb-empty {
  margin: 18px 22px;
  padding: 30px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.idb-empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.idb-empty-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.idb-empty-sub b { color: var(--dim); }

.idb-note {
  margin: 16px 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.idb-note b { color: var(--dim); }
/* The outcome of a bulk write. Tinted, because it reports something that just
   happened rather than something to know about. */
.idb-note.is-ok {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--dim);
}
.idb-note.is-bad {
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
  background: color-mix(in srgb, var(--red) 8%, transparent);
  color: var(--red);
}

/* ── Filter bar ──────────────────────────────────────────────── */
/*
 * Sits between the tabs and the table. The whole reason it exists: picking
 * twenty of two hundred rows is a filter-then-select-all job, not a scrolling
 * job, and the two chips are the two setup states this screen warns about.
 */
.idb-filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 22px 0;
}
.idb-filterfield {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 380px;
  padding: 0 10px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  transition: border-color .15s ease;
}
.idb-filterfield:focus-within { }
.idb-filterfield svg { flex: none; opacity: .75; }
.idb-filterinput {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.idb-filterinput::placeholder { color: var(--muted); }
/* The browser's own clear button, which does not match anything else here. */
.idb-filterinput::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.idb-chips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.idb-chipf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.idb-chipf:hover:not(:disabled) { border-color: var(--metal-hi); color: var(--text); }
.idb-chipf.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.idb-chipf:disabled { opacity: .45; cursor: default; }
.idb-chipn {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
}
.idb-chipf.is-active .idb-chipn { color: var(--accent); }
.idb-filtercount {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Ticket access: which departments a role may see ─────────── */
/*
 * Checkboxes inline in the cell rather than a multi-select. A department list is
 * short, all of it matters, and a `<select multiple>` hides the unchosen ones
 * behind a scroll — which is the wrong shape for a setting whose whole point is
 * "what is *not* included".
 */
.idb-scopelist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: 520px;
}
/* Dimmed, not hidden: the choice stays readable while the role sees everything,
   so switching back does not look like the selection was lost. */
.idb-scopelist.is-off { opacity: .45; }
.idb-scopeitem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
}
.idb-scopelist.is-off .idb-scopeitem { cursor: default; }
.idb-scopeitem input { accent-color: var(--accent); cursor: inherit; }
.idb-scopestale {
  flex: 1 1 100%;
  font-size: 11px;
  color: var(--yellow);
}

/* ── Grid ────────────────────────────────────────────────────── */

.idb-tablewrap { padding: 16px 22px 24px; }

.idb-tableframe {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}
.idb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.idb-table th {
  padding: 10px 13px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.idb-table td {
  padding: 9px 13px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  vertical-align: middle;
}
/* Ruled columns, as in the reference. */
.idb-table th + th,
.idb-table td + td { border-left: 1px solid var(--border); }
.idb-table tbody tr:first-child td { border-top: 0; }
.idb-table tbody tr:hover td { background: var(--card-2); }

/*
 * A selectable row.
 *
 * The whole row is the target, not the 16px checkbox inside it — that box was
 * the slowest part of a screen whose job is acting on many rows at once. The
 * cursor stays default rather than becoming a pointer: this is a grid, not a
 * list of links, and a row that looks clickable everywhere invites the guess
 * that clicking opens something.
 */
.idb-row { outline: none; }
/* A tint, not a fill. `--accent-deep` is a solid green meant for a checkbox with
   a white tick on it; behind a whole row of dark text it would be unreadable. */
.idb-row.is-picked > td { background: var(--accent-soft); }
.idb-row.is-picked:hover > td { background: var(--accent-soft); }
/* The left edge carries the state, so a picked row is readable at a glance even
   in a long list where the tint alone is subtle. */
.idb-row.is-picked > td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
/* Keyboard focus has to be visible on the row, not only on the checkbox. */
.idb-row:focus-visible > td { background: var(--card-2); }
.idb-row:focus-visible > td:first-child { box-shadow: inset 2px 0 0 var(--accent-line); }
/* Rows a bulk write would be refused on: no checkbox, no selection tint. */
.idb-row.is-locked { cursor: default; }
/* Text selection inside a row would otherwise start on every click-drag and
   fight the range select. Cells that hold a value worth copying opt back in. */
.idb-row { user-select: none; }
.idb-row .idb-trunc,
.idb-row .idb-c-mail,
.idb-row .idb-subtle { user-select: text; }

.idb-c-check {
  width: 42px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
.idb-c-name { color: var(--text); }
.idb-name {
  font-weight: 600;
  color: var(--text);
}
.idb-subtle {
  margin-left: 7px;
  font-size: 11px;
  color: var(--muted);
}
.idb-subtle-cell { color: var(--muted); }
.idb-tagsm {
  display: inline-flex;
  align-items: center;
  height: 16px;
  margin-left: 7px;
  padding: 0 5px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .03em;
  color: var(--muted);
  vertical-align: 1px;
}

/* Table cells ignore max-width under automatic layout, so the long values
   are clipped by an inner block instead. */
.idb-trunc {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.idb-c-when {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.idb-c-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.idb-warnnum { color: var(--yellow); }
.idb-c-act {
  text-align: right;
  white-space: nowrap;
}

.idb-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--dim);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
/* `:not(:disabled)` because the selection bar is now always on screen, and a
   disabled button that still lights up on hover reads as clickable. */
.idb-mini:hover:not(:disabled) {
  border-color: var(--border-2);
  background: var(--card-2);
  color: var(--text);
}
.idb-mini svg { color: var(--muted); }
/* People & roles: "Revoke access". Tinted like the Disconnect button, so the
   one row action that removes somebody is told apart from the others. */
.idb-mini.is-danger { color: var(--red); border-color: rgba(217, 106, 106, .35); }
.idb-mini.is-danger:hover:not(:disabled) {
  color: var(--red);
  background: rgba(217, 106, 106, .1);
  border-color: rgba(217, 106, 106, .55);
}
.idb-mini:disabled { opacity: .5; cursor: progress; }
.idb-c-act .idb-mini + .idb-mini { margin-left: 6px; }
.idb-mini.is-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* Owner grants dialog (Identity → People & roles → Permissions). */
.idb-grants-host { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.idb-grants-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.idb-grants {
  position: relative; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text);
}
.idb-grants h2 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.idb-grants header p { margin: 0 0 14px; color: var(--dim); font-size: 12px; }
.idb-grant-row { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hairline); cursor: pointer; }
.idb-grant-row input { margin-top: 3px; accent-color: var(--accent); }
.idb-grant-row strong { display: block; font-size: 12.5px; }
.idb-grant-row small { display: block; color: var(--muted); font-size: 11.5px; }
.idb-grants footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.idb-th-ico {
  display: inline-block;
  margin-right: 7px;
  color: var(--muted);
  vertical-align: -2px;
}

/* ── Checkboxes ──────────────────────────────────────────────── */

.idb-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.idb-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.idb-check span {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--card-2);
  transition: background .15s ease, border-color .15s ease;
}
.idb-check:hover span { border-color: var(--metal-hi); }
.idb-check input:checked + span {
  background: var(--accent-deep);
  border-color: var(--accent);
}
.idb-check input:checked + span::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--on-accent);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}
.idb-check input:indeterminate + span {
  background: var(--card-2);
  border-color: var(--metal-hi);
}
.idb-check input:indeterminate + span::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 6px;
  width: 8px;
  height: 1.6px;
  background: var(--text);
}
.idb-check input:focus-visible + span {
  outline: 2px solid var(--accent-line);
  outline-offset: 1px;
}

/* ── Categorical pills ───────────────────────────────────────── */

.idb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--pl);
  border-radius: 6px;
  background: var(--pb);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pc);
  white-space: nowrap;
  overflow: hidden;
}
.idb-pill i {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--pc);
}
.idb-pill.tone-green  { --pc: var(--t-green);  --pb: rgba(78, 201, 138, .09);  --pl: rgba(78, 201, 138, .20); }
.idb-pill.tone-orange { --pc: var(--t-orange); --pb: rgba(221, 144, 64, .09);  --pl: rgba(221, 144, 64, .20); }
.idb-pill.tone-red    { --pc: var(--t-red);    --pb: rgba(226, 104, 107, .09); --pl: rgba(226, 104, 107, .20); }
.idb-pill.tone-blue   { --pc: var(--t-blue);   --pb: rgba(85, 144, 226, .09);  --pl: rgba(85, 144, 226, .20); }
.idb-pill.tone-violet { --pc: var(--t-violet); --pb: rgba(169, 140, 224, .09); --pl: rgba(169, 140, 224, .20); }
.idb-pill.tone-teal   { --pc: var(--t-teal);   --pb: rgba(79, 188, 192, .09);  --pl: rgba(79, 188, 192, .20); }
.idb-pill.tone-slate  { --pc: var(--t-slate);  --pb: rgba(139, 149, 161, .08); --pl: rgba(139, 149, 161, .18); }

/* ── State chips ─────────────────────────────────────────────── */

.idb-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--pl);
  border-radius: 6px;
  background: var(--pb);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pc);
  white-space: nowrap;
}
.idb-state.is-on   { --pc: var(--t-green);  --pb: rgba(78, 201, 138, .09);  --pl: rgba(78, 201, 138, .20); }
.idb-state.is-off  { --pc: var(--t-red);    --pb: rgba(226, 104, 107, .09); --pl: rgba(226, 104, 107, .20); }
.idb-state.is-warn { --pc: var(--t-orange); --pb: rgba(221, 144, 64, .09);  --pl: rgba(221, 144, 64, .20); }
.idb-state.is-idle { --pc: var(--t-slate);  --pb: rgba(139, 149, 161, .08); --pl: rgba(139, 149, 161, .18); }

/* ── Narrow screens ──────────────────────────────────────────── */

@media (max-width: 1000px) {
  .idb-head { padding: 14px 14px 0; }
  .idb-tablewrap { padding: 12px 14px 18px; }
  .idb-selbar,
  .idb-note,
  .idb-empty { margin-left: 14px; margin-right: 14px; }
  .idb-selbar { padding-left: 14px; padding-right: 14px; margin-left: 0; margin-right: 0; }
  .idb-filterbar { padding-left: 14px; padding-right: 14px; }
  .idb-filtercount { margin-left: 0; }
  .idb-title-row { flex-wrap: wrap; }
  .idb-head-actions { margin-left: 0; width: 100%; }
  .idb-trunc { max-width: 170px; }
}

@media (max-width: 760px) {
  .idb-title { font-size: 21px; }
  .idb-tabs { width: 100%; justify-content: space-between; }
  .idb-tab { flex: 1 1 0; padding: 0 6px; text-align: center; }
  .idb-trunc { max-width: 120px; }
}

/* ════════════════════════════════════════════════════════════
   Knowledge base — card grid

   Back on the console's true-black ground with hairline silver
   structure, and borrowing Identity's colour language: a tinted state
   chip carries the publish state, the path reads as a link only once the
   article is actually reachable. Each card credits its author bottom
   right with the real profile picture from their account.
   ════════════════════════════════════════════════════════════ */

.kbb {
  position: relative;
  background: var(--bg);
}

/* ── Page header ─────────────────────────────────────────────── */

.kbb-head {
  flex: none;
  padding: 20px 26px 0;
}
.kbb-head.is-empty {
  display: none;
}

.kbb-crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  font-size: 12px;
  color: var(--muted);
}
.kbb-crumb {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46ch;
}
.kbb-crumb.is-cur { color: var(--dim); }
.kbb-crumb-sep { color: var(--metal-mid); }
.kbb-crumb-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease;
}
.kbb-crumb-link:hover { color: var(--text); }

.kbb-title-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 0 18px;
}
.kbb-title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background: var(--card-2);
  color: var(--metal-hi);
}
.kbb-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.008em;
  color: var(--text);
}

/* ── Body ────────────────────────────────────────────────────── */

.kbb-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
}
.kbb-body.is-article {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Browse mode: stack the panel and pager, and let the grey panel stretch to
   fill the leftover height so its background reaches the bottom of the card
   instead of stopping at the last row of article cards. */
.kbb-body.is-browse {
  display: flex;
  flex-direction: column;
}
.kbb-body.is-browse .kbb-panel {
  flex: 1 1 auto;
}

.kbb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.kbb-panel {
  padding: 18px 22px;
  border: none;
  border-radius: 0;
  background: var(--card);
}

/* ── Filter tabs ─────────────────────────────────────────────── */

.kbb-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.kbb-tab {
  height: 32px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.kbb-tab:hover { color: var(--dim); }
.kbb-tab.is-active {
  background: var(--card-2);
  border-color: var(--border-2);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ── Toolbar ─────────────────────────────────────────────────── */

.kbb-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.kbb-tool-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.kbb-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  font-weight: 550;
  color: var(--dim);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.kbb-tool:hover {
  background: var(--card-2);
  color: var(--text);
}
.kbb-tool svg {
  flex: none;
  color: var(--muted);
}
.kbb-tool.is-field { cursor: text; }
.kbb-tool.is-field:focus-within { border-color: var(--metal-hi); }

/* The pill draws the frame, so the control inside stays invisible. The broad
   input rules in theme-dark.css would otherwise paint a second box. */
.kbb-tool.is-field input,
.kbb-tool.is-field select {
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
  font-size: 12px;
  color: var(--text);
}
.kbb-tool.is-field input:focus,
.kbb-tool.is-field select:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}
.kbb-tool.is-field input { width: 108px; }
.kbb-tool.is-field input::placeholder { color: var(--muted); }
.kbb-tool.is-field select { cursor: pointer; }

/* The custom-select enhancer wraps the native <select> in its own bordered
   trigger. Inside this pill that would draw a second box, so flatten it and
   let the pill be the only frame.

   The trigger also fills the pill edge to edge: the enhancer positions its
   option panel off the trigger's bounding box, so a trigger that only wrapped
   its text would drop the panel indented and too narrow. The pill carries no
   padding of its own and the leading icon is taken out of flow, which leaves
   the trigger's box identical to the pill's. */
.kbb-tool.is-select {
  position: relative;
  padding: 0;
}
.kbb-tool.is-select .kbb-tool-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
}
.kbb-tool.is-field .cs { display: inline-flex; min-width: 0; }
.kbb-tool.is-field .cs-trigger,
.kbb-tool.is-field .cs-trigger:hover,
.kbb-tool.is-field .cs-trigger[aria-expanded="true"] {
  min-width: 0;
  height: 32px;
  gap: 10px;
  padding: 0 12px 0 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
}
.kbb-tool.is-field .cs-value { min-width: 0; }

/* Same primary treatment as Fleet and Identity. */
.kbb-tool.is-primary {
  background: var(--accent-deep);
  color: var(--on-accent);
  font-weight: 600;
}
.kbb-tool.is-primary svg { color: var(--on-accent); }
.kbb-tool.is-primary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

/* ── Bulk selection bar ──────────────────────────────────────── */

.kbb-picked {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: var(--card-2);
}
.kbb-picked-count {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.kbb-mini {
  height: 27px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--dim);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.kbb-mini:hover:not(:disabled) {
  border-color: var(--border-2);
  background: var(--hover);
  color: var(--text);
}
.kbb-mini:disabled {
  opacity: .5;
  cursor: default;
}
.kbb-mini.is-danger:hover:not(:disabled) {
  border-color: rgba(226, 104, 107, .38);
  color: var(--t-red);
  background: transparent;
}

/* ── Card grid ───────────────────────────────────────────────── */

.kbb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.kbb-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 136px;
  padding: 12px 14px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  transition: background .15s ease, border-color .15s ease;
}
.kbb-card:hover {
  background: var(--hover);
  border-color: var(--border-2);
}
.kbb-card.is-picked {
  background: var(--hover);
  border-color: var(--metal-hi);
}

.kbb-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.kbb-card-acts {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.kbb-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.kbb-act:hover {
  background: var(--hover-fade);
  color: var(--text);
}
.kbb-act.is-on { color: var(--t-green); }

/* ── Publish state ───────────────────────────────────────────── */

.kbb-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--pl);
  border-radius: 6px;
  background: var(--pb);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .015em;
  color: var(--pc);
  white-space: nowrap;
}
.kbb-state.is-on    { --pc: var(--t-green); --pb: rgba(78, 201, 138, .09);  --pl: rgba(78, 201, 138, .20); }
.kbb-state.is-draft { --pc: var(--t-slate); --pb: rgba(139, 149, 161, .08); --pl: rgba(139, 149, 161, .18); }

/* ── Card text ───────────────────────────────────────────────── */

.kbb-card-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.kbb-card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kbb-card-open:hover .kbb-card-title { text-decoration: underline; }
.kbb-card-slug {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kbb-card-slug.is-live { color: var(--blue); }

/* ── Card footer: date left, author right ────────────────────── */

.kbb-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  min-width: 0;
}
.kbb-card-date {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kbb-author {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.kbb-author-name {
  font-size: 11.5px;
  color: var(--dim);
  max-width: 104px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The initials sit underneath the photo, so a picture that fails to load
   simply reveals them with no gap and no second request. */
.kbb-avatar {
  position: relative;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--hover);
}
.kbb-avatar-ini {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .02em;
  color: var(--dim);
}
.kbb-avatar img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kbb-avatar img.is-failed { display: none; }

/* ── Checkbox ────────────────────────────────────────────────── */

.kbb-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: none;
  cursor: pointer;
}
.kbb-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.kbb-check span {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--card-2);
  transition: background .15s ease, border-color .15s ease;
}
.kbb-check:hover span { border-color: var(--metal-hi); }
.kbb-check input:checked + span {
  background: var(--accent-deep);
  border-color: var(--accent);
}
.kbb-check input:checked + span::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--on-accent);
  border-width: 0 1.7px 1.7px 0;
  transform: rotate(45deg);
}
.kbb-check input:focus-visible + span {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}

/* ── Empty state ─────────────────────────────────────────────── */

.kbb-empty {
  margin-top: 16px;
  padding: 34px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.kbb-empty b { color: var(--dim); }
.kbb-empty.is-err {
  color: var(--red);
  border-style: solid;
}

/* ── Pagination ──────────────────────────────────────────────── */

.kbb-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.kbb-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: transparent;
  font-size: 12.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.kbb-page:hover:not(:disabled) {
  background: var(--card-2);
  color: var(--text);
}
.kbb-page.is-active {
  background: var(--card-2);
  border-color: var(--metal-hi);
  color: var(--text);
  font-weight: 600;
}
.kbb-page:disabled {
  opacity: .4;
  cursor: default;
}
.kbb-page-gap {
  padding: 0 2px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Footer line ─────────────────────────────────────────────── */

.kbb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── Article mode ────────────────────────────────────────────── */

.kbb-head.is-article {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.kbb-article {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
}
.kbb-article-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 18px 26px 8px;
}
.kbb-article .kb-title-input {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.012em;
}
.kbb-save {
  flex: none;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}
.kbb-save.is-warn { color: var(--yellow); }
.kbb-save.is-err  { color: var(--red); }

.kbb-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
  padding: 0 26px 14px;
  border-bottom: 1px solid var(--border);
}
.kbb-select {
  height: 28px;
  min-width: 150px;
  padding: 0 8px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--dim);
  font-size: 11.5px;
}
.kbb-checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--dim);
  cursor: pointer;
}
.kbb-checkline input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}
.kbb-facts {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.kbb-article-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
}

/* ── Narrow screens ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .kbb-head { padding: 14px 14px 0; }
  .kbb-body { padding: 0; }
  .kbb-panel { padding: 14px; border-radius: 0; }
  .kbb-grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
  .kbb-tool-right { margin-left: 0; width: 100%; }
  .kbb-tool.is-field { flex: 1 1 130px; }
  .kbb-tool.is-field input { width: 100%; }
  .kbb-article-head { padding: 14px 16px 8px; }
  .kbb-article-meta { padding: 0 16px 12px; }
}

@media (max-width: 620px) {
  .kbb-title { font-size: 18px; }
  .kbb-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .kbb-tab { text-align: center; padding: 0 8px; }
  .kbb-grid { grid-template-columns: minmax(0, 1fr); }
  .kbb-author-name { display: none; }
}

/* ════════════════════════════════════════════════════════════
   Departments — liquid glass

   The view referenced about twenty .dept-* classes that were never
   defined anywhere, which is why the page looked unstyled. This is that
   missing layer, built as frosted glass.

   Two notes on the approach. First, a blur needs something behind it, and
   a true-black ground offers nothing, so a faint ambient wash sits under
   the view and the panels refract that. Second, the rail, tabs, inputs,
   buttons and modal shell are classes shared with the ticket dashboard,
   so every override here is nested under .dpt and that page is untouched.
   ════════════════════════════════════════════════════════════ */

.dpt {
  /* The glass recipe, in one place. */
  --g-fill:   rgba(255, 255, 255, .045);
  --g-fill-2: rgba(255, 255, 255, .078);
  --g-edge:   rgba(198, 210, 226, .13);
  --g-edge-2: rgba(198, 210, 226, .26);
  --g-spec:   rgba(255, 255, 255, .10);
  --g-frost:  rgba(12, 13, 15, .72);
  --g-blur:   blur(18px) saturate(150%);
  --g-blur-2: blur(26px) saturate(160%);
  --g-cast:   0 12px 34px rgba(0, 0, 0, .42);

  position: relative;
  isolation: isolate;
}

/* Glass with nothing behind it is just a grey box. These three pools of
   light give the panels something to pick up; at this alpha they read as
   depth rather than as colour. */
.dpt::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(126, 196, 168, .085), transparent 70%),
    radial-gradient(680px 400px at 88% 6%, rgba(150, 176, 214, .07), transparent 72%),
    radial-gradient(900px 620px at 52% 112%, rgba(198, 210, 226, .045), transparent 70%);
}

/* ── Top bar ─────────────────────────────────────────────────── */

.dpt .admin-table-toolbar {
  flex: none;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--g-edge);
  background: var(--g-frost);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
}

/* ── Department rail ─────────────────────────────────────────── */

.dpt .tdb-rail {
  width: 15rem;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--g-edge);
  background: var(--g-frost);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
}

.dept-tree-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

/* padding-left is set inline per depth, so it is never declared here. */
.dept-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding-right: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--dim);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.dept-node:hover {
  background: var(--g-fill);
  border-color: var(--g-edge);
  color: var(--text);
}
.dept-node.active {
  background: var(--g-fill-2);
  border-color: var(--g-edge-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--g-spec);
}
.dept-node.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 1px;
  background: var(--metal-hi);
}

.dept-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: transform .18s ease, color .16s ease;
}
.dept-caret:hover { color: var(--text); }
.dept-caret.open { transform: rotate(90deg); }
.dept-caret.invisible {
  visibility: hidden;
  pointer-events: none;
}

.dept-icon {
  display: inline-flex;
  flex: none;
  color: var(--metal-mid);
}
.dept-node.active .dept-icon { color: var(--metal-hi); }

.dept-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-counts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.dept-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 17px;
  padding: 0 5px;
  border: 1px solid var(--g-edge);
  border-radius: 5px;
  background: var(--g-fill);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Revealed on hover, but also on keyboard focus so it stays reachable. */
.dept-add-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s ease, background .16s ease, color .16s ease;
}
.dept-node:hover .dept-add-child,
.dept-node.active .dept-add-child,
.dept-add-child:focus-visible { opacity: 1; }
.dept-add-child:hover {
  background: var(--g-fill-2);
  color: var(--text);
}

/* ── Detail header ───────────────────────────────────────────── */

/* Sticky, so it has to occlude the rows sliding underneath — hence the
   frost rather than the thin fill used on tiles. */
.dept-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 15px 22px 0;
  border-bottom: 1px solid var(--g-edge);
  background: var(--g-frost);
  backdrop-filter: var(--g-blur-2);
  -webkit-backdrop-filter: var(--g-blur-2);
}
.dept-detail-crumb {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dept-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--g-edge-2);
  border-radius: 9px;
  background: var(--g-fill-2);
  box-shadow: inset 0 1px 0 var(--g-spec);
  color: var(--metal-hi);
}
.dept-detail-metric {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  margin-left: auto;
  flex: none;
  border: 1px solid var(--g-edge);
  border-radius: 999px;
  background: var(--g-fill);
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.dept-detail-metric svg { color: var(--muted); }

.dept-detail-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  padding-bottom: 10px;
}
.dpt .tdb-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.dpt .tdb-tab:hover {
  background: var(--g-fill);
  color: var(--dim);
}
.dpt .tdb-tab.active {
  background: var(--g-fill-2);
  border-color: var(--g-edge-2);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--g-spec);
}
/* The shared rule pushes this to the far edge, which is wrong inside a tab. */
.dpt .tdb-tab .tdb-rail-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  margin-left: 0;
  padding: 0 5px;
  border: 1px solid var(--g-edge);
  border-radius: 5px;
  background: var(--g-fill-2);
  font-size: 10px;
  font-weight: 600;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.dept-detail-body { padding: 18px 22px 26px; }

/* ── Statistic tiles ─────────────────────────────────────────── */

.dept-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dept-stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 16px 14px;
  border: 1px solid var(--g-edge);
  border-radius: 14px;
  background: var(--g-fill);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  box-shadow: inset 0 1px 0 var(--g-spec), var(--g-cast);
  transition: border-color .18s ease, transform .18s ease;
}
.dept-stat:hover {
  border-color: var(--g-edge-2);
  transform: translateY(-1px);
}
/* A single slow highlight raked across the corner, the way light catches a
   curved pane. Kept under 6% so it never turns into a visible gradient. */
.dept-stat::after {
  content: '';
  position: absolute;
  z-index: 0;
  top: -60%;
  left: -20%;
  width: 92%;
  height: 190%;
  transform: rotate(-8deg);
  background: linear-gradient(104deg, rgba(255, 255, 255, .055), transparent 62%);
  pointer-events: none;
}
/* Generated content paints last, so the text is lifted above the sheen. */
.dept-stat > * {
  position: relative;
  z-index: 1;
}
.dept-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dept-stat-value {
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dept-stat-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.dpt .ov-text-btn {
  margin-top: 3px;
  font-size: 11.5px;
  text-align: left;
  align-self: flex-start;
}

/* ── Panels ──────────────────────────────────────────────────── */

.dpt .admin-card {
  border: 1px solid var(--g-edge);
  border-radius: 14px;
  background: var(--g-fill);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
  box-shadow: inset 0 1px 0 var(--g-spec), 0 10px 28px rgba(0, 0, 0, .38);
}

.dept-sub-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--g-edge);
  border-radius: 11px;
  background: var(--g-fill);
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.dept-sub-card:hover {
  background: var(--g-fill-2);
  border-color: var(--g-edge-2);
  transform: translateY(-1px);
}

/* ── Members table ───────────────────────────────────────────── */

.dept-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.dpt .admin-search {
  height: 32px;
  border: 1px solid var(--g-edge);
  border-radius: 9px;
  background: var(--g-fill);
  backdrop-filter: var(--g-blur);
  -webkit-backdrop-filter: var(--g-blur);
}
.dpt .admin-search:focus-within {
  border-color: var(--g-edge-2);
  box-shadow: inset 0 1px 0 var(--g-spec);
}

.dpt .admin-table th,
.dpt .admin-table td { border-color: var(--g-edge); }
.dpt .admin-table thead th {
  background: var(--g-fill);
  border-bottom: 1px solid var(--g-edge);
}
.dpt .admin-table tbody tr { transition: background .14s ease; }
.dpt .admin-table tbody tr:hover td { background: var(--g-fill); }

.dpt input[type="checkbox"] { accent-color: var(--accent); }

.dept-remove-one {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.dept-remove-one:hover {
  border-color: rgba(239, 169, 169, .32);
  background: rgba(239, 169, 169, .08);
  color: var(--red);
}

/* ── Danger zone ─────────────────────────────────────────────── */

.dpt .admin-card.dept-danger {
  border-color: rgba(239, 169, 169, .2);
  background:
    linear-gradient(180deg, rgba(239, 169, 169, .055), rgba(255, 255, 255, .028));
}
.dpt .dept-danger-btn {
  border-color: rgba(239, 169, 169, .3);
  background: transparent;
  color: var(--red);
}
.dpt .dept-danger-btn:hover:not(:disabled) {
  border-color: rgba(239, 169, 169, .5);
  background: rgba(239, 169, 169, .09);
  color: var(--red);
}

/* ── Buttons and fields ──────────────────────────────────────── */

.dpt .admin-btn {
  border: 1px solid var(--g-edge);
  border-radius: 9px;
  background: var(--g-fill);
  color: var(--dim);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.dpt .admin-btn:hover:not(:disabled) {
  background: var(--g-fill-2);
  border-color: var(--g-edge-2);
  color: var(--text);
}
.dpt .admin-btn:disabled {
  opacity: .45;
  cursor: default;
}
.dpt .admin-btn-ghost {
  background: transparent;
  border-color: transparent;
}
.dpt .admin-btn-ghost:hover:not(:disabled) {
  background: var(--g-fill);
  border-color: var(--g-edge);
}
.dpt .admin-btn-primary {
  background: var(--accent-deep);
  color: var(--on-accent);
}
.dpt .admin-btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.dpt .tdb-input {
  height: 32px;
  border: 1px solid var(--g-edge);
  border-radius: 9px;
  background: var(--g-fill);
  color: var(--text);
}
.dpt .tdb-input:focus {
  border-color: var(--g-edge-2);
  background: var(--g-fill-2);
  box-shadow: inset 0 1px 0 var(--g-spec);
  outline: 0;
}
.dpt textarea.tdb-input {
  height: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}
.dpt .tdb-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Modals ──────────────────────────────────────────────────── */

.dpt .tdb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.dpt .tdb-modal {
  position: relative;
  border: 1px solid var(--g-edge-2);
  border-radius: 18px;
  background: rgba(16, 17, 20, .74);
  backdrop-filter: var(--g-blur-2);
  -webkit-backdrop-filter: var(--g-blur-2);
  box-shadow: inset 0 1px 0 var(--g-spec), 0 30px 80px rgba(0, 0, 0, .62);
}
.dpt .tdb-modal .border-border { border-color: var(--g-edge); }

.dept-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.dept-picker-row:hover { background: var(--g-fill); }
.dept-picker-row.active {
  background: var(--g-fill-2);
  border-color: var(--g-edge-2);
}

/* ── Graceful degradation ────────────────────────────────────── */

/* Without backdrop-filter the thin fills would show the page straight
   through, so those surfaces fall back to the solid card colour. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dpt .admin-table-toolbar,
  .dpt .tdb-rail,
  .dept-detail-head,
  .dpt .admin-card,
  .dpt .admin-search,
  .dept-stat { background: var(--card); }
  .dpt .tdb-modal { background: var(--surface); }
  .dpt .tdb-backdrop { background: rgba(0, 0, 0, .78); }
}

@media (prefers-reduced-transparency: reduce) {
  .dpt .admin-table-toolbar,
  .dpt .tdb-rail,
  .dept-detail-head,
  .dpt .admin-card,
  .dpt .admin-search,
  .dept-stat,
  .dpt .tdb-modal,
  .dpt .tdb-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .dpt .admin-table-toolbar,
  .dpt .tdb-rail,
  .dept-detail-head,
  .dpt .admin-card,
  .dpt .admin-search,
  .dept-stat { background: var(--card); }
  .dpt .tdb-modal { background: var(--surface); }
  .dpt::before { display: none; }
  .dept-stat::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dept-stat,
  .dept-sub-card,
  .dept-caret { transition: none; }
  .dept-stat:hover,
  .dept-sub-card:hover { transform: none; }
}

/* ── Narrow screens ──────────────────────────────────────────── */

@media (max-width: 1000px) {
  .dpt .admin-table-toolbar { padding: 10px 14px; }
  .dpt .tdb-rail { width: 12.5rem; }
  .dept-detail-head { padding: 12px 14px 0; }
  .dept-detail-body { padding: 14px 14px 20px; }
  .dept-stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .dept-stat-value { font-size: 23px; }
}

@media (max-width: 720px) {
  .dpt .tdb-rail { width: 10.5rem; }
  .dept-detail-tabs { gap: 2px; }
  .dpt .tdb-tab { padding: 0 9px; font-size: 12px; }
  .dept-stat-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ════════════════════════════════════════════════════════════
   Tickets — data grid

   Filter chips, sort and column menus, a ruled table, then a footer with
   bulk actions and paging. Same black ground and hairline silver as the
   rest; colour is carried only by the priority dot and the state icon.
   ════════════════════════════════════════════════════════════ */

/* ── Identity-shaped loading state ────────────────────────── */
.idy-loading-view {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.idy-loading-view .skeleton {
  display: block;
  background: linear-gradient(90deg, var(--border) 20%, var(--border-2) 50%, var(--border) 80%);
  background-size: 220% 100%;
  animation: fl-skeleton-shimmer 1.35s ease-in-out infinite;
}
.idy-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 44px minmax(0, 1fr) minmax(0, .42fr) 52px;
  gap: 1px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--border);
}
.idy-skeleton-cell {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px;
  background: var(--card);
}
.idy-skeleton-cell.is-meta { display: flex; align-items: center; }
.idy-skeleton-cell.is-meta.is-end { justify-content: flex-end; }
.idy-skeleton-cell.is-meta i { width: 52px; height: 8px; }
.idy-skeleton-cell.is-meta i.is-wide { width: 132px; }
.idy-skeleton-cell.is-meta i.is-status { width: 92px; height: 20px; border-radius: 999px; }
.idy-skeleton-cell.is-lead {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 4vw, 52px);
}
.idy-skeleton-cell.is-lead > span { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.idy-skeleton-cell.is-lead .is-title { width: min(320px, 72%); height: 22px; }
.idy-skeleton-cell.is-lead .is-line { width: min(460px, 92%); height: 9px; }
.idy-skeleton-cell.is-lead .is-line.is-short { width: min(350px, 70%); }
.idy-skeleton-cell.is-lead .is-button { width: 172px; height: 34px; border-radius: 9px; }
.idy-skeleton-cell.is-lead .is-link { width: 104px; height: 8px; margin-top: 2px; }
.idy-skeleton-cell.is-visual { display: grid; place-items: center; }
.idy-skeleton-cell.is-visual i { width: min(120px, 55%); aspect-ratio: 3 / 4; border-radius: 16px; }
.idy-skeleton-cell.is-side { display: flex; flex-direction: column; gap: 14px; }
.idy-skeleton-cell.is-side .is-label,
.idy-skeleton-cell.is-stage .is-label,
.idy-skeleton-cell.is-scopes .is-label { width: 76px; height: 8px; }
.idy-skeleton-cell.is-side .is-row { width: 92%; height: 9px; }
.idy-skeleton-cell.is-side .is-row.is-short { width: 68%; }
.idy-skeleton-cell.is-stage { display: flex; flex-direction: column; gap: 11px; }
.idy-skeleton-cell.is-stage .is-line { width: 88%; height: 8px; }
.idy-skeleton-cell.is-stage .is-line.is-short { width: 64%; }
.idy-skeleton-cell.is-scopes {
  grid-column: span 4;
  display: flex;
  align-items: center;
  gap: 22px;
}
.idy-skeleton-cell.is-scopes > span { display: flex; align-items: center; gap: 10px; min-width: 0; }
.idy-skeleton-cell.is-scopes > span i { width: 112px; height: 20px; border-radius: 999px; }
@media (max-width: 760px) {
  .idy-skeleton-cell { padding: 10px; }
  .idy-skeleton-cell.is-lead { padding: 22px 16px; }
  .idy-skeleton-cell.is-scopes > span i:nth-child(n + 3) { display: none; }
}

/* ── Departments-shaped loading state ─────────────────────── */
.dpt-loading-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.dpt-loading-view .skeleton,
.dpt-tree-loading .skeleton {
  display: block;
  background: linear-gradient(90deg, var(--border) 20%, var(--border-2) 50%, var(--border) 80%);
  background-size: 220% 100%;
  animation: fl-skeleton-shimmer 1.35s ease-in-out infinite;
}
.dpt-skeleton-toolbar { display: flex; align-items: center; }
.dpt-skeleton-toolbar > .is-title { width: 94px; height: 10px; }
.dpt-skeleton-toolbar > .is-count { width: 42px; height: 7px; }
.dpt-skeleton-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dpt-skeleton-toolbar-actions i { height: 28px; border-radius: 9px; }
.dpt-skeleton-toolbar-actions .is-refresh { width: 32px; }
.dpt-skeleton-toolbar-actions .is-new { width: 118px; }
.dpt-skeleton-shell { display: flex; flex: 1; min-height: 0; }
.dpt-tree-loading { width: 100%; min-height: 0; text-align: initial; }
.admin-empty:has(.dpt-tree-loading) {
  display: block;
  width: 100%;
  padding: 0;
  text-align: initial;
}
.dept-skeleton-node {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 6px 0 8px;
}
.dept-skeleton-node.depth-1 { padding-left: 22px; }
.dept-skeleton-node.depth-2 { padding-left: 36px; }
.dept-skeleton-node > .is-caret { width: 12px; height: 12px; flex: none; border-radius: 4px; }
.dept-skeleton-node > .is-folder { width: 14px; height: 12px; flex: none; border-radius: 3px; }
.dept-skeleton-node > .is-name { width: 54%; height: 8px; }
.dept-skeleton-node.is-2 > .is-name { width: 42%; }
.dept-skeleton-node.is-3 > .is-name { width: 64%; }
.dept-skeleton-counts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.dept-skeleton-counts i { width: 25px; height: 17px; border-radius: 5px; }
.dpt-skeleton-detail {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dpt-skeleton-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(260px, 60%);
}
.dpt-skeleton-detail-empty i { width: 38px; height: 38px; border-radius: 11px; }
.dpt-skeleton-detail-empty b { width: 72%; height: 10px; }
.dpt-skeleton-detail-empty span { width: 100%; height: 8px; }

/* ── Users-shaped loading state ───────────────────────────── */
.admin-empty:has(.usr-loading-view) {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.usr-loading-view {
  display: flex;
  flex: 1;
  align-self: stretch;
  width: 100%;
  min-height: 0;
}
.usr-skeleton-table-wrap { flex: 1; min-height: 0; overflow: hidden; }
.usr-skeleton-table { width: 100%; border-collapse: collapse; }
.usr-skeleton-table th { height: 36px; }
.usr-skeleton-table td { height: 58px; }
.usr-skeleton-head { width: 42px; height: 7px; }
.usr-skeleton-head.is-1 { width: 54px; }
.usr-skeleton-head.is-3 { width: 76px; }
.usr-skeleton-head.is-4 { width: 48px; }
.usr-skeleton-head.is-5 { width: 58px; margin-left: auto; }
.usr-skeleton-person { display: flex; align-items: center; gap: 10px; }
.usr-skeleton-person > i { width: 30px; height: 30px; flex: none; border-radius: 50%; }
.usr-skeleton-person > span { display: flex; flex-direction: column; gap: 7px; min-width: 100px; width: 52%; }
.usr-skeleton-person b { width: 72%; height: 9px; }
.usr-skeleton-person em { width: 100%; height: 7px; }
.usr-skeleton-control { height: 32px; border-radius: var(--radius); }
.usr-skeleton-control.is-role { width: 110px; }
.usr-skeleton-control.is-department { width: min(180px, 90%); }
.usr-skeleton-control.is-device { width: min(150px, 90%); }
.usr-skeleton-date { width: 92px; height: 8px; margin-left: auto; }
.usr-skeleton-row.is-2 .usr-skeleton-person b { width: 58%; }
.usr-skeleton-row.is-2 .usr-skeleton-person em { width: 82%; }
.usr-skeleton-row.is-3 .usr-skeleton-person b { width: 84%; }

/* ── Knowledge Base-shaped loading state ──────────────────── */
.kbb-loading:has(.kbb-loading-view) {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: var(--card);
}
.kbb-loading-view {
  display: flex;
  flex: 1;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  overflow: auto;
}
.kbb-skeleton-panel { width: 100%; min-height: 100%; }
.kbb-skeleton-tabs > i { width: 82px; height: 32px; border-radius: 9px; }
.kbb-skeleton-tabs > i:nth-child(2) { width: 74px; }
.kbb-skeleton-tabs > i:nth-child(3) { width: 62px; }
.kbb-skeleton-tabs > i:nth-child(4) { width: 58px; }
.kbb-skeleton-tabs > i.is-active { border: 1px solid var(--border-2); }
.kbb-skeleton-toolbar > i,
.kbb-skeleton-toolbar .kbb-tool-right > i { height: 32px; border-radius: 9px; }
.kbb-skeleton-select { width: 92px; }
.kbb-skeleton-toolbar .is-category { width: 146px; }
.kbb-skeleton-toolbar .is-search { width: 132px; }
.kbb-skeleton-toolbar .is-new { width: 96px; }
.kbb-skeleton-card { pointer-events: none; }
.kbb-skeleton-check { width: 14px; height: 14px; border-radius: 4px; }
.kbb-skeleton-state { width: 72px; height: 20px; border-radius: 6px; }
.kbb-skeleton-actions i { width: 20px; height: 20px; border-radius: 5px; }
.kbb-skeleton-title { width: 72%; height: 10px; }
.kbb-skeleton-slug { width: 48%; height: 8px; }
.kbb-skeleton-card.is-2 .kbb-skeleton-title { width: 54%; }
.kbb-skeleton-card.is-2 .kbb-skeleton-slug { width: 66%; }
.kbb-skeleton-card.is-3 .kbb-skeleton-title { width: 84%; }
.kbb-skeleton-date { width: 72px; height: 8px; }
.kbb-skeleton-author { flex-direction: row-reverse; }
.kbb-skeleton-author i { width: 25px; height: 25px; flex: none; border-radius: 50%; }
.kbb-skeleton-author b { width: 64px; height: 8px; }
.kbb-skeleton-card.is-2 .kbb-skeleton-author b { width: 48px; }

/* ── Tickets-shaped loading state ─────────────────────────── */
.tkt-loading:has(.tkt-loading-view) {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}
.tkt:has(.tkt-loading-view) > #tkt-bar { display: none; }
.tkt-loading-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  min-height: 0;
}
.tkt-skeleton-filter-icon { width: 14px; height: 14px; border-radius: 4px; }
.tkt-skeleton-add-filter { width: 92px; height: 24px; border-radius: 7px; }
.tkt-skeleton-tools { display: flex; }
.tkt-skeleton-tools > i { width: 105px; height: 30px; border-radius: var(--radius-sm); }
.tkt-skeleton-tools > i.is-icon { width: 32px; }
.tkt-skeleton-tools > i.is-primary { width: 92px; }
.tkt-skeleton-table th { height: 36px; }
.tkt-skeleton-table td { height: 54px; }
.tkt-skeleton-head-bar { width: 54px; height: 8px; }
.tkt-skeleton-check { width: 14px; height: 14px; margin: auto; border-radius: 4px; }
.tkt-skeleton-ticket-no { width: 58px; height: 7px; margin-bottom: 7px; }
.tkt-skeleton-ticket-title { width: min(150px, 82%); height: 9px; }
.tkt-skeleton-row.is-2 .tkt-skeleton-ticket-title { width: min(112px, 68%); }
.tkt-skeleton-row.is-3 .tkt-skeleton-ticket-title { width: min(172px, 88%); }
.tkt-skeleton-pill { width: 64px; height: 20px; border-radius: 6px; }
.tkt-skeleton-tag { width: 58px; height: 20px; border-radius: 5px; }
.tkt-skeleton-device { width: 92px; height: 8px; }
.tkt-skeleton-state { width: 22px; height: 22px; margin: auto; border-radius: 50%; }
.tkt-skeleton-person { display: flex; align-items: center; gap: 8px; }
.tkt-skeleton-person i { width: 24px; height: 24px; flex: none; border-radius: 50%; }
.tkt-skeleton-person b { width: 82px; height: 8px; }
.tkt-skeleton-row.is-2 .tkt-skeleton-person b { width: 64px; }
.tkt-skeleton-date { width: 88px; height: 8px; }
.tkt-skeleton-foot-note { width: 190px; height: 8px; }
.tkt-skeleton-foot .tkt-foot-right > i { width: 34px; height: 8px; }
.tkt-skeleton-foot .tkt-foot-right > i.is-size { width: 44px; height: 30px; border-radius: var(--radius-sm); }
.tkt-skeleton-foot .tkt-foot-right > i.is-range { width: 68px; }
.tkt-skeleton-foot .tkt-foot-right > i.is-page { width: 30px; height: 30px; border-radius: 50%; }

.tkt { position: relative; }

/* ── Filter bar ──────────────────────────────────────────────── */

.tkt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  flex-wrap: wrap;
  margin: 0;
  padding: 9px 11px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--card);
}
.tkt-bar-ico {
  display: inline-flex;
  flex: none;
  color: var(--muted);
}
.tkt-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tkt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--pl);
  border-radius: 7px;
  background: var(--pb);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pc);
  white-space: nowrap;
}
.tkt-chip-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--pc);
}
.tkt-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  opacity: .6;
  cursor: pointer;
}
.tkt-chip-x:hover { opacity: 1; background: rgba(255, 255, 255, .1); }

.tkt-addfilter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px dashed var(--border-2);
  border-radius: 7px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.tkt-addfilter:hover {
  color: var(--text);
  border-color: var(--metal-hi);
  background: var(--hover-fade);
}

.tkt-bar-right {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tkt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  font-size: 12px;
  font-weight: 550;
  color: var(--dim);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tkt-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.tkt-btn svg { color: var(--muted); }
.tkt-btn.is-icon { padding: 0 8px; }
.tkt-btn.is-slim { padding: 0 8px; min-width: 44px; justify-content: center; }
.tkt-btn.is-on {
  border-color: var(--metal-hi);
  color: var(--text);
}
.tkt-btn.is-primary {
  background: var(--accent-deep);
  color: var(--on-accent);
  font-weight: 600;
}
.tkt-btn.is-primary svg { color: var(--on-accent); }
.tkt-btn.is-primary:hover:not(:disabled) {
  background: var(--accent);
  color: var(--on-accent);
}
.tkt-caret { opacity: .7; }

/* ── Popover menus ───────────────────────────────────────────── */

.tkt-menu {
  position: fixed;
  z-index: 320;
  min-width: 176px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .58);
}
.tkt-menu-head {
  padding: 6px 9px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.tkt-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 12.5px;
  color: var(--dim);
  text-align: left;
  text-transform: capitalize;
  cursor: pointer;
}
.tkt-menu-item:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.tkt-menu-item.is-on { color: var(--text); }
.tkt-menu-item.is-on::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.tkt-menu-item.has-status-dot {
  justify-content: flex-start;
  gap: 10px;
  text-transform: none;
}
.tkt-menu-item.has-status-dot.is-on::after { display: none; }
.tkt-menu-item.is-locked { opacity: .55; cursor: default; }
.tkt-menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--border);
}
.tkt-menu-note {
  padding: 6px 9px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Grid ────────────────────────────────────────────────────── */

.tkt-grid-wrap {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  padding: 0;
}
.tkt-loading {
  flex: 1 1 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.tkt-frame {
  border: none;
  border-radius: 0;
  background: var(--card);
  overflow: hidden;
}
.tkt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
/* Not sticky: the frame clips to get rounded corners, and an ancestor with
   overflow: hidden between a sticky element and its scroll container stops it
   sticking anyway — it would only look broken. */
.tkt-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tkt-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  vertical-align: middle;
}
/* Ruled columns, as in the reference. */
.tkt-table th + th,
.tkt-table td + td { border-left: 1px solid var(--border); }
.tkt-table tbody tr:first-child td { border-top: 0; }
.tkt-table tbody tr:hover td { background: var(--card-2); }
.tkt-table tbody tr.is-picked td { background: var(--hover); }

.tkt-c-check {
  width: 40px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
.tkt-c-state { width: 178px; min-width: 178px; }
.tkt-c-when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.tkt-c-device { max-width: 170px; }
.tkt-c-person { max-width: 190px; }

.tkt-open {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 340px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.tkt-no {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tkt-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tkt-open:hover .tkt-subject { text-decoration: underline; }

.tkt-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tkt-none { color: var(--muted); }

/* ── Priority and category ───────────────────────────────────── */

.tkt-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--pl);
  border-radius: 6px;
  background: var(--pb);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pc);
  text-transform: capitalize;
  white-space: nowrap;
}
.tkt-pill i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--pc);
}

.tone-urgent { --pc: var(--t-red);    --pb: rgba(226, 104, 107, .09); --pl: rgba(226, 104, 107, .20); }
.tone-high   { --pc: var(--t-orange); --pb: rgba(221, 144, 64, .09);  --pl: rgba(221, 144, 64, .20); }
.tone-medium { --pc: var(--t-blue);   --pb: rgba(85, 144, 226, .09);  --pl: rgba(85, 144, 226, .20); }
.tone-low    { --pc: var(--t-green);  --pb: rgba(78, 201, 138, .09);  --pl: rgba(78, 201, 138, .20); }
.tone-plain  { --pc: var(--t-slate);  --pb: rgba(139, 149, 161, .08); --pl: rgba(139, 149, 161, .18); }

.tkt-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
  white-space: nowrap;
}

/* ── Inline status menu ─────────────────────────────────────── */

.tkt-state-button {
  --status-color: var(--t-slate);
  --status-bg: var(--card-2);
  --status-border: var(--border-2);
  appearance: none;
  width: 100%;
  min-width: 154px;
  height: 30px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--status-border);
  border-radius: 6px;
  background: var(--status-bg);
  color: var(--status-color);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.tkt-state-button:hover { filter: brightness(1.06); }
.tkt-state-button:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.tkt-state-button .tkt-caret { margin-left: auto; }
.tkt-state-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkt-status-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }

.tkt-state-button.is-open { --status-color: var(--text); --status-bg: var(--card); --status-border: var(--border-2); }
.tkt-state-button.is-in-progress { --status-color: var(--t-yellow, #d4a843); --status-bg: color-mix(in srgb, var(--t-yellow, #d4a843) 10%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-yellow, #d4a843) 34%, var(--border)); }
.tkt-state-button.is-waiting-customer { --status-color: var(--t-orange); --status-bg: color-mix(in srgb, var(--t-orange) 10%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-orange) 34%, var(--border)); }
.tkt-state-button.is-vip { --status-color: var(--t-violet, #9b7de5); --status-bg: color-mix(in srgb, var(--t-violet, #9b7de5) 10%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-violet, #9b7de5) 34%, var(--border)); }
.tkt-state-button.is-resolved { --status-color: var(--t-green); --status-bg: color-mix(in srgb, var(--t-green) 10%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-green) 34%, var(--border)); }
.tkt-state-button.is-close { --status-color: var(--t-slate); --status-bg: color-mix(in srgb, var(--t-slate) 8%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-slate) 30%, var(--border)); }
.tkt-state-button.is-discard { --status-color: var(--t-red); --status-bg: color-mix(in srgb, var(--t-red) 8%, var(--card-2)); --status-border: color-mix(in srgb, var(--t-red) 28%, var(--border)); }

.tkt-status-dot.is-open { color: var(--blue); }
.tkt-status-dot.is-in-progress { color: var(--yellow); }
.tkt-status-dot.is-waiting-customer { color: var(--orange, #dd9040); }
.tkt-status-dot.is-vip { color: var(--violet, #9b7de5); }
.tkt-status-dot.is-resolved { color: var(--green); }
.tkt-status-dot.is-close { color: var(--dim); }
.tkt-status-dot.is-discard { color: var(--red); }

/* ── Contact detail drawer ──────────────────────────────────── */

.ct-overlay {
  position: fixed;
  inset: 0;
  z-index: 340;
  background: rgba(0, 0, 0, .5);
}
.ct-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 341;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border-2);
  box-shadow: -18px 0 46px rgba(0, 0, 0, .5);
}
.ct-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.ct-head-id { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.ct-name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.ct-email { font-size: 12px; color: var(--muted); }
.ct-email:hover { color: var(--text); }
.ct-close {
  flex: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; cursor: pointer;
}
.ct-close:hover { color: var(--text); background: var(--hover); }
.ct-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.ct-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ct-stat { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 10px 8px; text-align: center; }
.ct-stat-val { font-size: 20px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.ct-stat-label { font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.ct-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 14px; }
.ct-card-title { font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--text); margin-bottom: 10px; }
.ct-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ct-card-head .ct-card-title { margin-bottom: 0; }
.ct-filter { width: auto; min-width: 130px; font-size: 12px; }
.ct-field { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 32px; }
.ct-field + .ct-field { border-top: 1px solid var(--border); }
.ct-label { font-size: 12px; color: var(--muted); }
.ct-value { font-size: 12.5px; color: var(--text); }
.ct-input { width: 100%; }

.ct-tickets { display: flex; flex-direction: column; gap: 6px; }
.ct-ticket {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  text-align: left;
  cursor: pointer;
}
.ct-ticket:hover { background: var(--hover); }
.ct-ticket-no { font-size: 10.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-ticket-title { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-ticket-date { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* ── People ──────────────────────────────────────────────────── */

.tkt-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tkt-person-name {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Initials sit under the photo, so a picture that fails to load reveals them
   with no gap and no second request. */
.tkt-av {
  position: relative;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--hover);
}
.tkt-av-ini {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  font-weight: 650;
  color: var(--dim);
}
.tkt-av img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tkt-av img.is-failed { display: none; }

.tkt-assign {
  display: block;
  max-width: 100%;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.tkt-assign:hover {
  border-color: var(--border-2);
  background: var(--hover-fade);
}

/* ── Row actions ─────────────────────────────────────────────── */

.tkt-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tkt-icon:hover {
  border-color: var(--border-2);
  background: var(--card-2);
  color: var(--text);
}
.tkt-icon.is-danger:hover {
  border-color: rgba(226, 104, 107, .34);
  background: rgba(226, 104, 107, .08);
  color: var(--t-red);
}

/* Checkbox lives in the shared component section now — see `.ui-check`. */

/* ── Empty state ─────────────────────────────────────────────── */

.tkt-empty {
  padding: 46px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.tkt-empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.tkt-empty-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────────── */

.tkt-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  flex-wrap: wrap;
  margin: 0;
  padding: 9px 11px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--card);
}
.tkt-foot-left,
.tkt-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tkt-foot-right { margin-left: auto; }
.tkt-foot-label {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.tkt-foot-label.is-quiet { color: var(--muted); }
.tkt-range {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tkt-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tkt-page:hover:not(:disabled) { background: var(--card-2); color: var(--text); }
.tkt-page:disabled { opacity: .4; cursor: default; }

/* ── Narrow screens ──────────────────────────────────────────── */

@media (max-width: 1180px) {
  .tkt-c-created, .tkt-c-device { display: none; }
}
@media (max-width: 980px) {
  .tkt-bar-right { margin-left: 0; width: 100%; }
  .tkt-c-category { display: none; }
}
@media (max-width: 760px) {
  .tkt-person-name { display: none; }
}

/* ============================================================
   Identity — hybrid indicators
   Added alongside the existing idb-* data-set styling. These say where an
   account is mastered, which decides whether a reset can legitimately be
   performed at all, so they are informational rather than decorative.
   ============================================================ */

.idb-src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--hover-fade);
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  white-space: nowrap;
}
.idb-src svg { flex: none; opacity: .85; }
.idb-src em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding-left: 5px;
  margin-left: 3px;
  border-left: 1px solid var(--border);
}
.idb-src.is-cloud  { color: var(--blue);   border-color: color-mix(in srgb, var(--blue) 26%, transparent); }
.idb-src.is-onprem { color: var(--yellow); border-color: color-mix(in srgb, var(--yellow) 30%, transparent); }

.idb-chip.is-ok {
  background: var(--accent-soft);
  color: var(--accent);
}
.idb-chip.is-warn {
  border-color: color-mix(in srgb, var(--yellow) 32%, transparent);
  background: color-mix(in srgb, var(--yellow) 9%, transparent);
  color: var(--yellow);
}

/* ── Reset chooser: routing note + loading skeleton ─────────────────── */

.id-rc-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}
.id-rc-note.is-ok   { border-color: var(--accent-line); background: var(--accent-soft); }
.id-rc-note.is-warn { border-color: color-mix(in srgb, var(--yellow) 30%, transparent); background: color-mix(in srgb, var(--yellow) 8%, transparent); }
.id-rc-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}
.id-rc-src svg { flex: none; }

.id-choice-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.id-choice-meta code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--hover-fade);
  color: var(--dim);
}
.id-choice-meta.is-warn { color: var(--yellow); }

.id-choice.is-disabled,
.id-choice:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.id-choice-skel { display: grid; gap: 8px; margin-top: 14px; }
.id-choice-skel span {
  display: block;
  height: 58px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--card-2) 30%, var(--hover) 50%, var(--card-2) 70%);
  background-size: 220% 100%;
  animation: nvo-shimmer 1.4s var(--ease) infinite;
}
.id-choice-skel span:nth-child(2) { animation-delay: .12s; }
.id-choice-skel span:nth-child(3) { animation-delay: .24s; }

/* ── On-prem job progress ───────────────────────────────────────────── */

.id-op-steps { display: grid; gap: 8px; margin-top: 14px; }
.id-op-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--dim);
  animation: nvo-rise .32s var(--ease) both;
}
.id-op-dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.id-op-step:last-child .id-op-dot { animation: nvo-beat 1.1s ease-in-out infinite; }

/* ============================================================
   Identity onboarding (nvo-*)
   First-run screen for connecting a Microsoft 365 tenant. Built only from
   theme tokens, so it follows the light and dark skins unchanged.
   ============================================================ */

.nvo {
  display: grid;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  animation: nvo-rise .5s var(--ease) both;
}

/* ── Setup sheet ────────────────────────────────────────────────────── */

/* Same hairline language as the connect sheet: this screen follows straight
   after it, so a rounded, glowing card would read as a different product. */
.nvo-setup {
  --line: color-mix(in srgb, var(--text) 13%, transparent);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--metal-hi);
  background: var(--bg);
}
.nvo-setup-inner {
  position: relative;
  z-index: 1;
  padding: 30px 30px 26px;
  text-align: left;
}

/* The glow belonged to the retired card. Kept as a no-op so the element in the
   markup has a rule, rather than being a class that means nothing. */
.nvo-hero-glow { display: none; }

/* Plain sentence case, not a machine readout: this screen is read once by a
   person who has just handed over their tenant, so it stays conversational. */
.nvo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.nvo-eyebrow svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.nvo-eyebrow.is-ok { color: var(--accent); }

.nvo-h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -.022em;
  color: var(--text);
}
.nvo-h1.is-sm { font-size: clamp(21px, 2.4vw, 28px); }
.nvo-h1 em {
  font-style: normal;
  color: var(--accent);
}
.nvo-lede {
  max-width: 60ch;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--dim);
}
.nvo-lede.is-sm { font-size: 12.5px; }

/* ============================================================
   Identity intro (idc-*)
   A deck that fills the content area edge to edge. Every measurement is taken
   from the deck rather than the document, so no slide can produce a scrollbar,
   and the cover's lattice keeps its rhythm at any size.
   ============================================================ */

.idc {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Boot surface ───────────────────────────────────────────────────────
   Shown while the view works out what it is. Same ground colour as everything
   that follows, so the arrival of the real screen is a change of content, not a
   change of layout. Both children fade in late: a fast load shows plain black
   rather than a flash of "loading". */
.idc-boot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}
.idc-boot-mark {
  width: 40px;
  height: 40px;
  opacity: 0;
  animation: idc-late-in .5s var(--ease) 450ms forwards, nvo-breathe 2.4s ease-in-out 950ms infinite;
}
.idc-boot-say {
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0;
  animation: idc-late-in .5s var(--ease) 700ms forwards;
}
.idc-deck {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  /* The page ground itself — black in the dark skin. Flat on purpose: a gradient
     here turns the whole surface muddy, and everything that has to read against
     it (lattice, cards) is derived from this colour rather than fixed. */
  background: var(--bg);
  animation: nvo-fade .5s var(--ease) both;
}

/* ── Slides ─────────────────────────────────────────────────────────────
   All stacked in the same box. The active one is the only one on screen and
   the only one reachable; the others are parked to the side in the direction
   they came from or are going. */
.idc-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(5%);
  transition:
    transform .52s var(--ease),
    opacity .34s var(--ease),
    visibility .52s step-end;
}
.idc-slide.is-past { transform: translateX(-5%); }
.idc-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    transform .52s var(--ease),
    opacity .34s var(--ease) .06s,
    visibility 0s;
}

/* ── Cover: the crosshair lattice ───────────────────────────────────────
   Column centres land at 46.2% / 66.8% / 87.2% and row centres at 19.5% /
   49.5% / 80.2% of the slide. The box below is offset by half a cell so a
   3x3 grid puts each cell centre exactly on those marks, and each arm spans a
   full cell so neighbouring marks meet without a seam. */
.idc-lattice {
  position: absolute;
  left: 35.95%;
  top: 4.35%;
  width: 61.5%;
  height: 90.9%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}

.idc-node {
  /* Unlit marks still have to read as part of the grid, so they are mixed from
     the text colour rather than taken from the much fainter border tokens. */
  --ln: color-mix(in srgb, var(--text) 30%, transparent);
  --st: color-mix(in srgb, var(--text) 55%, transparent);
  --arm: 1px;
  --star: 24px;
  position: relative;
  grid-column: var(--gc);
  grid-row: var(--gr);
  animation: nvo-fade .9s var(--ease) both;
  animation-delay: calc((var(--gc) + var(--gr)) * 70ms);
}
.idc-node.is-lit {
  --ln: var(--accent);
  --st: var(--accent-bright);
  --arm: 1.5px;
  --star: 34px;
}

/* Horizontal arm. */
.idc-node::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--arm);
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--ln) 14%, var(--ln) 86%, transparent);
}
/* Vertical arm. */
.idc-node::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--arm);
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--ln) 14%, var(--ln) 86%, transparent);
}

/* The four-point flare at the intersection. */
.idc-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--star);
  height: var(--star);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--st), transparent 78%);
  clip-path: polygon(50% 0, 55% 45%, 100% 50%, 55% 55%, 50% 100%, 45% 55%, 0 50%, 45% 45%);
}
.idc-node.is-lit .idc-star {
  filter: drop-shadow(0 0 7px var(--accent-line));
}

/* ── Cover: type ────────────────────────────────────────────────────────
   Pinned to the slide corners on a 6.2% margin, with the top row sharing a
   centre line with the first lattice row. */
.idc-brand {
  position: absolute;
  left: 6.2%;
  top: 19.5%;
  display: flex;
  align-items: center;
  gap: 14px;
  transform: translateY(-50%);
  animation: nvo-rise .6s var(--ease) both;
}
.idc-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: none;
}
.idc-word {
  font-size: clamp(24px, 2.5vw, 31px);
  font-weight: 500;
  letter-spacing: .002em;
  color: var(--text);
}

.idc-marker {
  position: absolute;
  right: 10%;
  top: 19.5%;
  transform: translateY(-50%);
  font-size: 13.5px;
  color: var(--dim);
  animation: nvo-rise .6s var(--ease) 80ms both;
}

.idc-subject {
  position: absolute;
  left: 6.2%;
  bottom: 16.5%;
  display: grid;
  gap: 6px;
  animation: nvo-rise .6s var(--ease) 160ms both;
}
.idc-subject span {
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--muted);
}

@media (max-width: 900px) {
  /* Below this the lattice would crowd the type, so it steps back and the
     wordmark keeps the space it needs. */
  .idc-lattice { opacity: .5; }
  .idc-marker { display: none; }
}

/* ── Connect slide: the spec sheet ──────────────────────────────────────
   A fixed four-by-four grid that fills the slide edge to edge. The hairlines
   are the container's own background showing through 1px gaps, which is the one
   technique that gives an even single line everywhere without doubling at the
   cell joins.

   Rows are fractions of the available height and every cell clips itself, so at
   a smaller window the sheet gets tighter rather than taller. It cannot produce
   a scrollbar. */
.idc-slide.is-connect { padding: 0; }

.idg {
  /* Same hairline as the rest of the console, so the sheet reads as part of
     the app rather than as a technical drawing. */
  --line: var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* Four bands: identification, the ask, what follows, what it may read. The ask
     gets the lion's share of the height because it is the only one that needs a
     decision from anybody. */
  grid-template-rows: 44px minmax(0, 1fr) minmax(0, .42fr) 52px;
  gap: 1px;
  height: 100%;
  overflow: hidden;
  background: var(--line);
  animation: nvo-fade .5s var(--ease) both;
}

/* Cells sit on the card surface over a hairline gap — the same construction as
   the fleet list, so the two pages read as one product. */
.idg-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px;
  background: var(--card);
}

/* ── Type ─────────────────────────────────────────────────────────────── */

/* Sentence case, not uppercase. These sit above prose inside cards, so they
   read as small headings; the uppercase micro-label treatment belongs on a
   table's column headers, where it labels a column of values. */
.idg-lab {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--dim);
}

/* Connection state, as a status chip like everywhere else in the console. */
.idg-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--dim);
}
.idg-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

/* ── Lead cell: the heading and the action ────────────────────────────── */

/* Heading, sentence and button as one block. Pinning the button to the floor of
   the cell gave it prominence but broke the reading order: the thing to press
   belongs directly under the sentence that explains it. */
.idg-cell.is-lead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  padding: 26px 24px 22px;
}
/* Key/value rows, styled like the device detail panel's spec rows: label muted,
   value in the text colour, separated by hairlines only. */
.idg-spec {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.idg-spec > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  background: var(--card);
}
.idg-spec dt {
  font-size: 13px;
  color: var(--muted);
}
.idg-spec dd {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}
/* Display face and tracking come from the shared title rule near the top. */
.idg-h {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
/* The one paragraph on the sheet that has to be read, so it is set at reading
   size rather than at label size. */
/* The console's body copy: 13px / 1.6 / --dim. Every sentence on this sheet
   uses exactly this, so nothing reads as a different face. */
.idg-lede {
  max-width: 52ch;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
}
.idg-do {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* ── Nev's cell ───────────────────────────────────────────────────────────
   He sits on the hairline at the bottom of his cell. The artwork carries 8.8%
   of its width as empty space below the feet; cancelling that and then going a
   few pixels further is what puts his weight on the line rather than above it.
   Margin percentages resolve against the cell width, the same basis as the
   image's own width, so the two stay in step at any size. */
.idg-cell.is-nev {
  --nev-w: min(76%, 196px);
  display: grid;
  align-content: end;
  justify-items: center;
  padding: 0;
  /* The one cell that does not clip: his legs have to hang over the line for the
     pose to read as sitting rather than as a cut-out. Safe for the no-scroll
     guarantee, because the grid itself still clips at its own edge. */
  overflow: visible;
  z-index: 2;
}
.idg-nev {
  display: block;
  width: var(--nev-w);
  max-width: 100%;
  height: auto;
  /* The trailing subtraction is how far his legs hang over the line below. */
  margin-bottom: calc(var(--nev-w) * -0.0879 - 34px);
  pointer-events: none;
  user-select: none;
  animation: nvo-rise .6s var(--ease) 80ms both;
}

/* ── Side cell: requirements and exclusions ──────────────────────────── */

.idg-cell.is-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}
.idg-cell.is-side .idg-spec { margin-top: 10px; }
.idg-never { display: grid; gap: 9px; }
.idg-never ul { list-style: none; display: grid; gap: 1px; background: var(--line); }
.idg-never li {
  padding: 8px 0 8px 16px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  position: relative;
}
/* A struck-through marker rather than a bullet: the line is a "not this". */
.idg-never li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--muted);
}

/* ── Stage band ──────────────────────────────────────────────────────── */

/* Title and sentence read as one block at the top of the card. They used to be
   pushed to opposite ends by `space-between`, which left a tall gap between a
   heading and the line explaining it. */
.idg-cell.is-stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 16px;
}
.idg-cell.is-stage .idg-lab {
  font-size: 13px;
  color: var(--text);
}
/* Plain body copy, identical to `.idg-lede` and to the console's default text.
   It was a size and a tone lighter, which made the cards look like they were
   set in a different typeface. */
.idg-stage-d {
  font-size: 13px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 36ch;
}

/* ── Scope strip ─────────────────────────────────────────────────────────
   Reads as one measured band across the foot of the sheet. It never wraps: at a
   narrow window the last entries are clipped by the cell rather than pushing the
   grid taller. */
.idg-cell.is-scopes {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
}
.idg-cell.is-scopes .idg-lab { flex: none; color: var(--muted); font-weight: 500; }
.idg-scopes {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  list-style: none;
}
/* These are literal Graph scope strings, so they stay monospace — same
   treatment as the hostname chips in the run-script modal. Each chip hugs its
   own text: stretching them to equal widths left the short scopes padded out
   with dead space and made the strip read as a broken table. */
.idg-scopes li {
  flex: 0 1 auto;
  min-width: 0;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--well);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centred, so vertical padding would only crop the label once the band gets
   short. */
.idg-cell.is-meta {
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.idg-cell.is-meta.is-end { justify-content: flex-end; }

/* ── Fitting the sheet to the window ────────────────────────────────────
   Height is the scarce dimension, and the button is the one thing that must
   never be squeezed out. So the supporting bands are shed in order of how much
   they add, rather than letting every cell get quietly clipped. */

/* The queries below are mutually exclusive on purpose. Each one states a whole
   row template and exactly which cells exist, because a template and a cell
   count that disagree is what shifts the entire sheet out of alignment. */

@media (min-width: 1001px) and (max-height: 700px) {
  /* What follows after consent is context, not the decision. It goes first so
     the ask keeps its room. */
  .idg { grid-template-rows: 38px minmax(0, 1fr) 46px; }
  .idg-cell.is-stage { display: none; }
  .idg-cell.is-lead { padding: 20px 22px 18px; gap: 14px; }
  .idg-cell.is-nev { --nev-w: min(58%, 150px); }
  .idg-lede { margin-top: 12px; font-size: 13px; }
}

@media (max-width: 1000px) {
  /* Two columns cannot carry four columns of prose. The side cell drops, the
     lead keeps both columns, and the stages fold into two rows of two, so every
     row holds exactly two cells and nothing wraps into a row of its own. */
  .idg {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 40px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .42fr) minmax(0, .42fr) 48px;
  }
  .idg-cell.is-drop,
  .idg-cell.is-side { display: none; }
  .idg-cell.is-lead { grid-column: span 2 !important; padding: 22px 18px 18px; }
  .idg-cell.is-nev { grid-column: span 2 !important; --nev-w: min(34%, 150px); }
  .idg-cell.is-scopes { grid-column: span 2 !important; }
}

/* Narrow *and* short: the stages go as well, leaving what this is, the action,
   and the scopes. Deliberately after the rule above, so it wins outright rather
   than the two combining into a template the cell count contradicts. */
@media (max-width: 1000px) and (max-height: 820px) {
  .idg { grid-template-rows: 40px minmax(0, 1fr) minmax(0, .5fr) 48px; }
  .idg-cell.is-stage { display: none; }
}

/* The console's button, not a spec-sheet pill: 8px corners, sentence case, no
   letter-spacing theatrics. Same geometry as the fleet toolbar's actions, one
   step taller because this is a page-level primary. */
.idc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.idc-pill:hover:not(:disabled) {
  border-color: var(--metal-hi);
  color: var(--text);
}

/* Filled, like every other primary in the console. */
.idc-pill.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  letter-spacing: -.01em;
}
.idc-pill.is-primary:hover:not(:disabled) {
  border-color: var(--accent-bright);
  background: var(--accent-bright);
  color: var(--on-accent);
}
.idc-pill:focus-visible { outline: none; box-shadow: none; }
.idc-pill:disabled { opacity: .6; cursor: default; }

.idc-plain {
  padding: 2px 0;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--metal-mid);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color .16s var(--ease), text-decoration-color .16s var(--ease);
}
.idc-plain:hover:not(:disabled) { color: var(--dim); text-decoration-color: var(--dim); }
.idc-plain:disabled { opacity: .6; cursor: default; }

.idc-spin {
  width: 13px;
  height: 13px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: nvo-rot .7s linear infinite;
}

/* Height is reserved even when empty, so a message appearing cannot make the
   cell taller and disturb the grid. */
.idc-connect-msg {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.idc-connect-msg.is-err  { color: var(--red); }
.idc-connect-msg.is-ok   { color: var(--accent); }
.idc-connect-msg.is-warn { color: var(--yellow); }

@media (max-width: 520px) {
  /* The sheet is already tight here; the remaining savings come from the cells
     themselves rather than from the type. */
  .idg-cell { padding: 10px 12px; }
  .idg-cell.is-lead { padding: 18px 14px 16px; }
}

/* ── Calls to action ────────────────────────────────────────────────── */

.nvo-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.nvo-btn svg { width: 17px; height: 17px; flex: none; display: block; }
.nvo-btn.is-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 8px 24px var(--accent-soft);
}
.nvo-btn.is-primary:hover:not(:disabled) {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 14px 34px var(--accent-soft);
}
.nvo-btn:disabled { opacity: .7; cursor: default; transform: none; }

/* ── Setup sequence ─────────────────────────────────────────────────── */

/* One stack of hairline-separated rows rather than a list of cards: the steps
   are a sequence, and a sequence reads better as a single ruled block. */
.nvo-run {
  display: grid;
  gap: 1px;
  margin: 24px 0 0;
  text-align: left;
  list-style: none;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.nvo-run-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 2px;
  background: var(--bg);
  transition: background .25s var(--ease), opacity .25s var(--ease);
}
.nvo-run-row[data-state="wait"] { opacity: .45; }
.nvo-run-row[data-state="run"]  { background: var(--accent-soft); }

.nvo-run-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.nvo-run-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.nvo-run-row[data-state="run"] .nvo-run-mark { border-color: var(--accent); }
.nvo-run-row[data-state="run"] .nvo-run-dot  { background: var(--accent); animation: nvo-beat 1s ease-in-out infinite; }
.nvo-run-row[data-state="ok"] .nvo-run-mark  { border-color: var(--accent); background: var(--accent); }
.nvo-run-row[data-state="ok"] .nvo-run-dot   { background: var(--on-accent); transform: scale(1.15); }
.nvo-run-row[data-state="warn"] .nvo-run-mark { border-color: var(--yellow); }
.nvo-run-row[data-state="warn"] .nvo-run-dot  { background: var(--yellow); }
.nvo-run-row[data-state="err"] .nvo-run-mark  { border-color: var(--red); }
.nvo-run-row[data-state="err"] .nvo-run-dot   { background: var(--red); }
.nvo-run-row[data-state="skip"] .nvo-run-dot  { background: var(--border-2); }

.nvo-run-tx { display: grid; gap: 4px; min-width: 0; }
.nvo-run-tx b { font-size: 12.5px; font-weight: 600; color: var(--text); }
/* Named directly rather than as "the em inside", because the sequence updates
   this line by class and the two should not be able to drift apart. */
.nvo-run-sub {
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.nvo-run-row[data-state="err"] em  { color: var(--red); }
.nvo-run-row[data-state="warn"] em { color: var(--yellow); }

/* ── Summary ────────────────────────────────────────────────────────── */

.nvo-summary {
  margin: 26px 0 0;
  text-align: left;
  animation: nvo-rise .45s var(--ease) both;
}
.nvo-sum-head { display: flex; gap: 13px; align-items: flex-start; }
.nvo-sum-head h2 { font-size: 19px; font-weight: 500; letter-spacing: -.018em; color: var(--text); }
.nvo-sum-head p { font-size: 12.5px; line-height: 1.6; color: var(--dim); margin-top: 5px; }
.nvo-sum-tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  animation: nvo-pop .45s var(--ease) both;
}
.nvo-sum-tick svg { width: 19px; height: 19px; }
/* An unfinished import must not be crowned with the success accent. */
.nvo-sum-tick.is-warn {
  border-color: color-mix(in srgb, var(--yellow) 38%, transparent);
  background: color-mix(in srgb, var(--yellow) 12%, transparent);
  color: var(--yellow);
}

.nvo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 20px;
  background: var(--line);
  border: 1px solid var(--line);
}
.nvo-stat {
  display: grid;
  gap: 4px;
  padding: 15px 14px;
  background: var(--bg);
}
.nvo-stat b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.nvo-stat span { font-size: 12px; color: var(--dim); }
.nvo-stat em { font-style: normal; font-size: 11px; color: var(--muted); }

.nvo-todo { margin-top: 16px; }
.nvo-todo > h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
}
.nvo-todo > h3 svg { width: 14px; height: 14px; }
.nvo-todo-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  margin-bottom: 1px;
  border: 1px solid var(--line);
  border-left-width: 2px;
  background: var(--bg);
}
.nvo-todo-row.is-warn { border-left-color: var(--yellow); }
.nvo-todo-row.is-err  { border-left-color: var(--red); }
.nvo-todo-row.is-info { border-left-color: var(--blue); }
.nvo-todo-row.is-ok   { border-left-color: var(--accent); }
.nvo-todo-ico { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.nvo-todo-ico svg { width: 15px; height: 15px; }
.nvo-todo-row.is-warn .nvo-todo-ico { color: var(--yellow); }
.nvo-todo-row.is-err  .nvo-todo-ico { color: var(--red); }
.nvo-todo-row.is-info .nvo-todo-ico { color: var(--blue); }
.nvo-todo-row.is-ok   .nvo-todo-ico { color: var(--accent); }
.nvo-todo-tx { display: grid; gap: 3px; min-width: 0; }
.nvo-todo-tx b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.nvo-todo-tx em { font-style: normal; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

.nvo-sum-cta {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ── Keyframes ──────────────────────────────────────────────────────── */

@keyframes nvo-rise   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nvo-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes nvo-pop    { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes nvo-rot    { to { transform: rotate(360deg); } }
@keyframes nvo-beat   { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .65; } }
@keyframes nvo-breathe{ 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes nvo-shimmer{ from { background-position: 180% 0; } to { background-position: -80% 0; } }

/* Intro deck: the boot surface and the card drawings. */
@keyframes idc-late-in { to { opacity: 1; } }

/* Motion is decoration here — every state is also carried by colour, border
   and text, so switching it off loses nothing. */
@media (prefers-reduced-motion: reduce) {
  .nvo,
  .nvo-summary,
  .nvo-sum-tick,
  .idc-deck,
  .idc-node,
  .idc-brand,
  .idc-marker,
  .idc-subject,
  .idc-boot-mark,
  .idc-boot-say,
  .idg,
  .idg-nev,
  .id-op-step { animation: none; }
  .nvo-hero-glow { animation: none; }
  /* Slides still change, they just stop travelling to do it. */
  .idc-slide { transition: opacity .01ms, visibility .01ms; transform: none; }
  .idc-slide.is-past { transform: none; }
  /* These two start at zero opacity and are revealed by their animation, so
     switching animation off has to reveal them instead. */
  .idc-boot-mark,
  .idc-boot-say { opacity: 1; }
  .nvo-run-row[data-state="run"] .nvo-run-dot,
  .id-op-step:last-child .id-op-dot { animation: none; }
  .id-choice-skel span { animation: none; }
  .nvo-btn.is-primary:hover:not(:disabled) { transform: none; }
}

/* ============================================================
   Identity confirmation dialog (idm-*)
   Replaces window.confirm for destructive actions. Same hairline language as
   the connect sheet, so a dialog does not look like it came from a different
   application than the screen behind it.
   ============================================================ */

.idm {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .68);
  animation: nvo-fade .18s var(--ease) both;
}

.idm-box {
  --line: color-mix(in srgb, var(--text) 13%, transparent);
  width: min(460px, 100%);
  border: 1px solid var(--metal-hi);
  background: var(--bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  animation: nvo-rise .24s var(--ease) both;
}
.idm-box:focus { outline: none; }

.idm-head {
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--line);
}
.idm-lab {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.idm-box.is-danger .idm-lab { color: var(--red); }
.idm-t {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.25;
  color: var(--text);
}
.idm-lead {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dim);
}

/* What disappears, counted per kind. A native dialog can only run this together
   into a sentence; here it can be checked at a glance. */
.idm-rows {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.idm-rows > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 24px;
  background: var(--bg);
}
.idm-rows dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.idm-rows dd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}
.idm-box.is-danger .idm-rows dd { color: var(--red); }

/* What survives, kept visually apart from what does not. */
.idm-keeps {
  list-style: none;
  display: grid;
  gap: 8px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.idm-keeps li {
  position: relative;
  padding-left: 16px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.idm-keeps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.idm-do {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
}
.idm-btn {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--metal-hi);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  cursor: pointer;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.idm-btn:hover { color: var(--text); border-color: var(--text); }
.idm-btn:focus-visible { outline: none; box-shadow: none; }
.idm-btn.is-go {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}
.idm-btn.is-go:hover { background: var(--accent-bright); color: var(--on-accent); }
.idm-box.is-danger .idm-btn.is-go { background: var(--red); color: #2a0d0d; }
.idm-box.is-danger .idm-btn.is-go:hover { background: color-mix(in srgb, var(--red) 82%, #fff); }

/* ── Ticket detail workspace ─────────────────────────────────── */
.tkt { position: relative; }
/* The detail layer fills its host with inset:0. Whichever view root hosts it
   (tickets grid, ticket dashboards, or the SPA view root when opened from
   search) must be the positioned containing block, or the layer escapes to the
   viewport and covers the whole screen. */
:has(> .tkd-layer) { position: relative; }
.tkd-layer {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--card);
}
.tkd-loading { display: flex; flex: 1; align-items: center; justify-content: center; }
.tkd-error { margin: auto; max-width: 440px; padding: 28px; text-align: center; }
.tkd-error h2 { margin: 0 0 8px; font-size: 16px; }
.tkd-error p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.tkd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
.tkd-back, .tkd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--dim);
  background: var(--card);
  cursor: pointer;
}
.tkd-back:hover, .tkd-icon-btn:hover { color: var(--text); background: var(--hover); }
.tkd-head-copy { min-width: 0; flex: 1; }
.tkd-kicker { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; font-size: 10px; font-weight: 650; color: var(--muted); }
.tkd-title { margin: 0; overflow: hidden; font-size: 16px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.tkd-head-actions { display: flex; align-items: center; gap: 8px; }
.tkd-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); flex: 1; min-height: 0; }
.tkd-side { overflow-y: auto; border-right: 1px solid var(--border); background: var(--bg); }
.tkd-side-title { padding: 15px 16px 10px; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--dim); text-transform: uppercase; }
.tkd-card { margin: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tkd-card-title { margin: 0 0 12px; font-size: 11px; font-weight: 700; color: var(--dim); }
.tkd-contact { display: flex; align-items: center; gap: 10px; }
.tkd-avatar { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 750; }
.tkd-contact-copy { min-width: 0; }
.tkd-contact-name { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tkd-contact-email { overflow: hidden; margin-top: 2px; font-size: 10.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.tkd-field { display: block; margin-top: 11px; }
.tkd-field:first-child { margin-top: 0; }
.tkd-label { display: block; margin-bottom: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: .055em; color: var(--muted); text-transform: uppercase; }
.tkd-select, .tkd-input {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-2);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--card-2);
  font: inherit;
  font-size: 11.5px;
}
.tkd-select:focus, .tkd-input:focus { }
.tkd-value { font-size: 11.5px; line-height: 1.45; color: var(--dim); overflow-wrap: anywhere; }
.tkd-device { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-2); }
.tkd-device-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border-radius: 7px; color: var(--accent); background: var(--accent-soft); }
.tkd-device-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: var(--text); }
.tkd-meta-list { display: grid; gap: 10px; }
.tkd-meta-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; font-size: 10.5px; }
.tkd-meta-row dt { color: var(--muted); }
.tkd-meta-row dd { margin: 0; color: var(--dim); }
.tkd-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--card); }
.tkd-tabs { display: flex; align-items: center; gap: 2px; min-height: 45px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.tkd-tab { align-self: stretch; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 11px; font-weight: 650; cursor: pointer; }
.tkd-tab:hover { color: var(--text); }
.tkd-tab.is-active { border-bottom-color: var(--accent); color: var(--text); }
.tkd-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 26px; }
.tkd-summary { margin-bottom: 18px; padding: 14px 15px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); }
.tkd-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.tkd-summary-title { font-size: 10px; font-weight: 750; letter-spacing: .055em; color: var(--accent); text-transform: uppercase; }
.tkd-summary-count { font-size: 9.5px; color: var(--muted); }
.tkd-summary p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--dim); }
.tkd-chat-error { margin-bottom: 15px; padding: 12px 13px; border: 1px solid rgba(226,104,107,.28); border-radius: 9px; background: rgba(226,104,107,.07); color: var(--t-red); font-size: 11px; }
.tkd-chat-error button { margin-left: 8px; padding: 0; border: 0; color: inherit; background: transparent; font-weight: 700; text-decoration: underline; cursor: pointer; }
.tkd-msg { margin-bottom: 17px; }
.tkd-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tkd-msg-who { font-size: 11.5px; font-weight: 700; }
.tkd-msg-role { padding: 2px 6px; border: 1px solid var(--border-2); border-radius: 5px; font-size: 8.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.tkd-msg-role.is-ai { border-color: var(--accent-line); color: var(--accent); }
.tkd-msg-role.is-note { border-color: rgba(221,144,64,.3); color: var(--t-orange); }
.tkd-msg-time { margin-left: auto; font-size: 9.5px; color: var(--muted); }
.tkd-bubble { margin-left: 39px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11.5px; line-height: 1.6; color: var(--dim); }
.tkd-bubble.is-ai { border-color: var(--accent-line); background: var(--accent-soft); }
.tkd-bubble.is-note { border-color: rgba(221,144,64,.25); background: rgba(221,144,64,.06); }
.tkd-message-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 260px)); gap: 8px; margin: 9px 0 0 39px; }
.tkd-message-images img { width: 100%; max-height: 280px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.tkd-system { margin: 14px 0; text-align: center; }
.tkd-system span { display: inline-flex; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--card-2); font-size: 9.5px; }
.tkd-empty { padding: 38px 20px; color: var(--muted); font-size: 11.5px; text-align: center; }
.tkd-composer { flex: none; padding: 11px 20px 14px; border-top: 1px solid var(--border); background: var(--card-2); }
.tkd-compose-modes { display: flex; gap: 3px; margin-bottom: 7px; }
.tkd-mode { padding: 4px 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.tkd-mode.is-active { color: var(--text); background: var(--hover); }
.tkd-compose-box { border: 1px solid var(--border-2); border-radius: 9px; background: var(--card); overflow: hidden; }
.tkd-compose-box:focus-within { }
.tkd-compose-box.is-note { border-color: rgba(221,144,64,.28); }
.tkd-compose-box textarea { display: block; width: 100%; min-height: 56px; padding: 10px 11px; border: 0; outline: 0; resize: vertical; color: var(--text); background: transparent; font: inherit; font-size: 11.5px; }
.tkd-compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 8px 11px; }
.tkd-compose-hint { font-size: 9.5px; color: var(--muted); }
.tkd-send { height: 28px; padding: 0 11px; border: 0; border-radius: 7px; color: var(--on-accent); background: var(--accent-deep); font-size: 10.5px; font-weight: 700; cursor: pointer; }
.tkd-send:hover:not(:disabled) { background: var(--accent); }
.tkd-send:disabled { opacity: .55; cursor: wait; }
.tkd-timeline { position: relative; max-width: 720px; margin: 2px 0 0 7px; padding: 0; list-style: none; }
.tkd-timeline::before { content: ''; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 1px; background: var(--border-2); }
.tkd-event { position: relative; display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 12px; padding-bottom: 19px; }
.tkd-event-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 2px solid var(--card); border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--border-2); }
.tkd-event.is-important .tkd-event-dot { background: var(--accent); }
.tkd-event-title { font-size: 11.5px; font-weight: 650; color: var(--text); }
.tkd-event-copy { margin-top: 2px; font-size: 10.5px; color: var(--dim); }
.tkd-event-time { margin-top: 3px; font-size: 9.5px; color: var(--muted); }
@media (max-width: 900px) {
  .tkd-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .tkd-head-actions .tkd-chat-link { display: none; }
}
@media (max-width: 700px) {
  .tkd-layout { display: flex; flex-direction: column; overflow-y: auto; }
  .tkd-side { max-height: 42%; border-right: 0; border-bottom: 1px solid var(--border); }
  .tkd-main { min-height: 58%; }
  .tkd-title { white-space: normal; }
  .tkd-head { align-items: flex-start; }
  .tkd-head-actions { display: none; }
}

/* Ticket property rail: use the same readable scale as the rest of admin. */
.tkd-layout { grid-template-columns: clamp(320px, 24vw, 370px) minmax(0, 1fr); }
.tkd-side-title {
  padding: 18px 18px 13px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}
.tkd-card { margin: 14px; padding: 16px; border-radius: 11px; }
.tkd-card + .tkd-card { margin-top: 0; }
.tkd-card-title { margin-bottom: 14px; font-size: 13px; color: var(--text); }
.tkd-contact { gap: 12px; width: 100%; min-width: 0; }
.tkd-avatar { width: 36px; height: 36px; font-size: 11px; }
.tkd-contact-name { display: block; font-size: 13px; line-height: 1.35; }
.tkd-contact-email { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.35; }
.tkd-field { margin-top: 14px; }
.tkd-label {
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--dim);
  text-transform: none;
}
.tkd-select, .tkd-input { height: 38px; padding: 0 11px; font-size: 12.5px; }
.tkd-value { font-size: 12.5px; line-height: 1.5; }
.tkd-device { width: 100%; gap: 11px; padding: 12px; }
.tkd-device-icon { width: 33px; height: 33px; }
.tkd-device-name { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tkd-meta-list { gap: 12px; }
.tkd-meta-row { grid-template-columns: 86px minmax(0, 1fr); gap: 10px; font-size: 11.5px; line-height: 1.4; }
.tkd-link-card {
  appearance: none;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tkd-link-card:hover:not(:disabled), .tkd-link-card:focus-visible {
  border-color: var(--border-2);
  outline: none;
  background: var(--hover);
}
.tkd-link-card:disabled { cursor: default; }
.tkd-link-arrow { display: inline-flex; align-items: center; margin-left: auto; color: var(--muted); }
.tkd-link-card:hover .tkd-link-arrow { color: var(--accent); }
.users-focus-row td { background: var(--accent-soft) !important; }
@media (max-width: 1050px) {
  .tkd-layout { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .tkd-layout { grid-template-columns: 270px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .tkd-layout { display: flex; }
}

/* Ticket detail cleanup: aligned, flatter, and information-first. */
.tkd-side-title,
.tkd-side-spacer,
.tkd-tabs {
  box-sizing: border-box;
  height: 46px;
  min-height: 46px;
  border-bottom: 1px solid var(--border);
}
.tkd-side-title { display: flex; align-items: center; padding: 0 18px; }
.tkd-tabs { padding: 0 18px; }
.tkd-side { background: var(--card); }
.tkd-card {
  margin: 0;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.tkd-card + .tkd-card { margin-top: 0; }
.tkd-card-title { margin-bottom: 13px; font-size: 12.5px; }
.tkd-card .tkd-field { display: grid; width: 100%; min-width: 0; }
.tkd-card .tkd-select {
  display: block;
  inline-size: 100% !important;
  width: 100% !important;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  background-color: var(--card-2);
}
.tkd-contact.tkd-link-card,
.tkd-device.tkd-link-card { padding: 8px; border-radius: 6px; }
.tkd-summary {
  margin-bottom: 20px;
  padding: 0 0 13px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.tkd-summary-head { margin-bottom: 6px; }
.tkd-summary-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text);
  text-transform: none;
}
.tkd-summary-count { font-size: 10.5px; }
.tkd-summary p { max-width: 900px; font-size: 12px; color: var(--dim); }
.tkd-msg-role {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 9px;
  color: var(--muted);
}
.tkd-msg-role.is-ai { border: 0; color: var(--accent); }
.tkd-bubble { border-radius: 5px; background: transparent; }
.tkd-bubble.is-ai {
  border-color: var(--border);
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.tkd-bubble.is-note { border-radius: 5px; }
.tkd-compose-box { border-radius: 6px; }
.tkd-select.tkd-status-open,
.tkd-select.tkd-status-in-progress { color: var(--text); }
.tkd-select.tkd-status-waiting-customer,
.tkd-select.tkd-status-waiting-external { color: var(--orange, #dd9040); }
.tkd-select.tkd-status-resolved,
.tkd-select.tkd-status-close { color: var(--green); }
.tkd-select.tkd-status-discard { color: var(--t-red); }
.tkd-select.tkd-priority-urgent { color: var(--t-red); }
.tkd-select.tkd-priority-high { color: var(--t-orange); }
.tkd-select.tkd-priority-medium { color: var(--t-blue); }
.tkd-select.tkd-priority-low { color: var(--t-green); }

/* ============================================================
   Fleet device workspace — full-page endpoint detail
   ============================================================ */
.fd-page {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  color: var(--text);
}
.fd-topbar {
  position: relative;
  flex: none;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.fd-back {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transform: translateY(-50%);
}
.fd-back:hover { color: var(--text); background: var(--hover-fade); }
.fd-device-head {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  padding-left: 31px;
}
.fd-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fd-os {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
}
.fd-os img, .fd-os svg { width: 100%; height: 100%; }
.fd-identity-copy { min-width: 0; }
.fd-title-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fd-title-line h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fd-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--muted);
}
.fd-presence i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fd-presence-online { color: var(--live); }
.fd-presence-offline { color: var(--muted); }
.fd-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.fd-meta span { color: var(--border-2); }
.fd-head-tags { min-height: 16px; margin-top: 7px; }
.fd-head-tags:empty { display: none; }
.fd-posture { display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; }
.fd-seen { color: var(--muted); font-size: 11px; white-space: nowrap; }
.fd-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.fd-action {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.fd-action:hover { border-color: var(--border-2); color: var(--text); }
.fd-action-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.fd-action-primary:hover { border-color: var(--accent-bright); background: var(--accent-bright); color: var(--on-accent); }
.fd-head-loading { display: flex; align-items: center; min-height: 58px; }
.fd-load-error { display: flex; flex-direction: column; gap: 3px; color: var(--red); }
.fd-load-error strong { font-size: 14px; }
.fd-load-error span { font-size: 11.5px; }

.fd-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: none;
  min-height: 39px;
  padding: 0 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.fd-tabs .panel-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 86px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.fd-tabs .panel-tab::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}
.fd-tabs .panel-tab:hover { color: var(--text); }
.fd-tabs .panel-tab.is-active { color: var(--text); }
.fd-tabs .panel-tab.is-active::after { background: var(--accent); }
.fd-tabs .panel-tab-locked { opacity: .42; }
.fd-tabs .panel-tab-code { margin-left: auto; }
.fd-tabs .panel-tab-code.dc-tab-ok { color: var(--live); }

.fd-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: var(--surface);
}

/* Device details are composed from independent cards instead of one large
   enclosing surface. Keep the frame and page as layout/scrolling contracts,
   but remove their visual treatment while a device detail view is mounted. */
.admin-content-frame:has(#fleet-device-page),
.admin-content-frame:has(#asset-detail-page) {
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.fd-page {
  gap: 12px;
  padding: 0;
  background: transparent;
}
.fd-topbar,
.fd-tabs {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.fd-tabs { overflow-y: hidden; }
.fd-page .fd-content {
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
}
.fd-page .fd-content > div { flex: 1; min-height: 0; }
.fd-page .fd-overview-grid,
.fd-page .fd-detail-grid,
.fd-page .fd-software-card,
.fd-page .fd-event-card,
.fd-page .fc-device-grid,
.fd-page .fc-loading-card {
  width: 100%;
  max-width: none;
}
@media (max-width: 620px) {
  .fd-page { gap: 9px; padding: 0; }
}

.fd-overview-grid {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(420px, 1.8fr) minmax(250px, .9fr);
  align-items: start;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto;
  min-height: 100%;
}
.fd-overview-grid > .fd-activity-card { align-self: stretch; }
.fd-metrics, .fd-center-column { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fd-card, .fd-metric-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: none;
  overflow: hidden;
}
.fd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 8px;
  background: transparent;
}
.fd-card-head h2 { margin: 0; color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.fd-card-head p { display: none; }
.fd-card-body { padding: 12px; }
.fd-metric-card { padding: 13px 14px; }
.fd-metric-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fd-metric-card header span { color: var(--text); font-size: 13px; font-weight: 650; }
.fd-metric-card header small { color: var(--muted); font-size: 10.5px; }
.fd-metric-value { margin-top: 12px; color: var(--text); font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1; }
.fd-metric-sub { min-height: 28px; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; }
.fd-meter { position: relative; height: 4px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: var(--well-hi); }
.fd-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.fd-tone-blue .fd-meter i { background: #4f8bd6; }
.fd-tone-violet .fd-meter i { background: #8c6bd8; }
.fd-tone-rose .fd-meter i { background: #bd557c; }
.fd-tone-warn .fd-meter i { background: var(--yellow); }
.fd-tone-bad .fd-meter i { background: var(--red); }
.fd-tone-muted .fd-meter i { background: var(--muted); }

.fd-info-list { display: grid; grid-template-columns: 1fr; }
.fd-info-row { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(120px, 1.2fr); gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--hairline); }
.fd-info-row:last-child { border-bottom: 0; }
.fd-info-row span { color: var(--muted); font-size: 13px; }
.fd-info-row strong { min-width: 0; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 550; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.fd-findings { display: grid; grid-template-columns: 1fr; }
.fd-finding { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.fd-finding:last-child { border-bottom: 0; }
.fd-finding > i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--muted); }
.fd-finding div { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; min-width: 0; }
.fd-finding strong { font-size: 13px; font-weight: 650; }
.fd-finding span { color: var(--dim); font-size: 13px; font-weight: 600; }
.fd-finding small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.fd-finding-ok > i { background: var(--live); }
.fd-finding-warn > i { background: var(--yellow); }
.fd-finding-bad > i { background: var(--red); }

.fd-activity-card { position: sticky; top: 0; align-self: start; height: 100%; display: flex; flex-direction: column; }
.fd-activity-list { padding: 2px 13px 8px; flex: 1 1 auto; overflow-y: auto; }
.fd-activity-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.fd-activity-item:last-child { border-bottom: 0; }
.fd-activity-item > i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #4f8bd6; }
.fd-activity-item > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fd-activity-head { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.fd-activity-item strong { color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.35; }
.fd-activity-item time { color: var(--muted); font-size: 12px; line-height: 1.35; white-space: nowrap; flex-shrink: 0; }
.fd-activity-item > div > span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fd-activity-ok > i { background: var(--live); }
.fd-activity-bad > i { background: var(--red); }
.fd-activity-muted > i { background: var(--muted); }

.fd-page .fl-tag-editor { padding: 10px; background: var(--well); }
.fd-page .fl-tag-create { grid-template-columns: minmax(120px, 1fr) 34px auto; }
.fd-page .dc-card { max-width: 760px; margin: 20px auto; }
.fd-page #tab-control {
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.fd-page #tab-control .cc-body { min-height: 420px; }
.fd-page #tab-control .cc-subtabs { margin-bottom: 16px; }

.fd-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 1440px; margin: 0 auto; }
.fd-card-wide { grid-column: 1 / -1; }
.fd-hardware-list { padding: 0 14px; }
.fd-hardware-list-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.fd-hardware-item { display: grid; grid-template-columns: minmax(140px, 1fr) auto; align-items: center; gap: 5px 16px; min-height: 54px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.fd-hardware-item:last-child { border-bottom: 0; }
.fd-hardware-item > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fd-hardware-item strong { overflow: hidden; color: var(--text); font-size: 12.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.fd-hardware-item span, .fd-hardware-value { color: var(--muted); font-size: 11.5px; }
.fd-hardware-item .fd-meter { grid-column: 1 / -1; margin: 1px 0 3px; }
.fd-software-card, .fd-event-card { max-width: 1440px; margin: 0 auto; }
.fd-software-head { min-height: 58px; }
.fd-software-search { display: flex; align-items: center; gap: 7px; width: min(260px, 38vw); height: 31px; padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--muted); }
.fd-software-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 11px; }
.fd-software-table { overflow: auto; }
.fd-software-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fd-software-table th { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--muted); background: var(--well); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.fd-software-table td { padding: 10px 14px; border-bottom: 1px solid var(--hairline); color: var(--dim); }
.fd-software-table tr:last-child td { border-bottom: 0; }
.fd-software-table td strong { color: var(--text); font-weight: 600; }
.fd-peripheral-kind {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--well);
  color: var(--dim);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.fd-peripheral-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fd-peripheral-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.fd-peripheral-status.is-ok { color: var(--live); }
.fd-peripheral-status.is-ok i { background: var(--live); }
.fd-peripheral-status.is-muted { color: var(--muted); }
.fd-peripheral-id {
  max-width: 360px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fd-event-list { padding: 0 14px 8px; }
.fd-event-list .ev-row { padding: 12px 0; }
.fd-event-loading { display: flex; justify-content: center; padding: 44px; }
.fd-empty-state { padding: 24px 14px; color: var(--muted); font-size: 11.5px; text-align: center; }
.fd-error-state { color: var(--red); }

@media (max-width: 1250px) {
  .fd-device-head { grid-template-columns: minmax(300px, 1fr) auto; }
  .fd-posture { display: none; }
  .fd-overview-grid { grid-template-columns: minmax(190px, .65fr) minmax(420px, 1.6fr); }
  .fd-activity-card { position: static; grid-column: 1 / -1; }
  .fd-activity-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
}
@media (max-width: 900px) {
  .fd-topbar { padding-inline: 14px; }
  .fd-back { top: 23px; left: 9px; transform: none; }
  .fd-device-head { grid-template-columns: 1fr; gap: 12px; padding-left: 27px; }
  .fd-actions { justify-content: flex-start; }
  .fd-overview-grid { grid-template-columns: 1fr; }
  .fd-metrics { display: grid; grid-template-columns: 1fr 1fr; }
  .fd-activity-card { grid-column: auto; }
  .fd-detail-grid { grid-template-columns: 1fr; }
  .fd-card-wide { grid-column: auto; }
  .fd-hardware-list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .fd-content { padding: 9px; }
  .fd-os { width: 34px; height: 34px; padding: 0; }
  .fd-title-line h1 { font-size: 18px; }
  .fd-meta { flex-wrap: wrap; white-space: normal; }
  .fd-tabs { padding-inline: 6px; }
  .fd-tabs .panel-tab { min-width: auto; padding-inline: 11px; }
  .fd-tabs .panel-tab-code { margin-left: 0; }
  .fd-metrics, .fd-info-list, .fd-findings, .fd-activity-list { grid-template-columns: 1fr; }
  .fd-info-row:nth-last-child(-n+2), .fd-finding:nth-last-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .fd-info-row:last-child, .fd-finding:last-child { border-bottom: 0; }
  .fd-page .fl-tag-create { grid-template-columns: minmax(0, 1fr) 34px; }
  .fd-page .fl-tag-create button { grid-column: 1 / -1; }
  .fd-software-head { align-items: stretch; flex-direction: column; }
  .fd-software-search { width: 100%; }
}

/* ── Overview: monthly AI spend gauge ───────────────────────── */
.ov-card-ai-spend {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ov-card-ai-spend .ov-card-head-tight {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.ov-ai-spend-wrap {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.ov-ai-budget {
  flex: none;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ov-ai-budget-chip {
  display: inline-flex;
  align-items: center;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ov-ai-budget-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--dim);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ov-ai-budget-edit:hover:not(:disabled) { color: var(--accent-deep); }
.ov-ai-budget-edit:disabled { opacity: .55; cursor: default; }
.ov-ai-spend-empty,
.ov-ai-spend-fallback {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ov-ai-spend-empty strong,
.ov-ai-spend-fallback strong { color: var(--text); font-size: 18px; letter-spacing: -.025em; }
.ov-ai-spend-empty span,
.ov-ai-spend-fallback > span,
.ov-ai-spend-fallback small { color: var(--muted); font-size: 10.5px; }
.ov-ai-spend-empty span { max-width: 230px; margin-top: 5px; line-height: 1.45; }
.ov-ai-spend-fallback > div {
  width: min(100%, 240px);
  height: 7px;
  margin: 16px 0 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--border);
}
.ov-ai-spend-fallback > div i { display: block; height: 100%; background: var(--accent); }

/* Balance the Overview side cards: Endpoint health grows by half a column,
   AI spend gives up half a column, and Ticket volume keeps its visual weight. */
@media (min-width: 1024px) {
  .ov-dash .ov-grid-top {
    grid-template-columns: minmax(0, 7fr) minmax(0, 10fr) minmax(0, 7fr);
  }
  .ov-dash .ov-grid-top > :first-child,
  .ov-dash .ov-grid-top > :nth-child(2),
  .ov-dash .ov-grid-top > :nth-child(3) {
    grid-column: auto;
  }
  /* Roles without billing.read get no AI spend card; Ticket volume takes its
     share of the row instead of leaving an empty third column. */
  .ov-dash .ov-grid-top.ov-grid-top-no-spend {
    grid-template-columns: minmax(0, 7fr) minmax(0, 17fr);
  }
}

/* ── Overview: ticket resolution Sankey ─────────────────────── */
.ov-card-ticket-flow {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.ov-card-ticket-flow .ov-card-head-tight {
  flex: none;
  margin-bottom: 4px;
}
.ov-ticket-flow-wrap {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.ov-ticket-flow-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1280px) {
  .ov-grid-bottom > .ov-card-ticket-flow {
    grid-column: span 2 / span 2;
  }
}

/* ── Overview: Tickets today (radial clock, catalog card) ───── */
.ov-card-ticket-clock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.ov-card-ticket-clock .ov-card-head-tight { flex: none; margin-bottom: 4px; }
.ov-card-ticket-clock .ov-card-head-tight { align-items: flex-start; }
/* The card's own period switch: the top bar's segmented control, a size down. */
.ov-card-seg {
  flex: none;
  height: 26px;
  padding: 2px;
}
.ov-card-seg .seg-btn {
  height: 100%;
  padding: 0 8px;
  font-size: 10.5px;
}
.ov-ticket-clock-wrap {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

/* ── Overview: the per-person card board ─────────────────────
   One 24-column grid. overview.js packs the cards into rows and sets each
   card's --ov-span so every row is filled. Rows share the height of the
   view; past two or three rows they keep a minimum height and the board
   scrolls. */
.ov-dash .ov-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 320px;
  gap: .75rem;
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ov-dash .ov-board > .ov-card {
  height: auto;
  min-width: 0;
  min-height: 0;
}
@media (min-width: 1024px) {
  .ov-dash .ov-board {
    grid-template-columns: repeat(24, minmax(0, 1fr));
    grid-auto-rows: minmax(280px, 1fr);
  }
  .ov-dash .ov-board > * {
    grid-column: span var(--ov-span, 24) / span var(--ov-span, 24);
  }
}
.ov-dash .ov-board > .ov-board-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px dashed var(--border-2);
  border-radius: .75rem;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Top-bar controls: the view controls, or the edit toolbar while editing. */
.ov-view-controls,
.ov-edit-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ov-edit-controls { display: none; }
.ov-header-controls.is-editing .ov-view-controls { display: none; }
.ov-header-controls.is-editing .ov-edit-controls { display: flex; }

.ov-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--dim);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.ov-icon-btn:hover { color: var(--text); border-color: var(--border-2); }
.ov-icon-btn lucide-icon { display: block; font-size: 15px; --icon-stroke: 1.88; }

.ov-edit-tool {
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
}
.ov-edit-tool lucide-icon { display: block; font-size: 14px; --icon-stroke: 2; }

.ov-icon-btn:focus-visible,
.ov-edit-grip:focus-visible,
.ov-edit-remove:focus-visible,
.ov-size-seg button:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 1px;
}

/* Edit mode: cards become dashed frames holding a skeleton of their content. */
.ov-dash .ov-board.is-editing > .ov-edit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 12px 14px;
  border-style: dashed;
  border-color: var(--border-2);
  cursor: grab;
  transition: opacity .15s var(--ease), border-color .15s var(--ease);
}
.ov-dash .ov-board.is-editing > .ov-edit-card:hover { border-color: var(--accent-line); }
.ov-dash .ov-board.is-editing > .ov-edit-card.is-dragging { opacity: .35; }
.ov-edit-card.is-drop-before::before,
.ov-edit-card.is-drop-after::after {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.ov-edit-card.is-drop-before::before { left: calc(-.375rem - 2px); }
.ov-edit-card.is-drop-after::after { right: calc(-.375rem - 2px); }

.ov-edit-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ov-edit-grip,
.ov-edit-remove {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: color .15s var(--ease), background .15s var(--ease);
}
.ov-edit-grip { cursor: grab; }
.ov-edit-remove { cursor: pointer; }
.ov-edit-grip:hover { color: var(--text); background: var(--hover-fade); }
.ov-edit-remove:hover { color: var(--red); background: var(--hover-fade); }
.ov-edit-grip lucide-icon,
.ov-edit-remove lucide-icon { display: block; font-size: 15px; --icon-stroke: 1.88; }
.ov-edit-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ov-size-seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
}
.ov-size-seg button {
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.ov-size-seg button:hover { color: var(--text); }
.ov-size-seg button[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.ov-edit-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 0 2px;
  pointer-events: none;
}
/* The shared skeleton fill is card-coloured in the dark skin (it is meant to
   sit on the page background), so on a card it would vanish. */
.ov-edit-body .skeleton {
  display: block;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text) 10%, transparent) 25%,
    color-mix(in srgb, var(--text) 16%, transparent) 37%,
    color-mix(in srgb, var(--text) 10%, transparent) 63%);
  background-size: 400% 100%;
}

.ov-skel-ring-wrap,
.ov-skel-gauge-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.ov-skel-ring {
  height: min(100%, 190px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 54%, #000 55%);
  mask: radial-gradient(circle, transparent 54%, #000 55%);
}
.ov-skel-gauge {
  width: min(80%, 260px);
  max-height: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 999px 999px 0 0;
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 59%);
  mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 59%);
}
.ov-skel-stats {
  display: grid;
  flex: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.ov-skel-stats.is-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-skel-stats span,
.ov-skel-list span {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ov-skel-stats i:first-child { width: 70%; height: 8px; }
.ov-skel-stats i:last-child { width: 100%; height: 4px; }
.ov-skel-list { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.ov-skel-list i:first-child { width: 74%; height: 10px; }
.ov-skel-list i:last-child { width: 46%; height: 7px; }
.ov-skel-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 6px;
  min-height: 0;
  padding-top: 8px;
  border-bottom: 1px solid var(--hairline);
}
.ov-skel-bars i { flex: 1; min-width: 0; border-radius: 4px 4px 0 0; }
.ov-skel-flow {
  display: flex;
  flex: 1;
  align-items: stretch;
  gap: 4px;
  min-height: 0;
  padding: 6px 0;
}
.ov-skel-node { flex: none; width: 8px; border-radius: 3px; }
.ov-skel-nodes { display: flex; flex: none; flex-direction: column; gap: 12px; }
.ov-skel-nodes .ov-skel-node:first-child { flex: 2; }
.ov-skel-nodes .ov-skel-node:last-child { flex: 3; }
.ov-skel-links { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 8px 0; }
/* Flows are lighter than nodes, as in the real Sankey. */
.ov-edit-body .ov-skel-links i { background: color-mix(in srgb, var(--text) 5%, transparent); }
.ov-skel-links i:first-child { flex: 2; border-radius: 2px; }
.ov-skel-links i:last-child { flex: 3; border-radius: 2px; }
/* Radial clock: spokes of dots between the hole and the rim. */
.ov-skel-dial {
  height: min(100%, 210px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  -webkit-mask:
    radial-gradient(circle, transparent 40%, #000 41%, #000 70%, transparent 71%),
    repeating-conic-gradient(#000 0deg 4.5deg, transparent 4.5deg 7.5deg);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle, transparent 40%, #000 41%, #000 70%, transparent 71%),
    repeating-conic-gradient(#000 0deg 4.5deg, transparent 4.5deg 7.5deg);
  mask-composite: intersect;
}
.ov-skel-legend { display: flex; flex: none; justify-content: center; gap: 14px; }
.ov-skel-legend i { width: 64px; height: 8px; }
.ov-skel-block { display: flex; flex: 1; min-height: 0; }
.ov-skel-block i { flex: 1; border-radius: var(--radius); }

/* The "Add a card" catalog dialog. */
.ov-cat-group { display: grid; gap: 8px; }
.ov-cat-heading { color: var(--muted); font-size: 11px; font-weight: 600; }
.ov-cat-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ov-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.ov-cat-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-2);
  color: var(--dim);
}
.ov-cat-icon lucide-icon { display: block; font-size: 16px; --icon-stroke: 1.88; }
.ov-cat-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ov-cat-title { color: var(--text); font-size: 13px; font-weight: 600; }
.ov-cat-desc { color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.ov-cat-add { flex: none; padding: 5px 10px; font-size: 11.5px; }
.ov-cat-add lucide-icon { display: block; font-size: 13px; --icon-stroke: 2; }
.ov-cat-empty { padding: 28px 20px; }
.ov-cat-note { margin: 0; color: var(--dim); font-size: 12px; }

/* Tags & assignment modal — opened from the device header so tags no longer
   consume a full card in the device overview. */
.fd-tags-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
}
.fd-tags-modal {
  width: 100%;
  max-width: 30rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.fd-tags-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.fd-tags-modal-head h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.fd-tags-modal-head p { margin-top: 2px; font-size: 12px; color: var(--muted); }
.fd-tags-modal-close {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.fd-tags-modal-close:hover { color: var(--text); border-color: var(--border-2); }
/* Neutralize the drawer well styling when the editor lives inside the modal. */
.fd-tags-modal .fl-tag-editor { padding: 0; border: 0; background: transparent; }

/* Live resource metric chart (CPU / memory / drives) — replaces the fill bar. */
.fd-metric-chart {
  margin-top: 12px;
  width: 100%;
  height: 48px;
  min-height: 48px;
}
.fd-metric-chart .fd-lmc-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Ticket process graph — observable execution path */
.tkd-scroll-process { padding: 0; overflow: hidden; background: var(--bg); }
.tkp { display: grid; grid-template-rows: auto minmax(340px, 1fr) auto; height: 100%; min-height: 0; color: var(--text); }
.tkp-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 16px 20px 14px; border-bottom: 1px solid var(--border); background: var(--card);
}
.tkp-head h2 { margin: 2px 0 3px; font-size: 15px; font-weight: 700; }
.tkp-head p { max-width: 720px; margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.tkp-eyebrow { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.tkp-count { flex: none; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--card-2); font-size: 9.5px; }
.tkp-viewport {
  min-height: 0; overflow: auto; overscroll-behavior: contain;
  /* Says "you can move this" before anyone tries. */
  cursor: grab;
  /* The pan handler owns the gesture, so the browser must not also claim it. */
  touch-action: none;
}
.tkp-viewport.is-panning { cursor: grabbing; }
/* Text selection while dragging turned a pan into a highlight of every card. */
.tkp-viewport.is-panning, .tkp-viewport.is-panning * { user-select: none; }

.tkp-canvas {
  /* No `overflow: hidden` any more: it clipped the lift and shadow of a card
     hovered near an edge, and made the board look like it ended before it did.
     Height comes from the markup now, so there is something to pan into. */
  position: relative; min-height: 100%;
  background-color: var(--bg);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted) 24%, transparent) .7px, transparent .8px);
  background-size: 15px 15px;
}
/* The edge-fade overlay is gone. It was fixed to the canvas rather than the
   viewport, so it did not follow the scroll: instead of hinting "there is more
   this way", it washed out two arbitrary columns of cards wherever you stopped —
   which is exactly the faded look on the far-right cards. */
.tkp-links { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* Quiet by default so the cards carry the board, and rounded ends so a curve does
   not finish in a hard stub now that there is no arrowhead to hide it. */
.tkp-link {
  fill: none; stroke: var(--border); stroke-width: 1.25; opacity: .75;
  stroke-linecap: round;
  transition: stroke .18s ease, stroke-width .18s ease, opacity .18s ease;
}
/* The dashed travelling line on hover, kept exactly as it was — it is the one
   thing that shows which two cards a connector belongs to. */
.tkp-link.is-linked { stroke: var(--accent); stroke-width: 2; opacity: 1; stroke-dasharray: 6 5; animation: tkp-flow .55s linear infinite; }
@keyframes tkp-flow { to { stroke-dashoffset: -11; } }
.tkp-node {
  position: absolute; z-index: 2; left: var(--tkp-left); top: var(--tkp-top);
  display: flex; flex-direction: column; width: 210px; min-height: 104px; padding: 11px 12px 10px;
  border: 1px solid var(--border-2); border-radius: 9px; outline: none;
  color: var(--text); background: color-mix(in srgb, var(--card) 96%, transparent);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .12); text-align: left; cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.tkp-node:hover, .tkp-node:focus-visible {
  z-index: 4; transform: translateY(-3px);
  background: var(--card); box-shadow: 0 11px 28px rgba(0, 0, 0, .22);
}
.tkp-node.is-selected { z-index: 3; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 12px 28px rgba(0, 0, 0, .2); }
.tkp-node.is-selected::after {
  content: ''; position: absolute; inset: -4px; border: 1px solid var(--accent-line); border-radius: 12px; pointer-events: none;
  animation: tkp-select .34s ease-out both;
}
@keyframes tkp-select { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.tkp-node-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; min-width: 0; }
.tkp-node-head time { margin-left: auto; color: var(--muted); font-size: 8.5px; white-space: nowrap; }
.tkp-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; flex: none;
  border-radius: 6px; color: var(--accent); background: var(--accent-soft);
}
.tkp-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.tkp-kind { display: inline-flex; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .065em; text-transform: uppercase; }
.tkp-kind.is-request, .tkp-kind.is-message { color: var(--t-blue, var(--accent)); }
.tkp-kind.is-analysis { color: var(--accent); }
.tkp-kind.is-decision { color: var(--t-violet, #9b7de5); }
.tkp-kind.is-action { color: var(--t-orange); }
.tkp-kind.is-validation, .tkp-kind.is-resolution { color: var(--t-green); }
.tkp-node.is-decision { border-style: dashed; }
.tkp-node.is-resolution { border-color: color-mix(in srgb, var(--t-green) 42%, var(--border)); }
.tkp-node > strong { display: block; overflow: hidden; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.tkp-node-summary { display: -webkit-box; overflow: hidden; color: var(--dim); font-size: 9.5px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tkp-node-actor { margin-top: auto; padding-top: 7px; color: var(--muted); font-size: 8.5px; }
.tkp-inspector {
  min-height: 116px; max-height: 168px; overflow: auto; padding: 13px 20px 15px;
  border-top: 1px solid var(--border); background: var(--card);
}
.tkp-inspector-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.tkp-inspector-head time { margin-left: auto; color: var(--muted); font-size: 9px; }
.tkp-inspector h3 { margin: 0 0 4px; font-size: 12.5px; }
.tkp-inspector p { max-width: 900px; margin: 0; color: var(--dim); font-size: 10.5px; line-height: 1.45; }
.tkp-inspector dl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 0; }
.tkp-inspector dl div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; font-size: 9.5px; }
.tkp-inspector dt { color: var(--muted); }
.tkp-inspector dd { margin: 0; color: var(--dim); }
.tkp-inspector-empty { display: flex; flex-direction: column; justify-content: center; min-height: 74px; }
.tkp-inspector-empty strong { font-size: 11.5px; }
.tkp-inspector-empty span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.tkp-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--muted); font-size: 11px; }
@media (max-width: 800px) {
  .tkp-head { padding: 13px 15px; }
  .tkp-head p { display: none; }
  .tkp-inspector { padding-right: 15px; padding-left: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tkp-node, .tkp-link { transition: none; }
  .tkp-link.is-linked, .tkp-node.is-selected::after { animation: none; }
}

/* Key information — compact dropdowns */
.tkd-card .tkd-field { margin-top: 11px; }
.tkd-card .cs-trigger,
.tkd-card .tkd-select {
  min-height: 32px; height: 32px; padding: 0 10px;
  font-size: 12px; border-radius: 6px;
}
.tkd-card .cs-menu-list .cs-option { font-size: 12px; }

/* Status text colors — waiting orange, active white, closed green. No dots. */
.tkd-card .cs:has(> .tkd-status-open) .cs-value,
.tkd-card .cs:has(> .tkd-status-in-progress) .cs-value,
.tkd-card .tkd-select.tkd-status-open,
.tkd-card .tkd-select.tkd-status-in-progress,
.cs-tone.is-open,
.cs-tone.is-in-progress { color: var(--text); font-weight: 650; }
.tkd-card .cs:has(> .tkd-status-waiting-customer) .cs-value,
.tkd-card .cs:has(> .tkd-status-waiting-external) .cs-value,
.tkd-card .tkd-select.tkd-status-waiting-customer,
.tkd-card .tkd-select.tkd-status-waiting-external,
.cs-tone.is-waiting-customer,
.cs-tone.is-waiting-external { color: var(--orange, #dd9040); font-weight: 650; }
.tkd-card .cs:has(> .tkd-status-resolved) .cs-value,
.tkd-card .cs:has(> .tkd-status-close) .cs-value,
.tkd-card .tkd-select.tkd-status-resolved,
.tkd-card .tkd-select.tkd-status-close,
.cs-tone.is-resolved,
.cs-tone.is-close { color: var(--green); font-weight: 650; }
.tkd-card .cs:has(> .tkd-status-discard) .cs-value,
.tkd-card .tkd-select.tkd-status-discard,
.cs-tone.is-discard { color: var(--t-red); font-weight: 650; }
.cs-option.cs-tone.is-open:hover,
.cs-option.cs-tone.is-open.selected,
.cs-option.cs-tone.is-in-progress:hover,
.cs-option.cs-tone.is-in-progress.selected { color: var(--text); }
.cs-option.cs-tone.is-waiting-customer:hover,
.cs-option.cs-tone.is-waiting-customer.selected,
.cs-option.cs-tone.is-waiting-external:hover,
.cs-option.cs-tone.is-waiting-external.selected { color: var(--orange, #dd9040); }
.cs-option.cs-tone.is-resolved:hover,
.cs-option.cs-tone.is-resolved.selected,
.cs-option.cs-tone.is-close:hover,
.cs-option.cs-tone.is-close.selected { color: var(--green); }
.cs-option.cs-tone.is-discard:hover,
.cs-option.cs-tone.is-discard.selected { color: var(--t-red); }
.tkd-card .cs:has(> .tkd-priority-urgent) .cs-value,
.tkd-card .tkd-select.tkd-priority-urgent { color: var(--t-red); font-weight: 650; }
.tkd-card .cs:has(> .tkd-priority-high) .cs-value,
.tkd-card .tkd-select.tkd-priority-high { color: var(--t-orange); font-weight: 650; }
.tkd-card .cs:has(> .tkd-priority-medium) .cs-value,
.tkd-card .tkd-select.tkd-priority-medium { color: var(--t-blue); font-weight: 650; }
.tkd-card .cs:has(> .tkd-priority-low) .cs-value,
.tkd-card .tkd-select.tkd-priority-low { color: var(--t-green); font-weight: 650; }

/* Summary divider spans the full width of the scroll area */
.tkd-scroll .tkd-summary {
  margin-left: -22px; margin-right: -22px;
  padding-left: 22px; padding-right: 22px;
}

/* Ticket detail header — match the panel, lighter buttons, title above meta */
.tkd-head { background: var(--card); }
.tkd-head .tkt-btn,
.tkd-head .tkd-back,
.tkd-head .tkd-icon-btn { background: var(--card-2); border-color: var(--border-2); }
.tkd-head .tkt-btn:hover,
.tkd-head .tkd-back:hover,
.tkd-head .tkd-icon-btn:hover { background: var(--hover); color: var(--text); }
.tkd-head-copy .tkd-title { margin: 0 0 4px; }
.tkd-head .tkd-kicker { margin-bottom: 0; }
.tkd-num {
  padding: 0; border: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: 10px; font-weight: 750; cursor: pointer;
  transition: color .14s ease;
}
.tkd-num:hover { color: var(--accent-bright, var(--accent)); text-decoration: underline; }
.tkd-num.is-copied { color: var(--t-green); }

/* Sidebar fills its full height — last card stretches into the leftover space */
.tkd-side { display: flex; flex-direction: column; }
.tkd-side > .tkd-card:last-child { flex: 1 1 auto; border-bottom: 0; }

/* Automation suggestions — clickable green link cards */

/* Contact card — phone/extra lines */
.tkd-contact-lines { display: flex; flex-direction: column; gap: 3px; margin: 10px 0 2px; padding-left: 2px; }
.tkd-contact-line { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
a.tkd-contact-link { color: var(--dim); text-decoration: none; transition: color .14s ease; }
a.tkd-contact-link:hover { color: var(--accent); }

/* Internal notes tab intro banner */
.tkd-notes-intro {
  margin-bottom: 16px; padding: 9px 12px; border: 1px solid rgba(221, 144, 64, .28);
  border-radius: 8px; background: rgba(221, 144, 64, .07); color: var(--t-orange);
  font-size: 11px; line-height: 1.45;
}

/* Ticket owner picker — teams / agents popover */
.tkd-owner-field { position: relative; }
.tkd-owner-head { display: flex; align-items: center; gap: 8px; }
.tkd-owner-pick {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
  padding: 3px 9px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 9.5px;
  font-weight: 750; letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .1s ease;
}
.tkd-owner-pick svg { width: 12px; height: 12px; }
.tkd-owner-pick:hover { background: var(--accent); color: var(--on-accent); }
.tkd-owner-pick:active { transform: scale(.96); }
.tkd-owner-head { width: 100%; }
.tkd-owner-caret {
  display: inline-flex; margin-left: auto; color: var(--muted);
  transition: transform .18s ease, color .18s ease;
}
.tkd-owner-current:hover .tkd-owner-caret { color: var(--accent); }
.tkd-owner-field.is-open .tkd-owner-caret { transform: rotate(90deg); color: var(--accent); }
.tkd-owner-ring {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
}
.tkd-owner-ring.sm { width: 30px; height: 30px; }
.tkd-owner-ring i { position: absolute; inset: 0; border-radius: 50%; border: 1.4px dotted var(--border-2); }
.tkd-owner-ring b { display: none; }
.tkd-owner-ring em {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-style: normal; font-size: 9.5px; font-weight: 750;
}
.tkd-owner-ring.sm em { width: 22px; height: 22px; font-size: 9px; }
.tkd-owner-current {
  display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 3px;
  padding: 9px 11px; border: 1px solid var(--border-2); border-radius: 9px;
  background: var(--card-2); color: var(--text); text-align: left; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.tkd-owner-current:hover, .tkd-owner-field.is-open .tkd-owner-current { background: var(--card);
}
.tkd-owner-current-name { font-size: 12.5px; font-weight: 700; }
.tkd-owner-pop {
  margin-top: 8px; border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--card); overflow: hidden; box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  animation: tkd-owner-pop .16s ease;
}
.tkd-owner-pop[hidden] { display: none; }
@keyframes tkd-owner-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.tkd-owner-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); }
.tkd-owner-tab {
  padding: 6px 4px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 10px; font-weight: 750; letter-spacing: .07em;
  text-transform: uppercase; cursor: pointer; transition: color .14s ease;
}
.tkd-owner-tab:hover { color: var(--dim); }
.tkd-owner-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tkd-owner-panel { padding: 8px; }
.tkd-owner-panel[hidden] { display: none; }
.tkd-owner-search { padding: 2px 4px 8px; }
.tkd-owner-search input {
  width: 100%; height: 32px; padding: 0 4px; border: 0; border-bottom: 1.5px solid var(--border-2);
  background: transparent; color: var(--text); font: inherit; font-size: 12px; outline: none;
  transition: border-color .15s ease;
}
.tkd-owner-search input::placeholder { color: var(--muted); }
.tkd-owner-search input:focus { border-bottom-color: var(--accent); }
.tkd-owner-list { display: flex; flex-direction: column; gap: 4px; max-height: 244px; overflow-y: auto; }
.tkd-owner-option {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 9px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text);
  text-align: left; cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .1s ease;
}
.tkd-owner-option:hover { background: var(--hover); }
.tkd-owner-option:active { transform: scale(.99); }
.tkd-owner-option.is-selected { border-color: var(--accent-line); background: var(--accent-soft); }
.tkd-owner-opt-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tkd-owner-opt-name { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tkd-owner-opt-email { overflow: hidden; margin-top: 1px; font-size: 10.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.tkd-owner-check { margin-left: auto; flex: none; color: var(--accent); }
.tkd-owner-hint { padding: 16px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.tkd-owner-unassign {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px; border: 0; border-top: 1px solid var(--border); background: var(--card-2);
  color: var(--accent); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  transition: background .14s ease;
}
.tkd-owner-unassign:hover { background: var(--hover); }
@media (prefers-reduced-motion: reduce) {
  .tkd-owner-pop { animation: none; }
  .tkd-owner-option, .tkd-owner-current { transition: none; }
}

/* Composer: no focus ring, no drag-resize, auto-growing height */
.tkd-compose-box:focus-within { border-color: var(--border-2); }
.tkd-compose-box.is-note:focus-within { border-color: rgba(221, 144, 64, .28); }
.tkd-compose-box textarea {
  min-height: 40px;
  resize: none;
  overflow-y: hidden;
}
.tkd-compose-box textarea:focus,
.tkd-compose-box textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ── Billing view ──────────────────────────────────────────────── */
.bl-view { display: flex; flex-direction: column; gap: 16px; }

/* Full-bleed views: no surrounding frame card, no title strip. */
.admin-content-frame.billing-bare,
.admin-content-frame.pc-bare,
.admin-content-frame.pp-bare,
.admin-content-frame.sc-bare,
.admin-content-frame.ap-bare,
.admin-content-frame.crq-bare {
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
}
.admin-content-frame.billing-bare > main,
.admin-content-frame.pc-bare > main,
.admin-content-frame.pp-bare > main,
.admin-content-frame.sc-bare > main,
.admin-content-frame.ap-bare > main,
.admin-content-frame.crq-bare > main { padding: 2px; }
/* Approvals, Change Requests: the view fills the panel so its empty state can
   centre in it. */
.admin-content-frame.ap-bare > main,
.admin-content-frame.crq-bare > main { display: flex; flex-direction: column; }

.bl-card { padding: 18px 20px; }
.bl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.bl-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.bl-card-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.5; max-width: 520px; }

.bl-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .bl-grid { grid-template-columns: 1fr 1fr; } }

/* Budget editor (mirrors the compact overview control) */
.bl-budget { flex: none; display: inline-flex; align-items: center; }
.bl-budget-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--dim);
  font: 600 11.5px/1 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.bl-budget-btn:hover:not(:disabled) { color: var(--accent-deep); }
.bl-budget-btn:disabled { opacity: .55; cursor: default; }
.bl-budget-pen { opacity: .7; }
.bl-budget-btn.hidden, .bl-budget-form.hidden { display: none; }
.bl-budget-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bl-budget-field {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.bl-budget-field:focus-within { }
.bl-budget-field input:focus,
.bl-budget-field input:focus-visible { outline: none; box-shadow: none; }
.bl-budget-currency { color: var(--muted); font-size: 12.5px; }
.bl-budget-field input {
  width: 74px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 0 0 4px;
  color: var(--text);
  font: 600 13px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.bl-budget-field input::-webkit-inner-spin-button,
.bl-budget-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bl-budget-save {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 12px/1 var(--font-sans);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.bl-budget-save:hover:not(:disabled) { background: var(--accent-bright); border-color: var(--accent-bright); }
.bl-budget-save:disabled { opacity: .6; cursor: default; }
.bl-budget-cancel {
  height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 600 12px/1 var(--font-sans);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.bl-budget-cancel:hover { color: var(--text); background: var(--hover-fade); }

/* Spend metrics */
.bl-spend-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .bl-spend-metrics { grid-template-columns: repeat(5, 1fr); } }

/* Budget is read from Azure: a link to it in the portal, plus a refresh. */
a.bl-budget-btn { gap: 6px; text-decoration: none; cursor: pointer; }
a.bl-budget-btn.is-missing { cursor: help; color: var(--muted); border-style: dashed; }
a.bl-budget-btn lucide-icon { font-size: 13px; }
.bl-budget { gap: 6px; }
.bl-budget-refresh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.bl-budget-refresh:hover:not(:disabled) { color: var(--text); background: var(--hover-fade); }
.bl-budget-refresh lucide-icon { font-size: 15px; }
.bl-budget-refresh.is-busy lucide-icon { animation: bl-spin .8s linear infinite; }
@keyframes bl-spin { to { transform: rotate(360deg); } }
/* ── Azure budget setup (azure-budget-setup.js) ─────────────────── */
.abs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.abs-title { font-size: 13px; font-weight: 700; color: var(--text); }
.abs-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.5; max-width: 560px; }
.abs-status {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600; color: var(--dim); white-space: nowrap;
}
.abs-status i { width: 7px; height: 7px; border-radius: 50%; background: #d9a300; }
.abs-status.is-ok i { background: var(--live, #3dd68c); }
.abs-loading { padding: 18px 4px; font-size: 12.5px; color: var(--muted); }

.abs-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.abs-step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.abs-step:first-child { border-top: 0; padding-top: 4px; }
.abs-step-mark { flex: none; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.abs-step-mark lucide-icon { font-size: 20px; color: var(--live, #3dd68c); }
.abs-num {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.abs-step.is-current .abs-num { border-color: var(--text); color: var(--text); }
.abs-step-body { flex: 1; min-width: 0; }
.abs-step-title { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 22px; }
.abs-step.is-later .abs-step-title { color: var(--muted); }
.abs-step-detail { margin-top: 4px; font-size: 12px; color: var(--dim); line-height: 1.55; }
.abs-step-detail p { margin: 4px 0 0; }
.abs-step-detail b { color: var(--text); font-weight: 600; }

.abs-seg { display: inline-flex; gap: 2px; margin: 8px 0 10px; padding: 2px; border: 1px solid var(--border); border-radius: 9px; }
.abs-seg-btn { height: 26px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 600 11.5px/1 var(--font-sans); cursor: pointer; }
.abs-seg-btn:hover { color: var(--text); }
.abs-seg-btn.is-on { background: var(--hover-fade); color: var(--text); }
.abs-howto { margin: 0 0 6px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.abs-howto li { padding-left: 2px; }
.abs-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-bright, var(--text)); text-decoration: none; font-weight: 600; }
.abs-link:hover { text-decoration: underline; }
.abs-link lucide-icon { font-size: 12px; }
.abs-fine { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.abs-ids { margin: 12px 0 4px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.abs-id { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--border); }
.abs-id:first-child { border-top: 0; }
.abs-id-label { font-size: 11.5px; color: var(--muted); }
.abs-id-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; color: var(--text); user-select: all; }
.abs-id-hint { grid-column: 2 / 4; margin-top: -4px; font-size: 11px; color: var(--muted); }
.abs-copy {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
}
.abs-copy:hover { color: var(--text); background: var(--hover-fade); }
.abs-copy lucide-icon { font-size: 14px; }
.abs-copy.is-done { color: var(--live, #3dd68c); }

.abs-budgets { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.abs-budget {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.abs-budget:hover { border-color: var(--border-2); }
.abs-budget.is-on { border-color: var(--accent-line, var(--border-2)); background: var(--hover-fade); }
.abs-budget input { accent-color: var(--accent, currentColor); margin: 0; }
.abs-budget-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.abs-budget-main b { font-size: 12.5px; }
.abs-budget-main span { font-size: 11.5px; color: var(--muted); }
.abs-budget-amount { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.abs-budget-amount span { font-size: 11px; font-weight: 500; color: var(--muted); }

.bl-caption-link { color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.bl-caption-link:hover { color: var(--text); }
.abs-where {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--hover-fade); font-size: 12px; color: var(--dim); line-height: 1.55;
}
.abs-where p { margin: 4px 0 0; }
.abs-where b { color: var(--text); font-weight: 600; }
.abs-where-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.abs-where-title lucide-icon { font-size: 14px; color: var(--muted); }
.abs-path { font-size: 11.5px; color: var(--muted); }
.abs-actions { display: flex; gap: 8px; margin-top: 10px; }
.abs-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: transparent;
  color: var(--text); font: 600 12px/1 var(--font-sans); text-decoration: none; cursor: pointer;
}
.abs-btn:hover:not(:disabled) { border-color: var(--border-2); background: var(--hover-fade); }
.abs-btn:disabled { opacity: .55; cursor: default; }
.abs-btn.is-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.abs-btn.is-primary:hover:not(:disabled) { background: var(--text); opacity: .88; }
.abs-btn lucide-icon { font-size: 14px; }
.abs-btn lucide-icon.is-spinning { animation: bl-spin .8s linear infinite; }
.abs-select { width: auto; margin-left: 8px; height: 28px; padding: 0 8px; font-size: 12px; }
.abs-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.abs-foot .abs-fine { margin: 0; }

.bl-budget-missing {
  display: flex; flex-direction: column; gap: 3px;
  margin-bottom: 14px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #d9a300 40%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, #d9a300 7%, transparent);
  font-size: 12px; color: var(--dim);
}
.bl-budget-missing strong { color: var(--text); font-weight: 600; }
.bl-metric-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.bl-metric-value.is-over { color: var(--red); }
.bl-metric-label { margin-top: 2px; font-size: 11px; color: var(--muted); }
.bl-spend-bar-caption { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* Month-to-date spend: bklit live line chart (chart-island). */
.bl-spend-line { position: relative; height: 240px; margin-top: 4px; }

/* Daily spend bar chart (fallback when the chart bundle is missing) */
.bl-chart { display: flex; flex-direction: column; gap: 6px; }
.bl-chart-plot {
  position: relative;
  height: 150px;
}
.bl-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
  width: 100%;
}
.bl-bar-col {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}
.bl-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
  transition: filter .12s;
}
.bl-bar.is-over { background: var(--yellow); }
.bl-bar-col.is-today .bl-bar { background: var(--accent-bright); }
.bl-bar-col.is-future .bl-bar { background: var(--border-2); min-height: 0; }
.bl-bar-col:hover .bl-bar { filter: brightness(1.12); }

.bl-chart-budget {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--border-2);
  pointer-events: none;
}
.bl-chart-budget span {
  position: absolute;
  right: 0;
  top: -8px;
  padding: 0 5px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
}
.bl-chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}

.bl-bar-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-panel);
}
.bl-bar-tooltip[hidden] { display: none; }

/* Breakdown tables */
.bl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bl-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.bl-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.bl-table tr:last-child td { border-bottom: 0; }
.bl-table .bl-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bl-mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; }

/* AI models */
/* Provider status pill: green dot when the Azure resource answered. */
.bl-conn {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.bl-conn:empty { display: none; }
.bl-conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.bl-conn.is-ok i { background: var(--live, #3dd68c); }
.bl-conn.is-bad i { background: var(--red, #e07a77); }
.bl-model-price { margin-top: 5px; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bl-dim { color: var(--muted); }
.bl-subhead {
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bl-tier-table tr.is-off td { opacity: .5; }
.bl-tier-table tr.bl-row-note td { padding-top: 0; color: var(--red, #e07a77); font-size: 11.5px; }
.bl-note { margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.bl-msg-err { color: var(--red, #e07a77); }
.bl-spend-warn { margin-top: 6px; font-size: 11.5px; color: #d9a300; }
.bl-models { display: flex; flex-direction: column; }
.bl-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.bl-model-row:last-child { border-bottom: 0; }
/* Text takes the room; the picker (native or custom-select's .cs wrapper) keeps
   its own width. Without this the global `select { width: 100% }` squeezes the
   description into a one-word column. */
.bl-model-info { flex: 1; min-width: 0; }
.bl-model-row > .cs,
.bl-model-row > .bl-model-select { flex: none; width: auto; min-width: 240px; }
.bl-model-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.bl-model-hint { margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.45; max-width: 460px; }
.bl-model-select {
  flex: none;
  min-width: 220px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: 500 12.5px/1 var(--font-sans);
  cursor: pointer;
}
.bl-model-select:hover:not(:disabled) { border-color: var(--border-2); }
.bl-model-select:disabled { opacity: .6; cursor: default; }
.bl-model-select:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.bl-models-foot { margin-top: 12px; min-height: 18px; }
.bl-msg { font-size: 11.5px; color: var(--muted); }
.bl-msg-ok { color: var(--accent-deep); }
.bl-empty { padding: 18px 4px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ── Contacts view: reuse the Fleet shell chrome ─────────────── */
#contacts-content .admin-search {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--well);
  font-size: 12px;
}
#contacts-content .admin-search:focus-within {
  border-color: var(--metal-hi);
  box-shadow: none;
}
#contacts-filter-seg {
  height: 30px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--well);
  border-color: var(--border);
}
#contacts-filter-seg .seg-btn { padding: 0 11px; height: 24px; font-size: 12px; font-weight: 500; }
#contacts-filter-seg .seg-slider {
  top: 3px;
  height: calc(100% - 6px);
  border-radius: 6px;
  background: var(--well-hi);
  border-color: transparent;
}

.fl-c-type { width: 104px; }

/* Internal / External directory tag */
.ct-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ct-type::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.ct-type-internal { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }
.ct-type-external { background: rgba(176, 119, 15, .1); color: var(--yellow); border-color: rgba(176, 119, 15, .28); }

@media (max-width: 760px) {
  .fl-c-type { display: none; }
}

/* Fill the shell height so the tree divider runs to the bottom of the section
   even when there are only a few contacts, and give the last row a bottom rule
   to match the ones above it. */
#contacts-content:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#contacts-content .fl-shell { grid-template-rows: minmax(0, 1fr); }
#contacts-table tbody tr:last-child td { border-bottom: 1px solid var(--hairline); }

/* Fade long search text/placeholder at the right edge instead of a hard clip. */
.fl-search input {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
}

/* Top bar: equal side columns keep the global search centred in the viewport
   regardless of what the breadcrumb or the per-page right-side controls hold.
   Each child is pinned to its column so hiding the search (settings) does
   not shift the right-hand controls into the middle slot. */
#admin-shell > .admin-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 32rem) minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}
#admin-shell > .admin-topbar > #project-selector { grid-column: 1; justify-self: start; min-width: 0; }
#admin-shell > .admin-topbar > .admin-global-search-wrap { grid-column: 2; width: 100%; margin: 0; }
#admin-shell > .admin-topbar > .admin-topbar-right { grid-column: 3; justify-self: end; min-width: 0; }



/* New-dashboard modal (scratch, in-memory). */
.tpd-sd-host { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tpd-sd-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.tpd-sd-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
}
.tpd-sd-modal h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.tpd-sd-modal p { margin-top: 5px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.tpd-sd-modal input {
  width: 100%;
  height: 38px;
  margin-top: 14px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.tpd-sd-modal input:focus { }
.tpd-sd-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* A sidebar ticket dashboard row: the name, truncated. */
.nav-sub-item { display: flex; align-items: center; gap: 6px; }
.nav-sub-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Its ticket count: a quiet number, so the parent Tickets badge stays the
   one that reads as a badge. */
.nav-sub-count {
  flex: none;
  min-width: 1.25rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.nav-sub-count[hidden] { display: none; }
.nav-sub-count.is-zero { opacity: .5; }
.nav-sub-item:hover .nav-sub-count,
.nav-sub-item.active .nav-sub-count { color: var(--dim); }

/* ── Unified Jira-style ticket queue ─────────────────────────────── */
.tkt-grid-wrap { background: var(--card); }
.tkt-frame { min-width: 960px; }
.tkt-table {
  table-layout: fixed;
  font-size: 12px;
}
.tkt-table th {
  height: 34px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--card);
}
.tkt-table td {
  height: 42px;
  padding: 6px 10px;
}
.tkt-table th + th,
.tkt-table td + td { border-left: 0; }
.tkt-table tbody tr:hover td { background: var(--hover-fade); }

.tkt-c-check { width: 38px; }
/* Ticket keeps a fixed width so it stays snug against the summary. The
   other columns take percentages and spread with the screen; the summary
   has no width and gets whatever is left. */
.tkt-c-key { width: 64px; }
.tkt-c-summary { width: auto; }
.tkt-c-status { width: 16%; }
.tkt-c-reporter { width: 16%; }
.tkt-c-assignee { width: 17%; }
.tkt-c-created { width: 14%; }

.tkt-key,
.tkt-summary {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.tkt-key {
  margin-left: -4px;
  padding: 3px 4px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}
.tkt-key:hover,
.tkt-key:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  outline: none;
  text-decoration: none;
}
.tkt-key.is-copied {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent), 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent);
  animation: tpd-copy-bounce .52s cubic-bezier(.22, 1.3, .36, 1) both;
}
.tkt-copy-toast {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--text) 24%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--card) 88%, white 12%);
  color: var(--text);
  box-shadow: var(--shadow-panel);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transform-origin: center bottom;
  animation: tpd-copy-toast-pop 1.6s cubic-bezier(.22, 1, .36, 1) both;
}
.tkt-copy-toast::before { content: '✓'; color: var(--text); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .tkt-key.is-copied { animation: none; }
  .tkt-copy-toast { animation: tpd-copy-toast-fade 1.6s ease both; }
}
.tkt-summary {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 550;
}
.tkt-key:hover,
.tkt-summary:hover { color: var(--accent); text-decoration: underline; }

/* Type icon sits inline before the title, as part of the summary. */
.tkt-summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tkt-summary-line .tkt-type { flex: none; }
.tkt-summary-line .tkt-summary { min-width: 0; }

.tkt-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
}
.tkt-type.is-hardware { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.tkt-type.is-account { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.tkt-type.is-network { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.tkt-type lucide-icon { font-size: 14px; --icon-stroke: 1.97; }

.tkt-reporter,
.tkt-person-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkt-reporter { color: var(--dim); }
.tkt-av { width: 22px; height: 22px; }
.tkt-person { gap: 7px; max-width: 100%; }
.tkt-assign { width: 100%; }

.tkt-state-button {
  width: max-content;
  max-width: 138px;
  min-width: 0;
  height: 25px;
  gap: 6px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10.5px;
}
.tkt-state-button .tkt-status-dot { width: 6px; height: 6px; }

/* In the queue tables the caret is hidden until hover. The pill then widens
   to the right to make room for it, and stays open while its menu is up. */
.tkt-table .tkt-state-button {
  display: inline-flex;
  /* width only animates while the status morph pins it inline (FLIP);
     colours ease when the tone class changes. */
  transition: max-width .2s ease, width .28s cubic-bezier(.22, 1, .36, 1),
              color .28s ease, background-color .28s ease, border-color .28s ease,
              filter .14s ease;
}
.tkt-table .tkt-state-button .tkt-status-dot { transition: color .28s ease, background-color .28s ease; }
.tkt-table .tkt-state-label.is-swapping { animation: tkt-state-label-in .26s ease both; }
@keyframes tkt-state-label-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.tkt-table .tkt-state-button .tkt-caret {
  flex: none;
  width: 0;
  margin-left: -6px; /* cancels the flex gap while hidden */
  opacity: 0;
  transform: rotate(0deg);
  transition: width .2s ease, margin-left .2s ease, opacity .16s ease,
              transform .22s cubic-bezier(.22, 1, .36, 1);
}
/* `is-menu-open`, not `is-open`: `is-open` is the tone class of the "Open"
   status, which made every Open pill look permanently expanded. */
.tkt-table .tkt-state-button:hover,
.tkt-table .tkt-state-button:focus-visible,
.tkt-table .tkt-state-button.is-menu-open { max-width: 156px; }
.tkt-table .tkt-state-button:hover .tkt-caret,
.tkt-table .tkt-state-button:focus-visible .tkt-caret,
.tkt-table .tkt-state-button.is-menu-open .tkt-caret {
  width: 11px;
  margin-left: 0;
  opacity: .8;
}
.tkt-table .tkt-state-button.is-menu-open .tkt-caret { transform: rotate(180deg); }
/* Hidden copy used to measure a pill's settled width: no transitions, so it
   reports the end state at once. */
.tkt-table .tkt-state-button.is-measuring,
.tkt-table .tkt-state-button.is-measuring * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tkt-table .tkt-state-button,
  .tkt-table .tkt-state-button .tkt-caret,
  .tkt-table .tkt-state-button .tkt-status-dot { transition: none; }
  .tkt-table .tkt-state-label.is-swapping { animation: none; }
}

.tkt-created {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .tkt-c-reporter { display: none; }
}
@media (max-width: 860px) {
  .tkt-c-created { display: none; }
  .tkt-frame { min-width: 690px; }
}

/* ── Ticket workspace redesign · full reference-style composition ─────────── */
.tkd-layer.tkd-workspace {
  border: 0;
  border-radius: 0;
  background: var(--bg);
}
.tkd-workspace,
.tkd-workspace * { box-sizing: border-box; }
.tkd-workspace button,
.tkd-workspace select,
.tkd-workspace textarea { font-family: inherit; }

/* Loading keeps the final two-column geometry stable while data arrives. */
.tkd-workspace .tkd-loading-workspace {
  display: grid;
  grid-template-columns: clamp(280px, 24vw, 340px) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}
.tkd-workspace .tkd-loading-side {
  display: flex;
  min-height: 0;
  padding: 10px;
  border-right: 1px solid var(--border);
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.tkd-workspace .tkd-loading-card {
  display: grid;
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  grid-template-columns: 34px 1fr;
  grid-template-rows: 12px 10px 10px;
  gap: 9px 10px;
}
.tkd-workspace .tkd-loading-card.is-3 { min-height: 220px; }
.tkd-workspace .tkd-loading-card i,
.tkd-workspace .tkd-loading-card b,
.tkd-workspace .tkd-loading-card span,
.tkd-workspace .tkd-loading-head i,
.tkd-workspace .tkd-loading-head b,
.tkd-workspace .tkd-loading-head span,
.tkd-workspace .tkd-loading-tabs i {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--card-2) 20%, var(--hover) 48%, var(--card-2) 76%);
  background-size: 220% 100%;
  animation: tkd-workspace-shimmer 1.35s ease-in-out infinite;
}
.tkd-workspace .tkd-loading-card i { width: 58px; height: 10px; grid-column: 1 / -1; }
.tkd-workspace .tkd-loading-card b { width: 34px; height: 34px; grid-row: 2 / 4; border-radius: 50%; }
.tkd-workspace .tkd-loading-card span { width: 76%; height: 9px; }
.tkd-workspace .tkd-loading-card span:last-child { width: 52%; }
.tkd-workspace .tkd-loading-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--card); }
.tkd-workspace .tkd-loading-head { display: grid; padding: 19px 28px 17px; border-bottom: 1px solid var(--border); grid-template-columns: 34px 66px 84px 1fr; gap: 10px; }
.tkd-workspace .tkd-loading-head i { width: 34px; height: 28px; border-radius: 8px; }
.tkd-workspace .tkd-loading-head b { width: 66px; height: 26px; }
.tkd-workspace .tkd-loading-head span { width: 84px; height: 26px; }
.tkd-workspace .tkd-loading-head span:last-child { width: min(420px, 70%); height: 20px; margin-top: 44px; grid-column: 1 / -1; }
.tkd-workspace .tkd-loading-tabs { display: flex; height: 45px; padding: 0 28px; border-bottom: 1px solid var(--border); align-items: center; gap: 28px; }
.tkd-workspace .tkd-loading-tabs i { width: 72px; height: 9px; }
.tkd-workspace .tkd-loading-body { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; }
@keyframes tkd-workspace-shimmer { to { background-position: -120% 0; } }

/* Workspace shell */
.tkd-workspace .tkd-layout {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  grid-template-columns: clamp(280px, 24vw, 340px) minmax(0, 1fr);
  background: var(--bg);
}
.tkd-workspace .tkd-side {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.tkd-workspace .tkd-side > .tkd-card,
.tkd-workspace .tkd-side > .tkd-card:last-child {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}
.tkd-workspace .tkd-card-title {
  display: flex;
  margin: 0 0 11px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  align-items: center;
  justify-content: space-between;
}
.tkd-workspace .tkd-card-title > span { color: var(--muted); font-size: 10px; font-weight: 600; }
.tkd-workspace .tkd-main {
  display: flex;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: var(--card);
  flex-direction: column;
}

/* Header */
.tkd-workspace .tkd-head {
  display: flex;
  padding: 17px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
}
.tkd-workspace .tkd-num {
  display: inline-flex;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 750;
  line-height: inherit;
  align-items: center;
  cursor: pointer;
}
.tkd-workspace .tkd-num:hover { color: var(--accent-bright, var(--accent)); text-decoration: underline; }
.tkd-workspace .tkd-num.is-copied { color: var(--t-green); }
.tkd-workspace .tkd-status-chip {
  display: inline-flex;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--dim);
  background: var(--card-2);
  font-size: 9.5px;
  font-weight: 700;
  align-items: center;
  gap: 6px;
}
.tkd-workspace .tkd-status-chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tkd-workspace .tkd-status-chip.is-open { border-color: color-mix(in srgb, var(--t-blue) 30%, var(--border)); color: var(--t-blue); background: color-mix(in srgb, var(--t-blue) 7%, var(--card)); }
.tkd-workspace .tkd-status-chip.is-in-progress,
.tkd-workspace .tkd-status-chip.is-waiting-customer { border-color: color-mix(in srgb, var(--t-orange) 30%, var(--border)); color: var(--t-orange); background: color-mix(in srgb, var(--t-orange) 7%, var(--card)); }
.tkd-workspace .tkd-status-chip.is-resolved,
.tkd-workspace .tkd-status-chip.is-close { border-color: color-mix(in srgb, var(--t-green) 30%, var(--border)); color: var(--t-green); background: color-mix(in srgb, var(--t-green) 7%, var(--card)); }
.tkd-workspace .tkd-status-chip.is-vip,
.tkd-workspace .tkd-status-chip.is-discard { border-color: color-mix(in srgb, var(--t-red) 30%, var(--border)); color: var(--t-red); background: color-mix(in srgb, var(--t-red) 7%, var(--card)); }
.tkd-workspace .tkd-title,
.tkd-workspace .tkd-head-copy .tkd-title {
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: 'Hanken Grotesk', Inter, sans-serif;
  font-size: clamp(18px, 1.55vw, 22px);
  font-weight: 700;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkd-workspace .tkd-kicker,
.tkd-workspace .tkd-head .tkd-kicker {
  display: flex;
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.3;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 16px;
}
.tkd-workspace .tkd-kicker > span { display: inline-flex; align-items: center; gap: 5px; }
.tkd-workspace .tkd-kicker lucide-icon { font-size: 12px; color: var(--dim); }

/* Requestor and asset cards */
.tkd-workspace .tkd-person-row { display: flex; min-width: 0; align-items: center; gap: 7px; }
.tkd-workspace .tkd-person-main {
  display: flex;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.tkd-workspace .tkd-person-main:hover .tkd-contact-name { color: var(--accent); }
.tkd-workspace .tkd-avatar {
  display: inline-flex;
  width: 31px;
  height: 31px;
  min-width: 31px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10.5px;
  font-weight: 750;
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-avatar.is-ai { color: #9d75ef; background: color-mix(in srgb, #9d75ef 12%, var(--card)); border-color: color-mix(in srgb, #9d75ef 25%, transparent); }
.tkd-workspace .tkd-avatar.is-note { color: var(--t-orange); background: color-mix(in srgb, var(--t-orange) 9%, var(--card)); border-color: color-mix(in srgb, var(--t-orange) 25%, transparent); }
.tkd-workspace .tkd-contact-copy { display: block; min-width: 0; flex: 1; }
.tkd-workspace .tkd-contact-name { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; transition: color .14s ease; }
.tkd-workspace .tkd-contact-email { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.tkd-workspace .tkd-card-icon {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: var(--card-2);
  text-decoration: none;
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-card-icon:hover { color: var(--accent); }
.tkd-workspace .tkd-card-icon lucide-icon { font-size: 13px; }
.tkd-workspace .tkd-contact-lines { margin: 8px 0 0 40px; gap: 2px; }
.tkd-workspace .tkd-contact-line { font-size: 11px; }
.tkd-workspace .tkd-asset-link {
  display: flex;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.tkd-workspace .tkd-asset-icon {
  display: inline-flex;
  width: 31px;
  height: 31px;
  min-width: 31px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-asset-icon lucide-icon { font-size: 15px; }
.tkd-workspace .tkd-device-name { display: block; overflow: hidden; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tkd-workspace .tkd-link-arrow { display: inline-flex; margin-left: auto; color: var(--muted); align-items: center; }
.tkd-workspace .tkd-link-arrow lucide-icon { font-size: 12px; }
.tkd-workspace .tkd-asset-link:hover .tkd-link-arrow,
.tkd-workspace .tkd-asset-link:hover .tkd-device-name { color: var(--accent); }
.tkd-workspace .tkd-asset-os { margin: 8px 0 0 40px; color: var(--muted); font-size: 8.8px; }
.tkd-workspace .tkd-card-empty { display: flex; padding: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.4; align-items: center; gap: 7px; }
.tkd-workspace .tkd-card-empty lucide-icon { font-size: 14px; }
/* Live online/offline state of the ticket's device (Asset card). */
.tkd-workspace .tkd-device-status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.tkd-workspace .tkd-device-status.is-online { color: var(--green); }
.tkd-workspace .tkd-device-status.is-offline { color: var(--dim); }
.tkd-workspace .tkd-device-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.tkd-workspace .tkd-device-status.is-online .tkd-device-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }

/* Editable ticket properties */
.tkd-workspace .tkd-property-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.tkd-workspace .tkd-field,
.tkd-workspace .tkd-card .tkd-field { display: grid; width: 100%; min-width: 0; margin: 0; gap: 4px; }
.tkd-workspace .tkd-field-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.tkd-workspace .tkd-assign-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}
.tkd-workspace .tkd-assign-link:hover { text-decoration: underline; }
.tkd-workspace .tkd-label {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}
.tkd-workspace .tkd-select,
.tkd-workspace .tkd-card .tkd-select {
  display: block;
  width: 100% !important;
  min-width: 100%;
  max-width: 100%;
  height: 36px;
  padding: 0 27px 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  color: var(--text);
  background-color: var(--card-2);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.tkd-workspace .tkd-select:hover { border-color: var(--border-2); }
.tkd-workspace .tkd-select:focus { box-shadow: none; }
.tkd-workspace .tkd-card .cs { width: 100%; min-width: 0; }
.tkd-workspace .tkd-card .cs-trigger { min-height: 36px; border-radius: 6px; font-size: 12px; border-color: var(--border); }
.tkd-workspace .tkd-card .cs-value { font-size: 12px; }
.tkd-workspace .cs-value.cs-tone.is-waiting-customer,
.tkd-workspace .cs-value.cs-tone.is-waiting-external {
  color: var(--orange, #dd9040);
}
.tkd-workspace .tkd-select[class*="tkd-status-"],
.tkd-workspace .tkd-select[class*="tkd-priority-"] {
  border-color: var(--border);
  background-color: var(--card-2);
}
.tkd-workspace .tkd-select.tkd-status-open,
.tkd-workspace .tkd-select.tkd-status-in-progress { color: var(--text); }
.tkd-workspace .tkd-select.tkd-status-waiting-customer,
.tkd-workspace .tkd-select.tkd-status-waiting-external { color: var(--orange, #dd9040); }
.tkd-workspace .tkd-select.tkd-status-resolved,
.tkd-workspace .tkd-select.tkd-status-close { color: var(--green); }
.tkd-workspace .tkd-select.tkd-status-discard { color: var(--t-red); }
.tkd-workspace .tkd-select.tkd-priority-urgent { color: var(--t-red); }
.tkd-workspace .tkd-select.tkd-priority-high { color: var(--t-orange); }
.tkd-workspace .tkd-readonly {
  display: flex;
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--dim);
  background: color-mix(in srgb, var(--card-2) 70%, transparent);
  font-size: 12px;
  align-items: center;
  justify-content: space-between;
}
.tkd-workspace .tkd-readonly span { padding: 2px 5px; border-radius: 999px; color: var(--muted); background: var(--hover); font-size: 8.5px; font-weight: 700; text-transform: uppercase; }
.tkd-workspace .tkd-tags { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.tkd-workspace .tkd-tag,
.tkd-workspace .tkd-tag-add {
  display: inline-flex;
  min-height: 23px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--dim);
  background: var(--card-2);
  font-size: 10.5px;
  font-weight: 650;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.tkd-workspace .tkd-tag lucide-icon,
.tkd-workspace .tkd-tag-add lucide-icon { font-size: 9px; }
.tkd-workspace .tkd-tag:hover { border-color: color-mix(in srgb, var(--t-red) 35%, var(--border)); color: var(--t-red); }
.tkd-workspace .tkd-tag-add { border-style: dashed; color: var(--muted); background: transparent; }
.tkd-workspace .tkd-tag-add:hover { color: var(--accent); }

/* Automation and SLA cards */

.tkd-workspace .tkd-sla-row + .tkd-sla-row { margin-top: 11px; }
.tkd-workspace .tkd-sla-head { display: flex; margin-bottom: 5px; color: var(--dim); font-size: 8.5px; align-items: center; justify-content: space-between; gap: 7px; }
.tkd-workspace .tkd-sla-head strong { color: var(--t-blue); font-size: 7.8px; font-weight: 700; }
.tkd-workspace .tkd-sla-head strong.is-met { color: var(--t-green); }
.tkd-workspace .tkd-sla-head strong.is-warning { color: var(--t-orange); }
.tkd-workspace .tkd-sla-head strong.is-breached { color: var(--t-red); }
.tkd-workspace .tkd-sla-track { width: 100%; height: 4px; overflow: hidden; border-radius: 999px; background: var(--hover); }
.tkd-workspace .tkd-sla-track span { display: block; height: 100%; border-radius: inherit; background: var(--t-blue); }
.tkd-workspace .tkd-sla-track span.is-met { background: var(--t-green); }
.tkd-workspace .tkd-sla-track span.is-warning { background: var(--t-orange); }
.tkd-workspace .tkd-sla-track span.is-breached { background: var(--t-red); }

/* Main tabs */
.tkd-workspace .tkd-tabs {
  display: flex;
  height: 45px;
  min-height: 45px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  align-items: stretch;
  gap: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tkd-workspace .tkd-tabs::-webkit-scrollbar { display: none; }
.tkd-workspace .tkd-tab {
  position: relative;
  display: inline-flex;
  min-width: max-content;
  height: 45px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.tkd-workspace .tkd-tab::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tkd-workspace .tkd-tab:hover { color: var(--text); }
.tkd-workspace .tkd-tab.is-active { color: var(--text); }
.tkd-workspace .tkd-tab.is-active::after { background: var(--accent); }
.tkd-workspace .tkd-tab span { display: inline-flex; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; color: var(--muted); background: var(--hover); font-size: 7.5px; align-items: center; justify-content: center; }

/* Conversation */
.tkd-workspace .tkd-scroll {
  flex: 1;
  min-height: 0;
  padding: 20px 28px 28px;
  background: var(--card);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 18%, transparent) transparent;
}

@supports selector(::-webkit-scrollbar) {
  .tkd-workspace .tkd-scroll {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }

  .tkd-workspace .tkd-scroll::-webkit-scrollbar {
    display: block;
    width: 10px;
    height: 10px;
    background: transparent;
  }

  .tkd-workspace .tkd-scroll::-webkit-scrollbar-track,
  .tkd-workspace .tkd-scroll::-webkit-scrollbar-track-piece,
  .tkd-workspace .tkd-scroll::-webkit-scrollbar-corner {
    background: transparent;
  }

  .tkd-workspace .tkd-scroll::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    -webkit-appearance: none;
    background: transparent;
  }
}
.tkd-workspace .tkd-scroll .tkd-summary {
  display: grid;
  width: 100%;
  margin: 0 0 20px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, #9d75ef 28%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, #9d75ef 6%, var(--card));
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}
.tkd-workspace .tkd-summary-icon { display: inline-flex; width: 27px; height: 27px; border-radius: 7px; color: #9d75ef; background: color-mix(in srgb, #9d75ef 12%, transparent); align-items: center; justify-content: center; }
.tkd-workspace .tkd-summary-icon lucide-icon { font-size: 14px; }
.tkd-workspace .tkd-summary-copy { min-width: 0; }
.tkd-workspace .tkd-summary-head { display: flex; margin: 0 0 4px; align-items: center; justify-content: space-between; gap: 8px; }
.tkd-workspace .tkd-summary-title { color: #a982f3; font-size: 9.5px; font-weight: 750; letter-spacing: 0; text-transform: none; }
.tkd-workspace .tkd-summary-count { color: var(--muted); font-size: 8px; }
.tkd-workspace .tkd-summary p { max-width: none; margin: 0; color: var(--dim); font-size: 10px; line-height: 1.55; }
.tkd-workspace .tkd-summary-updated { display: block; margin-top: 6px; color: var(--muted); font-size: 7.8px; }
.tkd-workspace .tkd-chat-error { margin: 0 0 14px; font-size: 9.5px; }
.tkd-workspace .tkd-thread { width: 100%; }
.tkd-workspace .tkd-msg {
  position: relative;
  display: grid;
  width: 100%;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}
.tkd-workspace .tkd-msg:first-child { padding-top: 0; }
.tkd-workspace .tkd-msg-avatar { padding-top: 1px; }
.tkd-workspace .tkd-msg-content { min-width: 0; }
.tkd-workspace .tkd-msg-head { display: flex; min-height: 20px; margin: 0 0 5px; align-items: center; gap: 7px; }
.tkd-workspace .tkd-msg-who { color: var(--text); font-size: 10px; font-weight: 700; }
.tkd-workspace .tkd-msg-role {
  display: inline-flex;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  color: var(--t-green);
  background: color-mix(in srgb, var(--t-green) 10%, transparent);
  font-size: 7px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}
.tkd-workspace .tkd-msg-role.is-ai { color: #9d75ef; background: color-mix(in srgb, #9d75ef 11%, transparent); }
.tkd-workspace .tkd-msg-role.is-note { color: var(--t-orange); background: color-mix(in srgb, var(--t-orange) 10%, transparent); }
.tkd-workspace .tkd-msg-time { margin-left: auto; color: var(--muted); font-size: 7.8px; }
.tkd-workspace .tkd-bubble,
.tkd-workspace .tkd-bubble.is-ai,
.tkd-workspace .tkd-bubble.is-note {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--dim);
  background: transparent;
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tkd-workspace .tkd-msg.is-note { margin-top: 5px; padding-right: 10px; padding-left: 10px; border: 1px solid color-mix(in srgb, var(--t-orange) 22%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--t-orange) 4%, var(--card)); }
.tkd-workspace .tkd-msg.is-ai .tkd-bubble { color: color-mix(in srgb, var(--text) 82%, #9d75ef); }
.tkd-workspace .tkd-message-images { margin: 9px 0 0; grid-template-columns: repeat(auto-fit, minmax(150px, 230px)); }
.tkd-workspace .tkd-system {
  display: grid;
  width: 100%;
  min-height: 55px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-align: left;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.tkd-workspace .tkd-system-icon { display: inline-flex; width: 26px; height: 26px; border: 1px solid color-mix(in srgb, var(--t-green) 22%, var(--border)); border-radius: 50%; color: var(--t-green); background: color-mix(in srgb, var(--t-green) 8%, var(--card)); align-items: center; justify-content: center; }
.tkd-workspace .tkd-system-icon lucide-icon { font-size: 12px; }
.tkd-workspace .tkd-system-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.tkd-workspace .tkd-system-copy strong { color: var(--text); font-size: 9.5px; font-weight: 650; }
.tkd-workspace .tkd-system-copy span { display: block; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 8px; }
.tkd-workspace .tkd-system time { color: var(--muted); font-size: 7.8px; }
.tkd-workspace .tkd-thread-loading { display: flex; min-height: 72px; align-items: center; justify-content: center; }

/* Composer */
.tkd-workspace .tkd-composer {
  flex: 0 0 auto;
  padding: 10px 28px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.tkd-workspace .tkd-compose-modes { display: flex; margin: 0 0 7px; gap: 14px; }
.tkd-workspace .tkd-mode { position: relative; padding: 3px 0 6px; border: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 9.5px; font-weight: 650; cursor: pointer; }
.tkd-workspace .tkd-mode::after { content: ''; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: transparent; }
.tkd-workspace .tkd-mode.is-active { color: var(--text); background: transparent; }
.tkd-workspace .tkd-mode.is-active::after { background: var(--accent); }
.tkd-workspace .tkd-compose-box { overflow: hidden; border: 1px solid var(--border-2); border-radius: 8px; background: var(--card-2); box-shadow: 0 1px 2px rgba(0, 0, 0, .025); }
.tkd-workspace .tkd-compose-box:focus-within { box-shadow: none; }
.tkd-workspace .tkd-compose-box.is-note { border-color: color-mix(in srgb, var(--t-orange) 30%, var(--border)); background: color-mix(in srgb, var(--t-orange) 3%, var(--card-2)); }
.tkd-workspace .tkd-compose-box textarea { display: block; width: 100%; min-height: 58px; max-height: 180px; padding: 10px 12px 6px; border: 0; outline: 0; resize: none; color: var(--text); background: transparent; font: inherit; font-size: 10px; line-height: 1.5; }
.tkd-workspace .tkd-compose-box textarea::placeholder { color: var(--muted); }
.tkd-workspace .tkd-compose-foot { display: flex; min-height: 35px; padding: 4px 7px 7px 12px; align-items: center; justify-content: space-between; gap: 10px; }
.tkd-workspace .tkd-compose-hint { display: inline-flex; color: var(--muted); font-size: 7.8px; align-items: center; gap: 4px; }
.tkd-workspace .tkd-compose-hint lucide-icon { font-size: 10px; }
.tkd-workspace .tkd-send { display: inline-flex; height: 29px; padding: 0 11px; border: 0; border-radius: 6px; color: var(--on-accent); background: var(--accent-deep); font-size: 9px; font-weight: 700; align-items: center; gap: 6px; cursor: pointer; }
.tkd-workspace .tkd-send lucide-icon { font-size: 11px; }
.tkd-workspace .tkd-send:hover:not(:disabled) { background: var(--accent); }
.tkd-workspace .tkd-send:disabled { opacity: .58; cursor: wait; }

/* Details, resources, history, and capture */
.tkd-workspace .tkd-section-stack { display: grid; width: min(820px, 100%); gap: 14px; }
.tkd-workspace .tkd-content-card { padding: 16px; border: 1px solid var(--border); border-radius: 9px; background: var(--card-2); }
.tkd-workspace .tkd-content-card-head { display: flex; margin-bottom: 11px; color: var(--dim); align-items: center; gap: 7px; }
.tkd-workspace .tkd-content-card-head lucide-icon { color: var(--accent); font-size: 14px; }
.tkd-workspace .tkd-content-card-head h3 { margin: 0; color: var(--text); font-size: 10.5px; font-weight: 700; }
.tkd-workspace .tkd-description { margin: 0; color: var(--dim); font-size: 10px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.tkd-workspace .tkd-description + .tkd-description { margin-top: 8px; }
.tkd-workspace .tkd-facts { display: grid; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.tkd-workspace .tkd-facts > div { display: grid; min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--border); grid-template-columns: 100px minmax(0, 1fr); gap: 12px; }
.tkd-workspace .tkd-facts dt { color: var(--muted); font-size: 8.5px; }
.tkd-workspace .tkd-facts dd { margin: 0; color: var(--dim); font-size: 9px; overflow-wrap: anywhere; }
.tkd-workspace .tkd-resource-list { display: grid; gap: 7px; }
.tkd-workspace .tkd-resource {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  background: var(--card);
  text-align: left;
  text-decoration: none;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.tkd-workspace .tkd-resource:hover:not(.is-static) { background: var(--hover); }
.tkd-workspace .tkd-resource.is-static { cursor: default; }
.tkd-workspace .tkd-resource-icon { display: inline-flex; width: 29px; height: 29px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); align-items: center; justify-content: center; }
.tkd-workspace .tkd-resource-icon lucide-icon { font-size: 13px; }
.tkd-workspace .tkd-resource > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.tkd-workspace .tkd-resource strong { overflow: hidden; color: var(--text); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.tkd-workspace .tkd-resource small { color: var(--muted); font-size: 8px; }
.tkd-workspace .tkd-resource > lucide-icon { color: var(--muted); font-size: 12px; }
.tkd-workspace .tkd-empty { padding: 28px 16px; color: var(--muted); font-size: 9.5px; text-align: center; }
.tkd-workspace .tkd-timeline { max-width: 760px; }
.tkd-workspace .tkd-event-title { font-size: 10px; }
.tkd-workspace .tkd-event-copy { font-size: 9px; }
.tkd-workspace .tkd-event-time { font-size: 8px; }

/* Error state */
.tkd-workspace .tkd-error { display: flex; max-width: 390px; padding: 34px; flex-direction: column; align-items: center; }
.tkd-workspace .tkd-error-icon { display: inline-flex; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 50%; color: var(--t-red); background: color-mix(in srgb, var(--t-red) 10%, transparent); align-items: center; justify-content: center; }
.tkd-workspace .tkd-error-icon lucide-icon { font-size: 19px; }

@media (max-width: 1050px) {
  .tkd-workspace .tkd-layout,
  .tkd-workspace .tkd-loading-workspace { grid-template-columns: 268px minmax(0, 1fr); }
  .tkd-workspace .tkd-side { padding: 8px; gap: 8px; }
  .tkd-workspace .tkd-side > .tkd-card,
  .tkd-workspace .tkd-side > .tkd-card:last-child { padding: 11px; }
  .tkd-workspace .tkd-head { padding-right: 22px; padding-left: 22px; }
  .tkd-workspace .tkd-tabs { padding: 0 22px; gap: 18px; }
  .tkd-workspace .tkd-scroll,
  .tkd-workspace .tkd-composer { padding-right: 22px; padding-left: 22px; }
}
@media (max-width: 820px) {
  .tkd-workspace .tkd-layout,
  .tkd-workspace .tkd-loading-workspace { display: flex; flex-direction: column; overflow: hidden; }
  .tkd-workspace .tkd-side,
  .tkd-workspace .tkd-loading-side {
    display: flex;
    width: 100%;
    max-height: 34%;
    flex: 0 0 34%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-y: auto;
  }
  .tkd-workspace .tkd-main,
  .tkd-workspace .tkd-loading-main { min-height: 0; flex: 1; }
}
@media (max-width: 620px) {
  .tkd-workspace .tkd-head { padding: 13px 15px 12px; }
  .tkd-workspace .tkd-title { font-size: 17px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .tkd-workspace .tkd-kicker { gap: 5px 10px; }
  .tkd-workspace .tkd-tabs { padding: 0 15px; gap: 17px; }
  .tkd-workspace .tkd-scroll { padding: 16px 15px 22px; }
  .tkd-workspace .tkd-composer { padding: 9px 15px 12px; }
  .tkd-workspace .tkd-summary-count { display: none; }
  .tkd-workspace .tkd-msg-time { width: 100%; margin: 1px 0 0; }
  .tkd-workspace .tkd-msg-head { flex-wrap: wrap; }
  .tkd-workspace .tkd-system { grid-template-columns: 30px minmax(0, 1fr); }
  .tkd-workspace .tkd-system time { grid-column: 2; }
  .tkd-workspace .tkd-compose-hint { max-width: 52%; }
  .tkd-workspace .tkd-facts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tkd-workspace .tkd-loading-card i,
  .tkd-workspace .tkd-loading-card b,
  .tkd-workspace .tkd-loading-card span,
  .tkd-workspace .tkd-loading-head i,
  .tkd-workspace .tkd-loading-head b,
  .tkd-workspace .tkd-loading-head span,
  .tkd-workspace .tkd-loading-tabs i { animation: none; }
}

/* Validation fixes: canceled SLA state and usable short-landscape workspace. */
.tkd-workspace .tkd-sla-head strong.is-canceled { color: var(--muted); }
.tkd-workspace .tkd-sla-track span.is-canceled { background: var(--muted); }

@media (max-width: 820px) and (max-height: 520px) {
  .tkd-workspace .tkd-layout,
  .tkd-workspace .tkd-loading-workspace {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    overflow: hidden;
  }
  .tkd-workspace .tkd-side,
  .tkd-workspace .tkd-loading-side {
    display: flex;
    width: auto;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: 7px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    flex: none;
    gap: 7px;
    overflow-y: auto;
  }
  .tkd-workspace .tkd-side > .tkd-card,
  .tkd-workspace .tkd-side > .tkd-card:last-child { padding: 9px; }
  .tkd-workspace .tkd-main,
  .tkd-workspace .tkd-loading-main { height: 100%; min-height: 0; }
  .tkd-workspace .tkd-head {
    padding: 7px 14px;
    gap: 4px;
  }
  .tkd-workspace .tkd-status-chip { min-height: 22px; }
  .tkd-workspace .tkd-title {
    display: block;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tkd-workspace .tkd-kicker { gap: 4px 9px; }
  .tkd-workspace .tkd-kicker > .tkd-kicker-category,
  .tkd-workspace .tkd-kicker > .tkd-kicker-created { display: none; }
  .tkd-workspace .tkd-tabs {
    height: 35px;
    min-height: 35px;
    padding: 0 14px;
    gap: 15px;
  }
  .tkd-workspace .tkd-tab { height: 35px; font-size: 9px; }
  .tkd-workspace .tkd-scroll { padding: 9px 14px 12px; }
  .tkd-workspace .tkd-scroll .tkd-summary { margin-bottom: 10px; padding: 8px 10px; }
  .tkd-workspace .tkd-summary-updated { display: none; }
  .tkd-workspace .tkd-msg { padding: 8px 0; }
  .tkd-workspace .tkd-composer { padding: 4px 14px 6px; }
  .tkd-workspace .tkd-compose-modes { margin-bottom: 3px; }
  .tkd-workspace .tkd-mode { padding-bottom: 4px; }
  .tkd-workspace .tkd-compose-box textarea {
    min-height: 32px;
    max-height: 52px;
    padding: 6px 9px 2px;
  }
  .tkd-workspace .tkd-compose-foot { min-height: 27px; padding: 2px 5px 4px 9px; }
  .tkd-workspace .tkd-send { height: 25px; }
}

/* Encapsulate the complete ticket conversation workspace like the property cards. */
.tkd-workspace .tkd-main,
.tkd-workspace .tkd-loading-main {
  margin: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}

@media (max-width: 1050px) {
  .tkd-workspace .tkd-main,
  .tkd-workspace .tkd-loading-main { margin: 8px; }
}

@media (max-width: 820px) and (max-height: 520px) {
  .tkd-workspace .tkd-main,
  .tkd-workspace .tkd-loading-main {
    height: auto;
    margin: 7px;
  }
}

/* Avoid a doubled gutter and divider between ticket properties and content. */
.tkd-workspace .tkd-side,
.tkd-workspace .tkd-loading-side {
  padding-right: 0;
  padding-left: 0;
  border: 0;
}

/* Ticket conversation refresh. The summary card above it is intentionally unchanged. */
.tkd-workspace .tkd-thread {
  display: flex;
  width: min(900px, 100%);
  margin: 0 auto;
  flex-direction: column;
  gap: 4px;
}
.tkd-workspace .tkd-msg {
  position: relative;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 8px 0;
  border: 0;
  align-items: flex-end;
  gap: 10px;
}
.tkd-workspace .tkd-msg:first-child { padding-top: 0; }
.tkd-workspace .tkd-msg-avatar { flex: 0 0 auto; padding: 0 0 3px; }
.tkd-workspace .tkd-msg .tkd-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 9px;
}
.tkd-workspace .tkd-msg-content {
  display: flex;
  width: fit-content;
  max-width: min(72ch, calc(100% - 42px));
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}
.tkd-workspace .tkd-msg-head {
  display: flex;
  width: 100%;
  min-height: 0;
  margin: 0 0 5px;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}
.tkd-workspace .tkd-msg-who { color: var(--text); font-size: 10.5px; font-weight: 700; }
.tkd-workspace .tkd-msg-role {
  display: inline-flex;
  padding: 2px 6px;
  border: 0;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.tkd-workspace .tkd-msg-role.is-requester {
  color: var(--t-green);
  background: color-mix(in srgb, var(--t-green) 10%, transparent);
}
.tkd-workspace .tkd-msg-role.is-agent {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.tkd-workspace .tkd-msg-role.is-ai {
  color: #9d75ef;
  background: color-mix(in srgb, #9d75ef 11%, transparent);
}
.tkd-workspace .tkd-msg-role.is-note {
  color: var(--t-orange);
  background: color-mix(in srgb, var(--t-orange) 10%, transparent);
}
.tkd-workspace .tkd-msg-time {
  width: auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  white-space: nowrap;
}
.tkd-workspace .tkd-bubble,
.tkd-workspace .tkd-bubble.is-ai,
.tkd-workspace .tkd-bubble.is-note {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px 13px 13px 4px;
  color: var(--text);
  background: var(--card-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .035);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tkd-workspace .tkd-msg.is-agent,
.tkd-workspace .tkd-msg.is-ai { flex-direction: row-reverse; }
.tkd-workspace .tkd-msg.is-agent .tkd-msg-content,
.tkd-workspace .tkd-msg.is-ai .tkd-msg-content { align-items: flex-end; }
.tkd-workspace .tkd-msg.is-agent .tkd-msg-head,
.tkd-workspace .tkd-msg.is-ai .tkd-msg-head { justify-content: flex-end; }
.tkd-workspace .tkd-msg.is-agent .tkd-bubble {
  border-color: var(--accent-line);
  border-radius: 13px 13px 4px 13px;
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
}
.tkd-workspace .tkd-msg.is-ai .tkd-bubble {
  border-color: color-mix(in srgb, #9d75ef 28%, var(--border));
  border-radius: 13px 13px 4px 13px;
  color: var(--text);
  background: color-mix(in srgb, #9d75ef 7%, var(--card));
}
.tkd-workspace .tkd-msg.is-agent .tkd-avatar {
  color: var(--accent);
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 11%, var(--card));
}
.tkd-workspace .tkd-msg.is-note {
  display: block;
  margin: 7px 0;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--t-orange) 28%, var(--border));
  border-left: 3px solid var(--t-orange);
  border-radius: 10px;
  background: color-mix(in srgb, var(--t-orange) 5%, var(--card));
}
.tkd-workspace .tkd-msg.is-note .tkd-msg-avatar { display: none; }
.tkd-workspace .tkd-msg.is-note .tkd-msg-content { width: 100%; max-width: none; align-items: stretch; }
.tkd-workspace .tkd-msg.is-note .tkd-bubble {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.tkd-workspace .tkd-message-images {
  width: 100%;
  margin: 8px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 230px));
}
.tkd-workspace .tkd-message-images img { border-radius: 10px; }

/* System activity is a quiet divider, not another message bubble. */
.tkd-workspace .tkd-system {
  display: flex;
  width: min(760px, 100%);
  min-height: 0;
  margin: 5px auto;
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.tkd-workspace .tkd-system::before,
.tkd-workspace .tkd-system::after {
  content: '';
  height: 1px;
  max-width: 110px;
  flex: 1;
  background: var(--border);
}
.tkd-workspace .tkd-system > .tkd-system-icon,
.tkd-workspace .tkd-system > .tkd-system-copy {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
}
.tkd-workspace .tkd-system > .tkd-system-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--card-2);
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-system-icon lucide-icon { font-size: 10px; }
.tkd-workspace .tkd-system > .tkd-system-copy {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}
.tkd-workspace .tkd-system-copy strong { color: var(--dim); font-size: 8.8px; font-weight: 650; }
.tkd-workspace .tkd-system-copy span {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 8px;
}
.tkd-workspace .tkd-system-copy span::before { content: '·'; margin-right: 5px; }
.tkd-workspace .tkd-system time {
  flex: none;
  grid-column: auto;
  color: var(--muted);
  font-size: 7.8px;
  white-space: nowrap;
}

/* Composer aligns with the transcript and uses a clear segmented mode control. */
.tkd-workspace .tkd-composer {
  flex: 0 0 auto;
  padding: 12px 28px 16px;
  border-top: 1px solid transparent;
  background: transparent;
}
.tkd-workspace .tkd-compose-inner { width: min(900px, 100%); margin: 0 auto; }
.tkd-workspace .tkd-compose-modes {
  display: inline-flex;
  width: max-content;
  margin: 0 0 8px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  align-items: center;
  gap: 3px;
}
.tkd-workspace .tkd-mode {
  position: relative;
  display: inline-flex;
  min-height: 29px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 650;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.tkd-workspace .tkd-mode lucide-icon { font-size: 11px; }
.tkd-workspace .tkd-mode::after { display: none; }
.tkd-workspace .tkd-mode:hover { color: var(--text); }
.tkd-workspace .tkd-mode.is-active {
  color: var(--text);
  background: var(--well-hi);
  box-shadow: var(--shadow-xs);
}
.tkd-workspace .tkd-compose-box {
  overflow: hidden;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--card-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.tkd-workspace .tkd-compose-box:focus-within {
  box-shadow: none;
}
.tkd-workspace .tkd-compose-box.is-note {
  border-color: color-mix(in srgb, var(--t-orange) 30%, var(--border));
  background: color-mix(in srgb, var(--t-orange) 4%, var(--card-2));
}
.tkd-workspace .tkd-compose-box.is-note:focus-within {
  border-color: var(--t-orange);
  box-shadow: none;
}
.tkd-workspace .tkd-compose-box textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-height: 180px;
  padding: 12px 13px 7px;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
}
.tkd-workspace .tkd-compose-box textarea::placeholder { color: var(--muted); }
.tkd-workspace .tkd-compose-foot {
  display: flex;
  min-height: 41px;
  padding: 5px 7px 7px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tkd-workspace .tkd-compose-hint {
  display: inline-flex;
  max-width: none;
  min-width: 0;
  color: var(--muted);
  font-size: 8.3px;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
}
.tkd-workspace .tkd-compose-visibility { display: inline-flex; align-items: center; gap: 4px; }
.tkd-workspace .tkd-compose-hint lucide-icon { font-size: 10px; }
.tkd-workspace .tkd-compose-shortcut { color: color-mix(in srgb, var(--muted) 82%, transparent); }
.tkd-workspace .tkd-send {
  display: inline-flex;
  min-width: 90px;
  height: 34px;
  flex: none;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--accent-deep);
  font-size: 9.5px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.tkd-workspace .tkd-send lucide-icon { font-size: 11px; }
.tkd-workspace .tkd-send:hover:not(:disabled) { background: var(--accent); }
.tkd-workspace .tkd-send:disabled { opacity: .58; cursor: wait; }

@media (max-width: 1050px) {
  .tkd-workspace .tkd-composer { padding-right: 22px; padding-left: 22px; }
}
@media (max-width: 620px) {
  .tkd-workspace .tkd-msg { padding: 7px 0; gap: 8px; }
  .tkd-workspace .tkd-msg .tkd-avatar { width: 28px; height: 28px; min-width: 28px; }
  .tkd-workspace .tkd-msg-content { max-width: calc(100% - 36px); }
  .tkd-workspace .tkd-msg-head { flex-wrap: wrap; }
  .tkd-workspace .tkd-msg-time { width: auto; margin-left: auto; }
  .tkd-workspace .tkd-bubble,
  .tkd-workspace .tkd-bubble.is-ai,
  .tkd-workspace .tkd-bubble.is-note { padding: 9px 11px; font-size: 10.5px; }
  .tkd-workspace .tkd-msg.is-note .tkd-bubble { padding: 0; }
  .tkd-workspace .tkd-system { gap: 5px; }
  .tkd-workspace .tkd-system::before,
  .tkd-workspace .tkd-system::after { max-width: 42px; }
  .tkd-workspace .tkd-system > .tkd-system-copy { flex-direction: column; align-items: flex-start; gap: 1px; }
  .tkd-workspace .tkd-system-copy span::before { display: none; }
  .tkd-workspace .tkd-system time { grid-column: auto; }
  .tkd-workspace .tkd-composer { padding: 10px 15px 12px; }
  .tkd-workspace .tkd-mode { min-height: 28px; padding: 0 9px; }
  .tkd-workspace .tkd-compose-box textarea { min-height: 58px; padding: 10px 11px 6px; }
  .tkd-workspace .tkd-compose-foot { min-height: 39px; padding-left: 11px; }
  .tkd-workspace .tkd-compose-hint { max-width: none; }
  .tkd-workspace .tkd-compose-shortcut { display: none; }
  .tkd-workspace .tkd-send { min-width: 82px; height: 34px; }
}
@media (max-width: 820px) and (max-height: 520px) {
  .tkd-workspace .tkd-msg { padding: 5px 0; }
  .tkd-workspace .tkd-bubble,
  .tkd-workspace .tkd-bubble.is-ai,
  .tkd-workspace .tkd-bubble.is-note { padding: 7px 10px; font-size: 10px; }
  .tkd-workspace .tkd-msg.is-note .tkd-bubble { padding: 0; }
  .tkd-workspace .tkd-system { margin: 2px auto; padding: 4px 0; }
  .tkd-workspace .tkd-composer { padding: 4px 14px 6px; }
  .tkd-workspace .tkd-compose-modes { margin-bottom: 4px; padding: 2px; }
  .tkd-workspace .tkd-mode { min-height: 24px; padding: 0 8px; }
  .tkd-workspace .tkd-compose-box textarea { min-height: 38px; max-height: 64px; padding: 6px 9px 3px; }
  .tkd-workspace .tkd-compose-foot { min-height: 31px; padding: 2px 5px 4px 9px; }
  .tkd-workspace .tkd-send { min-width: 78px; height: 30px; }
}

/* Ticket metadata readability and full-width User/Asset content rows. */
.tkd-workspace .tkd-requestor-card,
.tkd-workspace .tkd-asset-card { position: relative; }
.tkd-workspace .tkd-requestor-card > .tkd-card-title,
.tkd-workspace .tkd-asset-card > .tkd-card-title { padding-inline-end: 36px; }
.tkd-workspace .tkd-corner-action {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-end: 9px;
  z-index: 2;
  margin: 0;
}
.tkd-workspace .tkd-mail-action {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  color: var(--dim);
  background: transparent;
}
.tkd-workspace .tkd-mail-action:hover {
  border: 0;
  color: var(--accent);
  background: transparent;
}
.tkd-workspace .tkd-mail-action lucide-icon { font-size: 15px; }
.tkd-workspace .tkd-asset-action {
  display: inline-flex;
  width: 28px;
  height: 28px;
  margin: 0;
  color: var(--dim);
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-asset-action lucide-icon { font-size: 14px; }
.tkd-workspace .tkd-mail-action:focus-visible,
.tkd-workspace .tkd-person-main:focus-visible,
.tkd-workspace .tkd-asset-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tkd-workspace .tkd-person-main:focus-visible,
.tkd-workspace .tkd-asset-link:focus-visible { border-radius: 6px; }
.tkd-workspace .tkd-asset-link:focus-visible .tkd-asset-action { color: var(--accent); }

/* Muted information must stay secondary without becoming unreadable. */
.tkd-workspace .tkd-kicker,
.tkd-workspace .tkd-head .tkd-kicker {
  color: var(--dim);
  font-size: 10.5px;
  line-height: 1.4;
}
.tkd-workspace .tkd-kicker lucide-icon { font-size: 13px; }
.tkd-workspace .tkd-contact-name { font-size: 13.5px; }
.tkd-workspace .tkd-contact-email,
.tkd-workspace .tkd-asset-os {
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.45;
}
.tkd-workspace .tkd-device-name { font-size: 12.5px; }
.tkd-workspace .tkd-asset-os {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tkd-workspace .tkd-contact-line { font-size: 11.5px; }
.tkd-workspace .tkd-card-empty { color: var(--dim); font-size: 11.5px; }
.tkd-workspace .tkd-card-title > span {
  color: var(--dim);
  font-size: 10.5px;
}
.tkd-workspace .tkd-label {
  color: var(--dim);
  font-size: 11px;
}
.tkd-workspace .tkd-select,
.tkd-workspace .tkd-card .tkd-select,
.tkd-workspace .tkd-card .cs-trigger,
.tkd-workspace .tkd-card .cs-value { font-size: 12.5px; }
.tkd-workspace .tkd-readonly { font-size: 12.5px; }
.tkd-workspace .tkd-readonly span { font-size: 9.5px; }
.tkd-workspace .tkd-tag,
.tkd-workspace .tkd-tag-add { font-size: 10.5px; }

.tkd-workspace .tkd-sla-head {
  font-size: 9.5px;
  line-height: 1.35;
}
.tkd-workspace .tkd-sla-head strong {
  min-width: 0;
  max-width: 60%;
  font-size: 9px;
  line-height: 1.25;
  text-align: right;
}
.tkd-workspace .tkd-tab { font-size: 10.5px; }
.tkd-workspace .tkd-tab span { font-size: 8.5px; }
.tkd-workspace .tkd-summary-count,
.tkd-workspace .tkd-summary-updated { font-size: 9px; }
.tkd-workspace .tkd-msg-role { font-size: 8.5px; }
.tkd-workspace .tkd-msg-time { font-size: 9px; }
.tkd-workspace .tkd-system-copy strong { font-size: 9.5px; }
.tkd-workspace .tkd-system-copy span,
.tkd-workspace .tkd-system time { font-size: 9px; }
.tkd-workspace .tkd-compose-hint { font-size: 9px; }
.tkd-workspace .tkd-facts dt {
  color: var(--dim);
  font-size: 9.5px;
}
.tkd-workspace .tkd-facts dd { font-size: 10.5px; }

/* Keep the reply editor border neutral in both message modes and focus states. */
.tkd-workspace .tkd-compose-box,
.tkd-workspace .tkd-compose-box:focus-within,
.tkd-workspace .tkd-compose-box.is-note,
.tkd-workspace .tkd-compose-box.is-note:focus-within {
  border-color: var(--border-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

/* ============================================================
   Fleet commercial management — companies, bookings and rates
   ============================================================ */
.fc-device-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(440px, 1.35fr);
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
}
.fc-summary-card,
.fc-bookings-card,
.fc-device-status { grid-column: 1 / -1; }
.fc-loading-card { max-width: 1440px; margin: 0 auto; }
.fc-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fc-kpis > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 17px 18px;
  border-right: 1px solid var(--hairline);
}
.fc-kpis > div:last-child { border-right: 0; }
.fc-kpis span,
.fc-modal-kpis small { color: var(--muted); font-size: 9.5px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.fc-kpis strong { color: var(--text); font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.fc-kpis small { color: var(--muted); font-size: 9.5px; }

.fc-company-form,
.fc-charge-form {
  display: grid;
  align-items: end;
  gap: 10px;
  padding: 14px;
}
.fc-company-form { grid-template-columns: minmax(150px, 1fr) minmax(140px, .7fr) auto; }
.fc-charge-form { grid-template-columns: minmax(180px, 1.35fr) 90px minmax(145px, .8fr) minmax(145px, .8fr) auto; }
.fc-company-form label,
.fc-charge-form label,
.fc-plan-form label,
.fc-inline-plan-form label,
.fc-modal-toolbar label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}
.fc-company-form label > span,
.fc-charge-form label > span,
.fc-plan-form label > span,
.fc-inline-plan-form label > span,
.fc-modal-toolbar label > span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.fc-company-form .admin-input,
.fc-company-form .admin-select,
.fc-company-form .admin-btn,
.fc-charge-form .admin-input,
.fc-charge-form .admin-select,
.fc-charge-form .admin-btn,
.fc-plan-form .admin-input,
.fc-plan-form .admin-select,
.fc-inline-plan-form .admin-input,
.fc-inline-plan-form .admin-select { width: 100%; min-width: 0; height: 34px; }
.fc-field-wide { min-width: 0; }
.fc-charge-form [data-valid-to-field].is-disabled { opacity: .42; }
.fc-inline-note {
  padding: 0 14px 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.fc-charge-list { padding: 0 14px 5px; }
.fc-charge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.fc-charge-row:last-child { border-bottom: 0; }
.fc-charge-main { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.fc-charge-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fc-charge-main strong { overflow: hidden; color: var(--text); font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.fc-charge-main > span { color: var(--dim); font-size: 10.5px; }
.fc-charge-main small { color: var(--muted); font-size: 9.5px; }
.fc-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--well-hi);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.fc-chip-active { color: var(--live); background: var(--live-soft); }
.fc-chip-upcoming { color: var(--accent-deep); background: var(--accent-soft); }
.fc-chip-void { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.fc-charge-value { display: flex; min-width: 130px; flex-direction: column; align-items: flex-end; gap: 7px; }
.fc-charge-value > strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.fc-charge-value > strong small,
.fc-plan-value > strong small { margin-left: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.fc-charge-actions,
.fc-plan-value > span { display: flex; gap: 9px; }
.fc-text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
}
.fc-text-btn:hover { text-decoration: underline; }
.fc-text-btn-danger { color: var(--red); }
.fc-device-status,
.fc-modal-status { min-height: 18px; color: var(--live); font-size: 10.5px; }
.fc-charge-add-card .fc-device-status { padding: 0 14px 12px; }
.fc-device-status.is-error,
.fc-modal-status.is-error { color: var(--red); }

.fd-history-more {
  display: flex;
  justify-content: center;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--hairline);
}
.ev-dot-commercial { background: #8c6bd8; box-shadow: 0 0 8px color-mix(in srgb, #8c6bd8 55%, transparent); }
.ev-commercial { color: #9b7de5; background: color-mix(in srgb, #9b7de5 11%, transparent); }

.fc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
}
.fc-modal {
  display: flex;
  width: min(1180px, 100%);
  max-height: min(880px, calc(100vh - 36px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .52);
}
.fc-modal-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.fc-modal-head h2 { margin: 0; color: var(--text); font-size: 16px; font-weight: 700; }
.fc-modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.fc-modal-body { min-height: 240px; overflow: auto; padding: 14px; }
.fc-modal-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.fc-modal-toolbar input { height: 34px; }
.fc-modal-kpis { display: flex; align-items: center; gap: 25px; }
.fc-modal-kpis > span { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fc-modal-kpis strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.fc-modal-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 12px;
}
.fc-modal-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.fc-modal-section-wide { grid-column: 1 / -1; }
.fc-modal-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card-2);
}
.fc-modal-section h3 { margin: 0; color: var(--text); font-size: 12.5px; font-weight: 700; }
.fc-modal-section header p { margin: 2px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.fc-company-chips { display: flex; min-height: 45px; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.fc-company-chips span {
  align-self: flex-start;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--well);
  color: var(--dim);
  font-size: 9.5px;
}
.fc-company-chips small { color: var(--muted); font-size: 10.5px; }
.fc-company-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--hairline);
}
.fc-report-list { max-height: 290px; overflow: auto; }
.fc-report-company { border-bottom: 1px solid var(--hairline); }
.fc-report-company:last-child { border-bottom: 0; }
.fc-report-company > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}
.fc-report-company > summary::-webkit-details-marker { display: none; }
.fc-report-company > summary > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.fc-report-company > summary > span:last-child { align-items: flex-end; }
.fc-report-company summary strong { color: var(--text); font-size: 11px; }
.fc-report-company summary small { color: var(--muted); font-size: 9.5px; }
.fc-report-lines { padding: 0 14px 8px 28px; background: var(--well); }
.fc-report-lines > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.fc-report-lines > div:last-child { border-bottom: 0; }
.fc-report-lines span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.fc-report-lines strong { color: var(--dim); font-size: 10px; }
.fc-report-lines small { color: var(--muted); font-size: 9px; }
.fc-catalogue-layout { display: grid; grid-template-columns: minmax(290px, .75fr) minmax(360px, 1.25fr); min-height: 260px; }
.fc-plan-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: var(--well);
}
.fc-plan-form > label:first-of-type,
.fc-plan-form .fc-field-wide,
.fc-plan-form-actions { grid-column: 1 / -1; }
.fc-plan-form-actions { display: flex; gap: 8px; }
.fc-plan-list { max-height: 350px; overflow: auto; padding: 0 14px; }
.fc-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 62px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.fc-plan-row:last-child { border-bottom: 0; }
.fc-plan-row.is-inactive { opacity: .5; }
.fc-plan-row > div:first-child { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.fc-plan-row > div:first-child strong { color: var(--text); font-size: 11px; }
.fc-plan-row > div:first-child span { overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.fc-plan-value { display: flex; min-width: 115px; flex-direction: column; align-items: flex-end; gap: 6px; }
.fc-plan-value > strong { color: var(--text); font-size: 12px; }
.fc-modal-status { padding: 10px 2px 0; }

/* ── Inline rate-plan catalogue (on the Bookings tab) ────────── */
.fc-rate-plan-toggle {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.fc-rate-plan-toggle:hover,
.fc-rate-plan-toggle.is-active { background: var(--well); color: var(--text); border-color: var(--border-2); }
.fc-rate-plan-toggle lucide-icon { font-size: 15px; --icon-stroke: 1.97; }
.fc-inline-catalogue-card { grid-column: 1 / -1; }
.fc-inline-catalogue { display: grid; grid-template-columns: minmax(290px, .75fr) minmax(360px, 1.25fr); min-height: 180px; }
.fc-inline-plan-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border-right: 1px solid var(--border);
  background: var(--card);
}
.fc-inline-plan-form > label:first-of-type,
.fc-inline-plan-form .fc-field-wide,
.fc-inline-plan-form-actions { grid-column: 1 / -1; }
.fc-inline-plan-form-actions { display: flex; gap: 8px; }
.fc-inline-plan-list { max-height: 350px; overflow: auto; padding: 0 14px; }

@media (max-width: 1050px) {
  .fc-device-grid,
  .fc-modal-columns { grid-template-columns: 1fr; }
  .fc-summary-card,
  .fc-bookings-card,
  .fc-inline-catalogue-card,
  .fc-device-status,
  .fc-modal-section-wide { grid-column: auto; }
  .fc-charge-form { grid-template-columns: 1fr 1fr; }
  .fc-charge-form .fc-field-wide { grid-column: 1 / -1; }
  .fc-charge-form button[type="submit"] { justify-self: start; }
  .fc-modal-section:first-child { order: 2; }
  .fc-modal-section:nth-child(2) { order: 1; }
  .fc-modal-section-wide { order: 3; }
}
@media (max-width: 720px) {
  .fc-modal-overlay { padding: 0; }
  .fc-modal { width: 100%; max-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
  .fc-modal-toolbar { align-items: stretch; flex-direction: column; }
  .fc-modal-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .fc-modal-kpis > span { align-items: flex-start; }
  .fc-catalogue-layout { grid-template-columns: 1fr; }
  .fc-inline-catalogue { grid-template-columns: 1fr; }
  .fc-inline-plan-form { border-right: 0; border-bottom: 1px solid var(--border); }
  .fc-plan-form { border-right: 0; border-bottom: 1px solid var(--border); }
  .fc-company-form,
  .fc-charge-form { grid-template-columns: 1fr; }
  .fc-charge-form .fc-field-wide { grid-column: auto; }
  .fc-kpis { grid-template-columns: 1fr; }
  .fc-kpis > div { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .fc-kpis > div:last-child { border-bottom: 0; }
  .fc-charge-row { grid-template-columns: 1fr; gap: 8px; }
  .fc-charge-value { min-width: 0; align-items: flex-start; }
}

/* ============================================================
   Global control contract: buttons never cast a glow

   This is deliberately final and !important. ui.css loads before a few
   theme/component sheets, and those used to reintroduce emerald focus and
   hover shadows after the base button rules had removed them.
   ============================================================ */
:where(
  button,
  input[type="button" i],
  input[type="submit" i],
  input[type="reset" i],
  [role="button"],
  a.btn,
  a.admin-btn,
  .cs-trigger,
  .id-choice,
  .fl-tag-choice,
  .dept-node,
  .tdb-rail-item,
  .admin-search-result,
  .idb-tab,
  .kbb-tab,
  .tdb-tab,
  .idc-pill,
  .nvo-btn,
  .idm-btn,
  .tkt-key,
  .tpd-ticket-id,
  .tpd-view-all,
  .tpd-back
),
:where(
  button,
  input[type="button" i],
  input[type="submit" i],
  input[type="reset" i],
  [role="button"],
  a.btn,
  a.admin-btn,
  .cs-trigger,
  .id-choice,
  .fl-tag-choice,
  .dept-node,
  .tdb-rail-item,
  .admin-search-result,
  .idb-tab,
  .kbb-tab,
  .tdb-tab,
  .idc-pill,
  .nvo-btn,
  .idm-btn,
  .tkt-key,
  .tpd-ticket-id,
  .tpd-view-all,
  .tpd-back
)::before,
:where(
  button,
  input[type="button" i],
  input[type="submit" i],
  input[type="reset" i],
  [role="button"],
  a.btn,
  a.admin-btn,
  .cs-trigger,
  .id-choice,
  .fl-tag-choice,
  .dept-node,
  .tdb-rail-item,
  .admin-search-result,
  .idb-tab,
  .kbb-tab,
  .tdb-tab,
  .idc-pill,
  .nvo-btn,
  .idm-btn,
  .tkt-key,
  .tpd-ticket-id,
  .tpd-view-all,
  .tpd-back
)::after,
:where(
  button,
  input[type="button" i],
  input[type="submit" i],
  input[type="reset" i],
  [role="button"],
  a.btn,
  a.admin-btn,
  .cs-trigger,
  .id-choice,
  .fl-tag-choice,
  .dept-node,
  .tdb-rail-item,
  .admin-search-result,
  .idb-tab,
  .kbb-tab,
  .tdb-tab,
  .idc-pill,
  .nvo-btn,
  .idm-btn,
  .tkt-key,
  .tpd-ticket-id,
  .tpd-view-all,
  .tpd-back
) * {
  box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  text-shadow: none !important;
}

:where(
  button,
  input[type="button" i],
  input[type="submit" i],
  input[type="reset" i],
  [role="button"],
  a.btn,
  a.admin-btn,
  .cs-trigger,
  .id-choice,
  .fl-tag-choice,
  .dept-node,
  .tdb-rail-item,
  .admin-search-result,
  .idb-tab,
  .kbb-tab,
  .tdb-tab,
  .idc-pill,
  .nvo-btn,
  .idm-btn,
  .tkt-key,
  .tpd-ticket-id,
  .tpd-view-all,
  .tpd-back
):focus-visible {
  outline: none !important;
}

/* These are visual plates behind button groups, so they need the same rule. */
:where(.seg-slider, .view-seg.view-seg-floating) {
  box-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

/* ============================================================
   Ticket action bar (.tkd-actions)
   The three things somebody does on a ticket: take it, move it
   through the lifecycle, finish it. These were `<select>` fields
   inside a properties card several scrolls below the title, so
   the two most frequent actions in the product were also the
   hardest to find. Buttons, at the top, next to the subject.
   ============================================================ */

.tkd-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Reads as state, not as a control — it is the one item here you cannot press. */
.tkd-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  background: var(--card-2);
  white-space: nowrap;
}
.tkd-status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tkd-status-pill.is-open             { color: var(--t-blue); }
.tkd-status-pill.is-in-progress      { color: var(--t-yellow, #d4a843); }
.tkd-status-pill.is-waiting-customer { color: var(--t-orange); }
.tkd-status-pill.is-waiting-external { color: var(--t-violet, #9b7de5); }
.tkd-status-pill.is-resolved         { color: var(--t-green); }
.tkd-status-pill.is-discard          { color: var(--t-red); }

.tkd-act {
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tkd-act:hover:not(:disabled) { background: var(--hover); border-color: var(--metal-hi, var(--border-2)); }
.tkd-act:disabled { opacity: .55; cursor: default; }
.tkd-act:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }

/* Taking the ticket is the primary move on an unassigned one. */
.tkd-act.is-primary {
  background: var(--accent-deep);
  border-color: transparent;
  color: var(--on-accent);
}
.tkd-act.is-primary:hover:not(:disabled) { background: var(--accent); border-color: transparent; }

/* Finishing is affirmative but must not outshout taking the ticket, so it is
   tinted rather than filled. */
.tkd-act.is-resolve {
  color: var(--t-green);
  border-color: color-mix(in srgb, var(--t-green) 38%, var(--border));
  background: color-mix(in srgb, var(--t-green) 8%, var(--card-2));
}
.tkd-act.is-resolve:hover:not(:disabled) {
  background: color-mix(in srgb, var(--t-green) 16%, var(--card-2));
  border-color: color-mix(in srgb, var(--t-green) 55%, var(--border));
}

.tkd-act-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%239aa3ab' d='M2.2 4.2 6 8l3.8-3.8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.tkd-act[data-assign-me] {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 48%, var(--border));
  background: color-mix(in srgb, var(--green) 10%, var(--card-2));
}
.tkd-act[data-assign-me]:hover:not(:disabled) {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 18%, var(--card-2));
  border-color: color-mix(in srgb, var(--green) 70%, var(--border));
}

@media (max-width: 720px) {
  .tkd-actions { gap: 6px; }
  .tkd-act { padding: 0 10px; }
}

/* The sidebar's account menu is gone — organisation switching, settings and
   sign out all live in the workspace pill below, so its rules went with it. */

/* ============================================================
   Workspace pill (.wsp) — top left
   Replaces the old breadcrumb, which named the organisation and
   did nothing else while switching, inviting and member
   management lived in three other places. One pill, one menu,
   every row backed by a real endpoint.
   ============================================================ */

.wsp {
  /* Same glass recipe the departments view uses, restated locally so the pill
     does not depend on being inside .dpt. */
  --g-fill:   rgba(255, 255, 255, .045);
  /* Row hover only, kept low so the menu stays as quiet as the pill. */
  --g-fill-2: rgba(255, 255, 255, .05);
  --g-edge:   rgba(198, 210, 226, .13);
  --g-edge-2: rgba(198, 210, 226, .26);
  --g-spec:   rgba(255, 255, 255, .10);
  --g-frost:  rgba(12, 13, 15, .72);
  --g-blur:   blur(18px) saturate(150%);
  --g-blur-2: blur(26px) saturate(160%);

  /* The pill is a dark plate, not a bright one: a near-black wash over the bar
     behind it, so the glass reads as depth instead of as a highlight. */
  --wsp-plate:    rgba(9, 10, 12, .52);
  --wsp-plate-hi: rgba(9, 10, 12, .68);

  /* One decelerating curve, used only by the panel. Nothing on the pill moves,
     so there is no press curve any more. */
  --wsp-glide: cubic-bezier(.16, 1, .3, 1);

  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  /* Lines the mark up with the dropdown panel and the sidebar nav column
     (sidebar-nav 12px + nav-item 11px, minus the top bar’s 12px). */
  --wsp-inset: 11px;
}

/* The pill itself does not move or light up. It sits darker than the bar behind
   it and is defined by its edge, not by a fill — a control that reads as a
   surface rather than as something that wants attention. Only the panel it
   opens is animated. */
.wsp-trigger {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 330px;
  min-height: 48px;
  padding: 0 4px 0 var(--wsp-inset);
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: color .18s ease, opacity .18s ease;
}
.wsp.wsp-static .wsp-trigger { cursor: default; }
.wsp.wsp-static .wsp-trigger:hover { opacity: 1; }

/* No enclosing card — hover is a slight dim only. */
.wsp-trigger:hover:not(:disabled) { opacity: .88; }
.wsp-trigger[aria-expanded="true"] { opacity: 1; }
.wsp-trigger:disabled { opacity: .55; cursor: default; }
.wsp-trigger:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* Organisation mark. A custom upload replaces the letter fallback. */
.wsp-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.wsp-logo img {
  display: block;
  width: 24px; height: 24px;
  border-radius: 6px;
  object-fit: cover;
  user-select: none;
}
.wsp-logo-fallback {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

/* WhatsApp-style move-and-scale for the organisation mark. */
.logo-crop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #fff;
}
.logo-crop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  flex: none;
}
.logo-crop-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.logo-crop-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-crop-frame {
  position: relative;
  width: min(72vw, 62vh, 360px);
  aspect-ratio: 1;
  border-radius: 28px;
  overflow: hidden;
  cursor: grab;
  background: #111;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
  touch-action: none;
}
.logo-crop-frame.is-drag { cursor: grabbing; }
.logo-crop-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.logo-crop-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 20px 24px;
  flex: none;
}
.logo-crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 86vw);
}
.logo-crop-zoom button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.logo-crop-zoom button:hover { background: rgba(255,255,255,.14); }
.logo-crop-zoom button lucide-icon { font-size: 18px; }
.logo-crop-zoom input[type="range"] {
  flex: 1;
  accent-color: #fff;
  height: 4px;
}
.logo-crop-actions { display: flex; gap: 10px; }
.logo-crop-actions .admin-btn { min-width: 96px; justify-content: center; }

.wsp-copy { display: grid; gap: 2px; min-width: 0; text-align: left; line-height: 1.2; }
.wsp-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.wsp-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Reads as a label for the scope, not as a status — hence no colour. */
.wsp-badge {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--g-edge-2);
  border-radius: 6px;
  background: var(--g-fill);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.35;
  text-transform: uppercase;
}

.wsp-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Colour only. The chevron keeps its position so the pill's contents stay put. */
.wsp-chev {
  flex: none;
  margin-left: 3px;
  color: var(--dim);
  transition: color .18s ease;
}
.wsp-trigger[aria-expanded="true"] .wsp-chev { color: var(--text); }

/* ── The menu ─────────────────────────────────────────────── */

.wsp-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: var(--wsp-inset);
  z-index: 400;
  min-width: 306px;
  padding: 7px;
  /* Grows out of the pill's top-left rather than the box centre, so the panel
     looks like it unfolds from the mark you just clicked. */
  transform-origin: calc(var(--wsp-inset) + 12px) top;
  animation: wsp-in .38s var(--wsp-glide) both;
}

/* Bridges the 8px gap between the pill and the panel. Without it, moving the
   cursor from one to the other leaves the menu for a few pixels and the
   hover-close would fire while you are on your way in. Invisible, and a
   descendant of .wsp, so the pointer counts as still inside. */
.wsp-menu::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -9px;
  height: 9px;
}
@keyframes wsp-in {
  from { opacity: 0; transform: translateY(-8px) scale(.955); }
  to   { opacity: 1; transform: none; }
}

/* Rows settle in just behind the panel. Short, and capped at six steps so a
   long organisation list never feels like it is loading. */
.wsp-menu > * { animation: wsp-row .34s var(--wsp-glide) both; animation-delay: .05s; }
.wsp-menu > *:nth-child(2) { animation-delay: .08s; }
.wsp-menu > *:nth-child(3) { animation-delay: .1s; }
.wsp-menu > *:nth-child(4) { animation-delay: .12s; }
.wsp-menu > *:nth-child(5) { animation-delay: .14s; }
.wsp-menu > *:nth-child(n+6) { animation-delay: .16s; }
@keyframes wsp-row {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.wsp-sep { height: 1px; margin: 6px 5px; background: var(--float-edge); }
.wsp-orgs { display: grid; gap: 2px; }

.wsp-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}
.wsp-item:hover:not(:disabled) { background: var(--float-hover); }
.wsp-item:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.wsp-item svg { flex: none; color: var(--muted); }
.wsp-item.is-quiet { color: var(--dim); }

/* Heads the switch list. Only rendered when there is somewhere to switch to, so
   it never labels an empty group. */
.wsp-label {
  margin: 2px 0 4px;
  padding: 0 11px;
  color: var(--dim);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Initials here, not our mark: the rows exist to tell organisations apart, and
   the same logo repeated would carry no information. Kept dark like the pill —
   a plate you can read, not a highlight. */
.wsp-org-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px; flex: none;
  border-radius: 9px;
  border: 1px solid var(--float-edge);
  background: var(--card);
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
}
.wsp-org-copy { display: grid; gap: 1px; min-width: 0; }
.wsp-org-name { overflow: hidden; font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wsp-org-role { color: var(--muted); font-size: 10.5px; }

/* Disabled only while a switch is in flight — every row here is switchable. */
.wsp-org:disabled { opacity: .5; cursor: progress; }

/* Only the panel animates, so that is the only thing to switch off. */
@media (prefers-reduced-motion: reduce) {
  .wsp-trigger, .wsp-chev, .wsp-item { transition: none; }
  .wsp-menu, .wsp-menu > * { animation: none; }
}

@media (max-width: 860px) {
  .wsp-trigger { max-width: 210px; }
}
/* Below this the pill would crowd out search, so it keeps the mark and the
   organisation name and drops the second line. */
@media (max-width: 660px) {
  .wsp-trigger { max-width: 168px; height: 44px; gap: 9px; }
  .wsp-sub, .wsp-badge { display: none; }
  .wsp-name { font-size: 13.5px; }
}

/* ============================================================
   What's new (.nws) — centered modal
   Opens from the workspace pill menu only. Wide 16:9 panel over
   a dimmed backdrop. Solid card fill — no backdrop-filter (blurring
   the page behind it picked up vertical table lines as lighter bands).
   ============================================================ */

.nws {
  --nws-glide: cubic-bezier(.16, 1, .3, 1);

  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  pointer-events: none;
}
/* `display: flex` must not sit on the closed state — it overrides [hidden]
   and leaves the overlay covering the page with pointer-events: none, so
   the × cannot be clicked. */
.nws.is-open {
  display: flex;
  pointer-events: auto;
}

.nws-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  animation: nws-backdrop-in .28s ease both;
}
@keyframes nws-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.nws-open { overflow: hidden; }

/* ── The panel ────────────────────────────────────────────── */

.nws-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(960px, calc(100vw - 48px), calc((100vh - 48px) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  transform-origin: center center;
  animation: nws-in .34s var(--nws-glide) both;
}
@keyframes nws-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nws-panel, .nws-backdrop { animation: none; }
}

.nws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: none;
  padding: 13px 10px 13px 16px;
  border-bottom: 1px solid var(--float-edge);
}
.nws-head-title { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }

.nws-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.nws-icon-btn:hover { background: var(--float-hover); color: var(--text); }
.nws-icon-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }

.nws-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 28px 16px;
  overscroll-behavior: contain;
}

.nws-empty {
  padding: 26px 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

/* ── Entries ──────────────────────────────────────────────── */

.nws-item { padding: 14px 0; border-bottom: 1px solid var(--float-edge); }
.nws-item:last-child { border-bottom: 0; }

.nws-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.nws-date {
  color: var(--dim);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
}
.nws-tag {
  padding: 1px 6px;
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.nws-title {
  margin: 0 0 5px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
}
.nws-item.is-lead .nws-title { font-size: 18px; }

.nws-text {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-line;   /* keeps paragraph breaks an author typed */
}

.nws-shot {
  display: block;
  width: 100%;
  margin-top: 11px;
  border: 1px solid var(--float-edge);
  border-radius: 11px;
}

.nws-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.nws-link:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .nws { padding: 16px; }
  .nws-panel {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    aspect-ratio: auto;
    min-height: min(420px, calc(100vh - 32px));
  }
}

/* ============================================================
   Procurement (.pc) — companies, catalogue, logistics queue
   Borrows .admin-card / .admin-btn / .admin-table, so only the
   pieces those do not cover are defined here.
   ============================================================ */

/* ── Section bar ───────────────────────────────────────────── */
/*
 * The segmented control plus Refresh. The control itself is the shared `.seg`
 * component with its sliding indicator — only the count badge and the row it sits
 * in are defined here, because a second tab strip that looks almost like the first
 * is what makes a product feel assembled rather than designed.
 */
.pc-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.pc-view .pc-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.pc-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px 8px;
  margin: 0;
}
.pc-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.pc-bar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--dim);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.pc-bar-icon-btn:hover {
  background: var(--hover-fade);
  color: var(--text);
  border-color: var(--border-2);
}
.pc-bar-icon-btn:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}
.pc-bar-icon-btn lucide-icon {
  display: block;
  font-size: 18px;
  --icon-stroke: 1.97;
}
.pc-seg .seg-btn { display: inline-flex; align-items: center; gap: 7px; }
/*
 * The count rides on the pill.
 *
 * This is the number the one-page layout existed to keep visible; on the pill it
 * is visible from whichever section is open, which is what that layout was
 * actually reaching for.
 */
.pc-seg-n {
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--hover-fade);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.seg-btn.active .pc-seg-n { background: color-mix(in srgb, var(--on-accent) 22%, transparent); color: var(--on-accent); }
/* A company with no IAP cannot have its orders approved, and that only surfaces
   when an employee tries to order. So the pill says so before it happens. */
.pc-seg-n.is-bad {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--red);
}
.seg-btn.active .pc-seg-n.is-bad {
  background: color-mix(in srgb, var(--on-accent) 24%, transparent);
  color: var(--on-accent);
}

/* ── Section body ──────────────────────────────────────────── */

.pc-queue, .pc-reg { padding: 0; }
.pc-view .pc-orders { padding: 8px 16px 16px; }
.pc-view .pc-form-tight { padding: 0 16px 10px; margin-bottom: 0; }
.pc-view .pc-warn,
.pc-view .pc-notice { margin: 0 16px 10px; }
.pc-view .pc-p { padding: 0 16px; }
.pc-empty {
  padding: 52px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
/* No inner scroll any more: one section at a time means the page is short enough
   to scroll itself, and a scrollbar inside a scrollbar is two places to be lost. */
.pc-orders { margin-top: 4px; }

.pc-form-tight { margin-bottom: 12px; }

/* ── Catalogue composer (add item) ─────────────────────────── */

.pc-composer-host {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: nvo-fade .18s var(--ease) both;
}
.pc-composer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
}
.pc-composer-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(92vh, 880px);
  overflow: auto;
  border-radius: 18px;
  background: var(--card);
  animation: nvo-rise .24s var(--ease) both;
}
.pc-composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.pc-composer-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.pc-composer-head .nws-icon-btn { flex: none; }
.pc-composer-body { padding: 14px 16px 16px; }

.pc-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pc-composer-notice {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}
.pc-composer-notice.is-error {
  border: 1px solid color-mix(in srgb, var(--red) 34%, transparent);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  color: var(--text);
}
.pc-composer-notice.is-ok {
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-soft);
  color: var(--text);
}

.pc-composer-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--bg);
  cursor: pointer;
  overflow: hidden;
  outline: none;
  transition: border-color .16s ease, background .16s ease;
}
.pc-composer-hero:hover,
.pc-composer-hero:focus-visible {
  border-color: var(--border-2);
  background: var(--card-2);
}
.pc-composer-hero.is-drag {
  border-color: var(--border-2);
  background: var(--card-2);
}
.pc-composer-hero.has-image {
  border-style: solid;
  background: #fff;
}
.pc-composer-hero.has-image:hover,
.pc-composer-hero.has-image:focus-visible {
  background: #fff;
  border-color: var(--border-2);
}

.pc-composer-hero-empty {
  display: grid;
  gap: 4px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}
.pc-composer-hero-title { font-size: 13px; font-weight: 650; color: var(--text); }
.pc-composer-hero-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.pc-composer-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pc-composer-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.pc-composer-thumb {
  position: relative;
  display: block;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color .14s ease;
}
.pc-composer-thumb:hover {
  border-color: var(--border-2);
}
.pc-composer-thumb-main {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.pc-composer-thumb-main img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pc-composer-add-picture {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.pc-composer-add-picture:hover {
  border-color: var(--border-2);
  background: var(--card-2);
  color: var(--text);
}

.pc-composer-image-x {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0 0 1px;
  border: 0;
  border-radius: 7px;
  background: rgba(10, 12, 12, .76);
  color: #fff;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s ease;
}
.pc-composer-image-x:hover { background: rgba(10, 12, 12, .94); }
.pc-composer-hero-x {
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  font-size: 17px;
}

.pc-composer-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 16px;
}

.pc-composer-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.pc-composer-field .pc-input { flex: none; width: 100%; }

.pc-composer-kind-field { justify-self: start; }
.pc-composer-sku {
  justify-self: end;
  width: 128px;
}

/* Match input corners (10px), not the full-width pill seg used elsewhere. */
.pc-composer .pc-composer-kind.seg {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border-radius: 10px;
}
.pc-composer .pc-composer-kind .seg-btn {
  padding: 0 14px;
  height: 28px;
  font-size: 12.5px;
  border-radius: 7px;
}
.pc-composer .pc-composer-kind .seg-slider {
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  border-radius: 7px;
}
.pc-composer .pc-composer-sku .pc-input {
  height: 34px;
  text-align: left;
}
/* Every field in the dialog on one surface. Text inputs got it from the theme's
   input[type="text"] rule, the textarea did not (it fell back to the page black). */
.pc-composer .pc-input { background: var(--card-2); border-color: var(--border-2); }
.pc-composer-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pc-composer textarea.pc-composer-text {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 104px;
  padding: 14px 12px 12px;
  line-height: 1.55;
  /* No drag handle; it grows with its text instead (field-sizing). */
  resize: none;
  text-align: left;
  field-sizing: content;
}
/* `.pc-input` sets single-line height and zero vertical padding — override for the composer textarea. */
.pc-composer textarea.pc-input.pc-composer-text {
  height: auto;
  min-height: 104px;
  padding-top: 14px;
  padding-bottom: 12px;
}
.pc-card-lead { flex: 1 1 auto; margin: 0; }

.pc-composer-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.pc-input-inline { flex: 1 1 140px; }
.pc-inline { display: flex; align-items: center; gap: 6px; }

/* A company's sign-in mapping (tenants and directory rule), in a dialog. */
.pc-map-form { display: flex; flex-direction: column; gap: 12px; }
.pc-map-form .pc-input { flex: none; width: 100%; background: var(--card-2); border-color: var(--border-2); }
.pc-map-set { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }

/* ── Catalogue picture ─────────────────────────────────────── */
/*
 * A small tile, always drawn. Shots ship on white — the tile matches that surface
 * and the image fills it (`cover`) so the dark table background does not frame
 * each row. Empty is a legitimate state — a licence has no photo — so the tile
 * keeps its shape and simply stays blank rather than collapsing the column width
 * from row to row.
 */
.pc-c-thumb { width: 56px; }
.pc-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
.pc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  box-sizing: border-box;
}

/* The one warning worth putting inside the card: a company with no IAP cannot
   have its orders approved, and that only surfaces when somebody tries to order. */
.pc-warn {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--red) 8%, transparent);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.pc-h2 { margin: 0 0 4px; font-size: 14.5px; font-weight: 650; }
.pc-p { margin: 0 0 12px; color: var(--text); font-size: 12.5px; line-height: 1.6; }
.pc-p:last-child { margin-bottom: 0; }
.pc-muted { color: var(--muted); }
.pc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.pc-notice {
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12.5px;
}
.pc-notice.is-bad {
  border-color: color-mix(in srgb, var(--red) 34%, transparent);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}

/* ── Forms ─────────────────────────────────────────────────── */

.pc-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pc-input {
  flex: 1 1 180px;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.pc-input:focus { }
.pc-input-sm { flex: 0 0 148px; }
select.pc-input { cursor: pointer; }

.pc-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

/* ── Tables ────────────────────────────────────────────────── */

.pc-tablewrap {
  margin: 0;
  overflow: visible;
}

.pc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 34px;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
.pc-table tbody td {
  height: 54px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.pc-table tbody tr { transition: background .16s ease; }
.pc-table tbody tr:hover td { background: var(--hover-fade); }
.pc-table td.pc-c-pick { width: 168px; max-width: 168px; }
.pc-table td.pc-c-actions {
  width: 1%;
  white-space: nowrap;
}

.pc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pc-item .pc-thumb { flex: none; }
.pc-item-text { min-width: 0; }

.pc-name { font-size: 13px; font-weight: 600; }
.pc-sub { color: var(--muted); font-size: 11px; }
.pc-block { display: block; margin-top: 2px; }
.pc-num { color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pc-code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 11px;
}

/* Flex must not be applied to <td> — it stops cells sharing one row height. */
.pc-c-actions { text-align: right; }
.pc-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.pc-c-pick .cs { display: block; width: 100%; min-width: 0; }
.pc-c-pick .cs-trigger {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
  box-shadow: none;
}
.pc-c-pick select.pc-input { width: 100%; max-width: none; flex: none; }
.pc-danger { color: var(--red); }
.pc-danger:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
/* Square icon-only row actions (catalogue: activate / deactivate, delete). */
.pc-icon-act { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; }
.pc-icon-act lucide-icon { display: block; font-size: 16px; }
/* Icon-only save in the edit dialog: grey until something changed, then white. */
.admin-btn.pc-icon-save {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-color: transparent;
  background: color-mix(in srgb, var(--text) 11%, transparent);
  color: var(--muted);
  cursor: default;
  transition: background .18s, color .18s;
}
.admin-btn.pc-icon-save:hover { background: color-mix(in srgb, var(--text) 11%, transparent); color: var(--muted); }
.admin-btn.pc-icon-save.is-dirty,
.admin-btn.pc-icon-save.is-dirty:hover { background: var(--text); color: var(--bg); cursor: pointer; }
.admin-btn.pc-icon-save.is-dirty:hover { opacity: .9; }
.pc-icon-save lucide-icon { display: block; font-size: 18px; }
/* While saving and just after: the button grows into a pill with a mark and a word. */
.admin-btn.pc-submit.is-busy,
.admin-btn.pc-submit.is-done {
  display: inline-flex; align-items: center; gap: 9px;
  width: auto; height: 40px; padding: 0 16px 0 5px;
  border-radius: 999px; font-size: 13px; font-weight: 600; cursor: default; opacity: 1;
}
.admin-btn.pc-submit.is-busy,
.admin-btn.pc-submit.is-busy:hover { background: var(--card-2); color: var(--muted); border-color: var(--border); }
.admin-btn.pc-submit.is-done,
.admin-btn.pc-submit.is-done:hover {
  background: color-mix(in srgb, var(--green, #22c55e) 12%, var(--card-2));
  color: var(--green, #22c55e);
  border-color: color-mix(in srgb, var(--green, #22c55e) 30%, transparent);
}
.pc-save-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  animation: pc-save-pop .25s cubic-bezier(.22, 1, .36, 1);
}
.pc-save-mark svg { width: 16px; height: 16px; }
.pc-save-spin { animation: pc-save-spin .8s linear infinite; }
@keyframes pc-save-spin { to { transform: rotate(360deg); } }
@keyframes pc-save-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pc-save-spin, .pc-save-mark { animation: none; } }
.pc-del-note { color: var(--dim); }
.pc-del-note.is-error { color: var(--red); }
.pc-del-note[hidden] { display: none; }

.pc-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
}
.pc-chip.is-ok { background: var(--accent-soft); color: var(--accent); }
.pc-chip.is-warn { background: color-mix(in srgb, var(--yellow) 14%, transparent); color: var(--yellow); }
.pc-chip.is-bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pc-chip.is-info { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.pc-chip.is-idle { background: var(--card-2); color: var(--muted); }

/* ── Logistics queue: one line per order ───────────────────────
   Everything else about an order is on its own page (.pc-op),
   /procurement/orders/:id. */

.pc-queue tbody td { height: 42px; padding: 6px 16px; }
.pc-queue .pc-qgroup th {
  height: auto;
  padding: 14px 16px 6px;
  border-bottom: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
}
.pc-queue .pc-qgroup:hover th { background: transparent; }
.pc-qgroup em {
  margin-left: 7px;
  color: var(--dim);
  font-style: normal;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pc-qrow { cursor: pointer; }
.pc-q-ticket { width: 1%; white-space: nowrap; }
.pc-q-open {
  display: inline-block;
  padding: 2px 4px;
  margin: 0 -4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pc-q-open:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pc-q-trunc {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.pc-q-item { font-weight: 500; }
.pc-q-approval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.pc-q-approval::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.pc-q-approval.is-pending::before { background: var(--yellow); }
.pc-q-approval.is-approved::before { background: var(--accent); }
.pc-q-approval.is-rejected::before { background: var(--red); }
.pc-q-date {
  width: 1%;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pc-queue td.pc-q-go { width: 1%; padding-left: 0; color: var(--muted); }
.pc-q-go lucide-icon { display: block; width: 14px; height: 14px; }
.pc-qrow:hover .pc-q-go { color: var(--text); }

@media (max-width: 760px) {
  .pc-queue th:nth-child(5), .pc-queue td.pc-q-date { display: none; }
  .pc-q-trunc { max-width: 160px; }
}

/* ── Order page: /procurement/orders/:id ───────────────────────
   Main column for the work (device form, trail), side column for
   the facts (request, approval). Stacks below 960px. */

.pc-op { max-width: 1180px; padding: 16px 20px 32px; }
.pc-op-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.pc-op-crumb [aria-current] { color: var(--text); font-variant-numeric: tabular-nums; }
.pc-op-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -2px -6px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
}
.pc-op-back:hover { color: var(--text); background: var(--hover-fade); }
.pc-op-back:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pc-op-back lucide-icon { display: block; width: 14px; height: 14px; }
.pc-op-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 18px;
}
.pc-op-headmain { min-width: 0; }
.pc-op-title { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
.pc-op-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pc-op-meta .pc-chip { margin-left: 0; }
.pc-op-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pc-op-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}
.pc-op-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pc-op-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.pc-op .pc-notice { margin: 0 0 14px; }
.pc-op > .pc-od-error { margin: 0 0 14px; }
@media (max-width: 960px) {
  .pc-op-grid { grid-template-columns: minmax(0, 1fr); }
}

.pc-od-h { margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pc-od-dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
  font-size: 12.5px;
}
.pc-od-dl dt { color: var(--muted); }
.pc-od-dl dd { margin: 0; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.pc-od-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); }
.pc-od-link:hover { text-decoration-color: currentColor; }
.pc-od-text { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.55; }
.pc-od-quote {
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--border-2);
  color: var(--dim);
  white-space: pre-line;
}
.pc-od-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pc-od-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-od-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11.5px;
}
.pc-od-label.is-wide { grid-column: 1 / -1; }
.pc-od-label .pc-input { flex: none; width: 100%; }
.pc-od-label .cs { display: block; width: 100%; min-width: 0; }
.pc-od-label .cs-trigger { width: 100%; min-width: 0; min-height: 34px; font-size: 12.5px; box-shadow: none; }
.pc-od-submit { grid-column: 1 / -1; justify-self: start; margin-top: 4px; }
.pc-od-action { margin-top: 14px; }
.pc-od-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
  font-size: 12px;
}
.pc-od-trail {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.45;
}
.pc-od-trail li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.pc-od-trail strong { font-weight: 600; }
.pc-od-trail time { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .pc-od-form { grid-template-columns: 1fr; }
  .pc-od-dl { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ── One order in the logistics queue ──────────────────────── */

.pc-order {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pc-order:last-child { border-bottom: 0; padding-bottom: 0; }
.pc-order-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pc-order-meta { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.pc-order-note { margin: 8px 0 0; color: var(--text); font-size: 12.5px; line-height: 1.55; white-space: pre-line; }

.pc-num-tag {
  padding: 1px 6px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

.pc-device-done {
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 700px) {
  .pc-input-sm { flex: 1 1 120px; }
  .pc-actions { justify-content: flex-start; }
}

/* ── People & roles: the two editable columns ─────────────────
   The selects here sit in table cells, not in the flex row the
   member list in Settings uses. `.cs` (the custom-select wrapper)
   is inline-block with no width of its own, and its trigger is
   `width: 100%` — inside a cell that resolves against a
   shrink-to-fit box and collapses the control to a stub. Giving
   the wrapper a width is what fixes it. */

.idb-c-pick { min-width: 180px; }
.idb-c-pick .cs { display: block; width: 100%; min-width: 0; }
.idb-c-pick .cs-trigger {
  width: 100%;
  min-width: 0;
  height: 32px;
  font-size: 12.5px;
}

.idb-pick {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.idb-pick:focus { outline: none; }

/* Nothing here styles explanatory text inside a table cell, and nothing should.
   An earlier attempt put the reason a row was locked into a span called
   `.idb-lock` — a class that already existed for the round padlock badge beside
   the tenant name, 23×23 and inline-flex. The sentence inherited an icon's box,
   spilled out of it, and overlapped the rows below.
   Long reasons belong in `.idb-note` above the table; a cell carries a pill or a
   control. */

/* The per-row result of a save. Reserves no width, so it cannot squeeze the
   columns that carry the controls. */
.idb-save { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.idb-save.is-bad { color: var(--red); white-space: normal; }

/* Bulk-invite controls in the Identity selection bar. */
.idb-selgroup { display: inline-flex; align-items: center; gap: 6px; }
.idb-pick-sm { width: auto; min-width: 150px; height: 28px; font-size: 12px; }
.idb-mini.is-go {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.idb-mini.is-go:disabled { opacity: .5; cursor: default; }

/* ── DEMO-AI (dai-*) ──────────────────────────────────────────────
   Chat console for the insights agent. Full-height: a fixed composer at the
   bottom and one scroll region above it, so the input never moves while the
   conversation grows. Delete this block with the view.
   ──────────────────────────────────────────────────────────────── */

.dai-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.dai-boot { padding: 40px; text-align: center; color: var(--muted); font-size: 12.5px; }

.dai-dim { color: var(--muted); font-size: 11.5px; }
.dai-num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }

.dai-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.dai-chip.is-ok   { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent-bright); }
.dai-chip.is-warn { border-color: color-mix(in srgb, #d9a300 45%, var(--border)); color: #d9a300; }
.dai-chip.is-bad  { border-color: color-mix(in srgb, #d9534f 50%, var(--border)); color: #e07a77; }

/* The top bar is gone: the model chip moved to the foot of the rail and the
   "As employee" toggle was removed, which is what let the rail divider run the
   full height of the panel. `.dai-bar`, `.dai-bar-spacer` and `.dai-check` were
   deleted with it rather than left behind as rules nothing renders. */

/* scroll region */
.dai-log { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.dai-log-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 22px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* welcome */
/* Empty chat: everything centred in the panel, ChatGPT-style. */
.dai-home {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px;
}
.dai-welcome { width: 100%; max-width: 760px; margin: 0 auto; }
.dai-welcome h2 {
  margin: 0 0 22px;
  text-align: center;
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.01em;
}
.dai-welcome .dai-composer { padding: 0; }
.dai-samples { display: flex; flex-direction: column; margin-top: 14px; padding: 0 8px; }
.dai-sample {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.dai-sample lucide-icon { font-size: 15px; color: var(--muted); --icon-stroke: 1.75; }
.dai-sample:hover { color: var(--text); background: var(--hover-fade); }
.dai-welcome-note {
  margin: 18px 0 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* turns */
.dai-turn { display: flex; }
.dai-turn.is-user { justify-content: flex-end; }
.dai-turn.is-ai { justify-content: flex-start; }

.dai-msg { max-width: 100%; font-size: 13.5px; line-height: 1.6; }
.dai-turn.is-user .dai-msg {
  max-width: 76%;
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--card-2);
  border: 1px solid var(--border);
  white-space: pre-wrap;
}
.dai-turn.is-ai .dai-msg { width: 100%; }
.dai-turn.is-ai .dai-msg > p { margin: 0 0 9px; }
.dai-turn.is-ai .dai-msg > p:last-of-type { margin-bottom: 0; }

.dai-msg.is-error {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, #d9534f 40%, var(--border));
  background: var(--well);
}
.dai-msg.is-error strong { color: #e07a77; font-size: 12.5px; }
.dai-msg.is-error p { margin: 4px 0 0; font-size: 12.5px; color: var(--dim); }

.dai-answer-caveats { margin-top: 10px; }

/* thinking */
.dai-thinking { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.dai-dots { display: inline-flex; gap: 4px; }
.dai-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: dai-pulse 1.3s ease-in-out infinite;
}
.dai-dots i:nth-child(2) { animation-delay: .18s; }
.dai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dai-pulse {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
/* The current phase ("Planning…", "Looking things up…"); fades in when it changes. */
.dai-phase { display: inline-block; }
.dai-phase.is-new { animation: dai-phase-in .35s ease-out; }
.dai-elapsed { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: .7; }
@keyframes dai-phase-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .dai-phase.is-new { animation: none; }
}

/* the receipt */
.dai-receipt {
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.dai-receipt > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dim);
  list-style: none;
}
.dai-receipt > summary::-webkit-details-marker { display: none; }
.dai-receipt > summary::before { content: '▸'; color: var(--muted); font-size: 9px; }
.dai-receipt[open] > summary::before { content: '▾'; }
.dai-receipt > summary:hover { color: var(--text); }
.dai-receipt > summary > .dai-dim { margin-left: auto; font-family: var(--font-mono); }

.dai-receipt-body {
  padding: 4px 12px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dai-block { display: flex; flex-direction: column; gap: 6px; }
.dai-block > p { margin: 0; font-size: 12.5px; color: var(--dim); }
.dai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dai-flags { display: flex; flex-wrap: wrap; gap: 6px; }

.dai-list {
  margin: 0;
  padding-left: 17px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* one lookup */
.dai-job {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--well);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dai-job + .dai-job { margin-top: 7px; }
.dai-job.is-bad { border-color: color-mix(in srgb, #d9534f 35%, var(--border)); }
.dai-job-head { display: flex; align-items: center; gap: 8px; }
.dai-job-head code { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim); }
.dai-job-head .dai-dim { margin-left: auto; }
.dai-job-what { font-size: 12px; color: var(--text); }

.dai-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dai-table td { padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--dim); }
.dai-table tr:last-child td { border-bottom: 0; }
.dai-table td:last-child { color: var(--text); font-weight: 600; }

.dai-code { border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); }
.dai-code > summary {
  padding: 6px 9px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  list-style: none;
}
.dai-code > summary::-webkit-details-marker { display: none; }
.dai-code > summary::before { content: '▸ '; }
.dai-code[open] > summary::before { content: '▾ '; }
.dai-code > summary:hover { color: var(--text); }
.dai-code pre {
  margin: 0;
  padding: 9px 11px;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
  white-space: pre;
}

/* composer */
.dai-composer {
  flex-shrink: 0;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 20px;
}

/* ChatGPT-style pill: + on the left, auto-growing input, round send on the
   right. No focus ring or border change on focus — the caret is enough. */
.dai-pill {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 52px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card-2, var(--card));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.dai-plus,
.dai-send {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.dai-plus { background: transparent; color: var(--text); font-size: 20px; --icon-stroke: 1.75; }
.dai-plus:hover:not(:disabled) { background: var(--hover-fade); }
.dai-plus:disabled { cursor: default; opacity: .75; }
.dai-input {
  flex: 1;
  min-width: 0;
  align-self: center;
  resize: none;
  margin: 0;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 22px;
  max-height: 180px;
  overflow-y: auto;
}
.dai-input::placeholder { color: var(--muted); }
.dai-input:focus,
.dai-input:focus-visible { outline: none; box-shadow: none; border-radius: 0; }
.dai-input:disabled { opacity: .6; }

.dai-textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  max-height: 180px;
  overflow-y: auto;
  transition: border-color .16s, box-shadow .16s;
}
.dai-textarea:focus,
.dai-textarea:focus-visible { outline: none; border-color: var(--border-2); box-shadow: none; }
.dai-textarea:disabled { opacity: .6; }

/* Send: white circle, dark arrow (ChatGPT). Dimmed until there is text. */
.dai-send {
  background: var(--text);
  color: var(--bg);
  font-size: 18px;
  --icon-stroke: 2.25;
  transition: opacity .16s;
}
.dai-send:hover:not(:disabled) { opacity: .85; }
.dai-send:disabled { opacity: .25; cursor: default; }

/* One ticket as read by a `list` lookup: its fields, then its history and
   conversation in one chronological stream. Several records stack, so each one
   needs a visible edge — without it two tickets read as one long table. */
.dai-record {
  border-left: 2px solid var(--border);
  padding-left: 9px;
  margin-top: 8px;
}
.dai-record:first-child { margin-top: 0; }
.dai-record .dai-list { margin-top: 6px; }
.dai-record .dai-list li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.dai-record .dai-list li:last-child { border-bottom: 0; }

/* The conversation rail. `.dai-view` is a flex column, so the shell is the row
   inside it and `.dai-main` re-establishes the column the log and composer
   expect — without it, `.dai-log { flex: 1 }` has no column to fill. */
.dai-shell { display: flex; flex: 1; min-height: 0; }
.dai-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.dai-rail {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dai-rail.is-collapsed { width: 52px; }
.dai-rail-collapsed-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
}
.dai-rail-collapsed-nav .dai-rail-tool {
  width: 34px;
  height: 34px;
}
.dai-rail-collapsed-nav .dai-rail-tool.is-on {
  background: var(--card-hover, var(--card));
  color: var(--text);
}
.dai-rail-collapsed-nav .dai-rail-tool:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.dai-rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 8px 0 14px;
  flex-shrink: 0;
}
.dai-rail-brand {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}
.dai-rail-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dai-rail-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.dai-rail-tool:hover {
  background: var(--card-hover, var(--card));
  color: var(--text);
}
.dai-rail-tool lucide-icon { font-size: 17px; --icon-stroke: 1.69; }
.dai-rail-tool svg { display: block; }
/* Actions, then a quiet label, then the list. Separated by spacing and the label
   rather than by a rule — a second horizontal line so close to the top of the
   panel fights the vertical divider instead of supporting it. */
.dai-rail-nav {
  padding: 8px 6px 2px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
/* Full-strength text and icons: these two are the actions in this view, not
   secondary navigation, so they carry --text at full opacity rather than the
   dimmed treatment the main nav uses. */
.dai-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
/* Matches the main navigation's icon weight, so the rail does not read as if it
   came from a different product. */
.dai-nav-item lucide-icon {
  font-size: 17px;
  --icon-stroke: 1.59;
  flex-shrink: 0;
  color: var(--text);
  opacity: 1;
}
/* Where you are: one filled pill, shared by "New chat" and the open conversation
   (ChatGPT-style). Mixed from --text so it shows on both light and dark skins. */
.dai-rail {
  --dai-hover: color-mix(in srgb, var(--text) 5%, transparent);
  --dai-selected: color-mix(in srgb, var(--text) 10%, transparent);
}
.dai-nav-item:hover:not(:disabled) { background: var(--dai-hover); }
.dai-nav-item:disabled { opacity: .45; cursor: not-allowed; }
.dai-nav-item.is-on,
.dai-nav-item.is-on:hover:not(:disabled) { background: var(--dai-selected); }
.dai-nav-item.is-on lucide-icon { color: var(--text); }

.dai-rail-label {
  padding: 13px 12px 5px;
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}
/* Model picker — top-left of the chat area, ChatGPT-style. */
.dai-top {
  flex: none;
  display: flex;
  align-items: center;
  padding: 10px 12px 0;
}
.dai-model { position: relative; }
.dai-model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.dai-model-btn lucide-icon { font-size: 16px; color: var(--muted); --icon-stroke: 2; }
.dai-model-btn:hover,
.dai-model-btn[aria-expanded="true"] { background: var(--hover-fade); }
.dai-model-btn:focus-visible { box-shadow: none; }

.dai-model-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 320px;
  padding: 8px;
  border: 1px solid var(--float-edge-2, var(--border-2));
  border-radius: 16px;
  background: var(--card-2, var(--card));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.dai-model-menu[hidden] { display: none; }
.dai-model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  color: var(--muted);
  font-size: 13px;
}
.dai-model-head lucide-icon { font-size: 16px; cursor: help; }
.dai-model-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.dai-model-opt:hover:not(:disabled) { background: var(--hover-fade); }
.dai-model-opt:disabled { opacity: .45; cursor: default; }
.dai-model-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dai-model-opt-name { font-size: 14px; font-weight: 500; }
.dai-model-opt-name em {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
}
.dai-model-opt-desc { color: var(--muted); font-size: 12.5px; }
.dai-model-check { font-size: 18px; color: var(--text); }
.dai-rail-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 6px; }
.dai-rail-empty { padding: 14px 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.dai-rail-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: var(--radius);
}
.dai-rail-item:hover { background: var(--dai-hover); }
.dai-rail-item.is-active,
.dai-rail-item.is-active:hover { background: var(--dai-selected); }
.dai-rail-item.is-active .dai-rail-title { color: var(--text); }

.dai-rail-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.dai-rail-title {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  /* Long titles fade out instead of ending in "…". A mask, not a gradient
     overlay, so it fades into whatever is behind (idle, hover, selected). */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.dai-rail-meta { font-size: 10.5px; color: var(--muted); }

.dai-rail-del {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  opacity: 0;
  transition: opacity .12s, color .12s, background .12s;
}
.dai-rail-del lucide-icon { font-size: 15px; }
.dai-rail-item:hover .dai-rail-del { opacity: 1; }
.dai-rail-del:hover { color: #d9534f; background: var(--hover-fade); }
/* Keyboard users never trigger :hover, so the delete button has to appear on
   focus or it is unreachable without a mouse. */
.dai-rail-del:focus-visible { opacity: 1; outline: 1px solid var(--accent); }

/* ── scheduled questions ─────────────────────────────────────────────────────
   Replaces the conversation in the main area rather than sitting beside it: the
   rail is 236px, and a question plus seven weekday toggles plus a time does not
   fit there without becoming fiddly. */
.dai-sched { flex: 1; min-height: 0; overflow-y: auto; }
.dai-sched-inner { max-width: 880px; margin: 0 auto; padding: 34px 24px 40px; }

.dai-sched-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dai-sched-head h2 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 6px; }
.dai-sched-head p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.dai-sched-new {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.dai-sched-new lucide-icon { font-size: 15px; --icon-stroke: 2.2; }
.dai-sched-new:hover { opacity: .88; }
.dai-sched-new:focus-visible { box-shadow: none; outline: none; }

/* Calm, not alarming: it is a fact about this server, not an error. */
.dai-sched-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2, transparent);
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
}
.dai-sched-note lucide-icon { flex-shrink: 0; font-size: 15px; margin-top: 1px; color: var(--muted); }
.dai-sched-note code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text); }

/* The composer for a new / edited schedule: one card, three stacked zones. */
.dai-sched-form {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 16px;
  margin-bottom: 24px;
}
.dai-sched-form:focus-within { border-color: var(--border-2, var(--border)); }
.dai-sched-form-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.dai-sched-q {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 0 2px;
}
.dai-sched-q::placeholder { color: var(--muted); }
/* No focus ring on the question: the card already shows focus, and a box inside
   a box reads as an error state. */
.dai-sched-q:focus, .dai-sched-q:focus-visible { outline: none; box-shadow: none; }

/* Repeats / At / On, on one wrapping row with a divider above. */
.dai-sched-opts {
  display: flex;
  align-items: center;
  gap: 10px 22px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline, var(--border));
}
.dai-sched-opt { display: flex; align-items: center; gap: 9px; }
.dai-sched-opt-days { flex-wrap: wrap; }
.dai-sched-opt-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

/* Native select, native arrow — one arrow, and it always works. A custom caret
   on top of appearance:none is what gave us two. */
.dai-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2, transparent);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  color-scheme: dark light;
  cursor: pointer;
}
.dai-select:hover { border-color: var(--border-2, var(--border)); }
.dai-select:focus-visible, .dai-time:focus-visible { box-shadow: none; outline: none; }
.dai-time {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2, transparent);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  color-scheme: dark light;
}
.dai-time:hover { border-color: var(--border-2, var(--border)); }
/* The native clock button renders as a harsh light glyph on dark. Hide it; the
   field still opens its picker on click and accepts typing. */
.dai-time::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }

/* Day toggles: clearly round buttons, filled green when on. */
.dai-days { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dai-day {
  min-width: 34px;
  height: 32px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.dai-day:hover { color: var(--text); border-color: var(--border-2, var(--border)); }
.dai-day.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.dai-day.is-on:hover { color: var(--on-accent); }
.dai-day:focus-visible { box-shadow: none; outline: none; }

.dai-sched-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.dai-sched-foot-btns { display: flex; gap: 8px; margin-left: auto; }
.dai-sched-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--dim);
}
.dai-sched-preview lucide-icon { font-size: 14px; color: var(--live); }
.dai-sc.is-editing { border-color: var(--accent-line, var(--border-2)); }
.dai-sched-error { margin: 10px 2px 0; font-size: 12px; color: #e5736f; }
.dai-sched-none { padding: 8px 0; }
.dai-sched-sub { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 4px 0 10px; }
.dai-sched-foot { margin: 22px 0 0; font-size: 11.5px; color: var(--muted); }

/* Cards, three across on a wide panel. */
.dai-sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.dai-sc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 132px;
  padding: 15px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card, transparent);
  text-align: left;
  transition: border-color .14s, background .14s;
}
.dai-sc:hover { border-color: var(--border-2, var(--border)); }
/* Paused is a state, not a deletion: quieter, still readable. */
.dai-sc.is-off .dai-sc-title,
.dai-sc.is-off .dai-sc-when { opacity: .55; }

.dai-sc-title {
  margin: 0;

  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dai-sc-open {
  all: unset;
  cursor: pointer;
}
.dai-sc-open.is-static { cursor: default; }
/* The whole card opens the answers, not just the words. */
.dai-sc-open:not(.is-static)::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.dai-sc-open:focus-visible::after { box-shadow: none; }

.dai-sc-status {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dai-sc-status.is-bad { color: #e5736f; }

.dai-sc-when {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 7px;
  background: var(--live-soft);
  color: var(--live);
  font-size: 12px;
  font-weight: 500;
}
.dai-sc-when lucide-icon { font-size: 13px; }
.dai-sc.is-off .dai-sc-when { background: var(--hover-fade); color: var(--muted); }

.dai-sc-foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dai-sc-foot .dai-sc-when { margin-top: 0; }
.dai-sc-tools {
  position: relative;
  z-index: 1; /* above the stretched open button */
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .12s;
}
.dai-sc:hover .dai-sc-tools,
.dai-sc:focus-within .dai-sc-tools { opacity: 1; }
.dai-sc-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.dai-sc-tool lucide-icon { font-size: 14px; }
.dai-sc-tool:hover { background: var(--hover-fade); color: var(--text); }
.dai-sc-tool.is-danger:hover { color: #e5736f; }
.dai-sc-tool:focus-visible { box-shadow: none; outline: none; opacity: 1; }

/* Suggestion cards are buttons themselves. */
.dai-sc-idea { font: inherit; color: inherit; cursor: pointer; }
.dai-sc-idea:hover { background: var(--hover-fade); }
.dai-sc-idea:focus-visible { box-shadow: none; outline: none; }

@media (hover: none) { .dai-sc-tools { opacity: 1; } }

/* An inbox row that leads somewhere. Only answer notifications carry a
   conversation id, so only they get the pointer and the hover — the rest of the
   inbox stays as passive as it was. */
.inbox-item.is-clickable { cursor: pointer; border-radius: var(--radius); }
.inbox-item.is-clickable:hover { background: var(--card-hover, var(--card)); }
.inbox-item.is-clickable:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* ── Software patching (NinjaOne-style, WinGet) ─────────────────
   Patching view (patching.js) and the device panel in Fleet. */
.pp { width: 100%; padding: 6px 4px 48px; color: var(--text); }
.pp-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pp-head h1 { margin: 0; font-size: 20px; font-weight: 650; }
.pp-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--dim); }
/* Page-level actions, top right of the header (e.g. Generate report). */
.pp-head-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pp-head-actions:empty { display: none; }
/* Patching: the open section's own actions, laid out with "Report" after them. */
.pp-head-actions-section { display: contents; }
a.pp-btn, a.admin-btn { text-decoration: none; }
/* Report catalog: WinGet search. Clicking the input lists every known title
   A–Z under it, one line each with a round check; typing filters. The + in
   the input carries the number picked ("2 +") and adds them. */
.pp-rp-search { position: relative; width: min(640px, 100%); }
.pp-rp-search .pp-search { width: 100%; padding-right: 124px; }
.pp-rp-search .pp-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
/* The × (clear) and the add/remove button sit together at the input's right edge. */
.pp-rp-actions { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 2px; }
.pp-rp-clear {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; font-size: 14px; --icon-stroke: 2.2;
  transition: color .12s ease, background .12s ease;
}
.pp-rp-clear:hover { color: var(--text); background: var(--hover-fade); }
.pp-rp-clear[hidden] { display: none; }
.pp-rp-plus {
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent, #fff); cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; --icon-stroke: 2.4;
  transition: background .15s ease, transform .15s ease, gap .15s ease, padding .15s ease;
}
.pp-rp-plus lucide-icon { font-size: 15px; }
.pp-rp-plus.has-count { gap: 5px; padding: 0 7px 0 9px; }
.pp-rp-plus-part { display: inline-flex; align-items: center; gap: 3px; }
.pp-rp-plus-part + .pp-rp-plus-part { margin-left: 7px; padding-left: 7px; border-left: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
/* Only removals pending: the button reads as a removal. */
.pp-rp-plus.is-removing { background: var(--red); }
.pp-rp-plus.is-removing:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 85%, #fff); }
.pp-rp-plus:hover:not(:disabled) { background: var(--accent-bright, var(--accent)); }
.pp-rp-plus:active:not(:disabled) { transform: scale(.94); }
.pp-rp-plus:disabled { background: var(--card-2); color: var(--muted); cursor: default; }

.pp-rp-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  max-height: 380px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
  box-shadow: var(--shadow-panel, 0 12px 32px rgba(0,0,0,.35));
}
.pp-rp-results[hidden] { display: none; }
.pp-rp-opt {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .8fr) 18px;
  align-items: center; gap: 12px; width: 100%; padding: 6px 10px;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  transition: background .12s ease;
}
.pp-rp-opt:hover { background: var(--hover-fade); }
/* A catalog title unticked here: removed when the button is pressed. */
.pp-rp-opt.is-removing > span:not(.pp-round-check) { opacity: .55; text-decoration: line-through; text-decoration-color: var(--red); }
.pp-rp-opt.is-removing .pp-round-check { border-color: var(--red); }
.pp-rp-opt > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-rp-opt-name { font-weight: 600; }
.pp-rp-opt-id { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--dim); }
.pp-rp-opt-pub { color: var(--muted); }
.pp-rp-note { display: block; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; text-align: left; }
.pp-rp-more { cursor: pointer; color: var(--accent); font-weight: 600; border-radius: var(--radius-sm); }
.pp-rp-more:hover { background: var(--hover-fade); }
/* Round check: an empty ring; picked, it fills with the accent and shows a
   tick. The tick is an SVG path used as a mask, so it is drawn crisp and
   centred at any size instead of being built from two borders. Only the
   check is coloured; the card around it is not. */
.pp-round-check {
  position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-2); background: transparent;
  transition: background .18s ease, border-color .18s ease;
}
.pp-round-check::after {
  content: ''; position: absolute; inset: 0; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.3l2.5 2.5 5.1-5.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.2 8.3l2.5 2.5 5.1-5.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  transform: scale(.4); opacity: 0;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), opacity .15s ease;
}
.pp-round-check.is-on { background: var(--accent); border-color: var(--accent); }
.pp-round-check.is-on::after { opacity: 1; transform: scale(1); }
@media (prefers-reduced-motion: reduce) { .pp-round-check, .pp-round-check::after, .pp-rp-plus { transition: none; } }
/* Visually hidden, still read out (a column header with no visible text). */
.pp-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Toggle switch: in or out of the report. A real checkbox (role="switch"),
   restyled. The knob slides on a slight overshoot, and stretches toward where
   it is going while pressed, like a native switch. */
.pp-table .pp-c-toggle { width: 1%; text-align: right; white-space: nowrap; }
.pp-toggle {
  --w: 36px; --h: 20px; --knob: 14px; --pad: 3px;
  appearance: none; -webkit-appearance: none; box-sizing: border-box; flex: none; position: relative; display: inline-block;
  width: var(--w); height: var(--h); margin: 0; vertical-align: middle; cursor: pointer;
  border-radius: 99px; border: 1px solid var(--border-2);
  background: var(--card-2);
  transition: background .25s ease, border-color .25s ease, box-shadow .2s ease;
}
.pp-toggle::before {
  content: ''; position: absolute; top: calc(var(--pad) - 1px); left: calc(var(--pad) - 1px);
  width: var(--knob); height: var(--knob); border-radius: 99px;
  background: var(--dim);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  transition:
    transform .32s cubic-bezier(.34, 1.56, .64, 1),
    width .18s ease, background .25s ease;
}
.pp-toggle:hover { }
.pp-toggle:checked { background: var(--accent); border-color: var(--accent); }
.pp-toggle:checked::before {
  background: #fff;
  transform: translateX(calc(var(--w) - var(--knob) - var(--pad) * 2));
}
/* Pressed: the knob widens toward the side it will move to. */
.pp-toggle:active::before { width: calc(var(--knob) + 5px); }
.pp-toggle:checked:active::before { transform: translateX(calc(var(--w) - var(--knob) - 5px - var(--pad) * 2)); }
.pp-toggle:focus-visible { outline: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .pp-toggle, .pp-toggle::before { transition: none; } }

/* Square icon buttons: add (plus) and remove (trash). */
.pp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--dim); cursor: pointer; font-size: 15px; --icon-stroke: 2;
  transition: color .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.pp-icon-btn:hover { color: var(--text); background: var(--hover-fade); }
.pp-icon-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pp-icon-btn-danger:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

/* Report catalog table. One surface with the search above it: no line
   between the two, and a quiet header (sentence case, muted, no fill) in
   place of the filled uppercase bar the other patching tables use. */
.pp-rp-card .pp-toolbar { border-bottom: 0; padding: 12px 14px 4px; }
.pp-rp-table { table-layout: fixed; }
.pp-rp-table thead th {
  padding: 10px 14px 9px; background: none;
  font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.pp-rp-table td { padding: 11px 14px; }
.pp-rp-table td:not(.pp-c-check):not(.pp-c-toggle) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-rp-table .pp-rp-c-name { width: 26%; }
.pp-rp-table td.pp-rp-c-name { font-weight: 600; color: var(--text); }
.pp-rp-table .pp-rp-c-id { width: 28%; }
.pp-rp-table td.pp-rp-c-id { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--dim); }
.pp-rp-table .pp-rp-c-ver { width: 18%; }
.pp-rp-table td.pp-rp-c-ver { font-variant-numeric: tabular-nums; }
/* .pp-table sets these widths later in the file; the doubled class outranks it. */
.pp-table.pp-rp-table .pp-c-check { width: 44px; }
.pp-table.pp-rp-table .pp-c-toggle { width: 96px; }
/* Compliance reports page: the software catalog folds behind a header with an
   arrow; the report history sits under it. The fold slides open by animating
   the grid row from 0fr to 1fr. */
.pp-rp-catalog-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px;
  border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  border-radius: var(--radius-lg);
}
.pp-rp-chev { font-size: 16px; color: var(--dim); --icon-stroke: 2.2; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.pp-rp-catalog.is-open .pp-rp-chev { transform: rotate(90deg); }
.pp-rp-catalog-title { font-size: 13.5px; font-weight: 650; }
.pp-rp-catalog-sum { margin-left: auto; font-size: 12px; color: var(--muted); }
.pp-rp-catalog-head:hover .pp-rp-chev, .pp-rp-catalog-head:hover .pp-rp-catalog-sum { color: var(--text); }
.pp-rp-catalog-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .8, .2, 1); }
.pp-rp-catalog.is-open .pp-rp-catalog-body { grid-template-rows: 1fr; }
.pp-rp-catalog-inner { min-height: 0; overflow: hidden; }
.pp-rp-catalog.is-open:not(.is-animating) .pp-rp-catalog-inner { overflow: visible; }
@media (prefers-reduced-motion: reduce) { .pp-rp-chev, .pp-rp-catalog-body { transition: none; } }

.pp-card.pp-rp-history { margin-top: 12px; }
.pp-rp-history-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 6px; }
.pp-rp-history-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.pp-table.pp-rp-hist-table { table-layout: auto; }
.pp-rp-hist-table td.pp-rp-c-name { width: auto; }
.pp-rp-hist-table .pp-rp-h-act { width: 1%; white-space: nowrap; text-align: right; }
.pp-rp-hist-table tr.is-fresh td { animation: pp-rp-fresh 1.6s ease-out; }
@keyframes pp-rp-fresh { from { background: var(--hover-fade); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .pp-rp-hist-table tr.is-fresh td { animation: none; } }

/* Report history: title and scope, when, devices, a compliance meter. */
.pp-rp-hist-table td { vertical-align: middle; }
.pp-rp-h-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-rp-h-scope { margin-top: 2px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-rp-h-when { white-space: nowrap; }
.pp-table .pp-rp-h-comp { width: 170px; }
.pp-rp-meter { display: flex; align-items: center; gap: 10px; }
.pp-rp-meter span { flex: 1; height: 5px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.pp-rp-meter b { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.pp-rp-meter em { min-width: 34px; font-style: normal; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }

/* A report still being generated: a spinner where the date goes. */
.pp-spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); border-top-color: var(--accent); animation: bl-spin .7s linear infinite; vertical-align: middle; }
.pp-rp-hist-table tr.is-pending .pp-rp-h-name { color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .pp-spin { animation-duration: 2s; } }

/* Generate report dialog. */
.pp-gen { display: grid; gap: 16px; }
.pp-gen-field { display: grid; gap: 6px; }
.pp-gen-label { font-size: 12px; font-weight: 600; color: var(--dim); }
.pp-gen .pp-select, .pp-gen .pp-input { width: 100%; padding: 8px 10px; }
.pp-gen .cs { display: block; width: 100%; min-width: 0; }
.pp-gen .cs-trigger { width: 100%; min-width: 0; height: 36px; }
.pp-gen-mark { width: 16px; height: 16px; flex: none; color: var(--dim); }
/* The dropdown's option list is appended to <body>; it has to sit above the
   patching dialogs (z-index 9000), or it opens behind them and cannot be used. */
body .cs-panel { z-index: 9500; }
.pp-gen-kinds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pp-gen-kind {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2);
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer;
  transition: background .12s ease;
}
.pp-gen-kind:hover { background: var(--hover-fade); }
.pp-gen-kind lucide-icon { font-size: 16px; color: var(--dim); --icon-stroke: 1.8; }
.pp-gen-kind > span:not(.pp-round-check) { flex: 1; }
.pp-gen-ai { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); }
.pp-gen-ai > div { flex: 1; min-width: 0; }
.pp-gen-ai-title { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.pp-gen-ai.is-off .pp-gen-ai-title { color: var(--dim); }
.pp-toggle:disabled { opacity: .45; cursor: not-allowed; }

/* Report catalog: the version cell while its WinGet lookup runs. */
.pp-skel {
  display: inline-block; width: 72px; height: 10px; vertical-align: middle; border-radius: 99px;
  background: linear-gradient(90deg, var(--border) 20%, var(--border-2) 50%, var(--border) 80%);
  background-size: 220% 100%;
  animation: fl-skeleton-shimmer 1.35s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .pp-skel { animation: none; } }
/* Report catalog: a title left out of the report reads as switched off. */
.pp-table tr.is-excluded td:not(.pp-c-check):not(.pp-c-toggle) { opacity: .5; transition: opacity .2s ease; }
.pp-table tr td { transition: opacity .2s ease; }
.pp-tabs { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); }
.pp-tab { border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.pp-tab:hover { color: var(--text); }
.pp-tab.is-active { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.pp-tab .pp-count { margin-left: 6px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-tab:focus-visible, .pp-btn:focus-visible, .pp-link:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }

.pp-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); }
.pp-card + .pp-card { margin-top: 12px; }
.pp-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pp-card-head h2, .pp-card-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.pp-card-head .pp-sub { font-size: 11.5px; color: var(--dim); font-weight: 400; }
.pp-card-body { padding: 14px 16px; }
.pp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
@media (min-width: 1280px) { .pp-grid-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pp-grid-2 > .pp-card + .pp-card { margin-top: 0; }

.pp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pp-stat { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 12px 14px; }
.pp-stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pp-stat-value { margin-top: 6px; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pp-stat-sub { margin-top: 2px; font-size: 11.5px; color: var(--dim); }
.pp-bar { height: 5px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-top: 8px; }
.pp-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.pp-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.pp-toolbar .pp-spacer { flex: 1; }
.pp-search { min-width: 220px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); color: var(--text); font: inherit; font-size: 12.5px; }
.pp-search:focus { outline: none; box-shadow: none; }

.pp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pp-btn:hover:not(:disabled) { border-color: var(--border-2); }
.pp-btn:disabled { opacity: .45; cursor: not-allowed; }
.pp-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.pp-btn-primary:hover:not(:disabled) { background: var(--accent-bright, var(--accent)); border-color: var(--accent-bright, var(--accent)); }
.pp-btn-danger { color: var(--red); }
.pp-btn-sm { padding: 4px 9px; font-size: 11.5px; }
.pp-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.pp-table-wrap { overflow-x: auto; }
.pp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pp-table th { padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; background: var(--card-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.pp-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pp-table tbody tr:last-child td { border-bottom: 0; }
.pp-table tbody tr:hover td { background: var(--hover-fade); }
/* Rows that are not clickable (the report catalog) do not light up. */
.pp-table.pp-table-static tbody tr:hover td { background: none; }
.pp-table .pp-c-check { width: 34px; }
.pp-table .pp-num { text-align: right; font-variant-numeric: tabular-nums; }
.pp-table tr.pp-sub-row td { background: var(--card-2); padding: 8px 12px 10px 46px; }
.pp-mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: var(--dim); }
.pp-dim { color: var(--dim); }
.pp-muted { color: var(--muted); font-size: 11.5px; }
.pp-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.pp-err { color: var(--red); font-size: 12px; }
.pp-msg { font-size: 12px; color: var(--dim); }

.pp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 650; border: 1px solid transparent; white-space: nowrap; }
.pp-badge-green { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-color: color-mix(in srgb, var(--green) 26%, transparent); }
.pp-badge-yellow { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); border-color: color-mix(in srgb, var(--yellow) 26%, transparent); }
.pp-badge-red { color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.pp-badge-blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border-color: color-mix(in srgb, var(--blue) 26%, transparent); }
.pp-badge-gray { color: var(--dim); background: var(--hover-fade); border-color: var(--border); }
.pp-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--muted); }
.pp-dot.is-on { background: var(--green); }
/* Patching → Software: open CVEs on a title; opens it on Vulnerabilities. */
.pp-cve-badge { margin-left: 4px; text-decoration: none; cursor: pointer; }
.pp-cve-badge:hover { filter: brightness(1.18); }

/* ── Overview: Change calendar card (overview.js) ─────────────────
   The Change Requests list rows (.crq-row, change-requests.css), smaller. */
.ov-card-changes { display: flex; flex-direction: column; }
.ov-card-changes .ov-card-head-tight { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ov-card-changes .ov-kb-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
/* Two classes: change-requests.css loads after this file and pads .crq-rows. */
.crq-rows.ov-changes-list { padding: 0; gap: 1px; }
.ov-changes-list .crq-row { gap: 10px; padding: 5px 6px; border-radius: 8px; }
.ov-changes-list .crq-row-date { width: 34px; height: 34px; border-left-width: 3px; border-radius: 8px; }
.ov-changes-list .crq-row-wd { font-size: 8.5px; }
.ov-changes-list .crq-row-day { font-size: 13px; }
.ov-changes-list .crq-row-title { font-size: 12.5px; }
.ov-changes-list .crq-row-meta { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Reports (reports.js) ─────────────────────────────────────────
   The library: one card per report, grouped by area. A security report is
   drawn as a document (.rd), the same markup the PDF prints. */
.rpt-crumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.rpt-crumbs[hidden] { display: none; }
.rpt-crumbs a { color: var(--dim); text-decoration: none; }
.rpt-crumbs a:hover { color: var(--text); }
.rpt-domain + .rpt-domain { margin-top: 26px; }
.rpt-domain-head { margin-bottom: 10px; }
/* The section title with a small link to its page right beside it. */
.rpt-domain-title { display: flex; align-items: center; gap: 10px; }
.rpt-domain-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.rpt-domain-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
/* "Patching ↗": a small, quiet pill that opens another page (Reports area headings, Overview). */
.link-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 9px; border: 1px solid var(--border); border-radius: 99px; background: var(--card-2); font-size: 11.5px; font-weight: 500; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease); }
.link-pill lucide-icon { font-size: 12px; --icon-stroke: 2; transition: translate .15s var(--ease); }
.link-pill:hover, .link-pill:focus-visible { color: var(--text); border-color: var(--border-2); background: var(--hover-fade); }
.link-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link-pill:hover lucide-icon { translate: 1px -1px; }
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rpt-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--text); text-decoration: none; transition: border-color .15s var(--ease), background .15s var(--ease); }
.rpt-card:hover { border-color: var(--border-2); background: var(--hover-fade); }
.rpt-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rpt-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius); background: var(--card-2); border: 1px solid var(--border); color: var(--dim); font-size: 16px; margin-bottom: 4px; }
.rpt-card-title { font-size: 13.5px; font-weight: 650; }
.rpt-card-text { font-size: 12px; line-height: 1.5; color: var(--dim); }
.rpt-card-meta { margin-top: auto; padding-top: 6px; font-size: 11px; color: var(--muted); }
.rpt-period { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }

.rd { padding: 18px 20px 20px; }
.rd a { color: var(--accent); text-decoration: none; }
.rd-muted, .rd-sub { color: var(--muted); }
.rd-sub { font-size: 11.5px; margin-top: 2px; }
.rd-bad { color: var(--red); }
.rd-trunc { margin: 0 0 12px; }
.rd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin: 0 0 18px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.rd-facts dt { font-size: 11px; color: var(--muted); }
.rd-facts dd { margin: 2px 0 0; font-size: 12.5px; font-weight: 550; }
.rd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.rd-kpi { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); }
.rd-kpi-label { font-size: 11px; color: var(--muted); }
.rd-kpi-value { font-size: 24px; font-weight: 650; line-height: 1.2; margin-top: 2px; }
.rd-kpi-sub { font-size: 11.5px; color: var(--muted); }
.rd-section + .rd-section { margin-top: 22px; }
.rd-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rd-section-head h2 { margin: 0; font-size: 13.5px; font-weight: 650; }
.rd-section-head p { margin: 2px 0 0; font-size: 12px; }
.rd-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.rd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rd-table th { padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left; background: var(--card-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.rd-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rd-table tbody tr:last-child td { border-bottom: 0; }
.rd-table .rd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-sev { white-space: nowrap; }
.rd-sev::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--c); vertical-align: 0; }
.rd-empty { margin: 0; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: 12.5px; text-align: center; }
.rd-note { margin: 20px 0 0; font-size: 11.5px; line-height: 1.55; }

.pp-list-item { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pp-list-item:last-child { border-bottom: 0; }
.pp-list-item:hover { background: var(--hover-fade); }
.pp-list-title { font-size: 13.5px; font-weight: 650; }
.pp-list-meta { margin-top: 2px; font-size: 11.5px; color: var(--dim); }

/* Policy editor */
.pp-editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pp-editor-head .pp-name { flex: 1; min-width: 240px; font-size: 15px; font-weight: 650; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); color: var(--text); }
.pp-editor-layout { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .pp-editor-layout { grid-template-columns: 1fr; } }
.pp-side { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); padding: 6px; position: sticky; top: 8px; }
.pp-side-title { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pp-side button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--dim); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.pp-side button:hover { color: var(--text); background: var(--hover-fade); }
.pp-side button.is-active { color: var(--text); background: var(--card-2); box-shadow: inset 2px 0 0 var(--accent); }

.pp-field { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.pp-field:last-child { border-bottom: 0; }
@media (max-width: 760px) { .pp-field { grid-template-columns: 1fr; } }
.pp-field > label, .pp-field > .pp-label { font-size: 12.5px; font-weight: 600; padding-top: 6px; }
.pp-field .pp-help { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.pp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-col { display: grid; gap: 8px; }
.pp-input, .pp-select { padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); color: var(--text); font: inherit; font-size: 12.5px; }
.pp-input:focus, .pp-select:focus { outline: none; box-shadow: none; }
.pp-input-num { width: 72px; }
.pp-textarea { width: 100%; min-height: 64px; resize: vertical; }
.pp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.pp-check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.pp-radio { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; cursor: pointer; padding: 3px 0; }
.pp-radio input { accent-color: var(--accent); margin: 2px 0 0; }
.pp-nested { margin: 4px 0 6px 24px; display: grid; gap: 8px; }
.pp-daypick { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pp-daypick label { display: inline-flex; }
.pp-daypick input { position: absolute; opacity: 0; width: 0; height: 0; }
.pp-daypick span { min-width: 34px; text-align: center; padding: 4px 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 11.5px; font-weight: 600; color: var(--dim); cursor: pointer; background: var(--card-2); }
.pp-daypick input:checked + span { color: var(--on-accent, #fff); background: var(--accent); border-color: var(--accent); }
.pp-daypick input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.pp-note { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-2); font-size: 11.5px; color: var(--dim); }
.pp-switch { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pp-switch span { position: relative; width: 32px; height: 18px; border-radius: 99px; background: var(--border-2); transition: background .15s; }
.pp-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.pp-switch input:checked + span { background: var(--accent); }
.pp-switch input:checked + span::after { transform: translateX(14px); }
.pp-switch input:focus-visible + span { outline: 2px solid var(--accent-line); outline-offset: 2px; }

/* Modal */
.pp-modal-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, .55); }
.pp-modal { width: min(880px, 96vw); max-height: 88vh; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-xl, 14px); background: var(--card); box-shadow: var(--shadow-panel, 0 20px 60px rgba(0,0,0,.4)); color: var(--text); }
.pp-modal-sm { width: min(520px, 96vw); }
.pp-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pp-modal-head h2 { margin: 0; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.pp-modal-icon { font-size: 17px; color: var(--dim); --icon-stroke: 1.9; }
.pp-btn lucide-icon { font-size: 14px; --icon-stroke: 2.2; }
.pp-modal-body { padding: 14px 18px; overflow: auto; }
.pp-modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.pp-close { margin-left: auto; border: 0; background: none; color: var(--dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.pp-close:hover { color: var(--text); background: var(--hover-fade); }

/* Fleet device panel */
.fl-pp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fl-pp-head h2 { margin: 0; }
.fl-pp-head .pp-spacer { flex: 1; }
.fl-pp-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; font-size: 12px; }
.fl-pp-meta > div:nth-child(odd) { color: var(--muted); }
.fl-pp-chips { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.fl-pp-chips button { border: 1px solid var(--border); background: var(--card-2); color: var(--dim); font: inherit; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; cursor: pointer; }
.fl-pp-chips button.is-active { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft, var(--card)); }
.fl-pp-warn { margin: 8px 0; padding: 8px 10px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--yellow) 30%, transparent); background: color-mix(in srgb, var(--yellow) 8%, transparent); color: var(--yellow); font-size: 12px; }
.fl-pp-acts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.fl-pp .pp-table td, .fl-pp .pp-table th { padding: 6px 8px; }

/* ── Tickets: one overview at /tickets, one page per dashboard ─────── */
/* The stage holds either the overview panel or a dashboard's full page. */
.tpd-stage { display: flex; flex-direction: column; gap: 0.875rem; min-width: 0; }
.tpd-notice {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--dim);
  font-size: var(--tpd-type-xs, 12px);
}
/* The page title sits above the card, not inside it. */
.tpd-overview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  color: var(--text);
}
.tpd-overview-head {
  display: flex;
  flex-direction: column;
  padding: 0 0.125rem;
}
.tpd-overview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.tpd-overview-head h1 {
  margin: 0;
  color: var(--text);
  font-size: var(--tpd-type-md);
  font-weight: 700;
  line-height: 1.3;
}
/* Headings take focus on a route change so screen readers announce the page;
   they are not controls, so no ring. */
.tpd-overview-head h1:focus,
.tpd-full-heading h1:focus { outline: none; }
.tpd-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tpd-metric {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  padding: 1rem 1.125rem;
  border-right: 1px solid var(--border);
}
.tpd-metric:last-child { border-right: 0; }
.tpd-metric-label { color: var(--muted); font-size: var(--tpd-type-2xs); font-weight: 600; }
.tpd-metric-value {
  color: var(--dim);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tpd-overview-note {
  margin: 0;
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--tpd-type-xs);
}
@media (max-width: 52rem) {
  .tpd-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpd-metric:nth-child(2n) { border-right: 0; }
  .tpd-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
}

/* A dashboard's page: heading on the left, its actions on the right. */
.tpd-full-head { align-items: center; }
.tpd-full-actions { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; margin-left: auto; }
.tpd-full-actions .tkt-foot-label { margin: 0; }

/*
 * One control size on a dashboard page. The sort and rows pickers (enhanced
 * selects), the edit pen and the pager arrows all sit at 30px with the same
 * radius, so the header and the footer read as one set.
 */
.tpd-full-filter { --tpd-control: 30px; }
.tpd-full-filter .cs { display: inline-flex; width: auto; }
.tpd-full-filter .cs-trigger {
  height: var(--tpd-control);
  min-width: 0;
  width: auto;
  gap: 6px;
  padding: 0 9px 0 11px;
  font-size: 12px;
  line-height: 1;
  border-radius: var(--radius-sm);
}
.tpd-full-filter .cs-chevron { width: 10px; height: 10px; }
/* Sort: wide enough for its longest label, so it does not jump between choices. */
.tpd-full-actions .cs-trigger { min-width: 118px; }
/* Rows: a two- or three-digit number needs no more than this. */
.tpd-full-filter .tkt-foot-right .cs-trigger { min-width: 0; padding: 0 7px 0 9px; }
.tpd-edit-btn,
.tpd-full-filter .tkt-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tpd-control);
  height: var(--tpd-control);
  padding: 0;
  border-radius: var(--radius-sm);
}
.tpd-edit-btn svg,
.tpd-full-filter .tkt-page svg { width: 14px; height: 14px; }

/* Empty dashboard: just the message, no dashed box. */
.tpd-full-filter .tkt-empty { border: 0; border-radius: 0; }
/* The heading takes focus on a route change for screen readers; it is not a
   control, so no ring (the global :focus-visible draws one as a box-shadow). */
.tpd-full-heading h1:focus,
.tpd-full-heading h1:focus-visible,
.tpd-overview-head h1:focus-visible { outline: none; box-shadow: none; }
.tpd-full-note {
  margin: 0;
  padding: 0 0.125rem;
  color: var(--dim);
  font-size: var(--tpd-type-xs);
}

/* No pager: the table grows as its last row scrolls into view. This line sits
   under the card while more rows exist, and is what the scroll watcher sees. */
.tpd-more {
  flex: none;
  padding: 4px 2px 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
/* The shared table skeleton brings its own pager bar; a dashboard has none. */
.tpd-skeleton-dashboard .tpd-full-card .tkt-skeleton-foot { display: none; }

/* Loading shapes for both pages. */
.tpd-skeleton-eyebrow { display: block; width: 56px; height: 7px; margin-bottom: 8px; border-radius: 4px; }
.tpd-skeleton-heading { display: block; width: 140px; height: 12px; border-radius: 4px; }
.tpd-skeleton-metric-label { display: block; width: 72px; height: 8px; border-radius: 4px; }
.tpd-skeleton-metric.is-2 .tpd-skeleton-metric-label { width: 58px; }
.tpd-skeleton-metric.is-3 .tpd-skeleton-metric-label { width: 86px; }
.tpd-skeleton-metric-value { display: block; width: 36px; height: 20px; border-radius: 5px; }

/* ── Fleet: device page (overview, tabs, widgets) ─────────────────────
   Header + tabs + three-column overview. "Coming soon" parts share
   .fl-soon / .fl-soon-card / .fl-skel so they read as one family. */

.fl-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fl-spacer { flex: 1 1 auto; }
.fl-strong { color: var(--text); font-weight: 600; }

.fl-device .fl-device-top { flex-wrap: wrap; row-gap: 8px; align-items: flex-end; }
.fl-device .fl-device-back { align-self: center; }
.fl-device-crumbs {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  margin-bottom: 2px; color: var(--muted); font-size: 11.5px; white-space: nowrap;
}
.fl-device-crumbs span[aria-hidden] { color: var(--border-2); }
.fl-device-status { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.fl-link {
  padding: 0; border: 0; background: none; color: var(--accent-bright, var(--accent));
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.fl-link:hover { text-decoration: underline; }
.fl-link:focus-visible, .fl-dtab:focus-visible, .fl-hbtn:focus-visible,
.fl-icon-btn:focus-visible, .fl-seg-btn:focus-visible, .fl-tool:focus-visible,
.fl-fly-item:focus-visible {
  outline: 2px solid var(--accent-bright, var(--accent)); outline-offset: 2px;
}

.fl-health {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.fl-health i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fl-health.is-ok { color: var(--green); }
.fl-health.is-warn { color: var(--yellow); }
.fl-health.is-crit { color: var(--red); }

.fl-device-head-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fl-hbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--well);
  color: var(--dim); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer;
}
.fl-hbtn:hover { color: var(--text); border-color: var(--border-2); }
.fl-hbtn lucide-icon { font-size: 14px; }
.fl-tool-wrap.is-open > .fl-hbtn { color: var(--text); border-color: var(--border-2); }
.fl-fly-root.is-right { left: auto; right: 0; }
.fl-fly-item .fl-soon.is-sm { margin-left: auto; }

/* Tabs: real buttons now, scrolling sideways on narrow screens. */
.fl-device .fl-device-tabs { overflow-x: auto; scrollbar-width: none; }
.fl-dtab {
  flex: none; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.fl-dtab:hover { color: var(--text); }
.fl-dtab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.fl-dtab.is-soon { color: var(--dim); opacity: .7; }
.fl-dtab.is-soon.is-active { opacity: 1; }

.fl-device > .fl-action-out { margin: 0; padding: 0 18px; flex: none; }
.fl-device > .fl-action-out:not(:empty) { padding: 8px 18px; border-bottom: 1px solid var(--hairline, var(--border)); }

.fl-soon {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border: 1px dashed var(--border-2); border-radius: 999px;
  color: var(--muted); font-size: 10.5px; font-weight: 650; letter-spacing: .02em; white-space: nowrap;
}
.fl-soon.is-sm { height: 16px; padding: 0 6px; font-size: 10px; }

/* Cards */
.fl-card {
  margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); min-width: 0;
}
.fl-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.fl-card-head h2 {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  color: var(--text); font-size: 13px; font-weight: 650;
}
.fl-card-head h2 lucide-icon { font-size: 15px; color: var(--muted); }
.fl-card-head > .fl-card-meta, .fl-card-head > .fl-link, .fl-card-head > .fl-soon { margin-left: auto; }
.fl-card-meta { color: var(--muted); font-size: 11.5px; }
.fl-card-text { margin: 0; color: var(--dim); font-size: 12.5px; line-height: 1.5; }
.fl-card-foot { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }
.fl-soon-card { border-style: dashed; }
.fl-soon-preview { margin-top: 12px; opacity: .55; pointer-events: none; }

/* Overview: performance | information, running, health | activities */
.fl-ov {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.9fr) minmax(260px, 1.2fr);
}
.fl-ov-col { min-width: 0; }
.fl-ov-col > .fl-card:last-child { margin-bottom: 0; }
@media (max-width: 1280px) {
  .fl-ov { grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr); }
  .fl-ov > .fl-ov-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .fl-ov { grid-template-columns: 1fr; }
}
.fl-ov-activity .fl-feed { max-height: 720px; overflow: auto; }

.fl-perf-now { margin: -4px 0 8px; color: var(--text); font-size: 12.5px; }
.fl-spark { display: block; width: 100%; height: 56px; }
.fl-spark-line { fill: none; stroke: var(--live); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.fl-spark-area { fill: var(--live-soft); stroke: none; }
.fl-spark-grid { stroke: var(--hairline, var(--border)); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.fl-spark-empty {
  display: flex; align-items: center; justify-content: center; height: 56px;
  border-radius: 8px; background: var(--well); color: var(--muted); font-size: 12px;
}

.fl-vols, .fl-nics, .fl-feed { margin: 0; padding: 0; list-style: none; }
.fl-vols { display: grid; gap: 8px; margin-bottom: 10px; }
.fl-vols li { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 12.5px; }
.fl-vol-name { color: var(--text); }
.fl-vol-val { color: var(--text); font-variant-numeric: tabular-nums; }
.fl-vols .fl-meter { grid-column: 1 / -1; }
.fl-vol-sub { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.fl-meter { display: block; height: 6px; border-radius: 999px; background: var(--well); overflow: hidden; }
.fl-meter i { display: block; height: 100%; border-radius: inherit; background: var(--live); }
.fl-meter.is-warn i { background: var(--yellow); }
.fl-meter.is-crit i { background: var(--red); }
.fl-usage { display: inline-flex; align-items: center; gap: 8px; }
.fl-usage .fl-meter { width: 80px; }
.fl-nics { display: grid; gap: 8px; }
.fl-nics li { display: grid; gap: 2px; font-size: 12.5px; }
.fl-nic-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-nic-sub { color: var(--muted); font-size: 11.5px; }

/* Key / value lists */
.fl-kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 7px 16px; font-size: 12.5px; }
.fl-kv-k { color: var(--muted); }
.fl-kv-v { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.fl-kv-v code { font-size: 11.5px; }
.fl-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; }
.fl-copyable { display: inline-flex; align-items: center; gap: 6px; }
.fl-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
}
.fl-icon-btn:hover { background: var(--hover-fade); color: var(--text); }

/* Feeds: activities, running actions, health issues */
.fl-feed-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--hairline, var(--border));
}
.fl-feed-item:first-child { border-top: 0; padding-top: 2px; }
.fl-feed.is-compact .fl-feed-item { padding: 7px 0; }
.fl-feed-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 6px; background: var(--well); color: var(--muted);
}
.fl-feed-ico lucide-icon { font-size: 13px; }
.fl-feed-main { flex: 1; min-width: 0; }
.fl-feed-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--text); font-size: 12.5px; font-weight: 600; }
.fl-feed-sub { margin-top: 2px; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.fl-row-menu { flex: none; }
.fl-spin {
  width: 12px; height: 12px; border: 2px solid var(--border-2); border-top-color: var(--live);
  border-radius: 50%; animation: fl-spin .9s linear infinite;
}
@keyframes fl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fl-spin { animation: none; } }
.fl-sev { flex: none; width: 8px; height: 8px; margin: 5px 8px 0 8px; border-radius: 50%; background: var(--blue); }
.fl-sev.is-warn { background: var(--yellow); }
.fl-sev.is-crit { background: var(--red); }
.fl-health-ok { display: flex; align-items: center; gap: 8px; }
.fl-health-ok lucide-icon { color: var(--green); font-size: 16px; }

.fl-chip {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--well); color: var(--muted); font-size: 10.5px; font-weight: 650;
}
.fl-chip.is-green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.fl-chip.is-red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.fl-chip.is-yellow { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.fl-chip.is-blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }

/* Segmented filter */
.fl-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; flex-wrap: wrap; }
.fl-seg-btn {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; font-weight: 550; cursor: pointer;
}
.fl-seg-btn:hover { color: var(--text); }
.fl-seg-btn.is-active { background: var(--hover-fade); color: var(--text); }

/* Detail tables */
.fl-details { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-items: start; }
.fl-details > .fl-card { margin: 0; }
.fl-table-wrap { overflow-x: auto; }
.fl-dtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fl-dtable th {
  padding: 7px 10px; border-bottom: 1px solid var(--border); color: var(--muted);
  font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap;
}
.fl-dtable td { padding: 7px 10px; border-bottom: 1px solid var(--hairline, var(--border)); color: var(--dim); vertical-align: top; }
.fl-dtable tr:last-child td { border-bottom: 0; }
.fl-sw-search { margin-left: auto; width: min(280px, 100%); }

/* Tools */
.fl-tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fl-tools > .fl-card { margin: 0; }
.fl-tool-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Placeholders inside "coming soon" previews */
.fl-skel { display: inline-block; width: 60px; height: 10px; border-radius: 4px; background: var(--well); }
.fl-skel.is-wide { width: 140px; }
.fl-skel.is-block { display: block; width: 100%; height: 56px; margin-bottom: 8px; }
.fl-vuln-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.fl-vuln-tile { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.fl-vuln-tile span { display: block; color: var(--muted); font-size: 11.5px; }
.fl-vuln-tile strong { color: var(--text); font-size: 18px; }

/* Ticket detail: no divider between the title block and the tabs. */
.tkd-workspace .tkd-head { border-bottom: 0; }

/* Ticket composer: the mode toggle row is gone, so close the empty gap
   between the transcript and the input box. */
.tkd-workspace .tkd-scroll:has(+ .tkd-composer) { padding-bottom: 10px; }
.tkd-workspace .tkd-composer { padding-top: 4px; }

/* Composer box: one look in both modes, and no focus ring (no green outline). */
.tkd-workspace .tkd-compose-box,
.tkd-workspace .tkd-compose-box.is-note,
.tkd-workspace .tkd-compose-box:focus-within,
.tkd-workspace .tkd-compose-box.is-note:focus-within {
  border-color: var(--border-2);
  background: var(--card-2);
  box-shadow: none;
}

/* ── Composer visibility switch (Visible to the user / Private) ────────────
   Folded it reads like plain text: icon, label, a small caret. Clicked, it
   slides open sideways into a two-option track; a thumb glides to the pick
   and the track folds back to the chosen option. No popover. */
.tkd-workspace .tkd-compose-hint { gap: 6px 12px; }
.tkd-workspace .tkd-vis {
  --vis-ease: cubic-bezier(.22, 1, .36, 1);
  position: relative;
  display: inline-flex;
  height: 34px;
  padding: 3px;
  border-radius: 9px;
  background: transparent;
  align-items: center;
  cursor: pointer;
  transition: background-color .28s ease;
}
.tkd-workspace .tkd-vis:not(.is-expanded):hover { background: var(--hover); }
.tkd-workspace .tkd-vis.is-expanded { background: var(--bg); }

.tkd-workspace .tkd-vis-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--thumb-w, 0px);
  border-radius: 7px;
  background: var(--well-hi, var(--hover));
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--thumb-x, 3px));
  transition: transform .3s var(--vis-ease), width .3s var(--vis-ease),
              opacity .2s ease, background-color .28s ease;
}
.tkd-workspace .tkd-vis.is-expanded .tkd-vis-thumb { opacity: 1; }

.tkd-workspace .tkd-vis-opt {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: none;
  width: var(--w, auto);
  height: 28px;
  padding: 0 9px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  outline: none;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: width .3s var(--vis-ease), padding .3s var(--vis-ease),
              opacity .22s ease, color .22s ease;
}
.tkd-workspace .tkd-vis-opt:hover,
.tkd-workspace .tkd-vis-opt.is-on { color: var(--text); }
.tkd-workspace .tkd-vis.is-note .tkd-vis-opt.is-on { color: var(--t-orange); }
.tkd-workspace .tkd-vis-opt:focus-visible { box-shadow: none; }
/* Folded: only the chosen option keeps its width. */
.tkd-workspace .tkd-vis:not(.is-expanded) .tkd-vis-opt:not(.is-on) {
  width: 0;
  padding-right: 0;
  padding-left: 0;
  opacity: 0;
  pointer-events: none;
}
.tkd-workspace .tkd-vis-icon {
  display: inline-flex;
  flex: none;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkd-vis-icon lucide-icon { font-size: 15px; }
.tkd-workspace .tkd-vis-opt.is-on:not(:hover) .tkd-vis-icon { color: var(--dim); }
.tkd-workspace .tkd-vis.is-note .tkd-vis-opt.is-on .tkd-vis-icon { color: currentColor; }

/* Caret points the way it will slide: right to open, left to fold back. */
.tkd-workspace .tkd-vis-caret {
  flex: none;
  margin: 0 6px 0 -3px;
  color: var(--muted);
  opacity: .7;
  transition: transform .3s var(--vis-ease), opacity .16s ease, margin .3s var(--vis-ease);
}
.tkd-workspace .tkd-vis:hover .tkd-vis-caret { opacity: 1; }
.tkd-workspace .tkd-vis.is-expanded .tkd-vis-caret { margin-left: 3px; transform: rotate(180deg); }

/* Measuring natural widths, and the first paint: no motion. */
.tkd-workspace .tkd-vis.is-measuring .tkd-vis-opt { width: auto !important; padding: 0 9px !important; }
.tkd-workspace .tkd-vis.is-static,
.tkd-workspace .tkd-vis.is-static * { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tkd-workspace .tkd-vis,
  .tkd-workspace .tkd-vis * { transition: none !important; }
}

/* ── Ticket detail readability pass ───────────────────────────
   The conversation, header, tabs and composer had drifted down to 7.5–11px.
   Final sizes for the ticket workspace; overrides the earlier layers. */
.tkd-workspace .tkd-kicker,
.tkd-workspace .tkd-head .tkd-kicker { font-size: 12px; }
.tkd-workspace .tkd-kicker lucide-icon { font-size: 14px; }

.tkd-workspace .tkd-tab { font-size: 12.5px; }
.tkd-workspace .tkd-tab span { min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }

.tkd-workspace .tkd-summary-title { font-size: 11.5px; }
.tkd-workspace .tkd-summary p { font-size: 12.5px; line-height: 1.55; }
.tkd-workspace .tkd-summary-count,
.tkd-workspace .tkd-summary-updated { font-size: 10.5px; }
.tkd-workspace .tkd-chat-error { font-size: 12px; }

.tkd-workspace .tkd-msg-who { font-size: 12.5px; }
.tkd-workspace .tkd-msg-role { padding: 2px 7px; font-size: 10px; }
.tkd-workspace .tkd-msg-time { font-size: 10.5px; }
.tkd-workspace .tkd-bubble,
.tkd-workspace .tkd-bubble.is-ai,
.tkd-workspace .tkd-bubble.is-note { font-size: 13.5px; line-height: 1.6; }

.tkd-workspace .tkd-system-copy strong { font-size: 11.5px; }
.tkd-workspace .tkd-system-copy span,
.tkd-workspace .tkd-system time { font-size: 10.5px; }
.tkd-workspace .tkd-system-icon lucide-icon { font-size: 12px; }

.tkd-workspace .tkd-compose-box textarea { min-height: 72px; font-size: 13.5px; line-height: 1.55; }
.tkd-workspace .tkd-compose-hint { font-size: 12px; }
.tkd-workspace .tkd-send { height: 36px; font-size: 12px; }
.tkd-workspace .tkd-send lucide-icon { font-size: 13px; }

@media (max-width: 620px) {
  .tkd-workspace .tkd-bubble,
  .tkd-workspace .tkd-bubble.is-ai,
  .tkd-workspace .tkd-bubble.is-note { font-size: 13px; }
  .tkd-workspace .tkd-compose-box textarea { min-height: 60px; font-size: 13px; }
}

/* ── Ticket conversation (tkc-*) ──────────────────────────────────────────
   One centred column shared with the composer. The user is on the left, IT
   support and the assistant on the right. Borderless bubbles with soft fills,
   grouped runs from one sender, day dividers, and quiet inline events. */
.tkd-workspace .tkd-compose-inner { width: min(860px, 100%); }
.tkd-workspace .tkc {
  /* The --t-* tones are only defined under .tkt/.kbb; this view needs them too. */
  --tkc-green: var(--t-green, #4ec98a);
  --tkc-orange: var(--t-orange, #dd9040);
  --tkc-col: min(860px, 100%);
  --tkc-radius: 16px;
  --tkc-tuck: 5px;
  --tkc-requester: var(--well-hi, var(--card-2));
  --tkc-agent: color-mix(in srgb, var(--accent) 15%, var(--card));
  --tkc-ai: color-mix(in srgb, #9d75ef 11%, var(--card));
  display: flex;
  width: var(--tkc-col);
  margin: 0 auto;
  flex-direction: column;
  gap: 18px;
}

/* AI summary: a calm card, no hard outline. */
.tkd-workspace .tkc-summary {
  display: grid;
  padding: 13px 15px;
  border-radius: 12px;
  background: color-mix(in srgb, #9d75ef 7%, var(--card));
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
}
.tkd-workspace .tkc-summary-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #a982f3;
  background: color-mix(in srgb, #9d75ef 15%, transparent);
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkc-summary-icon lucide-icon { font-size: 15px; }
.tkd-workspace .tkc-summary-head {
  display: flex;
  margin-bottom: 3px;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.tkd-workspace .tkc-summary-head strong { color: #b394f5; font-size: 12px; font-weight: 700; }
.tkd-workspace .tkc-summary-head span { color: var(--muted); font-size: 11px; }
.tkd-workspace .tkc-summary p { margin: 0; color: var(--text); font-size: 13.5px; line-height: 1.55; }

.tkd-workspace .tkc-thread { display: flex; flex-direction: column; padding-bottom: 6px; }
.tkd-workspace .tkc-loading { display: flex; min-height: 72px; align-items: center; justify-content: center; }

/* Inline events (ticket opened, escalated, …) */
.tkd-workspace .tkc-event {
  display: flex;
  max-width: 100%;
  margin: 8px auto 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 7px;
}
.tkd-workspace .tkc-event-icon { display: inline-flex; color: var(--dim); }
.tkd-workspace .tkc-event-icon lucide-icon { font-size: 13px; }
.tkd-workspace .tkc-event-text { color: var(--dim); }
.tkd-workspace .tkc-event time { color: var(--muted); font-size: 11px; }
.tkd-workspace .tkc-event time::before { content: '·'; margin-right: 7px; }

/* Messages */
.tkd-workspace .tkc-msg { display: flex; align-items: flex-start; gap: 10px; }
.tkd-workspace .tkc-msg + .tkc-msg { margin-top: 3px; }
.tkd-workspace .tkc-msg.is-first { margin-top: 14px; }
.tkd-workspace .tkc-thread > .tkc-msg:first-child,
.tkd-workspace .tkc-event + .tkc-msg { margin-top: 0; }
.tkd-workspace .tkc-msg.is-right { flex-direction: row-reverse; }
.tkd-workspace .tkc-av { flex: 0 0 30px; width: 30px; }
.tkd-workspace .tkc-avatar {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--dim);
  background: var(--card-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  align-items: center;
  justify-content: center;
}
.tkd-workspace .tkc-avatar.is-requester { color: var(--tkc-green); background: color-mix(in srgb, var(--tkc-green) 13%, var(--card)); }
.tkd-workspace .tkc-avatar.is-agent { color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.tkd-workspace .tkc-avatar.is-ai { color: #b394f5; background: color-mix(in srgb, #9d75ef 16%, var(--card)); }
.tkd-workspace .tkc-avatar lucide-icon { font-size: 14px; }

.tkd-workspace .tkc-body {
  display: flex;
  min-width: 0;
  max-width: min(640px, 78%);
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.tkd-workspace .tkc-msg.is-right .tkc-body { align-items: flex-end; }
.tkd-workspace .tkc-head {
  display: flex;
  min-height: 18px;
  padding: 0 4px;
  align-items: baseline;
  gap: 8px;
}
.tkd-workspace .tkc-msg.is-right .tkc-head { flex-direction: row-reverse; }
.tkd-workspace .tkc-who { color: var(--text); font-size: 12.5px; font-weight: 650; }
.tkd-workspace .tkc-head time,
.tkd-workspace .tkc-note-head time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.tkd-workspace .tkc-bubble {
  max-width: 100%;
  padding: 9px 14px;
  border-radius: var(--tkc-radius);
  color: var(--text);
  background: var(--tkc-requester);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.tkd-workspace .tkc-msg.is-agent .tkc-bubble { background: var(--tkc-agent); }
.tkd-workspace .tkc-msg.is-ai .tkc-bubble { background: var(--tkc-ai); }
/* Tucked corners where bubbles of one group meet, on the sender's side. */
.tkd-workspace .tkc-msg.is-left:not(.is-first) .tkc-bubble { border-top-left-radius: var(--tkc-tuck); }
.tkd-workspace .tkc-msg.is-left:not(.is-last) .tkc-bubble { border-bottom-left-radius: var(--tkc-tuck); }
.tkd-workspace .tkc-msg.is-right:not(.is-first) .tkc-bubble { border-top-right-radius: var(--tkc-tuck); }
.tkd-workspace .tkc-msg.is-right:not(.is-last) .tkc-bubble { border-bottom-right-radius: var(--tkc-tuck); }

/* Formatted text inside bubbles and notes */
.tkd-workspace .tkc-bubble > *,
.tkd-workspace .tkc-note-body > * { margin: 0; }
.tkd-workspace .tkc-bubble > * + *,
.tkd-workspace .tkc-note-body > * + * { margin-top: 8px; }
/* A Tailwind preflight elsewhere on the page sets `ol, ul { list-style: none }`. */
.tkd-workspace .tkc-bubble ol,
.tkd-workspace .tkc-note-body ol { padding-left: 22px; list-style: decimal outside; }
.tkd-workspace .tkc-bubble ul,
.tkd-workspace .tkc-note-body ul { padding-left: 20px; list-style: disc outside; }
.tkd-workspace .tkc-bubble li,
.tkd-workspace .tkc-note-body li { display: list-item; }
.tkd-workspace .tkc-bubble li + li,
.tkd-workspace .tkc-note-body li + li { margin-top: 3px; }
.tkd-workspace .tkc-bubble li::marker { color: var(--muted); }
.tkd-workspace .tkc-bubble strong { color: var(--text); font-weight: 650; }

.tkd-workspace .tkc-images {
  display: grid;
  width: min(460px, 100%);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}
.tkd-workspace .tkc-images img {
  display: block;
  width: 100%;
  max-height: 260px;
  border-radius: 12px;
  background: var(--bg);
  object-fit: cover;
}

/* Private notes span the column so they never read as a reply. */
.tkd-workspace .tkc-note {
  margin: 14px 0 0;
  padding: 10px 14px 11px;
  border-left: 3px solid var(--tkc-orange);
  border-radius: 4px 12px 12px 4px;
  background: color-mix(in srgb, var(--tkc-orange) 7%, var(--card));
}
.tkd-workspace .tkc-note + .tkc-msg,
.tkd-workspace .tkc-msg + .tkc-note { margin-top: 14px; }
.tkd-workspace .tkc-note-head {
  display: flex;
  margin-bottom: 5px;
  color: var(--tkc-orange);
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.tkd-workspace .tkc-note-head lucide-icon { font-size: 13px; }
.tkd-workspace .tkc-note-tag { font-size: 11.5px; font-weight: 700; }
.tkd-workspace .tkc-note-head .tkc-who { font-size: 12px; }
.tkd-workspace .tkc-note-body { color: var(--text); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tkd-workspace .tkc-note .tkc-images { margin-top: 8px; }

@media (max-width: 620px) {
  .tkd-workspace .tkc { gap: 14px; }
  .tkd-workspace .tkc-av { flex-basis: 26px; width: 26px; }
  .tkd-workspace .tkc-avatar { width: 26px; height: 26px; font-size: 9.5px; }
  .tkd-workspace .tkc-body { max-width: calc(100% - 36px); }
  .tkd-workspace .tkc-bubble,
  .tkd-workspace .tkc-note-body { font-size: 13px; }
}

/* ── Dashboard wizard (ticket-presets.js, mountDashboardWizard) ───────────
   Name → Filters → Visibility, the same for a new dashboard (in a dialog) and
   an existing one (the manager's right pane). */

/* Manager pane: the wizard fills it and scrolls on its own. */
.tpd-config-wizard { min-width: 0; min-height: 0; overflow-y: auto; background: var(--card); }
.tpd-config-wizard .tpd-wiz { max-width: 46rem; min-height: 100%; margin: 0 auto; }

/* Dialog: a little wider than the old form, and a steady height so the box
   does not jump between steps. */
.tpd-modal.tpd-modal-wiz { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.tpd-modal-wiz .tpd-wiz-body { min-height: 300px; }

.tpd-wiz { display: flex; flex-direction: column; }
.tpd-wiz-head { padding: 18px 22px 0; }
.tpd-wiz-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.tpd-wiz-title h2 {
  margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: 14px; font-weight: 700;
}

/* Step bar: three bars, filled up to the current step; each one jumps there. */
.tpd-wiz-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.tpd-wiz-step {
  display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 6px 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  font: inherit; text-align: left; cursor: pointer; transition: color .15s var(--ease);
}
.tpd-wiz-bar { display: block; height: 4px; border-radius: 999px; background: var(--border-2); transition: background .2s var(--ease); }
.tpd-wiz-step.is-reached .tpd-wiz-bar { background: var(--text); }
.tpd-wiz-step.is-current,
.tpd-wiz-step:hover { color: var(--text); }
.tpd-wiz-step:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.tpd-wiz-step-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.tpd-wiz-step-label b { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .6; }

.tpd-wiz-body { flex: 1 1 auto; padding: 30px 22px 26px; }
.tpd-wiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--border); }
.tpd-wiz-foot > div { display: flex; align-items: center; gap: 8px; }

/* Step 1: the name, large and centred, on an underline. */
.tpd-wiz-name { max-width: 420px; margin: 28px auto 0; text-align: center; }
.tpd-wiz-name-label { display: block; margin-bottom: 22px; color: var(--text); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.tpd-wiz-name-input {
  display: block; width: 100%; padding: 8px 2px 10px;
  border: 0; border-bottom: 2px solid var(--border-2); border-radius: 0;
  background: transparent; color: var(--text); font: inherit; font-size: 17px; text-align: center;
  outline: none; transition: border-color .15s var(--ease);
}
.tpd-wiz-name-input::placeholder { color: var(--muted); }
.tpd-wiz-name-input:focus { border-bottom-color: var(--text); }
.tpd-wiz-name-input[aria-invalid="true"] { border-bottom-color: var(--red); }
.tpd-wiz-name-input:disabled { opacity: .6; }
.tpd-wiz-hint { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.tpd-wiz-hint.is-error { color: var(--red); }

/* Steps 2 and 3: a heading over the content. */
.tpd-wiz-section { margin: 0 0 16px; }
.tpd-wiz-section h3 { margin: 0; color: var(--text); font-size: 16px; font-weight: 700; outline: none; }
.tpd-wiz-section p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

/* Step 2: filters as a two-column table — field | value — and a + row. */
.tpd-wiz-criteria { overflow: hidden; border: 1px solid var(--border-2); border-radius: 12px; }
.tpd-wiz-row { display: grid; grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr); min-height: 50px; }
.tpd-wiz-row + .tpd-wiz-row { border-top: 1px solid var(--border); }
.tpd-wiz-cell { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; }
.tpd-wiz-cell.is-field { border-right: 1px solid var(--border); }
.tpd-wiz-row.is-empty .tpd-wiz-cell { grid-column: 1 / -1; justify-content: center; color: var(--muted); font-size: 12px; }

/* The field: quiet, it labels the row. */
.tpd-wiz-cell.is-field .cs { display: block; width: 100%; }
.tpd-wiz-cell.is-field .cs-trigger {
  min-width: 0; height: 34px; padding: 0 10px; border-color: transparent; background: transparent;
  font-size: 13px; font-weight: 600;
}
.tpd-wiz-cell.is-field .cs-trigger:hover:not(:disabled) { background: var(--hover-fade); border-color: transparent; }

/* The values: pills, "or" between them, and a + for another one. They wrap
   onto a second line rather than squeezing. */
.tpd-wiz-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.tpd-wiz-pill { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.tpd-wiz-or { color: var(--muted); font-size: 11px; }
.tpd-wiz-pill-remove {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tpd-wiz-pill-remove:hover { color: var(--text); background: var(--hover-fade); }
.tpd-wiz-pill-remove:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.tpd-wiz-pill-remove svg { width: 10px; height: 10px; }
.tpd-wiz-value-add {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; padding: 0;
  border: 1px dashed var(--border-2); border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.tpd-wiz-value-add:hover { color: var(--text); border-color: var(--text); background: var(--hover-fade); }
.tpd-wiz-value-add:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.tpd-wiz-value-add lucide-icon { font-size: 14px; --icon-stroke: 2; }

/* The value: a pill. */
.tpd-wiz-cell.is-value .cs { width: auto; max-width: 100%; }
.tpd-wiz-cell.is-value .cs-trigger {
  min-width: 0; height: 28px; gap: 8px; padding: 0 10px 0 12px;
  border: 1px solid var(--border-2); border-radius: 999px; background: var(--card-2);
  font-size: 12px; font-weight: 600;
}
.tpd-wiz-cell.is-value .cs-trigger:hover:not(:disabled) { border-color: var(--text); }

.tpd-wiz-remove {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; margin-left: auto; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.tpd-wiz-row:hover .tpd-wiz-remove,
.tpd-wiz-row:focus-within .tpd-wiz-remove { opacity: 1; }
.tpd-wiz-remove:hover { color: var(--text); background: var(--hover-fade); }
.tpd-wiz-remove:focus-visible { opacity: 1; outline: 2px solid var(--accent-line); outline-offset: 1px; }
.tpd-wiz-remove svg { width: 12px; height: 12px; }
@media (hover: none) { .tpd-wiz-remove { opacity: 1; } }

.tpd-wiz-add {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tpd-wiz-add:hover { color: var(--text); background: var(--hover-fade); }
.tpd-wiz-add:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.tpd-wiz-add lucide-icon { font-size: 18px; --icon-stroke: 2; }

/* Step 3: visibility, not built yet. */
.tpd-wiz-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 190px; padding: 28px; border: 1.5px dashed var(--border-2); border-radius: 22px; text-align: center;
}
.tpd-wiz-soon strong { color: var(--text); font-size: 17px; font-weight: 700; }
.tpd-wiz-soon span { max-width: 34ch; color: var(--muted); font-size: 12px; }

@media (max-width: 640px) {
  .tpd-wiz-row { grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tpd-wiz-bar, .tpd-wiz-step, .tpd-wiz-remove, .tpd-wiz-add, .tpd-wiz-name-input { transition: none; }
}

/* ── No highlight rings, anywhere ───────────────────────────────────
   Product rule: nothing gets a ring, glow or coloured outline around it on
   hover or focus. Outlines are off for every element (this file loads after
   theme.css and tailwind.css, and the focus selectors here outrank their
   :where() rules); --ring is an empty shadow in both themes; coloured
   hover/focus borders and ring shadows were taken out of the rules
   themselves. Do not add new ones. */
*, *::before, *::after { outline: none !important; }
*:focus, *:focus-visible, *:focus-within,
*:focus::before, *:focus::after, *:focus-visible::before, *:focus-visible::after { outline: none !important; }
