/* =====================================================================
   Enless Solutions Ltd Support Portal — theme matched to enless-solutions.com
   Same palette, Archivo typeface, and the site-wide hover/focus "lift":
   scale 1.03, rise 4px, soft shadow, neighbours recede to 60%, 0.25s,
   orange focus ring. Self-hosted font only (CSP font-src 'self').
   ===================================================================== */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}
:root {
  --ink: #16232E; --ink-2: #22333F; --ink-line: #34495A; --ink-text: #C8D3DA;
  --paper: #F4F6F5; --panel: #E6EBEA; --rule: #C7D0CF; --text: #1D2A33; --muted: #52636E;
  --link: #2A64A8; --signal: #E8822A; --white: #FFFFFF;
  --w-orange: #E8822A; --w-green: #3A9A5B; --w-blue: #3B78C4; --w-brown: #8A5A3B; --w-red: #B8322F;
  --soft-blue: #E3ECF7; --soft-orange: #FBE9D8; --soft-green: #E0F1E6; --soft-brown: #F1E6DE; --soft-red: #F7E1E0;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* POR-10.2.0: formatted ticket updates — portal font by default; Consolas (then the platform mono) for code and the Font box; highlight yellow */
  --rte-font: Consolas, "Cascadia Mono", Menlo, "SF Mono", ui-monospace, monospace;
  --rte-mark: #FFE58A;
  --radius: 6px; --wrap: 1180px; --gutter: clamp(1rem, 4vw, 2.5rem);
  /* the site's lift */
  --lift-scale: 1.03; --lift-y: -4px; --lift-dur: .25s; --lift-ease: cubic-bezier(.2, .7, .2, 1);
  --lift-shadow: 0 2px 4px rgba(22, 35, 46, .06), 0 20px 40px -20px rgba(22, 35, 46, .45);
  --lift-ring: 0 0 0 3px var(--signal); --recede: .6;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--font);
       font-size: 1.0625rem; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-stretch: 75%; font-weight: 750; line-height: 1.08; letter-spacing: -.005em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: 1.45rem; font-stretch: 82%; margin: 0 0 .9rem; }
h4 { font-size: 1.15rem; font-stretch: 85%; margin: 0; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header (same as the main site) ---------- */
.ptop { position: sticky; top: 0; z-index: 10; background: var(--ink); border-bottom: 1px solid var(--ink-line); }
.ptop-inner { display: flex; align-items: center; gap: 1rem 1.5rem; min-height: 4.25rem; flex-wrap: wrap; }
.pbrand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; margin-right: auto;
         font-stretch: 80%; font-weight: 800; font-size: 1.3rem; letter-spacing: .01em; }
.pbrand img { height: 38px; width: auto; }
.pbrand span { font-weight: 450; color: var(--ink-text); }
.pbrand .tag { font-size: .78rem; font-stretch: 100%; font-weight: 700; color: var(--ink); background: var(--signal);
              padding: .12rem .5rem; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.pnav { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.pnav a, .linkish { color: var(--ink-text); text-decoration: none; font-weight: 550; font: inherit; font-weight: 550; }
.pnav a:hover, .linkish:hover, .pnav a[aria-current="page"] { color: #fff; }
.pnav .pnav-cta { color: var(--ink); background: var(--signal); padding: .42rem .9rem; border-radius: 4px; font-weight: 700; }
.pnav .pnav-cta:hover { background: #F39446; color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.inline { display: inline; margin: 0; }
@media (max-width: 640px) {
  .pnav { order: 3; width: 100%; justify-content: space-between; padding-bottom: .75rem; gap: .9rem; font-size: .95rem; }
  .pbrand img { height: 32px; }
}

/* ---------- Layout ---------- */
main.wrap { padding-top: clamp(1.5rem, 4vw, 2.75rem); padding-bottom: 3rem; }
.panel { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.75rem); margin-bottom: 1.25rem; }
.narrow { max-width: 30rem; margin-left: auto; margin-right: auto; }
.form-wide { max-width: 46rem; margin-left: auto; margin-right: auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.headrow h1, .headrow .button { margin-top: 0; }
.aside, .hint { color: var(--muted); font-size: .95rem; }
.hint { margin: .3rem 0 0; }
.opt { font-weight: 400; color: var(--muted); font-size: .85em; }
.crumb { margin: 0 0 .5rem; font-size: .92rem; }
.crumb a { color: var(--muted); }
.ref { font-family: var(--mono); font-weight: 600; color: var(--muted); font-size: .8em; margin-right: .35rem; }
.sub { display: block; color: var(--muted); font-size: .88rem; }
.sub-inline { color: var(--muted); font-size: .88rem; }
.foot { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 2.5rem; font-size: .92rem; color: var(--muted); }
.foot a { color: var(--muted); }

/* ---------- Forms & buttons (site style) ---------- */
label { display: block; font-weight: 650; margin: 1rem 0 .35rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=time], input[type=datetime-local], input[type=month], input[type=week], input:not([type]), select, textarea {
  width: 100%; padding: .7rem .8rem; font: inherit; color: var(--text); background: var(--white);
  border: 1px solid var(--rule); border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-line); }
textarea { resize: vertical; }
input[type=file] { margin-top: .25rem; font: inherit; font-size: .95rem; }
input.code { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; max-width: 12rem; text-align: center; }
button, .button { display: inline-block; margin-top: 1.25rem; font: inherit; font-weight: 700; text-decoration: none;
  padding: .8rem 1.3rem; border-radius: 4px; border: 2px solid transparent; cursor: pointer;
  background: var(--signal); color: var(--ink); transition: background-color .2s; }
button:hover, .button:hover { background: #F39446; }
button.secondary { background: transparent; color: var(--w-red); border-color: var(--w-red); }
.linkish:hover { background: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 450; }
.check input { width: auto; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.row label { width: 100%; margin-bottom: 0; }
.row button { margin-top: 0; }
.cf-turnstile { margin-top: 1.25rem; min-height: 65px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Notices ---------- */
.notice { padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid var(--rule); border-left: 4px solid var(--muted);
          background: var(--white); margin: 0 0 1rem; }
.notice ul { margin: 0; padding-left: 1.1rem; }
.notice-success { border-left-color: var(--w-green); }
.notice-info { border-left-color: var(--w-blue); }
.notice-error { border-left-color: var(--w-red); }

/* ---------- Status / priority chips ---------- */
.badge { display: inline-block; padding: .14rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
         white-space: nowrap; font-stretch: 90%; }
.badge.status-new { background: var(--soft-blue); color: #1F4F8A; }
.badge.status-assigned { background: var(--soft-orange); color: #8A4A12; }
.badge.status-in_progress { background: var(--soft-brown); color: #6A4128; }
.badge.status-completed { background: var(--soft-green); color: #23663A; }
.badge-internal { background: var(--soft-orange); color: #8A4A12; margin-left: .3rem; }
.prio { font-weight: 600; font-size: .92rem; }
.prio-low { color: var(--muted); }
.prio-high { color: #B5600F; }
.prio-critical { color: var(--w-red); font-weight: 800; }

/* ---------- The site's lift: one style for every card ---------- */
.lift { transition: transform var(--lift-dur) var(--lift-ease), box-shadow var(--lift-dur) var(--lift-ease),
        opacity var(--lift-dur) var(--lift-ease); transform-origin: center; position: relative; outline: none; }
.lift:hover, .lift:focus-visible, .lift:focus-within {
  transform: translateY(var(--lift-y)) scale(var(--lift-scale)); box-shadow: var(--lift-shadow); z-index: 2; opacity: 1; }
.lift:focus-visible { box-shadow: var(--lift-ring), var(--lift-shadow); }
.recede:has(.lift:hover) .lift:not(:hover),
.recede:has(.lift:focus-visible) .lift:not(:focus-visible) { opacity: var(--recede); }
@media (prefers-reduced-motion: reduce) {
  .lift { transition: box-shadow var(--lift-dur), opacity var(--lift-dur); }
  .lift:hover, .lift:focus-visible, .lift:focus-within { transform: none; }
}

/* Dashboard status cards */
.counts { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 0; margin: 0; }
@media (max-width: 720px) { .counts { grid-template-columns: repeat(2, 1fr); } }
.count a { display: block; text-decoration: none; color: var(--muted); background: var(--white); border: 1px solid var(--rule);
           border-top: 4px solid var(--a, var(--w-blue)); border-radius: var(--radius); padding: .9rem 1.1rem 1rem; }
.count strong { display: block; font-size: 2.3rem; line-height: 1.1; color: var(--ink); font-stretch: 75%; font-weight: 800; }
.count.status-new { --a: var(--w-blue); }
.count.status-assigned { --a: var(--w-orange); }
.count.status-in_progress { --a: var(--w-brown); }
.count.status-completed { --a: var(--w-green); }

/* Ticket cards */
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1.1rem;
          padding: .5rem .25rem .75rem; margin: 0; list-style: none; }
.tcard { --a: var(--w-blue); --a-soft: var(--soft-blue);
         display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text);
         background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--a);
         border-radius: var(--radius); overflow: hidden; }
.tcard.status-assigned { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.tcard.status-in_progress { --a: var(--w-brown); --a-soft: var(--soft-brown); }
.tcard.status-completed { --a: var(--w-green); --a-soft: var(--soft-green); }
.tcard-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--a-soft); padding: .6rem 1rem; }
.tcard-ref { font-family: var(--mono); font-weight: 700; font-size: .9rem; color: var(--ink); }
.tcard-body { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 auto; padding: .9rem 1rem 1rem; }
.tcard-cat { font-size: .85rem; color: var(--muted); }
.tcard-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: auto; padding-top: .6rem;
              border-top: 1px dashed var(--rule); font-size: .88rem; color: var(--muted); }
.tcard-meta b { color: var(--text); font-weight: 600; }
/* POR-8.3.0: the stage colour alone marks a card; Critical is shown by its priority label */
.tcard .more { max-height: 0; overflow: hidden; opacity: 0; font-size: .9rem; color: var(--muted);
               transition: max-height var(--lift-dur) var(--lift-ease), opacity var(--lift-dur) var(--lift-ease); }
.tcard:hover .more, .tcard:focus-visible .more { max-height: 6rem; opacity: 1; }
@media (hover: none) { .tcard .more { max-height: none; opacity: 1; } }

/* ---------- Lists, tabs, filters ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; border-bottom: 1px solid var(--rule); margin: .5rem 0 1rem; }
.tabs a { padding: .45rem 0; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 550; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--signal); }
/* POR-8.3.0 — one standard filter bar for every list (Tickets, Users, Companies):
   row 1 = search across the full width; row 2 = filters and sort in equal columns.
   Every control is the same height (44px touch target) with the same label spacing,
   and columns keep the same width on every page whether it has one filter or four. */
.filters { --ctl-h: 2.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
           gap: .9rem 1rem; align-items: end; margin-bottom: .75rem; }
.filters .f-search { grid-column: 1 / -1; }
.filters label { margin: 0 0 .35rem; font-size: .85rem; font-weight: 650; color: var(--ink); }
.filters input:not([type=hidden]), .filters select {
  height: var(--ctl-h); padding: 0 .8rem; font: inherit; font-size: 1rem; line-height: 1.2; margin: 0; }
.filters select {
  -webkit-appearance: none; appearance: none; padding-right: 2.3rem; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352636E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .8rem center / .75rem; }
.filters .f-search input {
  padding-left: 2.5rem;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%2352636E' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%2352636E' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat .85rem center / 1rem; }
.filters input:focus-visible, .filters select:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; border-color: var(--ink-line); }
.filters .f-actions { display: flex; gap: 1rem; align-items: center; min-height: var(--ctl-h); }
.filters .f-actions button { margin: 0; height: var(--ctl-h); padding: 0 1.3rem; }
.filters .f-actions a { font-weight: 650; white-space: nowrap; }
/* With JavaScript, results update as you type or choose, so the button is only the no-JS fallback */
.filters.js-live .f-actions button { display: none; }
.filters.js-live .f-actions:not(:has(a)) { display: none; }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr 1fr; gap: .75rem; } }   /* phones: two filters per row */

/* ---------- Ticket page ---------- */
.details { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.5rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.progress { list-style: none; display: flex; padding: 0; margin: .25rem 0 1.25rem; }
.progress li { flex: 1; font-size: .85rem; color: var(--muted); padding-top: .5rem; border-top: 4px solid var(--rule); margin-right: 3px; }
.progress li.done { border-top-color: var(--signal); color: var(--ink); }
.progress li.current { font-weight: 800; }
.update button { margin-top: 1rem; }
.thread { list-style: none; padding: 0; margin: 0; }
.msg { border-left: 3px solid var(--rule); padding: .3rem 0 .3rem 1rem; margin-bottom: 1.25rem; }
.msg-staff { border-left-color: var(--w-blue); }
.msg-internal { border-left-color: var(--signal); background: var(--soft-orange); padding: .6rem .9rem .6rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.msg .meta { margin: 0 0 .35rem; font-size: .92rem; color: var(--muted); }
.msg .meta strong { color: var(--ink); }
.msg .body { overflow-wrap: anywhere; }
/* POR-10.2.0: formatted updates (.rte). Same in Light / Navy / Auto: panel-coloured code, yellow highlight with ink text. */
.rte { line-height: 1.5; }                                         /* A2.1: the portal font (Archivo) by default */
.rte .f-mono, .rte code, .rte pre { font-family: var(--rte-font); }
.rte p { margin: 0 0 .5em; }
.rte p:last-child { margin-bottom: 0; }
.rte ul, .rte ol { margin: 0 0 .5em; padding-left: 1.7em; }
.rte ol { padding-left: 2.2em; }                                    /* room for "10." in any font */
.rte .ind-1 { margin-left: 2em; } .rte .ind-2 { margin-left: 4em; } .rte .ind-3 { margin-left: 6em; } .rte .ind-4 { margin-left: 8em; }
.rte li > p { margin: 0; }
.rte li + li { margin-top: .15em; }
.rte code { font-family: var(--rte-font); background: var(--panel); border: 1px solid var(--rule); border-radius: 3px; padding: 0 .3em; font-size: .95em; }
.rte pre { font-family: var(--rte-font); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .5em .7em; margin: 0 0 .5em; white-space: pre-wrap; overflow-wrap: anywhere; }
.rte pre code { background: none; border: 0; padding: 0; }
.rte mark { background: var(--rte-mark); color: #16232E; padding: 0 .15em; border-radius: 2px; }
/* POR-10.2.0-A2: reply box toolbar (rt-editor.js). Looks like the textarea it replaces: same border, radius, focus ring. */
.rte-src { display: none; }
.rte-wrap { border: 1px solid var(--rule); border-radius: var(--radius-ctl, 4px); background: var(--white); }
.rte-wrap.is-focus { outline: 3px solid var(--signal); outline-offset: 3px; border-color: var(--ink-line); }
.rte-wrap.is-invalid { border-color: var(--w-red); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .3rem .35rem; border-bottom: 1px solid var(--rule);
  background: var(--panel); border-radius: var(--radius-ctl, 4px) var(--radius-ctl, 4px) 0 0; }
/* button.rte-btn.ghost: .ghost keeps the navy/auto "dark text on orange" button rule off these */
.rte-bar button.rte-btn { margin: 0; min-height: 2.5rem; min-width: 2.5rem; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 6px; font-weight: 600; }
.rte-bar button.rte-btn .ico { width: 1.15rem; height: 1.15rem; margin: 0; }
.rte-bar button.rte-btn:hover { background: var(--white); border-color: var(--rule); color: var(--ink); }
.rte-bar button.rte-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.rte-bar button.rte-btn[aria-pressed="true"] { background: var(--soft-orange); border-color: var(--signal); color: var(--ink); }
.rte-bar button.rte-btn:disabled { opacity: .4; cursor: default; background: transparent; border-color: transparent; }
.rte-bar select.rte-font { width: auto; min-height: 2.5rem; margin: 0; padding: .25rem 1.6rem .25rem .55rem; font-size: .9rem;
  background-color: var(--white); color: var(--ink); border: 1px solid var(--rule); }
.rte-bar select.rte-font:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.rte-sep { width: 1px; align-self: stretch; margin: .3rem .2rem; background: var(--rule); }
.rte-area { padding: 0; }
.rte-edit { min-height: 8.5rem; max-height: 60vh; overflow-y: auto; outline: none; color: var(--text); padding: .7rem .8rem; }
.rte-wrap.is-empty .rte-edit > p:first-child::before { content: "Write the update…"; color: var(--muted); float: left; height: 0; pointer-events: none; }
.rte-msg { margin: .4rem 0 0; color: var(--w-red); font-weight: 600; }
/* ProseMirror's own rules (TipTap injects these as a <style> tag, which the CSP blocks; injectCSS is off) */
.ProseMirror { position: relative; word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces;
  font-variant-ligatures: none; font-feature-settings: "liga" 0; }
.ProseMirror pre { white-space: pre-wrap; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection * { caret-color: transparent; }
@media (max-width: 560px) { .rte-bar button.rte-btn { min-width: 2.75rem; min-height: 2.75rem; } .rte-sep { display: none; }
  .rte .ind-1 { margin-left: 1.2em; } .rte .ind-2 { margin-left: 2.4em; } .rte .ind-3 { margin-left: 3.6em; } .rte .ind-4 { margin-left: 4.8em; } }
.files { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .93rem; }
.files li::before { content: "📎 "; }
.activity { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.activity li { padding: .35rem 0; border-bottom: 1px dashed var(--rule); }
.activity li:last-child { border-bottom: 0; }
.steps { padding-left: 1.25rem; }
.qr { display: block; margin: 1rem auto; background: #fff; padding: 8px; border: 1px solid var(--rule); border-radius: var(--radius); }
.secret { font-family: var(--mono); font-size: 1.05rem; word-break: break-all; background: var(--panel); padding: .5rem .75rem; border-radius: var(--radius); }

/* POR-8.1.0 recovery codes: shown once, meant to be read off the screen or printed */
.rcodes { list-style: none; margin: 1rem 0; padding: .75rem; display: grid; gap: .35rem .75rem;
          grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
          background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); }
.rcodes li { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .04em; text-align: center; }
.ver { color: var(--muted); }
.dash-list { margin-top: 1.5rem; }
.tcard .more { margin: 0; }

/* ===================== V5: user administration (same palette + lift) ===================== */
.count.role-admin { --a: var(--w-orange); }
.count.role-tech { --a: var(--w-blue); }
.count.role-client { --a: var(--w-green); }
.count.role-sales { --a: var(--w-brown); }   /* POR-10.0.0 */
.count.role-inactive { --a: var(--rule); }
.badge.role-admin { background: var(--soft-orange); color: #8A4A12; }
.badge.role-tech { background: var(--soft-blue); color: #1F4F8A; }
.badge.role-client { background: var(--soft-green); color: #23663A; }
.badge.role-sales { background: var(--soft-brown); color: #6E4429; }   /* POR-10.0.0 */
.badge.role-inactive { background: var(--panel); color: var(--muted); }

.newuser { margin-top: 1.5rem; }
.newuser > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.newuser > summary::-webkit-details-marker { display: none; }
.newuser > summary .h2 { font-size: 1.45rem; font-stretch: 82%; font-weight: 750; color: var(--ink); line-height: 1.1; }
.newuser > summary .h2::after { content: " +"; color: var(--signal); }
.newuser[open] > summary .h2::after { content: " −"; }
.roles { border: 0; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 720px) { .roles { grid-template-columns: 1fr; } }
.roles legend { font-weight: 650; color: var(--ink); margin-bottom: .35rem; }
.role-pick { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: .75rem .9rem; font-weight: 400; cursor: pointer;
             background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--a, var(--w-green)); border-radius: var(--radius);
             transition: transform var(--lift-dur) var(--lift-ease), box-shadow var(--lift-dur) var(--lift-ease); }
.role-pick.role-client { --a: var(--w-green); } .role-pick.role-sales { --a: var(--w-brown); } .role-pick.role-tech { --a: var(--w-blue); } .role-pick.role-admin { --a: var(--w-orange); }
.role-pick:hover, .role-pick:has(input:checked), .role-pick:has(input:focus-visible) {
  transform: translateY(var(--lift-y)) scale(var(--lift-scale)); box-shadow: var(--lift-shadow); }
.role-pick:has(input:focus-visible) { box-shadow: var(--lift-ring), var(--lift-shadow); }
.role-pick input { width: auto; margin-top: .3rem; accent-color: var(--signal); }
.role-pick small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.35; }
@media (prefers-reduced-motion: reduce) { .role-pick:hover, .role-pick:has(input:checked) { transform: none; } }

.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: 1.1rem;
          padding: .5rem .25rem .75rem; margin: 0; list-style: none; }
.ucard { --a: var(--w-green); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--rule);
         border-top: 4px solid var(--a); border-radius: var(--radius); overflow: hidden; }
.ucard.role-admin { --a: var(--w-orange); } .ucard.role-tech { --a: var(--w-blue); } .ucard.role-client { --a: var(--w-green); } .ucard.role-sales { --a: var(--w-brown); }
.ucard.role-inactive { --a: var(--rule); background: var(--paper); }
.ucard-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem 1rem; background: var(--paper); }
.ucard-body { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem 1rem; flex: 1 1 auto; }
.flags { display: flex; gap: .35rem; }
.flag { font-size: .75rem; font-weight: 700; color: var(--ink); background: var(--panel); padding: .05rem .45rem; border-radius: 999px; }
.flag-bad { background: var(--soft-red); color: var(--w-red); }
.manage { margin-top: .75rem; border-top: 1px dashed var(--rule); padding-top: .6rem; }
.manage > summary { cursor: pointer; font-weight: 650; color: var(--link); }
.manage .row { margin-top: .4rem; }
.manage .row label { margin-top: .4rem; }
.manage .row select { flex: 1 1 8rem; width: auto; }
.actions-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
button.small { margin-top: 0; padding: .45rem .8rem; font-size: .9rem; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
button.ghost:hover { border-color: var(--ink-line); background: transparent; }
button.secondary:hover { background: var(--soft-red); }

/* ===================== V6: account detail ===================== */
.ulink { color: var(--ink); text-decoration: none; }
.ulink:hover { color: var(--link); text-decoration: underline; }
.flags.big .flag, .flags.big .badge { font-size: .9rem; }
.meta-dl { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--rule); font-size: .95rem; }
.actions-grid { display: grid; gap: .75rem; }
.actions-grid form { margin: 0; }
.actions-grid .hint { margin-top: .35rem; }
.role-row { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }
.role-row select { flex: 1 1 10rem; width: auto; }
.status-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.selectable .tcard { cursor: pointer; }
.selectable .tcard:has(input:checked) { box-shadow: var(--lift-ring), var(--lift-shadow); }
.tcard .h4 { font-size: 1.15rem; font-stretch: 85%; font-weight: 750; color: var(--ink); line-height: 1.15; }
.tcard-body { display: flex; }
.tick { display: inline-flex; gap: .45rem; align-items: center; }
.tick input { width: 1.1rem; height: 1.1rem; accent-color: var(--signal); }
.bulkbar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; margin-top: 1rem; padding: .9rem 1rem;
           background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); position: sticky; bottom: .5rem; z-index: 3; }
.bulk-op { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bulk-op label { margin: 0; font-size: .92rem; }
.bulk-op select { width: auto; min-width: 12rem; }
.bulk-op { min-width: 0; max-width: 100%; }
.bulk-op select { max-width: 100%; }   /* POR-10.6.0: long client names no longer push phones sideways */
.danger { border-color: var(--w-red); }
.danger > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; }
.danger > summary::-webkit-details-marker { display: none; }
.danger > summary .h2 { font-size: 1.3rem; font-stretch: 82%; font-weight: 750; color: var(--w-red); }
.modes { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.modes legend { font-weight: 650; color: var(--ink); margin-bottom: .25rem; }
.modes select { max-width: 26rem; margin-left: 1.6rem; }

/* ===================== V6: site chrome, portal bar, Connect, auth screens ===================== */
/* Readable at every size: type and controls scale with the viewport, never below 17px */
body { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=time], input[type=datetime-local], input[type=month], input[type=week], input:not([type]), select, textarea { min-height: 3rem; font-size: 1em; }
button, .button { min-height: 3rem; }
button.small { min-height: 2.5rem; }
.skip { position: absolute; left: -9999px; top: .5rem; z-index: 50; background: var(--signal); color: var(--ink); padding: .5rem .9rem; border-radius: 4px; font-weight: 700; }
.skip:focus { left: .5rem; }

/* Main-site header/footer: their own (scoped) CSS styles them; keep them full width */
.site-chrome { width: 100%; }
.site-chrome-head { position: relative; z-index: 20; }
.site-chrome-foot { margin-top: 0; }

/* Portal bar — sits under the site header, same ink family */
.pbar { position: sticky; top: 0; z-index: 15; background: var(--ink-2); border-bottom: 3px solid var(--signal); }
.pbar-inner { display: flex; align-items: center; gap: .75rem 1.5rem; min-height: 3.5rem; flex-wrap: wrap; }
.pbar-title { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: auto;
              font-stretch: 85%; font-weight: 750; font-size: 1.1rem; }
.pbar-title .tag { font-size: .78rem; font-stretch: 100%; font-weight: 700; color: var(--ink); background: var(--signal);
                   padding: .12rem .55rem; border-radius: 999px; letter-spacing: .03em; text-transform: uppercase; }
.pbar-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.pbar-links a, .pbar-links .linkish { color: var(--ink-text); text-decoration: none; font-weight: 600; padding: .35rem 0;
                                      border-bottom: 2px solid transparent; }
.pbar-links a:hover, .pbar-links .linkish:hover { color: #fff; }
.pbar-links a[aria-current="page"] { color: #fff; border-bottom-color: var(--signal); }
.pbar-links .pbar-cta { color: var(--ink); background: var(--signal); padding: .45rem .95rem; border-radius: 4px; border: 0; }
.pbar-links .pbar-cta:hover { background: #F39446; color: var(--ink); }
.pbar-links .pbar-cta[aria-current="page"] { color: var(--ink); }
@media (max-width: 720px) {
  .pbar { position: static; }
  .pbar-name { display: none; }
  .pbar-links { width: 100%; justify-content: space-between; gap: .4rem .9rem; padding-bottom: .6rem; font-size: .95rem; }
}

/* Connect strip — mirrors the site's Connect section */
.connect { background: var(--ink); color: var(--ink-text); margin-top: clamp(1.5rem, 4vw, 3rem); border-top: 4px solid var(--signal); }
.connect-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
                 padding-top: clamp(1.25rem, 3vw, 2rem); padding-bottom: clamp(1.25rem, 3vw, 2rem); }
.connect h2 { color: #fff; margin: 0 0 .25rem; }
.connect p { margin: 0; }
.connect-actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; }
.connect-actions .button { margin-top: 0; }
/* WhatsApp button — the main site's V10.1 component (.wa-pair / .wa-btn), so the
   Connect strip, the sign-in panel and enless-solutions.com all look the same. */
.wa-pair { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.4rem; }
a.wa-btn { display: inline-flex; align-items: center; gap: .55rem; padding: .75rem 1.15rem; border: 1px solid #4F9A90;
           border-radius: 4px; background: transparent; color: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
           text-decoration: none; transition: border-color .2s ease, background-color .2s ease; }
a.wa-btn:hover { border-color: #25D366; background: color-mix(in srgb, #25D366 10%, transparent); }
a.wa-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
a.wa-btn .wa-ic { width: 18px; height: 18px; flex: 0 0 18px; }
@media (prefers-reduced-motion: reduce) { a.wa-btn { transition: none; } }
.connect-phone { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.connect-phone:hover { text-decoration: underline; }

/* Sign-in / sign-up: full screen, split, sized to the viewport */
.is-auth main.wrap { padding-top: clamp(1rem, 3vh, 2.5rem); padding-bottom: clamp(1rem, 3vh, 2.5rem); }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1rem, 3vw, 2.5rem);
        align-items: stretch; min-height: calc(100dvh - 10rem); }
.auth-intro { background: var(--ink); color: var(--ink-text); border-radius: var(--radius); border-top: 4px solid var(--signal);
              padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.auth-intro .eyebrow { margin: 0 0 .5rem; color: var(--signal); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.auth-h { color: #fff; font-size: clamp(2.2rem, 4.5vw, 3.6rem); margin: 0 0 1rem; }
.auth-lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); margin: 0 0 1.25rem; }
.auth-lead b { color: #fff; }
.auth-points { margin: 0 0 1.5rem; padding-left: 1.2rem; }
.auth-points li { margin: .3rem 0; }
.auth-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.auth-actions .button { margin-top: 0; }
.auth-card { margin: 0; display: flex; flex-direction: column; justify-content: flex-start;
             padding: clamp(1.5rem, 4vw, 3rem); max-width: none; }
.auth-card .auth-title { font-size: clamp(1.8rem, 3vw, 2.4rem); font-stretch: 75%; margin: 0 0 .75rem; }
.auth-card form { width: 100%; }
.auth-card button[type=submit] { width: 100%; }
.auth-card .qr { width: clamp(180px, 22vw, 240px); height: auto; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-card { order: -1; }                /* form first on phones/tablets */
  .auth-points { display: none; }
  .auth-intro { padding: 1.25rem 1.25rem 1.5rem; }
  .auth-h { font-size: 1.8rem; }
}
@media (min-width: 901px) and (max-height: 760px) {
  .auth-points { display: none; }          /* short laptop screens: keep everything above the fold */
  .auth-card label { margin-top: .7rem; }
}
.ver { font-size: .8rem; color: var(--muted); text-align: right; margin: .5rem auto 1rem; }

/* ===================== V7: account approval ===================== */
.counts-5 { grid-template-columns: repeat(5, 1fr); }
.counts-6 { grid-template-columns: repeat(6, 1fr); }   /* POR-10.0.0: + Sales */
@media (max-width: 980px) { .counts-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .counts-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) { .counts-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .counts-5 { grid-template-columns: repeat(2, 1fr); } }
.count.role-pending { --a: var(--signal); }
.badge.appr-pending { background: var(--soft-orange); color: #8A4A12; }
.badge.appr-rejected { background: var(--soft-red); color: var(--w-red); }
.badge.appr-approved { background: var(--soft-green); color: #23663A; }
.flag-warn { background: var(--soft-orange); color: #8A4A12; }
.flag-ok { background: var(--soft-green); color: #23663A; }   /* POR-10.3.0-A2 price age OK */

.ucards-appr { grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr)); }
.ucard.appr { --a: var(--signal); }
.ucard.appr-stale { --a: var(--w-red); box-shadow: inset 0 0 0 1px var(--soft-red); }
.appr-dl { margin: .6rem 0 .2rem; gap: .35rem 1rem; }
.appr-dl dd { overflow-wrap: anywhere; }
@media (max-width: 460px) { .appr-dl { grid-template-columns: 1fr; gap: 0 0; }
  .appr-dl dt { margin-top: .4rem; font-size: .85rem; } }
.appr-form { margin-top: .6rem; border-top: 1px dashed var(--rule); padding-top: .6rem; }
.appr-form label { margin-top: 0; }
.appr-form textarea { width: 100%; }
.appr-form .actions-row { margin-top: .5rem; }
.appr-note { background: var(--panel); border-left: 3px solid var(--signal); padding: .5rem .7rem;
             margin: .5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }

/* Pending-review count on the Users nav item */
.pbar-badge { display: inline-block; min-width: 1.25rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px;
              background: var(--signal); color: var(--ink); font-size: .72rem; font-weight: 800; line-height: 1.3rem;
              text-align: center; vertical-align: text-top; }

/* ---------- POR-8.0.0: address lookup (F2) ---------- */
/* The suggestion list is positioned under the field; the field keeps the normal
   form styling so manual entry looks and behaves exactly as it always has. */
.lookup { position: relative; }
.lookup-results { position: absolute; z-index: 20; left: 0; right: 0; margin: .15rem 0 0; padding: 0;
                  list-style: none; background: var(--white); border: 1px solid var(--rule);
                  border-radius: 4px; box-shadow: var(--lift-shadow); max-height: 17rem; overflow-y: auto; }
.lookup-option { display: block; padding: .55rem .8rem; cursor: pointer; border-bottom: 1px solid var(--panel); }
.lookup-option:last-child { border-bottom: 0; }
.lookup-option:hover, .lookup-option:focus { background: var(--soft-orange); outline: none; }
.lookup-main { display: block; font-weight: 650; color: var(--ink); }
.lookup-sub { display: block; font-size: .9rem; color: var(--muted); }

/* ---------- POR-8.0.0: company confirmation at registration (F3) ---------- */
.company-confirm { margin: 1rem 0 0; padding: .9rem 1rem; background: var(--soft-orange);
                   border-left: 3px solid var(--signal); border-radius: 4px; font-size: 1.15rem; }

/* ---------- POR-8.0.0: ticket types, companies, merges (F1, F4, F5) ---------- */
.badge.status-merged { background: var(--soft-brown); color: var(--w-brown); }
.merge-note { margin: 0 0 1.25rem; padding: .9rem 1rem; background: var(--soft-brown);
              border-left: 3px solid var(--w-brown); border-radius: 4px; }
.dupe-list { margin: 0; padding: 0; list-style: none; }
.dupe-list li { padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.dupe-list li:last-child { border-bottom: 0; }
.dupe-score { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px;
              background: var(--panel); color: var(--muted); font-size: .78rem; font-weight: 700; }
.dupe-reason { display: block; font-size: .9rem; color: var(--muted); }
/* Admin tables for types, companies and the review queues */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th, .admin-table td { padding: .6rem .5rem; text-align: left; border-bottom: 1px solid var(--rule);
                                   vertical-align: middle; }
.admin-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { width: 5rem; }
.admin-table form { display: inline; }
.admin-table input[type=text], .admin-table input:not([type]) { margin: 0; }
.admin-table .inline-form { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.admin-table .inline-form:last-child { margin-bottom: 0; }
.admin-table .inline-form button { margin-top: 0; }
/* Stacked decision buttons need to read as separate choices, not one block. */
.admin-table td > form + form { margin-top: .4rem; }
.type-order { width: 4.5rem; }
.muted-row td { color: var(--muted); }
/* Visually hidden label text, kept available to screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
           overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Portal SP1.0: attachment scan status ---------- */
.scan { display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px;
        font-size: .74rem; font-weight: 700; letter-spacing: .02em; vertical-align: baseline; }
.scan-checked   { background: var(--soft-green);  color: var(--w-green); }
.scan-sanitised { background: var(--soft-blue);   color: var(--w-blue); }
.scan-holding   { background: var(--soft-orange); color: var(--w-brown); }
.scan-blocked,
.scan-missing,
.scan-error     { background: var(--soft-red);    color: var(--w-red); }
/* A file that cannot be served is shown, but not as a link. */
.file-off { color: var(--muted); text-decoration: line-through; }
.ver-sp { font-weight: 700; color: var(--w-green); }

/* =====================================================================
   POR-8.3.0 — Grid/List views, sorting, live search
   Colours come ONLY from the existing tokens and the same status/role
   classes the cards use, so grid and list always match. No new hex values.
   Rows highlight like cards but never transform: a transformed or
   positioned table row is what breaks click targets in WebKit.
   ===================================================================== */
/* List bar: result count on the left, Grid/List toggle on the right, directly above every list */
.listbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: .25rem 0 .6rem; }
.listbar .aside { margin: 0; }
.listbar .vtoggle { margin-left: auto; }
.headrow h2 { margin-top: 0; }

/* Grid / List segmented control */
.vtoggle { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.vtoggle a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; font-size: .9rem; font-weight: 650;
             color: var(--muted); text-decoration: none; }
.vtoggle a + a { border-left: 1px solid var(--rule); }
.vtoggle a:hover { color: var(--ink); background: var(--paper); }
.vtoggle a.on { color: var(--ink); background: var(--soft-orange); box-shadow: inset 0 -3px 0 var(--signal); }
.vtoggle a:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.vtoggle svg { flex: none; }

/* Containment: a wide table scrolls inside its own box, never past the page or into the footer */
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .5rem;
              border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); }

/* List view table */
.ltable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ltable thead th { background: var(--paper); text-align: left; font-size: .8rem; text-transform: uppercase;
                   letter-spacing: .06em; color: var(--muted); padding: .55rem .7rem; border-bottom: 1px solid var(--rule);
                   white-space: nowrap; }
.ltable th.c-num, .ltable td.c-num { text-align: right; }
.th-sort { color: inherit; text-decoration: none; display: inline-flex; gap: .3rem; align-items: center; }
.th-sort:hover, .th-sort.is-active { color: var(--ink); }
.th-sort:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.th-arrow { font-size: .7rem; opacity: .45; }
.th-sort.is-active .th-arrow { opacity: 1; color: var(--signal); }

.ltable td { padding: 0; border-bottom: 1px solid var(--rule); vertical-align: top; background: var(--white);
             transition: background-color var(--lift-dur) var(--lift-ease), opacity var(--lift-dur) var(--lift-ease); }
.ltable tbody tr:last-child td { border-bottom: 0; }
.ltable a.cell { display: block; padding: .65rem .7rem; color: var(--text); text-decoration: none; min-height: 100%; }
.ltable .l-main { font-weight: 650; color: var(--ink); }
.ltable .sub { margin-top: .1rem; }
.ltable .c-nowrap a.cell { white-space: nowrap; }
.ltable .c-subject { min-width: 14rem; }
.ltable .badge, .ltable .flags { white-space: nowrap; }

/* Row colour: the same --a / --a-soft pair the cards use, as a left bar */
.lrow { --a: var(--rule); --a-soft: var(--paper); cursor: pointer; }
.lrow > td:first-child { box-shadow: inset 4px 0 0 var(--a); }
/* (ticket stage colours for .lrow are set in the "Ticket stage colours" block below) */
.lrow.status-merged      { --a: var(--w-brown);  --a-soft: var(--soft-brown); }
.lrow.role-admin  { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.lrow.role-tech   { --a: var(--w-blue);   --a-soft: var(--soft-blue); }
.lrow.role-client { --a: var(--w-green);  --a-soft: var(--soft-green); }
.lrow.role-sales  { --a: var(--w-brown);  --a-soft: var(--soft-brown); }
.lrow.role-inactive { --a: var(--rule);   --a-soft: var(--panel); }
.lrow.cstatus-active         { --a: var(--w-green);  --a-soft: var(--soft-green); }
.lrow.cstatus-pending_review { --a: var(--signal);   --a-soft: var(--soft-orange); }
.lrow.cstatus-merged         { --a: var(--w-brown);  --a-soft: var(--soft-brown); }

/* Last opened, then hover / keyboard focus / press (later rules win): the card treatment, without transform */
.lrow.is-last > td { background: var(--paper); }
.lrow.is-last > td:first-child { box-shadow: inset 6px 0 0 var(--a); }   /* same stage colour, just thicker */
/* Hover / focus: the row tints AND outlines in its own status colour. Inset shadows on the
   cells only, so nothing is drawn outside the row or the table, and nothing is positioned. */
.lrow:hover > td, .lrow:focus-within > td {
  background: var(--a-soft); box-shadow: inset 0 2px 0 var(--a), inset 0 -2px 0 var(--a); }
.lrow:hover > td:first-child, .lrow:focus-within > td:first-child {
  box-shadow: inset 6px 0 0 var(--a), inset 0 2px 0 var(--a), inset 0 -2px 0 var(--a); }
.lrow:hover > td:last-child, .lrow:focus-within > td:last-child {
  box-shadow: inset -2px 0 0 var(--a), inset 0 2px 0 var(--a), inset 0 -2px 0 var(--a); }
.lrow:active > td { background: var(--panel); }
.ltable a.row-link:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }   /* neutral, high-contrast keyboard ring; the row itself shows its stage colour */
.ltable tbody:hover > tr:not(:hover) > td { opacity: var(--recede); }
a.tcard.is-last, a.ccard.is-last { box-shadow: 0 0 0 2px var(--a); }  /* stage colour, never a different one */

/* Live search busy state */
[data-live-part="results"][aria-busy="true"] { opacity: .55; transition: opacity .15s; }

/* Company cards (grid view): the user-card component, coloured by company status */
.ccard { height: 100%; text-decoration: none; color: var(--text); }
.ccard.cstatus-active         { --a: var(--w-green); }
.ccard.cstatus-pending_review { --a: var(--signal); }
.ccard.cstatus-merged         { --a: var(--w-brown); background: var(--paper); }
.ccard h4 { margin: 0; color: var(--ink); }
.badge.cstatus-active         { background: var(--soft-green);  color: #23663A; }
.badge.cstatus-pending_review { background: var(--soft-orange); color: #8A4A12; }
.badge.cstatus-merged         { background: var(--soft-brown);  color: var(--w-brown); }

/* Narrow screens: drop the secondary columns; what remains scrolls inside .table-wrap */
@media (max-width: 720px) {
  .ltable .c-opt { display: none; }
  .ltable .c-subject { min-width: 10rem; }
  .vtoggle a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ltable td { transition: none; }
}

/* =====================================================================
   POR-8.3.0 — Ticket stage colours (one definition for pills, cards,
   dashboard counts and list rows, so every view agrees):
     New          red,   glowing
     Assigned     amber, glowing
     In progress  amber, solid (no glow)
     Completed    green
   Colours are the existing tokens (--w-red, --w-orange, --w-green and their
   soft pairs). The glow is on the pill only, never the row, and only animates
   when the visitor has not asked for reduced motion.
   ===================================================================== */
.badge.status-new         { background: var(--soft-red);    color: var(--w-red);  box-shadow: 0 0 0 1px var(--w-red); }
.badge.status-assigned    { background: var(--soft-orange); color: #8A4A12;       box-shadow: 0 0 0 1px var(--w-orange); }
.badge.status-in_progress { background: var(--w-orange);    color: var(--ink); }
.badge.status-completed   { background: var(--soft-green);  color: #23663A; }

.count.status-new, .tcard.status-new, .lrow.status-new, .mini-item.status-new                         { --a: var(--w-red);    --a-soft: var(--soft-red); }
.count.status-assigned, .tcard.status-assigned, .lrow.status-assigned, .mini-item.status-assigned          { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.count.status-in_progress, .tcard.status-in_progress, .lrow.status-in_progress, .mini-item.status-in_progress { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.count.status-completed, .tcard.status-completed, .lrow.status-completed, .mini-item.status-completed       { --a: var(--w-green);  --a-soft: var(--soft-green); }
.count.status-merged { --a: var(--w-brown); }

@keyframes stage-glow-new {
  0%, 100% { box-shadow: 0 0 0 1px var(--w-red); }
  50%      { box-shadow: 0 0 0 1px var(--w-red), 0 0 10px 3px rgba(184, 50, 47, .45); }   /* --w-red */
}
@keyframes stage-glow-assigned {
  0%, 100% { box-shadow: 0 0 0 1px var(--w-orange); }
  50%      { box-shadow: 0 0 0 1px var(--w-orange), 0 0 10px 3px rgba(232, 130, 42, .5); } /* --w-orange */
}
@media (prefers-reduced-motion: no-preference) {
  .badge.status-new      { animation: stage-glow-new 2.2s ease-in-out infinite; }
  .badge.status-assigned { animation: stage-glow-assigned 2.2s ease-in-out infinite; }
}

/* =====================================================================
   POR-8.3.0 — Dashboard: symmetric rows of four, attention tiles,
   two equal columns for workload and recent activity.
   ===================================================================== */
.dash-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-head h1 { margin: 0; }
.dash-head .aside { margin: 0; }
.dash-sub { font-size: 1.05rem; margin: 1.5rem 0 .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.counts + .panel, .attn + .panel { margin-top: 1.5rem; }
.attn .sub { display: block; margin-top: .15rem; font-size: .85rem; color: var(--muted); }
.count.attn-bad   { --a: var(--w-red); }
.count.attn-warn  { --a: var(--signal); }
.count.attn-clear { --a: var(--rule); }
.count.attn-clear strong { color: var(--muted); }
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 1.25rem; align-items: stretch; }   /* equal-height columns */
.dash-cols > .panel { margin-bottom: 0; }
.dash-cols h2 { margin-top: 0; }

/* Compact "recently updated" list: stage colour bar, same tokens as rows and cards */
.mini { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .5rem; }
.mini-item { --a: var(--rule); --a-soft: var(--paper);
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ref subj badge" "ref when badge";
  gap: .1rem .9rem; align-items: center; padding: .6rem .8rem; text-decoration: none; color: var(--text);
  background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--a); border-radius: var(--radius);
  transition: background-color var(--lift-dur) var(--lift-ease), box-shadow var(--lift-dur) var(--lift-ease); }
.mini-item .tcard-ref { grid-area: ref; }
.mini-item .mini-subj { grid-area: subj; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item .badge { grid-area: badge; }
.mini-item .mini-when { grid-area: when; font-size: .85rem; color: var(--muted); }
.mini-item:hover, .mini-item:focus-visible { background: var(--a-soft); box-shadow: inset 0 0 0 1px var(--a); }
.mini-item:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .mini-item { transition: none; } }

/* =====================================================================
   POR-8.4.0 (lab) — Navy dark theme. Chosen per user (nav bar toggle:
   Light -> Navy -> Auto). Auto follows the device's dark-mode setting.
   Tokens only, plus the few places that need a fixed colour on dark.
   ===================================================================== */
.pbar-links .pbar-theme { display: inline-flex; align-items: center; gap: .35rem; }
.pbar-links .pbar-theme:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
@media (max-width: 720px) { .pbar-links .pbar-theme span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

:root[data-theme="navy"] { color-scheme: dark;
  --paper: #0D1720; --white: #16232E; --panel: #1E2E3A; --rule: #2F4353; --text: #D3DCE2; --muted: #94A5B0;
  --link: #8DB9EE; --ink: #EEF3F6;
  --soft-blue: #1B3350; --soft-orange: #3D2A17; --soft-green: #183626; --soft-brown: #33261D; --soft-red: #3B1C1D;
  --lift-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 40px -20px rgba(0, 0, 0, .8); }
:root[data-theme="navy"] .ptop, :root[data-theme="navy"] .connect { background: #16232E; }
:root[data-theme="navy"] .pbrand .tag, :root[data-theme="navy"] .pbar-title .tag, :root[data-theme="navy"] .pnav .pnav-cta, :root[data-theme="navy"] .pnav .pnav-cta:hover, :root[data-theme="navy"] .pbar-links .pbar-cta, :root[data-theme="navy"] .pbar-links .pbar-cta:hover, :root[data-theme="navy"] .pbar-badge, :root[data-theme="navy"] .skip, :root[data-theme="navy"] .badge.status-in_progress, :root[data-theme="navy"] button:not(.secondary):not(.ghost):not(.linkish), :root[data-theme="navy"] .button:not(.ghost) { color: #16232E; }   /* A2: ghost links keep their light text */
:root[data-theme="navy"] .badge.status-new, :root[data-theme="navy"] .badge.appr-rejected, :root[data-theme="navy"] .flag-bad, :root[data-theme="navy"] .prio-critical { color: #F29A96; }
:root[data-theme="navy"] .badge.status-assigned, :root[data-theme="navy"] .badge-internal, :root[data-theme="navy"] .badge.role-admin, :root[data-theme="navy"] .badge.appr-pending, :root[data-theme="navy"] .flag-warn, :root[data-theme="navy"] .badge.cstatus-pending_review, :root[data-theme="navy"] .prio-high { color: #F3B97D; }
:root[data-theme="navy"] .badge.role-tech { color: #9CC2F0; }
:root[data-theme="navy"] .badge.role-sales { color: #DDB08F; }
:root[data-theme="navy"] .flag-ok, :root[data-theme="navy"] .badge.status-completed, :root[data-theme="navy"] .badge.role-client, :root[data-theme="navy"] .badge.appr-approved, :root[data-theme="navy"] .badge.cstatus-active { color: #86D6A0; }
:root[data-theme="navy"] .badge.status-merged, :root[data-theme="navy"] .badge.cstatus-merged { color: #DDB08F; }
:root[data-theme="navy"] .filters select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2394A5B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
:root[data-theme="navy"] .filters .f-search input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%2394A5B0' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%2394A5B0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
:root[data-theme="navy"] input::placeholder, :root[data-theme="navy"] textarea::placeholder { color: #7D8F9B; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] { color-scheme: dark;
  --paper: #0D1720; --white: #16232E; --panel: #1E2E3A; --rule: #2F4353; --text: #D3DCE2; --muted: #94A5B0;
  --link: #8DB9EE; --ink: #EEF3F6;
  --soft-blue: #1B3350; --soft-orange: #3D2A17; --soft-green: #183626; --soft-brown: #33261D; --soft-red: #3B1C1D;
  --lift-shadow: 0 2px 4px rgba(0, 0, 0, .35), 0 20px 40px -20px rgba(0, 0, 0, .8); }
  :root[data-theme="auto"] .ptop, :root[data-theme="auto"] .connect { background: #16232E; }
  :root[data-theme="auto"] .pbrand .tag, :root[data-theme="auto"] .pbar-title .tag, :root[data-theme="auto"] .pnav .pnav-cta, :root[data-theme="auto"] .pnav .pnav-cta:hover, :root[data-theme="auto"] .pbar-links .pbar-cta, :root[data-theme="auto"] .pbar-links .pbar-cta:hover, :root[data-theme="auto"] .pbar-badge, :root[data-theme="auto"] .skip, :root[data-theme="auto"] .badge.status-in_progress, :root[data-theme="auto"] button:not(.secondary):not(.ghost):not(.linkish), :root[data-theme="auto"] .button:not(.ghost) { color: #16232E; }
  :root[data-theme="auto"] .badge.status-new, :root[data-theme="auto"] .badge.appr-rejected, :root[data-theme="auto"] .flag-bad, :root[data-theme="auto"] .prio-critical { color: #F29A96; }
  :root[data-theme="auto"] .badge.status-assigned, :root[data-theme="auto"] .badge-internal, :root[data-theme="auto"] .badge.role-admin, :root[data-theme="auto"] .badge.appr-pending, :root[data-theme="auto"] .flag-warn, :root[data-theme="auto"] .badge.cstatus-pending_review, :root[data-theme="auto"] .prio-high { color: #F3B97D; }
  :root[data-theme="auto"] .badge.role-tech { color: #9CC2F0; }
  :root[data-theme="auto"] .flag-ok, :root[data-theme="auto"] .badge.status-completed, :root[data-theme="auto"] .badge.role-client, :root[data-theme="auto"] .badge.appr-approved, :root[data-theme="auto"] .badge.cstatus-active { color: #86D6A0; }
  :root[data-theme="auto"] .badge.status-merged, :root[data-theme="auto"] .badge.cstatus-merged { color: #DDB08F; }
  :root[data-theme="auto"] .filters select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2394A5B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  :root[data-theme="auto"] .filters .f-search input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5' fill='none' stroke='%2394A5B0' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%2394A5B0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
  :root[data-theme="auto"] input::placeholder, :root[data-theme="auto"] textarea::placeholder { color: #7D8F9B; }
}

/* =====================================================================
   POR-8.4.0 (lab) — SLA. "Waiting on client" is blue: the one stage that
   is not ours to move. SLA badges reuse the stage reds/ambers.
   ===================================================================== */
.badge.status-waiting_client { background: var(--soft-blue); color: #1F4F8A; }
.count.status-waiting_client, .tcard.status-waiting_client, .lrow.status-waiting_client, .mini-item.status-waiting_client
  { --a: var(--w-blue); --a-soft: var(--soft-blue); }
.count.attn-good { --a: var(--w-green); }

.sla { display: inline-block; margin-left: .35rem; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem;
       font-weight: 800; letter-spacing: .02em; white-space: nowrap; vertical-align: baseline; }
.sla-at_risk  { background: var(--soft-orange); color: #8A4A12; box-shadow: inset 0 0 0 1px var(--w-orange); }
.sla-breached { background: var(--w-red); color: var(--white); }
.sla-paused   { background: var(--soft-blue); color: #1F4F8A; }
.tcard-flags  { display: inline-flex; align-items: center; gap: .35rem; }
.tcard-flags .sla { margin-left: 0; }

.sla-line { font-weight: 650; }
.sla-line.sla-met      { color: #23663A; background: none; }
.sla-line.sla-on_track { color: var(--text); background: none; }
.sla-line.sla-at_risk  { color: #8A4A12; background: none; box-shadow: none; }
.sla-line.sla-breached { color: var(--w-red); background: none; }
.sla-line.sla-na       { color: var(--muted); font-weight: 450; }

/* SLA settings table: inputs sized to the cell */
.ltable td.sla-cell { padding: .5rem .7rem; vertical-align: middle; }
.ltable td.sla-cell input { max-width: 8rem; margin: 0; }

/* Navy: lighter text on the dark tints */
:root[data-theme="navy"] .badge.status-waiting_client, :root[data-theme="navy"] .sla-paused { color: #9CC2F0; }
:root[data-theme="navy"] .sla-at_risk, :root[data-theme="navy"] .sla-line.sla-at_risk { color: #F3B97D; }
:root[data-theme="navy"] .sla-line.sla-met { color: #86D6A0; }
:root[data-theme="navy"] .sla-line.sla-breached { color: #F29A96; }
:root[data-theme="navy"] .sla-breached { color: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .badge.status-waiting_client, :root[data-theme="auto"] .sla-paused { color: #9CC2F0; }
  :root[data-theme="auto"] .sla-at_risk, :root[data-theme="auto"] .sla-line.sla-at_risk { color: #F3B97D; }
  :root[data-theme="auto"] .sla-line.sla-met { color: #86D6A0; }
  :root[data-theme="auto"] .sla-line.sla-breached { color: #F29A96; }
  :root[data-theme="auto"] .sla-breached { color: #FFFFFF; }
}

/* =====================================================================
   POR-8.4.0 (lab) — Nav bar: title | links spread evenly | New ticket | theme icon
   ===================================================================== */
.pbar-inner { flex-wrap: nowrap; }
.pbar-title { margin-right: 0; flex: none; }
.pbar-inner > .pbar-links { flex: 1 1 auto; justify-content: space-evenly; gap: .5rem 1rem; margin: 0 1rem; }
.pbar-inner > .pbar-links { flex-wrap: nowrap; }
.pbar-links .linkish { margin: 0; white-space: nowrap; }
.pbar-links > a, .pbar-menu > summary { white-space: nowrap; }
.pbar-inner > .pbar-cta { flex: none; color: var(--ink); background: var(--signal); padding: .45rem .95rem; border-radius: 4px;
                          font-weight: 700; text-decoration: none; }
.pbar-inner > .pbar-cta:hover { background: #F39446; }
.pbar-inner > .pbar-theme { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
                            margin-left: .25rem; border-radius: 999px; color: var(--ink-text); border: 1px solid var(--ink-line); }
.pbar-inner > .pbar-theme:hover { color: #fff; border-color: var(--ink-text); }
.pbar-inner > .pbar-theme:focus-visible, .pbar-inner > .pbar-cta:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* Settings drop-down (a <details>, works without script) */
.pbar-menu { position: relative; }
.pbar-menu > summary { list-style: none; cursor: pointer; color: var(--ink-text); font-weight: 600; padding: .35rem 0;
                       border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: .3rem; }
.pbar-menu > summary::-webkit-details-marker { display: none; }
.pbar-menu > summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                              transform: translateY(-2px) rotate(45deg); }
.pbar-menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.pbar-menu > summary:hover, .pbar-menu[open] > summary { color: #fff; }
.pbar-menu > summary[aria-current="page"] { color: #fff; border-bottom-color: var(--signal); }
.pbar-menu > summary:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.pbar-menu-list { position: absolute; top: calc(100% + .5rem); left: 50%; transform: translateX(-50%); z-index: 30; min-width: 12rem;
                  display: flex; flex-direction: column; padding: .4rem; background: var(--ink-2); border: 1px solid var(--ink-line);
                  border-top: 3px solid var(--signal); border-radius: var(--radius); box-shadow: var(--lift-shadow); }
.pbar-links .pbar-menu-list a { padding: .5rem .75rem; border-bottom: 0; border-radius: 4px; white-space: nowrap; }
.pbar-links .pbar-menu-list a:hover { background: rgba(255, 255, 255, .08); }
.pbar-links .pbar-menu-list a.sub { padding-left: 1.6rem; font-weight: 500; font-size: .92rem; }

@media (max-width: 1180px) {
  .pbar-inner { flex-wrap: wrap; }
  .pbar-inner > .pbar-links { flex-wrap: wrap; }
  .pbar-title { margin-right: auto; }
  .pbar-inner > .pbar-links { order: 3; flex-basis: 100%; margin: 0; justify-content: space-between; padding-bottom: .6rem; }
}

/* =====================================================================
   Settings: tree-style side menu beside the settings pages
   ===================================================================== */
.settings-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.settings-tree { position: sticky; top: 5rem; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem; }
.settings-root { margin: 0 0 .5rem; font-size: .8rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.settings-tree ul { list-style: none; margin: 0; padding: 0; }
.settings-tree ul ul { margin: .15rem 0 .25rem .55rem; padding-left: .7rem; border-left: 2px solid var(--rule); }
.settings-tree a { display: block; padding: .4rem .55rem; border-radius: 4px; color: var(--text); text-decoration: none; font-weight: 600; }
.settings-tree ul ul a { font-weight: 500; font-size: .93rem; color: var(--muted); }
.settings-tree a:hover { background: var(--paper); color: var(--ink); }
.settings-tree a[aria-current="page"] { background: var(--soft-orange); color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); }
.settings-tree a:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.settings-main { min-width: 0; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tree { position: static; }
  .settings-tree > ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
  .settings-tree ul ul { display: flex; gap: .5rem; border-left: 0; padding-left: 0; margin: 0; }
}

/* =====================================================================
   Count groups: header line with the Cards / Chart toggle; donut chart
   ===================================================================== */
.dash-bar { margin: 1.5rem 0 .75rem; }
.dash-bar .dash-sub { margin: 0; }
.dash-head + .dash-bar { margin-top: .5rem; }
.chart-panel { margin-bottom: 0; }
.donut-wrap { display: flex; align-items: center; gap: 2rem 3rem; flex-wrap: wrap; justify-content: center; }
.donut { width: 13rem; height: 13rem; flex: none; }
.donut-track { stroke: var(--panel); }
.donut-seg { transition: stroke-width .15s; }
.donut a:hover .donut-seg, .donut a:focus .donut-seg { stroke-width: 6.5; }
.donut-big { font-size: .5rem; font-weight: 800; fill: var(--ink); font-family: var(--font); }
.donut-small { font-size: .22rem; fill: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .02em; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; min-width: 16rem; }
.donut-legend a, .donut-legend .lg-row { display: grid; grid-template-columns: 1rem 1fr auto 3rem; align-items: center; gap: .7rem;
                                         padding: .45rem .6rem; border-radius: 4px; color: var(--text); text-decoration: none; }
.donut-legend a:hover { background: var(--paper); }
.donut-legend a:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.swatch { width: 1rem; height: 1rem; border-radius: 3px; }
.lg-label { font-weight: 600; }
.lg-val { font-weight: 800; color: var(--ink); text-align: right; }
.lg-pct { color: var(--muted); text-align: right; font-size: .9rem; }
.chart-note { text-align: center; margin: 1rem 0 0; }
@media (prefers-reduced-motion: reduce) { .donut-seg { transition: none; } }

/* Segment colours = the same tokens as the cards and pills.
   Assigned is the light amber of its pill, In progress the solid amber of its pill. */
.seg-new            { stroke: var(--w-red);    background: var(--w-red); }
.seg-assigned       { stroke: #F2B27A;         background: #F2B27A; }
.seg-in_progress    { stroke: var(--w-orange); background: var(--w-orange); }
.seg-waiting_client { stroke: var(--w-blue);   background: var(--w-blue); }
.seg-completed      { stroke: var(--w-green);  background: var(--w-green); }
.seg-sla-on_track   { stroke: var(--w-green);  background: var(--w-green); }
.seg-sla-at_risk    { stroke: var(--w-orange); background: var(--w-orange); }
.seg-sla-breached   { stroke: var(--w-red);    background: var(--w-red); }
.seg-role-admin     { stroke: var(--w-orange); background: var(--w-orange); }
.seg-role-tech      { stroke: var(--w-blue);   background: var(--w-blue); }
.seg-role-client    { stroke: var(--w-green);  background: var(--w-green); }
.seg-role-inactive  { stroke: #9AA7AF;         background: #9AA7AF; }

/* Navy: dark text on the orange button outside the links list */
:root[data-theme="navy"] .pbar-inner > .pbar-cta { color: #16232E; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .pbar-inner > .pbar-cta { color: #16232E; } }

/* POR-8.4.0 (lab): theme switch sits at the far right of the bar, outside the content
   column, so New ticket lines up with the site header's phone button above it.
   Only where there is room beside the 1180px column; narrower screens keep it inline. */
@media (min-width: 1181px) {
  .pbar-inner > .pbar-theme { position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%); margin: 0; }
}
@media (min-width: 1181px) and (max-width: 1279px) {   /* tight margin: a smaller icon closer to the edge */
  .pbar-inner > .pbar-theme { right: .4rem; width: 2rem; height: 2rem; }
}

/* SLA coverage */
.scope-choice { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.scope-choice legend { font-weight: 650; margin-bottom: .5rem; padding: 0; }
.scope-choice .radio { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 600; cursor: pointer; }
.cover-list { list-style: none; margin: .5rem 0 1rem; padding: .75rem; display: grid; gap: .35rem 1rem;
              grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); max-height: 22rem; overflow-y: auto;
              border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.cover-list label { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .3rem .4rem; border-radius: 4px; font-weight: 500; cursor: pointer; }
.cover-list label:hover { background: var(--white); }
.cover-list input, .scope-choice input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--signal); }
.seg-sla-none { stroke: #9AA7AF; background: #9AA7AF; }

/* =====================================================================
   POR-9.0.0 — Inventory (client assets). Reuses the list/card system:
   .lrow / .ucard take --a / --a-soft from the asset status, exactly as
   tickets take theirs from the stage. Lifecycle alert colours arrive in A2.
     Active     green      In repair  amber
     Lost       red        Retired    grey (muted card)
   ===================================================================== */
.lrow.astatus-active,    .acard.astatus-active    { --a: var(--w-green);  --a-soft: var(--soft-green); }
.lrow.astatus-in_repair, .acard.astatus-in_repair { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.lrow.astatus-lost,      .acard.astatus-lost      { --a: var(--w-red);    --a-soft: var(--soft-red); }
.lrow.astatus-retired,   .acard.astatus-retired   { --a: var(--rule);     --a-soft: var(--panel); }
.acard { height: 100%; text-decoration: none; color: var(--text); }
.acard.astatus-retired { background: var(--paper); }
.acard h4 { margin: 0; color: var(--ink); }
.badge.astatus-active    { background: var(--soft-green);  color: #23663A; }
.badge.astatus-in_repair { background: var(--soft-orange); color: #8A4A12; }
.badge.astatus-lost      { background: var(--soft-red);    color: var(--w-red); }
.badge.astatus-retired   { background: var(--panel);       color: var(--muted); }
a.acard.is-last { box-shadow: 0 0 0 2px var(--a); }
.form-sub { font-size: 1.15rem; font-stretch: 82%; margin: 1.5rem 0 .5rem; color: var(--ink); border-top: 1px solid var(--rule); padding-top: 1rem; }
.form-sub .opt { margin-left: .4rem; }
.details dt.staff-only { color: #8A4A12; }
.details dt.staff-only::after { content: " · staff"; font-size: .78rem; font-weight: 600; }
.prewrap { white-space: pre-wrap; }
summary.h2-summary { font-size: 1.25rem; font-weight: 700; color: var(--ink); cursor: pointer; }
summary.h2-summary:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
:root[data-theme="navy"] .badge.astatus-active { color: #86D6A0; }
:root[data-theme="navy"] .badge.astatus-in_repair, :root[data-theme="navy"] .details dt.staff-only { color: #F3B97D; }
:root[data-theme="navy"] .badge.astatus-lost { color: #F29A96; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .badge.astatus-active { color: #86D6A0; }
  :root[data-theme="auto"] .badge.astatus-in_repair, :root[data-theme="auto"] .details dt.staff-only { color: #F3B97D; }
  :root[data-theme="auto"] .badge.astatus-lost { color: #F29A96; }
}

/* Asset forms: date and number fields look like every other field */
.asset-form input[type=date], .asset-form input[type=number], .alert-input input[type=number], .renew-form input[type=date], .jc-form input[type=date], .jc-form input[type=time] { width: 100%; padding: .7rem .8rem; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--white); color: var(--text); font: inherit; min-height: 3rem; }
.asset-form input[type=date]:focus, .asset-form input[type=number]:focus, .alert-input input:focus, .renew-form input:focus, .jc-form input[type=date]:focus, .jc-form input[type=time]:focus { border-color: var(--ink-line); }
:root[data-theme="navy"] .asset-form input[type=date], :root[data-theme="navy"] .renew-form input[type=date], :root[data-theme="navy"] .jc-form input[type=date], :root[data-theme="navy"] .jc-form input[type=time] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .asset-form input[type=date], :root[data-theme="auto"] .renew-form input[type=date], :root[data-theme="auto"] .jc-form input[type=date], :root[data-theme="auto"] .jc-form input[type=time] { color-scheme: dark; } }
.renew-form input[type=date] { width: auto; min-width: 11rem; }

/* Admin tables: one control height for inputs, selects and small buttons, so a row of
   edit controls lines up (Settings > Ticket types, Asset categories, Companies review). */
.admin-table input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .admin-table select,
.admin-table button.small { min-height: 2.75rem; height: 2.75rem; margin: 0; box-sizing: border-box; }
.admin-table input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .admin-table select { padding: .35rem .7rem; }
.admin-table button.small { padding: 0 .9rem; line-height: 1; }
.cat-table .cat-name { flex: 1 1 14rem; min-width: 10rem; }
.cat-table .cat-class { flex: 0 0 11rem; width: 11rem; }
.cat-table .cat-act button.small { min-width: 7.5rem; }
.cat-table .cat-del button.small, .cat-table .cat-del .sub-inline { display: inline-block; min-width: 5.5rem; text-align: center; }
.cat-table td { vertical-align: middle; }

/* POR-9.0.0 A1.1 — Add assets: step marker, two choice cards, CSV import report */
.steps-mini { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; list-style: none; padding: 0; margin: .25rem 0 1rem; counter-reset: st; }
.steps-mini li { counter-increment: st; color: var(--muted); font-weight: 600; font-size: .92rem; }
.steps-mini li::before { content: counter(st); display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .4rem;
  border-radius: 50%; border: 1px solid var(--rule); font-size: .8rem; }
.steps-mini li.on { color: var(--ink); }
.steps-mini li.on::before { background: var(--signal); border-color: var(--signal); color: #16232E; }
.steps-mini li.done::before { content: "✓"; background: var(--soft-green); border-color: var(--w-green); color: #23663A; }
.choice-cards { grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); }
.choice-cards.choice-3 { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.ucard.choice { --a: var(--rule); height: 100%; text-decoration: none; color: var(--text); }
.ucard.choice h4 { margin: 0 0 .3rem; color: var(--ink); }
.ucard.choice.is-on { --a: var(--signal); box-shadow: 0 0 0 2px var(--signal); }
.tpl-box { border: 1px solid var(--rule); border-left: 4px solid var(--signal); border-radius: 8px; background: var(--panel);
           padding: 1rem 1.1rem .4rem; margin: .25rem 0 1.25rem; }
.tpl-dl { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .75rem; }
.tpl-dl .tpl-btn { margin-top: 0; min-height: 2.75rem; display: inline-flex; align-items: center; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.button.ghost:hover, .button.ghost:focus-visible { background: transparent; border-color: var(--signal); }
.howto { margin: 0 0 1rem; padding-left: 1.3rem; }
.howto li { margin: .3rem 0; }
.imp-counts { margin: 1rem 0; }
.imp-c-create { --a: var(--w-green); } .imp-c-skip { --a: var(--rule); } .imp-c-error { --a: var(--w-red); } .imp-c-warn { --a: var(--w-orange); }
.ltable-import .cell { display: block; padding: .6rem .7rem; }
.lrow.imp-row-create { --a: var(--w-green);  --a-soft: var(--soft-green); }
.lrow.imp-row-skip   { --a: var(--rule);     --a-soft: var(--panel); }
.lrow.imp-row-error  { --a: var(--w-red);    --a-soft: var(--soft-red); }
.lrow.imp-row-create, .lrow.imp-row-skip, .lrow.imp-row-error { cursor: default; }
.badge.imp-a-create, .badge.imp-applied { background: var(--soft-green); color: #23663A; }
.badge.imp-a-skip, .badge.imp-reversed  { background: var(--panel); color: var(--muted); }
.badge.imp-a-error { background: var(--soft-red); color: var(--w-red); }
.badge.imp-dry_run { background: var(--soft-orange); color: #8A4A12; }
.imp-msg { display: block; font-size: .88rem; }
.imp-err { color: var(--w-red); } .imp-warn { color: #8A4A12; }
:root[data-theme="navy"] .badge.imp-a-create, :root[data-theme="navy"] .badge.imp-applied { color: #86D6A0; }
:root[data-theme="navy"] .badge.imp-a-error, :root[data-theme="navy"] .imp-err { color: #F29A96; }
:root[data-theme="navy"] .badge.imp-dry_run, :root[data-theme="navy"] .imp-warn { color: #F3B97D; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .badge.imp-a-create, :root[data-theme="auto"] .badge.imp-applied { color: #86D6A0; }
  :root[data-theme="auto"] .badge.imp-a-error, :root[data-theme="auto"] .imp-err { color: #F29A96; }
  :root[data-theme="auto"] .badge.imp-dry_run, :root[data-theme="auto"] .imp-warn { color: #F3B97D; }
}

/* =====================================================================
   POR-9.0.0 A2 — Inventory lifecycle alerts (warranty, EOL/EOS, renewal).
   Same language as the ticket stages: the pill carries the colour and the
   glow, never the whole row; the glow only animates when the visitor has not
   asked for reduced motion.
     expired   red pill, glowing, "+N mo" since the date
     near      amber pill, glowing, time left
     accepted  red outline, no glow (EOS passed, client accepted the risk)
     ok        plain date
   ===================================================================== */
.life { display: inline-block; font-size: .8rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
        padding: .12rem .5rem; border-radius: 999px; color: var(--muted); background: var(--panel); }
.life-ok, .life-none { font-weight: 600; }
.life-near     { background: var(--soft-orange); color: #8A4A12;        box-shadow: 0 0 0 1px var(--w-orange); }
.life-expired  { background: var(--soft-red);    color: var(--w-red);   box-shadow: 0 0 0 1px var(--w-red); }
.life-accepted { background: transparent;        color: var(--w-red);   box-shadow: inset 0 0 0 1px var(--w-red); }
/* A2.4: expired warranty = information only. Grey, no glow, does not colour the row or card. */
.life-lapsed   { background: var(--panel);       color: var(--muted);   box-shadow: inset 0 0 0 1px var(--rule); font-weight: 600; }
.life-kind { font-weight: 600; opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .life-expired { animation: stage-glow-new 2.2s ease-in-out infinite; }
  .life-near    { animation: stage-glow-assigned 2.2s ease-in-out infinite; }
}
.life-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.details dd .life { margin-left: .35rem; vertical-align: 1px; }
.ltable-assets td .life { font-size: .76rem; white-space: normal; max-width: 7.5rem; border-radius: .75rem; }
.life .nw { white-space: nowrap; }
:root[data-theme="navy"] .life { color: #B9C6D0; }
:root[data-theme="navy"] .life-near { color: #F3B97D; }
:root[data-theme="navy"] .life-expired, :root[data-theme="navy"] .life-accepted { color: #F29A96; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .life { color: #B9C6D0; }
  :root[data-theme="auto"] .life-near { color: #F3B97D; }
  :root[data-theme="auto"] .life-expired, :root[data-theme="auto"] .life-accepted { color: #F29A96; }
}

/* Settings > Inventory > Alert windows: three equal fields, same control height as the admin tables */
.alert-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); gap: 1rem; align-items: end; }
.alert-field label { display: block; font-weight: 700; margin-bottom: .35rem; }
.alert-input { display: flex; align-items: center; gap: .5rem; }
.alert-input input[type=number] { width: 6.5rem; min-height: 2.75rem; }
.alert-form button { margin-top: 0; min-height: 2.75rem; justify-self: start; }

/* Company page: category chips under the inventory tiles */
.cat-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1rem 0 .25rem; }
.cat-chips .flag { display: inline-block; font-size: .85rem; padding: .3rem .7rem; text-decoration: none; }
.cat-chips .flag b { margin-left: .25rem; }
.headrow .button.ghost { margin-top: 0; }
.ltable-assets .l-tag { display: block; font-size: .78rem; margin-top: .15rem; }
.ltable-assets td:first-child { min-width: 9rem; }

/* =====================================================================
   POR-9.0.0 A2.1 — Asset sections (page and form), hardware / software.
   One colour per kind of information, from the existing tokens, the same in
   every theme (the soft tokens already switch for navy / auto):
     Device / Product          blue
     Warranty / Term + dates   orange (the alert colour family)
     Location / Who uses it    green
     Staff only                brown
   ===================================================================== */
.asec { --a: var(--rule); --a-soft: var(--panel);
        background: var(--white); border: 1px solid var(--rule); border-top: 4px solid var(--a);
        border-radius: var(--radius, 6px); padding: 0 1.25rem 1rem; margin: 0 0 1rem; }
.asec-id     { --a: var(--w-blue);   --a-soft: var(--soft-blue); }
.asec-dates  { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.asec-place  { --a: var(--w-green);  --a-soft: var(--soft-green); }
.asec-staff  { --a: var(--w-brown);  --a-soft: var(--soft-brown); }
.asec-help   { --a: var(--ink-line, var(--muted)); --a-soft: var(--panel); }
.asec > h2, .asec > summary { margin: 0 -1.25rem 1rem; padding: .65rem 1.25rem; background: var(--a-soft);
        font-size: 1.05rem; font-stretch: 85%; font-weight: 800; color: var(--ink); }
.asec > h2 .opt, .asec > summary .opt { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: .4rem; font-stretch: 100%; }
.asec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1rem; }
.asec-grid .asec { margin: 0; }
@media (max-width: 860px) { .asec-grid { grid-template-columns: 1fr; } }
.asec .details { grid-template-columns: minmax(7.5rem, max-content) 1fr; }
.asec .details dt { color: var(--muted); }
.dd-note { display: block; font-size: .85rem; color: var(--muted); margin-top: .1rem; }
.asec .renew-form { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule); align-items: end; }
.asec .renew-form button { margin-top: 0; min-height: 3rem; }
.asec-help p { margin: 0 0 .8rem; }
.asec-help .button { margin-top: 0; }

/* The form: each section is a <details>; the summary is the coloured header */
details.asec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.asec > summary::-webkit-details-marker { display: none; }
details.asec > summary::before { content: "▸"; color: var(--a); font-size: .9rem; transition: transform .15s; }
details.asec[open] > summary::before { transform: rotate(90deg); }
details.asec:not([open]) { padding-bottom: 0; }
details.asec:not([open]) > summary { margin-bottom: 0; }
details.asec > summary:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.asset-form .asec .grid2 { margin-bottom: .25rem; }
.asset-form > button[type=submit] { margin-top: .5rem; }
.wend-field { display: none; }
.wend-field.is-on, .asec:has(#a-wterm option[value="custom"]:checked) .wend-field { display: block; }
.sub-more { margin-top: .5rem; }
.sub-more > summary { cursor: pointer; color: var(--link); font-size: .92rem; font-weight: 600; }
.sub-more[open] > summary { margin-bottom: .5rem; }

/* After "Add": next-step buttons */
.added-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1rem 0 .25rem; padding: .8rem 1rem;
             background: var(--soft-green); border-left: 4px solid var(--w-green); border-radius: 4px; }
.added-bar > span { flex-basis: 100%; }
.added-bar .button { margin-top: 0; min-height: 2.75rem; display: inline-flex; align-items: center; }

/* Inventory: All / Hardware / Software tabs */
.kind-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--rule); margin: .25rem 0 1.25rem; }
.kind-tabs a { padding: .6rem 1rem; font-weight: 700; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent;
               margin-bottom: -1px; border-radius: 4px 4px 0 0; }
.kind-tabs a:hover { color: var(--ink); background: var(--paper); }
.kind-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.kind-tabs a.kt-hardware[aria-current="page"] { border-bottom-color: var(--w-blue); }
.kind-tabs a.kt-software[aria-current="page"] { border-bottom-color: var(--w-green); }
.kind-tabs a:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.ucard.choice-hardware { --a: var(--w-blue); }
.ucard.choice-software { --a: var(--w-green); }
.ucard.choice-csv      { --a: var(--signal); }

/* A2.2 — An asset's accent (row bar, card top, hover tint, page head) follows its WORST date,
   not its status: overdue / expired / past EOS = red, nearing = amber, otherwise the status
   colour. One rule for every place an asset is drawn (list, grid, children, dashboard). */
.lrow.alert-expired, .acard.alert-expired, .lrow.alert-accepted, .acard.alert-accepted,
.mini-item.alert-expired, .mini-item.alert-accepted  { --a: var(--w-red);    --a-soft: var(--soft-red); }
.lrow.alert-near, .acard.alert-near, .mini-item.alert-near { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.asset-head.alert-expired, .asset-head.alert-accepted { border-top: 4px solid var(--w-red); }
.asset-head.alert-near { border-top: 4px solid var(--w-orange); }

/* =====================================================================
   POR-9.0.0 A2.2 — Dashboard: pulse strip, section menu, attention feed,
   Coming-up timeline. Same tokens, lift and focus ring as the rest.
   ===================================================================== */
.dash-head > div .aside { margin: .2rem 0 0; }
.pulse { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .75rem;
         grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); }
.pulse-item { --a: var(--w-blue); display: grid; grid-template-columns: auto 1fr; grid-template-areas: "n label" "n sub";
              column-gap: .85rem; align-items: center; padding: .8rem 1rem; text-decoration: none; color: var(--text);
              background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--a); border-radius: var(--radius); }
.pulse-item strong { grid-area: n; font-size: 2rem; line-height: 1; font-stretch: 75%; font-weight: 800; color: var(--ink); }
.pulse-item span  { grid-area: label; font-weight: 700; color: var(--ink); }
.pulse-item small { grid-area: sub; color: var(--muted); font-size: .85rem; }
.pulse-item.tone-bad   { --a: var(--w-red); }   .pulse-item.tone-bad strong  { color: var(--w-red); }
.pulse-item.tone-warn  { --a: var(--w-orange); }
.pulse-item.tone-good  { --a: var(--w-green); }
.pulse-item.tone-clear { --a: var(--rule); }
@media (max-width: 600px) {
  .pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .pulse-item { grid-template-columns: 1fr; grid-template-areas: "n" "label" "sub"; padding: .65rem .75rem; row-gap: .15rem; }
  .pulse-item strong { font-size: 1.6rem; }
}

.dtabs { display: flex; gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding: .3rem; margin: 0 0 1.25rem; background: var(--panel);
         border-radius: calc(var(--radius) + 4px); width: fit-content; max-width: 100%; }
.dtabs a { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: var(--radius);
           font-weight: 700; color: var(--muted); text-decoration: none; transition: background-color var(--lift-dur), color var(--lift-dur); }
.dtabs a:hover { color: var(--ink); background: var(--white); }
.dtabs a.on { color: var(--ink); background: var(--white); box-shadow: 0 1px 3px rgba(22, 35, 46, .15), inset 0 -3px 0 var(--signal); }
.dtabs a:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.dtab-n { min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; font-size: .78rem; text-align: center; color: #fff; }
.dtab-bad  { background: var(--w-red); }
.dtab-warn { background: var(--w-orange); color: #16232E; }
.dpanel + .dpanel { margin-top: 2rem; }                  /* no script: sections stack */
.dtabs-on .dpanel + .dpanel { margin-top: 0; }
.dpanel-h { font-size: 1.05rem; margin: 0 0 .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dtabs-on .dpanel > .dpanel-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }  /* the tab names it */
.dpanel .dash-bar:first-child { margin-top: 0; }
.dash-gap { margin-top: 1.25rem; }
.dash-cols-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .dash-cols-main { grid-template-columns: 1fr; } }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.feed-item { --a: var(--rule); --a-soft: var(--paper);
             display: grid; grid-template-columns: 3rem 1fr auto 1rem; align-items: center; gap: .75rem;
             padding: .6rem .8rem; text-decoration: none; color: var(--text); background: var(--white);
             border: 1px solid var(--rule); border-left: 4px solid var(--a); border-radius: var(--radius);
             transition: background-color var(--lift-dur) var(--lift-ease), box-shadow var(--lift-dur) var(--lift-ease); }
.feed-bad  { --a: var(--w-red);    --a-soft: var(--soft-red); }
.feed-warn { --a: var(--w-orange); --a-soft: var(--soft-orange); }
.feed-item strong { font-size: 1.6rem; font-stretch: 75%; font-weight: 800; color: var(--a); text-align: right; line-height: 1; }
.feed-warn strong { color: #8A4A12; }
.feed-label { font-weight: 650; color: var(--ink); }
.feed-label small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; }
.feed-sec { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.feed-go { color: var(--muted); font-size: 1.3rem; }
.feed-item:hover, .feed-item:focus-visible { background: var(--a-soft); box-shadow: inset 0 0 0 1px var(--a); }
.feed-item:hover .feed-go { color: var(--a); }
.feed-item:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
@media (max-width: 520px) { .feed-sec { display: none; } .feed-item { grid-template-columns: 2.4rem 1fr 1rem; } }
.all-clear { margin: .25rem 0; padding: .9rem 1rem; border-radius: var(--radius); background: var(--soft-green); color: var(--ink); font-weight: 600; }
.all-clear span { color: var(--w-green); margin-right: .35rem; }

.timeline { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .45rem; }
.tl-item { grid-template-columns: 7.5rem 1fr auto; grid-template-areas: "when what pill"; }
.tl-when { grid-area: when; font-weight: 700; color: var(--ink); }
.tl-when small, .tl-what small { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); }
.tl-what { grid-area: what; min-width: 0; }
.tl-what b { color: var(--ink); }
.tl-pill { grid-area: pill; }
@media (max-width: 600px) { .tl-item { grid-template-columns: 1fr auto; grid-template-areas: "what pill" "when when"; } }
:root[data-theme="navy"] .feed-warn strong, :root[data-theme="navy"] .feed-bad strong { filter: brightness(1.35); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .feed-warn strong, :root[data-theme="auto"] .feed-bad strong { filter: brightness(1.35); } }
@media (prefers-reduced-motion: reduce) { .feed-item, .dtabs a { transition: none; } }

/* A2.4 dashboard tile tone for information-only counts (out of warranty) */
.count.attn-info { --a: var(--ink-line); }
.count.attn-info strong { color: var(--muted); }

/* =====================================================================
   POR-9.0.0 A2.6 — Pager (every list page, grid and list alike).
   Same control language as the Grid / List toggle: one height, one border,
   the signal underline on the current choice, the focus ring.
   ===================================================================== */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem;
         margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }
.pg-info { margin: 0; color: var(--muted); font-size: .9rem; }
.pg-pages, .pg-per { display: inline-flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--radius);
                     overflow: hidden; background: var(--white); }
.pg-n, .pg-per a, .pg-per span, .pg-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem;
                     min-height: 2.5rem; padding: 0 .7rem; font-size: .9rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.pg-pages > * + *, .pg-per > * + * { border-left: 1px solid var(--rule); }
.pg-n:hover, .pg-per a:hover { color: var(--ink); background: var(--paper); }
.pg-n.is-on, .pg-per a.on { color: var(--ink); background: var(--soft-orange); box-shadow: inset 0 -3px 0 var(--signal); }
.pg-n.is-off { opacity: .45; cursor: default; }
.pg-gap { min-width: 2rem; padding: 0 .3rem; }
.pg-per span { color: var(--muted); font-weight: 600; cursor: default; }
.pg-n:focus-visible, .pg-per a:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
[data-live-part="results"]:focus { outline: none; }
[data-live-part="results"][aria-busy="true"] { opacity: .55; transition: opacity .15s; }
@media (max-width: 640px) {
  .pager { justify-content: center; }
  .pg-info { width: 100%; text-align: center; }
  .pg-pages .pg-n[rel] { font-size: 0; min-width: 2.5rem; }          /* "‹ Previous" -> "‹" on phones */
  .pg-pages .pg-n[rel="prev"]::before { content: "‹"; font-size: 1.1rem; }
  .pg-pages .pg-n[rel="next"]::before { content: "›"; font-size: 1.1rem; }
  .pg-pages .is-off { display: none; }
}
@media (prefers-reduced-motion: reduce) { [data-live-part="results"][aria-busy="true"] { transition: none; } }

/* =====================================================================
   POR-9.0.0 A2.7 — Card design (from Anil's sample), site-wide.
   Our colours and type; the sample's structure: 12 px cards with a hairline
   border and a whisper of shadow, header / footer bands, rows split by
   dividers with a 3 px tone edge, soft pills, underline tabs with chips.
   ===================================================================== */
:root { --radius-card: 12px; --shadow-card: 0 1px 3px rgba(22, 35, 46, .05); --hairline: color-mix(in srgb, var(--rule) 70%, var(--white)); }

/* Cards everywhere: panels, count tiles, grid cards, tables, sections */
.panel, .card, .ucard, .tcard, .acard, .count a, .asec, .table-wrap, .pulse-item, .chart-panel {
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.panel, .card { border-color: var(--hairline); }
.card { background: var(--white); border: 1px solid var(--hairline); overflow: hidden; margin: 0 0 1.25rem; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
          padding: .95rem 1.25rem; border-bottom: 1px solid var(--hairline); }
.card-h h2 { margin: 0; font-size: 1.02rem; font-weight: 750; display: inline-flex; align-items: center; gap: .5rem; }
.card-h .vtoggle { margin: 0; }
.card-pad { padding: 1rem 1.25rem; margin: 0; }
.card-f { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1.25rem;
          border-top: 1px solid var(--hairline); background: var(--paper); font-size: .8rem; color: var(--muted); }
.card-f > span, .card-f a, .card-f-btn { display: inline-flex; align-items: center; gap: .35rem; }
.card-f a, .card-f-btn { color: var(--ink); font-weight: 650; text-decoration: none; }
.card-f a:hover, .card-f-btn:hover { text-decoration: underline; }
.card-f-center { justify-content: center; }
.card-empty { padding: 1rem 1.25rem; margin: 0; color: var(--muted); }
.count-chip { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .4rem; border-radius: 999px;
              background: var(--panel); color: var(--muted); font-size: .74rem; font-weight: 700; }
.ico { flex: none; width: 1.1rem; height: 1.1rem; vertical-align: -3px; }
.ico-sm { width: .95rem; height: .95rem; }
.ico-xs { width: .8rem; height: .8rem; }

/* Search inside a card header */
.card-search { display: inline-flex; align-items: center; gap: .45rem; padding: 0 .85rem; min-height: 2.3rem; min-width: min(15rem, 100%);
               border: 1px solid var(--hairline); border-radius: 999px; background: var(--white); color: var(--muted); }
.card-search input { border: 0; padding: .35rem 0; min-height: 0; background: transparent; font-size: .9rem; width: 100%; box-shadow: none; }
.card-search input:focus { outline: none; }
.card-search:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px var(--soft-orange); }

/* Dashboard head */
.dash-head h1 { font-size: clamp(1.9rem, 4vw, 2.3rem); letter-spacing: -.01em; }
.dash-date { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .35rem 0 0; color: var(--muted); font-size: .92rem; }
.dash-date .dot { opacity: .45; }
.pill-link { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .95rem; border: 1px solid var(--hairline);
             border-radius: 999px; background: var(--white); box-shadow: var(--shadow-card); color: var(--ink); font-weight: 650;
             font-size: .9rem; text-decoration: none; }
.pill-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--signal); }

/* KPI cards (pulse) */
.pulse { gap: 1rem; margin-bottom: 1.5rem; }
.pulse-item { position: relative; grid-template-columns: 1fr; grid-template-areas: "n" "label" "sub"; row-gap: .15rem;
              padding: 1.15rem 1.25rem 1.1rem; border-color: var(--hairline); border-left-width: 4px; }
.pulse-item strong { font-size: 2.15rem; font-stretch: 80%; letter-spacing: -.01em; margin-bottom: .35rem; }
.pulse-item span:not(.pulse-ico) { font-size: .95rem; }
.pulse-ico { position: absolute; top: 1rem; right: 1rem; display: grid; place-items: center; width: 2.2rem; height: 2.2rem;
             border-radius: 50%; background: color-mix(in srgb, var(--a) 14%, var(--white)); color: var(--a); }
.pulse-item.tone-clear .pulse-ico { background: var(--panel); color: var(--muted); }
@media (max-width: 600px) { .pulse-ico { width: 1.8rem; height: 1.8rem; top: .7rem; right: .7rem; } }

/* Underline tabs with icons and chips: dashboard sections, ticket status, inventory kind */
.utabs, .dtabs.utabs, .tabs, .kind-tabs {
  display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: .25rem; width: auto; max-width: 100%;
  padding: 0; margin: 0 0 1.5rem; background: none; border-radius: 0; border-bottom: 1px solid var(--hairline); }
.utabs a, .dtabs.utabs a, .tabs a, .kind-tabs a {
  flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1rem; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none;
  font-size: .95rem; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.utabs a:hover, .tabs a:hover, .kind-tabs a:hover { color: var(--ink); background: none; }
.utabs a.on, .dtabs.utabs a.on, .tabs a[aria-current="page"], .kind-tabs a[aria-current="page"] {
  color: var(--ink); background: none; box-shadow: none; border-bottom-color: var(--signal); font-weight: 700; }
.utabs a.on .ico, .tabs a[aria-current="page"] .ico { color: var(--signal); }
.utabs a:focus-visible, .tabs a:focus-visible, .kind-tabs a:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.tab-n { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.3rem; padding: 0 .4rem; border-radius: 999px;
         font-size: .72rem; font-weight: 750; background: var(--panel); color: var(--muted); }
.utabs a.on .tab-n { background: var(--ink); color: var(--white); }
.tab-n.tab-bad  { background: var(--soft-red);    color: var(--w-red); }
.tab-n.tab-warn { background: var(--soft-orange); color: #8A4A12; }
.utabs a.on .tab-n.tab-bad  { background: var(--w-red); color: #fff; }
.utabs a.on .tab-n.tab-warn { background: var(--w-orange); color: #16232E; }

/* Count tiles (stage, SLA, inventory, company): the KPI card's left edge instead of a top bar */
.count a { border-top: 1px solid var(--hairline); border-color: var(--hairline); border-left: 4px solid var(--a, var(--w-blue)); padding: 1rem 1.15rem; }

/* Overview: Needs attention */
.dash-cols-main { gap: 1.25rem; align-items: start; }
.dash-side { display: grid; gap: 1.25rem; }
.dash-side .card { margin: 0; }
.attn-card { margin: 0; }
.feed { display: block; margin: 0; padding: 0; list-style: none; }
.feed li + li .feed-item { border-top: 1px solid var(--hairline); }
.feed-item { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; gap: 1rem; padding: .95rem 1.25rem;
             border: 0; border-left: 3px solid var(--a); border-radius: 0; background: var(--white); box-shadow: none; }
.feed-item:hover, .feed-item:focus-visible { background: var(--paper); box-shadow: none; }
.feed-item:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.feed-num { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; font-weight: 800; font-size: .9rem;
            background: var(--a-soft); color: var(--a); }
.feed-warn .feed-num { color: #8A4A12; }
.feed-label { font-weight: 650; color: var(--ink); }
.feed-label b { color: var(--a); font-weight: 800; }
.feed-warn .feed-label b { color: #8A4A12; }
.feed-label small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; margin-top: .1rem; }
.feed-sec { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: 999px; background: var(--panel);
            font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.feed-item:hover .feed-sec { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.feed-item strong, .feed-go { display: none; }                 /* A2.2 markup leftovers */
.attn-card .all-clear { margin: 1rem 1.25rem; }
@media (max-width: 560px) { .feed-item { grid-template-columns: 2rem 1fr; gap: .75rem; padding: .85rem 1rem; } .feed-sec { display: none; }
                            .feed-num { width: 2rem; height: 2rem; } }

/* Right column: Recently updated + Quick insight */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li + li .recent-item { border-top: 1px solid var(--hairline); }
.recent-item { --a: var(--rule); display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main badge" "when badge";
               gap: .25rem .75rem; align-items: center; padding: .85rem 1.25rem; border-left: 3px solid var(--a);
               text-decoration: none; color: var(--text); background: var(--white); }
.recent-item.status-new { --a: var(--w-red); }  .recent-item.status-assigned, .recent-item.status-in_progress { --a: var(--w-orange); }
.recent-item.status-completed { --a: var(--w-green); }  .recent-item.status-waiting_client { --a: var(--w-blue); }
.recent-item:hover, .recent-item:focus-visible { background: var(--paper); }
.recent-item:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.recent-main { grid-area: main; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-main b { color: var(--ink); font-family: var(--mono); font-size: .88rem; }
.recent-subj { color: var(--text); font-size: .9rem; }
.recent-when { grid-area: when; display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .8rem; }
.recent-item .badge { grid-area: badge; animation: none; }
.insight { display: grid; grid-template-columns: auto 1fr; gap: .9rem; padding: 1.1rem 1.25rem; border-style: dashed; box-shadow: none; background: var(--white); }
.insight-ico { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--ink); color: var(--white); }
.insight h2 { margin: 0 0 .25rem; font-size: .98rem; }
.insight p { margin: 0 0 .5rem; color: var(--muted); font-size: .92rem; }
.insight a { color: var(--ink); font-weight: 700; font-size: .88rem; }

/* Work list card on the overview */
.card.dash-list { margin-top: 1.25rem; }
.card.dash-list .card-pad .tcards { padding-top: 0; }

/* Navy / auto */
:root[data-theme="navy"] .tab-n.tab-warn, :root[data-theme="navy"] .feed-warn .feed-num, :root[data-theme="navy"] .feed-warn .feed-label b { color: #F3B97D; }
:root[data-theme="navy"] .insight-ico { background: var(--signal); color: #16232E; }
:root[data-theme="navy"] .utabs a.on .tab-n { background: var(--text); color: var(--white); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .tab-n.tab-warn, :root[data-theme="auto"] .feed-warn .feed-num, :root[data-theme="auto"] .feed-warn .feed-label b { color: #F3B97D; }
  :root[data-theme="auto"] .insight-ico { background: var(--signal); color: #16232E; }
  :root[data-theme="auto"] .utabs a.on .tab-n { background: var(--text); color: var(--white); }
}
.pulse-item .pulse-ico { grid-area: auto; }   /* absolute child of a grid: anchor to the card, not the label row */
.card-h-note { font-size: .82rem; color: var(--muted, #5b6770); }
.card-h h2 .ico { color: var(--signal, #E8822A); }

/* ===========================================================================
   POR-9.0.0 A2.8 — quick-view drawer (peek.js): tickets and assets
   =========================================================================== */
html.peek-open { overflow: hidden; }
.peek-dialog { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(30rem, 100vw);
  height: 100dvh; max-height: none; max-width: 100vw; background: var(--white); color: var(--text);
  box-shadow: -24px 0 48px -24px rgba(22, 35, 46, .45); }
.peek-dialog::backdrop { background: rgba(13, 23, 32, .38); backdrop-filter: blur(3px); }
.peek-dialog[open] { animation: peek-in .22s var(--lift-ease) both; }
.peek-dialog[open]::backdrop { animation: peek-fade .22s ease both; }
@keyframes peek-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes peek-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .peek-dialog[open], .peek-dialog[open]::backdrop { animation: none; } }
.peek-panel { height: 100%; }
.peek-loading { margin: 2rem 1.5rem; color: var(--muted); }
.peek-dialog.is-loading .peek { opacity: .55; transition: opacity .15s; }

.peek { display: flex; flex-direction: column; height: 100%; border-left: 4px solid transparent; }
.peek.alert-expired { border-left-color: var(--w-red); }
.peek.alert-near { border-left-color: var(--w-orange); }
.peek-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--hairline); }
.peek-ico { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--panel); color: var(--ink); }
.peek-id { display: flex; flex-direction: column; min-width: 0; }
.peek-id b { font-size: .95rem; letter-spacing: .01em; color: var(--ink); }
.peek-id small { color: var(--muted); font-size: .8rem; }
.mono { font-family: var(--mono); }
.mono-soft { font-family: var(--mono); font-weight: 600; font-size: .9em; }
.peek-close { margin-left: auto; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.peek-close:hover { background: var(--panel); color: var(--ink); }

.peek-body { flex: 1; overflow-y: auto; padding: 1.25rem 1.25rem 1.5rem; overscroll-behavior: contain; }
.peek-title { margin: 0 0 .7rem; font-size: 1.45rem; }
.peek-title:focus { outline: none; }
.peek-title:focus-visible { outline: 3px solid var(--signal); outline-offset: 4px; }
.peek-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; align-items: center; }
.pchip { display: inline-block; padding: .14rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--panel); color: var(--text); }
.pchip-caps { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; padding: .2rem .65rem; }
.pchip.prio-high { color: #B5600F; } .pchip.prio-critical { background: var(--soft-red); color: var(--w-red); font-weight: 800; }

.peek-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 0 0 1.25rem; }
.pfact { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border-radius: 10px; background: var(--paper);
  border: 1px solid var(--hairline); min-width: 0; }
.pfact > span { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pfact > b { display: inline-flex; align-items: center; gap: .35rem; font-size: .98rem; color: var(--ink); overflow-wrap: anywhere; }
.pfact > b .ico { width: 16px; height: 16px; flex: none; }
.pfact > small { color: var(--muted); font-size: .78rem; }
.pfact-bad { background: var(--soft-red); border-color: color-mix(in srgb, var(--w-red) 35%, transparent); }
.pfact-bad > b { color: var(--w-red); }
.pfact-warn { background: var(--soft-orange); } .pfact-warn > b { color: #8A4A12; }
.pfact-good > b { color: #23663A; }
.muted { color: var(--muted); font-style: normal; font-weight: 500; }

.peek-h { margin: 1.25rem 0 .55rem; font-size: .95rem; }
.peek-msg { margin: 0; padding: .8rem .95rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--hairline); }
.peek-msg p { margin: 0 0 .4rem; font-size: .92rem; line-height: 1.5; }
.peek-msg footer { font-size: .78rem; color: var(--muted); }
.peek-msg.is-internal { background: var(--soft-orange); border-color: color-mix(in srgb, var(--w-orange) 40%, transparent); }

.peek-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.peek-links a { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: 10px; text-decoration: none;
  color: var(--text); border: 1px solid var(--hairline); border-left: 3px solid var(--rule); background: var(--white); }
.peek-links a:hover { background: var(--paper); }
.peek-links a > span:not(.badge):not(.life) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.peek-links b { font-size: .92rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-links small { color: var(--muted); font-size: .78rem; }
.peek-links .ico { flex: none; color: var(--muted); }
.peek-links a.alert-expired { border-left-color: var(--w-red); } .peek-links a.alert-near { border-left-color: var(--w-orange); }
.peek-links a.status-new { border-left-color: var(--w-red); } .peek-links a.status-assigned, .peek-links a.status-in_progress { border-left-color: var(--w-orange); }
.peek-links a.status-completed { border-left-color: var(--w-green); }

.peek-dates { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.peek-dates li { display: flex; align-items: center; gap: .6rem; padding: .6rem .85rem; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.peek-dates li:first-child { border-top: 0; }
.peek-dates li > span { flex: 1; color: var(--muted); font-size: .88rem; }
.peek-dates li > b { font-variant-numeric: tabular-nums; color: var(--ink); }
.peek-empty { color: var(--muted); font-size: .9rem; margin: 1.25rem 0 0; }

.peek-activity { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--hairline); }
.peek-activity li { position: relative; display: flex; flex-direction: column; padding: 0 0 .85rem .25rem; font-size: .9rem; }
.peek-activity li::before { content: ""; position: absolute; left: calc(-1rem - 6px); top: .35rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--rule); box-shadow: 0 0 0 3px var(--white); }
.peek-activity li.is-latest::before { background: var(--signal); }
.peek-activity small { color: var(--muted); font-size: .76rem; }

.peek-foot { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .9rem 1.25rem;
  border-top: 1px solid var(--hairline); background: var(--white); }
.peek-assign { display: flex; gap: .5rem; flex: 1 1 14rem; margin: 0; }
.peek-assign select { flex: 1; min-width: 0; min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--white); color: var(--text); font: inherit; }
.peek-assign .button { min-height: 2.75rem; }
.peek-open { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; min-height: 2.75rem; justify-content: center; }
.peek-open .ico { width: 16px; height: 16px; }

/* Phones: a full-width sheet that slides up */
@media (max-width: 640px) {
  .peek-dialog { inset: auto 0 0 0; width: 100vw; height: 92dvh; border-radius: 16px 16px 0 0; }
  .peek-dialog[open] { animation-name: peek-up; }
  @keyframes peek-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .peek { border-left: 0; border-top: 4px solid transparent; border-radius: 16px 16px 0 0; }
  .peek.alert-expired { border-top-color: var(--w-red); } .peek.alert-near { border-top-color: var(--w-orange); }
  .peek-facts { grid-template-columns: 1fr; }
  .peek-open { flex: 1 1 100%; }
}
.peek-foot { flex-wrap: nowrap; }
.peek-foot .button, .peek-foot button, .peek-foot .peek-assign select { font-size: .95rem; min-height: 2.6rem; height: 2.6rem; padding: .45rem .95rem; line-height: 1.2; }   /* POR-10.6.0-A3.4: + button (Save … matched the links) */
.peek-foot .peek-assign select { padding-right: 2rem; }
.peek-foot .peek-open { flex: none; white-space: nowrap; }
@media (max-width: 640px) { .peek-foot { flex-wrap: wrap; } }
.peek-foot .button, .peek-foot button, .peek-foot select { margin: 0; align-self: center; box-sizing: border-box; }
.peek-assign { align-items: center; }
@media (max-width: 640px) {
  .peek-foot .peek-open { flex: 1 1 100%; }
  .peek-facts { grid-template-columns: 1fr 1fr; }
}

/* ===========================================================================
   POR-9.0.0 A2.9 — rounded corners everywhere + one icon language
   Containers 12px (--radius-card), boxes inside them 10px (--radius), controls 10px
   (--radius-ctl), pills 999px. The main-site chrome (.site-chrome) is not touched.
   =========================================================================== */
:root { --radius: 10px; --radius-ctl: 10px; }
.panel, .card, .notice, .settings-tree, .auth-intro, .table-wrap { border-radius: var(--radius-card); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=url], input[type=time], input[type=datetime-local], input[type=month], input[type=week], input[type=search], input:not([type]), select, textarea, button, .button,
.asset-form input[type=date], .asset-form input[type=number], .alert-input input[type=number], .renew-form input[type=date], .jc-form input[type=date], .jc-form input[type=time],
.pbar-cta, .pbar-inner > .pbar-cta, .pbar-links .pbar-cta, .pnav .pnav-cta, .lookup-results, .pbar-menu-list,
.pbar-links .pbar-menu-list a, .settings-tree a, .cover-list label, .company-confirm, .merge-note, .added-bar,
.kind-tabs a, .skip { border-radius: var(--radius-ctl); }
.kind-tabs a, .utabs a, .tabs a { border-radius: 0; }            /* underline tabs stay square-bottomed */
button.linkish, .linkish { border-radius: 6px; }
input[type=file]::file-selector-button { border-radius: var(--radius-ctl); border: 1px solid var(--rule); background: var(--white);
  padding: .5rem .9rem; margin-right: .75rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--panel); }

/* Collapsible form sections and conversation entries as rounded boxes */
details.asec, .asec { border-radius: var(--radius-card); overflow: hidden; }
.msg { border: 1px solid var(--hairline); border-left: 3px solid var(--rule); border-radius: var(--radius); padding: .75rem 1rem;
  background: var(--white); margin-bottom: .75rem; }
.msg-staff { border-left-color: var(--w-blue); }
.msg-internal { border-left-color: var(--signal); background: var(--soft-orange); border-radius: var(--radius); padding: .75rem 1rem; }
.activity li { padding: .5rem .25rem; }
.progress li { border-radius: 2px; }
.progress li { border-top-width: 4px; }

/* ---------- Icons ---------- */
.ico { flex: none; vertical-align: -.2em; }
/* Page titles: icon chip */
h1 > .ico:first-child { width: 1.15em; height: 1.15em; padding: .32em; box-sizing: content-box; margin-right: .45em; border-radius: 12px;
  background: color-mix(in srgb, var(--signal) 14%, var(--white)); color: var(--signal); vertical-align: -.32em; stroke-width: 1.7; }
/* Section headings: small signal-coloured icon */
h2 > .ico:first-child, .h2 > .ico:first-child, summary > .ico:first-child { width: .95em; height: .95em; margin-right: .45em; color: var(--signal); vertical-align: -.12em; }
.card-h h2 > .ico:first-child { width: 18px; height: 18px; margin-right: 0; vertical-align: middle; }
.peek-title > .ico { display: none; }
/* Buttons with an icon */
button:has(> .ico), .button:has(> .ico) { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
button > .ico, .button > .ico { width: 1.05em; height: 1.05em; }
/* Definition lists: muted icon before each label */
dt > .ico-dt { width: 15px; height: 15px; margin-right: .45rem; color: var(--muted); vertical-align: -.15em; }
/* Settings dropdown items */
.pbar-menu-list a > .ico { width: 16px; height: 16px; margin-right: .5rem; vertical-align: -.2em; opacity: .8; }
.pbar-menu-list a.sub > .ico { display: none; }
/* "What are you adding?" cards */
.choice .choice-ico { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; margin-bottom: .6rem; border-radius: 12px;
  background: var(--panel); color: var(--ink); }
.choice-csv .choice-ico { background: var(--soft-orange); color: #8A4A12; }
.choice-hardware .choice-ico { background: var(--soft-orange); color: #8A4A12; }
.choice-software .choice-ico { background: var(--soft-green); color: #23663A; }
.manage > summary > .ico { width: 15px; height: 15px; margin-right: .35rem; vertical-align: -.15em; }

/* Notices: a status icon (CSS mask of an inline SVG — data: is allowed by img-src; no inline styles) */
.notice { position: relative; padding-left: 2.6rem; }
.notice::before { content: ""; position: absolute; left: .9rem; top: .95rem; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--notice-ico) center / contain no-repeat; mask: var(--notice-ico) center / contain no-repeat; opacity: .85; }
.notice { --notice-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5.5M12 7.8v.01'/%3E%3C/svg%3E"); }
.notice-success { --notice-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='m8.5 12.3 2.4 2.4 4.8-5'/%3E%3C/svg%3E"); }
.notice-error, .notice-warning { --notice-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 21.5 20h-19z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.01'/%3E%3C/svg%3E"); }
h1 > .ico:first-child { width: 22px; height: 22px; padding: 9px; border-radius: 12px; vertical-align: -10px; margin-right: .6rem; }
.pfact > span { display: inline-flex; align-items: center; gap: .35rem; }
.pfact > span > .ico-dt { width: 13px; height: 13px; }
.cols > * { min-width: 0; }
.details dd { overflow-wrap: anywhere; min-width: 0; }

/* ===========================================================================
   POR-9.0.0 A2.10 — hover: only the item under the pointer comes forward
   Neighbours no longer fade, nothing changes size, nothing reflows.
   =========================================================================== */
:root { --recede: 1; }
.recede:has(.lift:hover) .lift:not(:hover), .recede:has(.lift:focus-visible) .lift:not(:focus-visible) { opacity: 1; }
.ltable tbody:hover > tr:not(:hover) > td { opacity: 1; }
.lift:hover, .lift:focus-visible { z-index: 3; }
/* A list row lifts with a shadow drawn outside its own box: rows above and below stay put */
.lrow { position: relative; transition: box-shadow var(--lift-dur) var(--lift-ease); }
.lrow:hover, .lrow:focus-within { box-shadow: var(--lift-shadow); z-index: 2; }
/* Ticket cards: the request text used to grow the card on hover (pushing the next row down).
   It now opens as an overlay under the card instead, so the grid never moves. */
@media (hover: hover) {
  .tcard { overflow: visible; }
  .tcard .tcard-top { border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
  .tcard .more { position: absolute; left: -1px; right: -1px; top: calc(100% - 2px); z-index: 4; margin: 0;
    max-height: none; padding: .7rem 1rem .85rem; background: var(--white); border: 1px solid var(--rule); border-top: 1px dashed var(--rule);
    border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--lift-shadow); line-height: 1.45;
    opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none;
    transition: opacity var(--lift-dur) var(--lift-ease), transform var(--lift-dur) var(--lift-ease), visibility var(--lift-dur); }
  .tcard:hover .more, .tcard:focus-visible .more { max-height: none; opacity: 1; visibility: visible; transform: none; }
  .tcard:hover, .tcard:focus-visible { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  /* containers that clip their corners must not clip the overlay */
  .card:has(.tcards), .panel:has(.tcards) { overflow: visible; }
  .card:has(.tcards) > .card-h { border-radius: var(--radius-card) var(--radius-card) 0 0; }
  .card:has(.tcards) > .card-f { border-radius: 0 0 var(--radius-card) var(--radius-card); }
}

/* ===========================================================================
   A2.10 — in-place save messages, shown next to the form that was submitted
   =========================================================================== */
.inplace-msg { display: flex; align-items: flex-start; gap: .6rem; margin: .75rem 0 0; padding: .6rem .7rem .6rem 2.3rem;
  position: relative; border-radius: var(--radius); font-size: .92rem; font-weight: 600; line-height: 1.4;
  animation: inplace-in .25s var(--lift-ease) both; transition: opacity .5s; max-width: 40rem; }
.inplace-msg::before { content: ""; position: absolute; left: .7rem; top: .65rem; width: 17px; height: 17px; background: currentColor;
  -webkit-mask: var(--notice-ico) center / contain no-repeat; mask: var(--notice-ico) center / contain no-repeat; }
.inplace-msg.is-ok { background: var(--soft-green); color: #23663A; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w-green) 35%, transparent);
  --notice-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='m8.5 12.3 2.4 2.4 4.8-5'/%3E%3C/svg%3E"); }
.inplace-msg.is-err { background: var(--soft-red); color: var(--w-red); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w-red) 35%, transparent);
  --notice-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 21.5 20h-19z'/%3E%3Cpath d='M12 10v4.5M12 17.5v.01'/%3E%3C/svg%3E"); }
.inplace-msg.is-fading { opacity: 0; }
.inplace-msg.is-float { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; max-width: min(28rem, calc(100vw - 2.5rem)); box-shadow: var(--lift-shadow); margin: 0; }
.inplace-x { margin: -.15rem -.2rem 0 auto; padding: 0 .35rem; min-height: 0; background: none; border: 0; color: inherit; font-size: 1.15rem;
  line-height: 1; cursor: pointer; opacity: .7; }
.inplace-x:hover { opacity: 1; background: none; }
.peek .inplace-msg, .peek-dialog .inplace-msg { margin: 0 1.25rem .5rem; }
form.is-saving { opacity: .7; transition: opacity .15s; }
form.is-saving [type="submit"], form.is-saving button:not([type]) { cursor: progress; }
@keyframes inplace-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .inplace-msg { animation: none; } }
.inplace-msg { align-items: center; }
.inplace-msg .inplace-x { margin: 0 0 0 auto; min-height: 0; height: auto; align-self: center; border-radius: 6px; }

/* ===========================================================================
   POR-9.0.0 A2.11 — portal bar: everything inside the page column
   title | primary links (icon + label) | Settings ⚙ | account (initial) | New ticket
   New ticket's right edge is the column edge, the same edge as the site header's call button.
   =========================================================================== */
.pbar-inner { flex-wrap: nowrap; gap: 1rem; }
.pbar-inner > .pbar-links { flex: 1 1 auto; justify-content: flex-start; gap: .25rem; margin: 0 0 0 .75rem; min-width: 0; }
.pbar-links > a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-radius: 8px;
  border-bottom: 0; font-size: .97rem; position: relative; }
.pbar-links > a:hover { background: rgba(255, 255, 255, .07); }
.pbar-links > a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 -2px 0 var(--signal); }
.pbar-links .nav-ico, .pbar-tools .nav-ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.pbar-links > a[aria-current="page"] .nav-ico { color: var(--signal); opacity: 1; }
.pbar-tools { flex: none; display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.pbar-icon-menu > summary { width: 2.4rem; height: 2.4rem; padding: 0; justify-content: center; border-radius: 999px; border: 1px solid var(--ink-line);
  color: var(--ink-text); border-bottom-width: 1px; }
.pbar-icon-menu > summary::after { display: none; }
.pbar-icon-menu > summary:hover, .pbar-icon-menu[open] > summary { color: #fff; border-color: var(--ink-text); background: rgba(255, 255, 255, .06); }
.pbar-icon-menu > summary[aria-current="page"] { color: var(--signal); border-color: var(--signal); }
.pbar-avatar { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--signal); color: #16232E;
  font-weight: 800; font-size: .9rem; font-stretch: 100%; }
.pbar-me > summary { border-color: transparent; }
.pbar-tools .pbar-menu-list { left: auto; right: 0; transform: none; min-width: 15rem; }
.pbar-menu-h { margin: .2rem .75rem .45rem; padding-bottom: .5rem; border-bottom: 1px solid var(--ink-line); color: #fff; font-weight: 700; font-size: .95rem; }
.pbar-menu-h small { display: block; color: var(--ink-text); font-weight: 500; font-size: .8rem; margin-top: .1rem; overflow-wrap: anywhere; }
.pbar-menu-list a, .pbar-menu-list .pbar-menu-btn { display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; color: var(--ink-text);
  text-decoration: none; font-weight: 600; border-radius: var(--radius-ctl); width: 100%; text-align: left; font-size: .95rem; }
.pbar-menu-list a:hover, .pbar-menu-list .pbar-menu-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.pbar-menu-list a[aria-current="page"] { color: #fff; }
.pbar-menu-list .ico, .pbar-menu-list svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.pbar-menu-list .pbar-theme-item small { color: var(--ink-text); opacity: .75; font-weight: 500; margin-left: .2rem; }
.pbar-menu-list form { margin: .2rem 0 0; padding-top: .25rem; border-top: 1px solid var(--ink-line); }
.pbar-menu-list .pbar-menu-btn { margin: 0; border: 0; background: none; cursor: pointer; min-height: 0; }
.pbar-tools > .pbar-cta { display: inline-flex; align-items: center; gap: .4rem; margin-left: .35rem; color: var(--ink); background: var(--signal);
  padding: .5rem 1rem; border-radius: var(--radius-ctl); font-weight: 700; text-decoration: none; white-space: nowrap; }
.pbar-tools > .pbar-cta:hover { background: #F39446; }
.pbar-tools > .pbar-cta .ico { width: 17px; height: 17px; stroke-width: 2.4; }
:root[data-theme="navy"] .pbar-tools > .pbar-cta { color: #16232E; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .pbar-tools > .pbar-cta { color: #16232E; } }

/* Hover / keyboard-focus label for icon-only controls (text from data-tip; no inline style) */
[data-tip] { position: relative; }
.pbar [data-tip]::before { content: attr(data-tip); position: absolute; top: calc(100% + .55rem); left: 50%; transform: translate(-50%, -4px);
  padding: .3rem .6rem; border-radius: 8px; background: #0D1720; color: #fff; font-size: .78rem; font-weight: 600; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; z-index: 40; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.pbar-tools [data-tip]::before { left: auto; right: 0; transform: translateY(-4px); }
.pbar [data-tip]:hover::before, .pbar [data-tip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }
.pbar-tools [data-tip]:hover::before, .pbar-tools [data-tip]:focus-visible::before { transform: none; }
.pbar-menu[open] > [data-tip]::before { opacity: 0 !important; }
/* Labelled links don't need the tooltip while their label shows */
.pbar-links > a[data-tip]::before { display: none; }

/* Narrower desktops: primary links become icon-only (label on hover / focus) */
@media (max-width: 1100px) and (min-width: 721px) {
  .pbar-links > a .nav-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pbar-links > a[data-tip]::before { display: block; }
  .pbar-links > a { padding: .5rem .65rem; }
}
/* Override the older wrap rule: the bar stays one row down to phone width */
@media (max-width: 1180px) {
  .pbar-inner { flex-wrap: nowrap; }
  .pbar-inner > .pbar-links { order: 0; flex-basis: auto; margin: 0 0 0 .5rem; padding-bottom: 0; justify-content: flex-start; flex-wrap: nowrap; }
  .pbar-title { margin-right: 0; }
}
/* Phones: title + tools on the first row, the links as an even row of icon + small label under it */
@media (max-width: 720px) {
  .pbar-inner { flex-wrap: wrap; row-gap: .25rem; }
  .pbar-inner > .pbar-links { order: 3; flex: 1 1 100%; margin: 0; justify-content: space-between; padding-bottom: .4rem; }
  .pbar-links > a { flex-direction: column; gap: .15rem; font-size: .72rem; padding: .35rem .3rem; }
  .pbar-links > a .pbar-badge { position: absolute; top: 0; right: 0; margin: 0; }
  .pbar-tools > .pbar-cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pbar-tools > .pbar-cta { padding: .5rem .65rem; }
}
.pbar-menu-list a.sub { padding: .35rem .75rem .35rem 2.85rem; font-weight: 500; font-size: .88rem; }
.pbar-tools .pbar-menu-list { min-width: 16.5rem; }
.pbar-theme-item small { white-space: nowrap; }

/* ===========================================================================
   A2.11 — the drawer is a full ticket workspace: update, conversation, reply
   =========================================================================== */
.peek-dialog { width: min(40rem, 100vw); }  /* 9.1.0 A2.2: was 36rem */
.peek-sec { margin: 1.1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.peek-sec > .peek-h { margin-top: 0; display: flex; align-items: center; gap: .45rem; }
.peek-h > .ico { width: 16px; height: 16px; color: var(--signal); }
.peek-update form.update { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem .6rem; align-items: end; margin: 0; }
.peek-update form.update label { margin: 0; font-size: .78rem; font-weight: 700; color: var(--muted); grid-row: 1; }
.peek-update form.update select { grid-row: 2; min-height: 2.6rem; padding: .4rem .6rem; font-size: .92rem; }
.peek-update form.update button { grid-row: 3; grid-column: 1 / -1; justify-self: start; margin-top: .55rem; padding: .55rem 1rem; font-size: .92rem; }
.peek-update form.update .hint { grid-row: 4; grid-column: 1 / -1; margin: .1rem 0 0; font-size: .8rem; }
.peek-update form.update .inplace-msg { grid-column: 1 / -1; }
.peek-thread { list-style: none; margin: 0; padding: 0; max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
.peek-thread .msg { padding: .6rem .8rem; margin-bottom: .5rem; font-size: .9rem; }
.peek-thread .meta { font-size: .78rem; margin: 0 0 .25rem; }
.peek-thread .files { margin: .35rem 0 0; font-size: .82rem; }
.peek-more { margin: 0 0 .5rem; font-size: .85rem; }
.peek-reply form { margin: 0; }
.peek-reply label { font-size: .82rem; margin-top: .4rem; }
.peek-reply textarea { min-height: 5.5rem; font-size: .92rem; }
.peek-reply .hint { font-size: .76rem; }
.peek-reply button[type="submit"] { margin-top: .6rem; padding: .55rem 1rem; font-size: .92rem; }
.peek-reply input[type=file] { font-size: .85rem; }
.peek-act > summary { cursor: pointer; list-style: none; }
.peek-act > summary::-webkit-details-marker { display: none; }
.peek-act > summary::after { content: "Show"; margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--link); }
.peek-act[open] > summary::after { content: "Hide"; }
.peek-act[open] > summary { margin-bottom: .6rem; }
@media (max-width: 640px) {
  .peek-update form.update { grid-template-columns: 1fr 1fr; }
  .peek-update form.update label, .peek-update form.update select { grid-row: auto; }
  .peek-update form.update button, .peek-update form.update .hint { grid-row: auto; }
}
.peek form .inplace-msg { margin: .6rem 0 0; max-width: none; }

/* ===========================================================================
   POR-9.0.0 A3 — tickets from assets, asset picker, linked assets
   =========================================================================== */
.from-asset { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .75rem 0 .35rem; padding: .75rem 1rem;
  border: 1px solid var(--hairline); border-left: 4px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.from-asset.alert-expired { border-left-color: var(--w-red); } .from-asset.alert-near { border-left-color: var(--w-orange); }
.from-asset > div { display: flex; flex-direction: column; flex: 1 1 14rem; min-width: 0; }
.from-asset b { color: var(--ink); } .from-asset small { color: var(--muted); }
.from-asset-link { font-size: .88rem; font-weight: 600; }

.apick { border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: .9rem 1rem 1rem; margin: 1.25rem 0 .25rem; background: var(--white); }
.apick legend { display: inline-flex; align-items: center; gap: .45rem; padding: 0 .4rem; font-weight: 750; color: var(--ink); }
.apick legend .ico { width: 17px; height: 17px; color: var(--signal); }
.apick > .hint { margin: 0 0 .6rem; }
.apick[aria-busy="true"] { opacity: .55; }
.apick-search { position: relative; margin: 0 0 .7rem; }
.apick-search .ico { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.apick-search input { padding-left: 2.3rem; min-height: 2.6rem; }
.apick-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .75rem 1rem; }
.apick-group h4 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .45rem; font-size: .9rem; }
.apick-group h4 .ico { width: 16px; height: 16px; color: var(--muted); }
.apick-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 18rem; overflow-y: auto; padding-right: .2rem; }
.apick-item { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .5rem .65rem; border: 1px solid var(--hairline); border-left: 3px solid var(--rule);
  border-radius: var(--radius-ctl); cursor: pointer; font-weight: 500; transition: background-color .15s, box-shadow .15s; }
.apick-group li.alert-expired .apick-item { border-left-color: var(--w-red); } .apick-group li.alert-near .apick-item { border-left-color: var(--w-orange); }
.apick-item:hover { background: var(--paper); }
.apick-item.is-on { background: var(--soft-orange); box-shadow: inset 0 0 0 1px var(--signal); }
.apick-item input { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; accent-color: var(--signal); }
.apick-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.apick-main b { font-size: .92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apick-main small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.asset-sub { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.asset-sub .aside { margin: 0; }
.asset-sub .button { margin: 0; display: inline-flex; align-items: center; gap: .45rem; }

.linked-assets li { display: flex; align-items: stretch; gap: .45rem; }
.linked-assets li > a { flex: 1; min-width: 0; }
.unlink-form { margin: 0; display: flex; }
.icon-btn { margin: 0; padding: 0 .7rem; min-height: 0; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn .ico { width: 16px; height: 16px; }
.link-more { margin-top: .9rem; }
.link-more > summary { cursor: pointer; font-weight: 650; color: var(--link); display: inline-flex; align-items: center; gap: .4rem; }
.link-more form > button { margin-top: .8rem; }

/* row / timeline "create ticket" action */
.ltable .c-act { width: 1%; padding: 0 .35rem; vertical-align: middle; }
.row-act, .tl-act { display: inline-flex; align-items: center; gap: .05rem; padding: .35rem .45rem; border-radius: 8px; color: var(--muted);
  text-decoration: none; font-weight: 800; border: 1px solid transparent; }
.row-act .ico, .tl-act .ico { width: 17px; height: 17px; }
.row-act span, .tl-act span { font-size: .85rem; margin-left: -.1rem; }
.row-act:hover, .row-act:focus-visible, .tl-act:hover, .tl-act:focus-visible { color: var(--signal); border-color: var(--signal); background: var(--white); }
.timeline li { display: flex; align-items: stretch; gap: .4rem; }
.timeline li > .tl-item { flex: 1; min-width: 0; }
.timeline li > .tl-act { align-self: center; }
main [data-tip]::before { content: attr(data-tip); position: absolute; bottom: calc(100% + .4rem); right: 0; padding: .25rem .55rem; border-radius: 8px;
  background: #0D1720; color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 10; }
main [data-tip]:hover::before, main [data-tip]:focus-visible::before { opacity: 1; }
.apick-group, .apick-group li, .apick-item { min-width: 0; }
.apick-group ul { overflow-x: hidden; }
.apick-group ul { grid-template-columns: minmax(0, 1fr); }
.peek-body > .inplace-msg { margin: 0 0 .75rem; max-width: none; }

/* ===========================================================================
   POR-9.0.0 A3.4 — "already open" notice; merge preview
   =========================================================================== */
.related-box { margin: 1.1rem 0 .2rem; padding: .85rem 1rem; border-radius: var(--radius-card); background: var(--soft-orange);
  border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent); }
.related-box > p { display: flex; align-items: center; gap: .45rem; margin: 0 0 .5rem; font-size: .95rem; }
.related-box > p .ico { width: 17px; height: 17px; color: var(--signal); flex: none; }
.related-box ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .35rem; }
.related-box li { padding: .5rem .7rem; background: var(--white); border-radius: var(--radius-ctl); border: 1px solid var(--hairline); }
.related-box li a { font-weight: 650; color: var(--ink); text-decoration: none; } .related-box li a:hover { text-decoration: underline; }
.related-box li small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.related-box .hint { margin: 0; font-size: .8rem; }
.mp-warn { margin: .5rem 0 1rem; padding: .75rem 1rem .75rem 2.2rem; border-radius: var(--radius); background: var(--soft-orange); }
.mp-warn:empty { display: none; }
.mp-warn li { margin: .2rem 0; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1rem; align-items: start; margin: .5rem 0 1rem; }
.mp-arrow { align-self: center; color: var(--signal); } .mp-arrow .ico { width: 26px; height: 26px; transform: rotate(45deg); }
.mp-card { border: 1px solid var(--hairline); border-top: 4px solid var(--rule); border-radius: var(--radius-card); padding: 1rem 1.1rem; background: var(--white); }
.mp-card.mp-dup { border-top-color: var(--w-brown); } .mp-card.mp-into { border-top-color: var(--w-green); }
.mp-role { margin: 0 0 .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mp-card h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.mp-desc { margin: .6rem 0 0; padding: .6rem .75rem; background: var(--paper); border-radius: var(--radius); font-size: .88rem; color: var(--text); }
.mp-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.mp-actions button, .mp-actions .button { margin: 0; display: inline-flex; align-items: center; gap: .45rem; }
@media (max-width: 760px) { .mp-grid { grid-template-columns: 1fr; } .mp-arrow { justify-self: center; } .mp-arrow .ico { transform: rotate(135deg); } }
.via-merge { font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* POR-9.1.0 — completion report links (ticket page + drawer) */
.report-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .4rem 0 .9rem; padding: .45rem .7rem;
  border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--white); }
.report-links .report-h { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .86rem; margin-right: .3rem; }
.report-links .report-h .ico { width: 1rem; height: 1rem; color: var(--signal); }
.report-links .button.small { margin: 0; padding: .32rem .7rem; font-size: .84rem; min-height: 0; }
.report-links .report-internal { border-style: dashed; }
.peek-foot { flex-wrap: wrap; }
.peek-foot .report-links { flex: 1 1 100%; margin: 0; padding: .4rem .6rem; }
.report-links .button.small { display: inline-flex; align-items: center; line-height: 1.2; }
.peek-foot .report-links .button.small { height: auto; min-height: 0; font-size: .84rem; padding: .32rem .7rem; }

/* POR-9.1.0 A2 — reply type (Reply / Internal note / Solution) and the marked solution */
.rtype { border: 0; padding: 0; margin: .9rem 0 .4rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; min-width: 0; }
.rtype legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; padding: 0; }
.rt { margin: 0; min-width: 0; display: flex; }
.rt input { position: absolute; opacity: 0; pointer-events: none; }
.rt span { flex: 1; min-height: 3.6rem; box-sizing: border-box; align-content: center; display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--rule);
  border-radius: var(--radius-ctl); background: var(--white); cursor: pointer; }
.rt span .ico { grid-row: span 2; width: 1.1rem; height: 1.1rem; color: var(--muted); }
.rt span b { font-size: .92rem; white-space: nowrap; } .rt span small { color: var(--muted); font-size: .78rem; grid-column: 2; white-space: nowrap; }
.rt input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.rt-note input:checked + span { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); background: var(--soft-orange); }
.rt-note input:checked + span .ico { color: var(--signal); }
.rt-sol input:checked + span { border-color: var(--ok, #2E8B57); box-shadow: inset 0 0 0 1px var(--ok, #2E8B57); background: var(--soft-green); }
.rt-sol input:checked + span .ico { color: var(--ok, #2E8B57); }
.rt input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
.rt-complete { margin: .2rem 0 .8rem; padding: .5rem .7rem; border-radius: var(--radius-ctl); background: var(--soft-green); border: 1px dashed var(--ok, #2E8B57); }
.rtype:not(:has(.rt-sol input:checked)) + .rt-complete { display: none; }
form:has(> .rtype) { container-type: inline-size; }
@container (max-width: 31rem) { .rtype { grid-template-columns: 1fr; } .rt span { min-height: 0; } }
@media (max-width: 560px) { .rtype { grid-template-columns: 1fr; } .rt span { min-height: 0; } }
.msg.msg-solution { border-left-color: var(--ok, #2E8B57); background: var(--soft-green); }
.badge-solution { display: inline-flex; align-items: center; gap: .25rem; background: var(--ok, #2E8B57); color: #fff; font-size: .74rem; font-weight: 700;
  padding: .1rem .5rem; border-radius: 999px; margin-right: .4rem; }
.badge-solution .ico { width: .85rem; height: .85rem; }
.mark-sol-form { margin: .35rem 0 0; }
.linklike { background: none; border: 0; padding: 0; margin: 0; color: var(--muted); font-size: .82rem; font-weight: 600; cursor: pointer;
  display: inline-flex; gap: .3rem; align-items: center; min-height: 0; height: auto; box-shadow: none; }
.linklike .ico { width: .9rem; height: .9rem; } .linklike:hover, .linklike:focus-visible { color: var(--ok, #2E8B57); background: none; }
.mark-sol.on:hover, .mark-sol.on:focus-visible { color: #A3271C; }
.sol-card { margin: 0 0 1rem; border: 1px solid var(--ok, #2E8B57); border-left-width: 4px; border-radius: var(--radius-card); background: var(--soft-green); padding: .7rem .9rem; }
.sol-h { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .3rem; } .sol-h .ico { color: var(--ok, #2E8B57); }
.sol-b { overflow-wrap: anywhere; }

/* ===========================================================================
   POR-9.2.0 — Tools
   =========================================================================== */
/* Full-height tool pages (camera planner): site header + portal bar, then the tool fills the rest. */
body.is-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.is-app > .site-chrome-head, body.is-app > .ptop, body.is-app > .pbar { flex: none; }
body.is-app > .pbar { position: relative; }
body.is-app > main.app-main { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0; max-width: none; }
/* Tools landing page */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; margin-top: 1.25rem; }
.tool-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.15rem 1.25rem; background: var(--white); border: 1px solid var(--rule);
  border-radius: var(--radius); color: var(--text); text-decoration: none; }
.tool-card .tool-ico { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 10px;
  background: var(--soft-orange); color: var(--signal); }
.tool-card .tool-ico .ico { width: 24px; height: 24px; }
.tool-card .tool-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.tool-card .tool-body > b { color: var(--ink); font-size: 1.1rem; font-stretch: 85%; font-weight: 750; }
.tool-card .tool-body > span { color: var(--muted); font-size: .93rem; line-height: 1.45; }
.tool-card .tool-go { flex: none; align-self: center; color: var(--muted); }
.tool-card:hover .tool-go { color: var(--signal); }
.tool-card.is-soon { opacity: .65; border-style: dashed; }
.tool-card.is-soon .tool-ico { background: var(--panel); color: var(--muted); }
.tool-card .badge { vertical-align: .1em; margin-left: .35rem; font-size: .72rem; }
/* Phones: the site header and portal bar scroll away and the tool takes the whole screen below them. */
@media (max-width: 720px) {
  body.is-app { display: block; height: auto; overflow: visible; }
  body.is-app > main.app-main { height: 100vh; height: 100dvh; }
}

/* POR-10.0.0: the admin bar carries one more icon (Sales); tighten the primary links so it stays on one row */
.pbar-inner.has-sales > .pbar-links > a { padding-left: .45rem; padding-right: .45rem; }
.pbar-inner.has-sales { gap: .75rem; }
@media (max-width: 1240px) and (min-width: 721px) {
  .pbar-inner.has-sales .pbar-links > a .nav-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pbar-inner.has-sales .pbar-links > a[data-tip]::before { display: block; }
}
/* POR-10.3.0: the admin bar is capped at the page column (--wrap), so with Sales on, five labelled links + badges + four
   icon buttons + New ticket no longer fit and the links ran under the Sales icon. Users and Companies become icon buttons
   (label on hover / focus, count pinned to the icon); nav.js adds .is-tight if the links still overflow (zoom, badges),
   which makes every link icon-only instead of overlapping. Phones (≤ 720px) keep their own two-row layout. */
@media (min-width: 721px) {
  .pbar-inner.has-sales .pbar-links > a.nav-sm .nav-t,
  .pbar-inner.is-tight .pbar-links > a .nav-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pbar-inner.has-sales .pbar-links > a.nav-sm[data-tip]::before,
  .pbar-inner.is-tight .pbar-links > a[data-tip]::before { display: block; }
  .pbar-inner.has-sales .pbar-links > a.nav-sm .pbar-badge,
  .pbar-inner.is-tight .pbar-links > a .pbar-badge { position: absolute; top: -.2rem; right: -.25rem; margin: 0; min-width: 1.1rem; padding: 0 .25rem;
    font-size: .66rem; line-height: 1.1rem; }
}
/* POR-10.4.0-A2: up to 50 linked assets per ticket */
.apick-count { margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.apick-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.apick-full { color: #8A4A12; font-weight: 650; }
:root[data-theme="navy"] .apick-full { color: #F3B97D; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .apick-full { color: #F3B97D; } }
.apick-search { display: flex; gap: .5rem; align-items: center; }
.apick-search input { flex: 1; min-width: 0; }
.apick-search button { margin: 0; flex: none; white-space: nowrap; }
.link-all { margin: .35rem 0 0; }
.link-all > summary { cursor: pointer; font-weight: 650; color: var(--ink); padding: .35rem 0; }
.link-all > summary:hover { color: var(--signal); }
.link-all[open] > summary { margin-bottom: .35rem; }
.peek-more { margin: .35rem 0 0; font-size: .85rem; }
.apick { min-width: 0; }                                   /* a fieldset is min-content wide by default: keep phones from side-scrolling */
.apick-search { flex-wrap: wrap; }
.apick-search input { flex: 1 1 12rem; }
.apick-search .ico { top: 1.3rem; }                        /* centred on the input line, also when the button wraps below */
/* POR-10.6.0-A2.1: panel header with buttons (company page Inventory + Tickets): heading centred on the buttons,
   and a gap before the panel content (the count tiles have no top margin of their own) */
.headrow.headrow-panel { align-items: center; margin-bottom: 1rem; }
.headrow.headrow-panel h2 { margin-bottom: 0; }
/* POR-10.4.0-A3: Inventory header buttons (Export CSV + Add assets) */
.headrow .headrow-actions { margin-top: 0; }
.headrow .headrow-actions .button { margin: 0; }
@media (max-width: 600px) {
  .headrow .headrow-actions { width: 100%; flex-wrap: nowrap; }
  .headrow .headrow-actions .button { flex: 1 1 0; justify-content: center; padding-inline: .75rem; white-space: nowrap; }
}

/* POR-10.6.0 (backlog 2): tick-box column on ticket tables inside bulk forms (user page List view) */
.ltable td.c-tick, .ltable th.c-tick { width: 2.6rem; padding: .7rem .4rem .7rem .8rem; vertical-align: middle; }
.ltable td.c-tick input { margin: 0; }

/* POR-10.7.0: job cards / visits (existing tokens and status colours only) */
.jc-row.status-new, .jc-chip.status-new                     { --a: var(--w-red); }
.jc-row.status-assigned, .jc-chip.status-assigned           { --a: var(--w-orange); }
.jc-row.status-in_progress, .jc-chip.status-in_progress     { --a: var(--w-orange); }
.jc-row.status-waiting_client, .jc-chip.status-waiting_client { --a: var(--w-blue); }
.jc-row.status-completed, .jc-chip.status-completed         { --a: var(--w-green); }
.jc-row.status-merged, .jc-chip.status-merged               { --a: var(--w-brown); }
.jc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.jc-row { border: 1px solid var(--rule); border-left: 4px solid var(--a, var(--rule)); border-radius: var(--radius); background: var(--white);
          padding: .65rem .85rem; display: grid; gap: .35rem; }
.jc-row-main, .jc-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; }
.jc-row-meta { color: var(--muted); font-size: .9rem; }
.jc-row-meta .badge { margin-left: auto; }
.jc-ref { font-family: var(--mono); font-weight: 650; }
.jc-when, .jc-row-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.jc-h { display: flex; align-items: center; gap: .45rem; margin: 1.25rem 0 .25rem; }
.jc-pre { margin: 0; overflow-wrap: anywhere; }
.jc-form fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: .25rem 1rem 1rem; margin: 1rem 0; min-width: 0; }
.jc-form legend { font-weight: 700; padding: 0 .35rem; color: var(--ink); }
.jc-when-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.jc-when-row input { width: 100%; min-width: 0; box-sizing: border-box; }
.jc-form .check span { min-width: 0; overflow-wrap: anywhere; }
.jc-form fieldset > * { max-width: 100%; }
.jc-form .check { margin-top: .75rem; }
.ltable.jc-tech-t td, .ltable.jc-tech-list td { padding: .55rem .7rem; vertical-align: middle; }
.ltable.jc-tech-t td.c-tick input { width: 1.1rem; height: 1.1rem; accent-color: var(--signal); }
.ltable.jc-tech-t label { margin: 0; font-weight: 650; }
.jc-mail-m { display: none; }
.jc-add { margin-top: .75rem; }
.jc-add > summary { cursor: pointer; color: var(--link); font-weight: 650; display: inline-flex; align-items: center; gap: .4rem; }
.jc-cancel { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.jc-cancel > div { flex: 1 1 16rem; }
.jc-cancel button { margin: 0; }
.jc-tech-row { display: grid; grid-template-columns: minmax(10rem, 1.2fr) minmax(12rem, 1.5fr) minmax(8rem, 1fr) auto auto; gap: .5rem .75rem; align-items: end; }
.jc-tech-row .check { margin: 0 0 .7rem; }
.jc-tech-row button { margin: 0; }
.jc-weekbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; margin: .5rem 0 1rem; }
.jc-weekbar > button { margin: 0; }
.jc-weeknav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-right: auto; }
.jc-weeknav .button { padding: .4rem .85rem; margin: 0; min-height: 0; }
.jc-weeknav strong { font-size: 1.1rem; color: var(--ink); }
.jc-weektech { min-width: 12rem; }
.jc-weektech label { margin-top: 0; font-size: .9rem; }
.jc-weektech select { min-height: 3rem; }
.ltable.jc-week { table-layout: fixed; }
.ltable.jc-week th[scope="row"] { padding: .55rem .7rem; text-align: left; font-weight: 650; color: var(--ink); width: 10rem; vertical-align: top; }
.ltable.jc-week td { padding: .35rem; vertical-align: top; }
.ltable.jc-week .jc-today { background: var(--soft-orange); }
.jc-chip { display: grid; gap: .1rem; border: 1px solid var(--rule); border-left: 4px solid var(--a, var(--rule)); border-radius: var(--radius);
           background: var(--white); padding: .35rem .5rem; margin-bottom: .35rem; color: var(--text); text-decoration: none; font-size: .85rem; overflow-wrap: anywhere; }
.jc-chip:hover, .jc-chip:focus-visible { border-color: var(--signal); }
.jc-chip small { color: var(--muted); }
.jc-week-days { display: none; }
.jc-day { margin: 1rem 0 .4rem; font-size: 1rem; }
.jc-day.jc-today { color: var(--signal); }
@media (max-width: 760px) {
  .jc-week-wide { display: none; }
  .jc-week-days { display: block; }
  .jc-tech-row { grid-template-columns: 1fr; }
  .jc-tech-row .check { margin: .25rem 0; }
}
@media (max-width: 640px) {
  .jc-when-row { grid-template-columns: 1fr 1fr; }
  .jc-when-row > div:first-child { grid-column: 1 / -1; }
  .ltable.jc-tech-t th.c-opt, .ltable.jc-tech-t td.c-opt { display: none; }
  .jc-mail-m { display: inline; }
  .jc-row-meta .badge { margin-left: 0; }
}

/* POR-10.7.0-A1.1: visits month calendar, drawer, technician picker, grid card fix, Technicians grid (existing tokens only) */
.jc-cal-note { margin: 0 0 .75rem; }
.jc-cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--white);
          border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.jc-cal th { background: var(--paper); text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
             padding: .55rem .6rem; border-bottom: 1px solid var(--rule); }
.jc-cal td { vertical-align: top; height: 7.75rem; padding: .35rem .4rem; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); min-width: 0; }
.jc-cal tr > td:last-child { border-right: 0; }
.jc-cal tbody tr:last-child > td { border-bottom: 0; }
.jc-cal td.jc-out { background: var(--paper); }
.jc-cal td.jc-out .jc-cal-n { color: var(--muted); font-weight: 500; }
.jc-cal td.jc-today { background: var(--soft-orange); }
.jc-cal-n { display: block; font-weight: 700; font-size: .9rem; color: var(--ink); margin: 0 0 .3rem .1rem; }
.jc-cal td.jc-today .jc-cal-n { color: var(--signal); }
.jc-cal-dn { display: none; }
.jc-cal .jc-chip { padding: .25rem .4rem; margin-bottom: .25rem; font-size: .78rem; min-width: 0; overflow-wrap: normal; }
.jc-cal .jc-chip > * { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jc-cal-more { display: inline-block; font-size: .8rem; font-weight: 650; padding: .1rem .2rem; }
@media (max-width: 760px) {                       /* phone: an agenda, one heading per day that has visits */
  .jc-cal, .jc-cal tbody, .jc-cal tr, .jc-cal td { display: block; width: auto; }
  .jc-cal { border: 0; background: none; overflow: visible; }
  .jc-cal thead { display: none; }
  .jc-cal td { height: auto; border: 0; padding: 0 0 .5rem; background: none; }
  .jc-cal td.jc-out, .jc-cal td.jc-today { background: none; }
  .jc-cal td.jc-cal-empty { display: none; }
  .jc-cal-n { display: none; }
  .jc-cal-dn { display: block; font-weight: 700; color: var(--ink); margin: .75rem 0 .4rem; }
  .jc-cal td.jc-today .jc-cal-dn { color: var(--signal); }
  .jc-cal .jc-chip { font-size: .85rem; padding: .35rem .5rem; }
  .jc-cal .jc-chip > * { white-space: normal; }
}
/* grid card: the ticket line sits inside the card (was the ticket cards' hover overlay, which hung below the card and the panel) */
.tcard-sub { margin: 0; font-size: .9rem; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* technician picker: search + who is ticked; the list scrolls inside the form */
.filters.jc-tech-tools { margin: .25rem 0 .5rem; }
.jc-tech-on { grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-height: 1.6rem; }
.jc-techs .table-wrap { max-height: 24rem; overflow-y: auto; }
.jc-techs .ltable thead th { position: sticky; top: 0; z-index: 1; }
.jc-tech-t tbody tr:has(input[name="techs[]"]:checked) > td { background: var(--soft-orange); }
.jc-tech-t tr[hidden], .jc-tech-none[hidden] { display: none; }
.jc-tech-none { display: block; margin: .25rem 0; }
/* the same form in the side drawer */
.peek .grid2 { grid-template-columns: 1fr; }
.peek .jc-when-row { grid-template-columns: 1fr 1fr; }
.peek .jc-when-row > div:first-child { grid-column: 1 / -1; }
.peek .ltable.jc-tech-t th.c-opt, .peek .ltable.jc-tech-t td.c-opt { display: none; }
.peek .jc-mail-m { display: inline; }
.peek .jc-techs .table-wrap { max-height: 16rem; }
.jc-peek-cancel { margin-top: 1.25rem; border-top: 1px dashed var(--rule); padding-top: .75rem; }
/* Settings → Technicians grid: the edit form stacks inside the card */
.ucard .jc-tech-card { grid-template-columns: 1fr; gap: .25rem; margin-top: .4rem; }
.ucard .jc-tech-card .check { margin: .5rem 0; }
.ucard .jc-tech-card button { justify-self: start; }

/* POR-10.7.0-A2: Record the work (existing tokens and components only) */
.jc-work > h2, .jc-work > h3 { margin-top: 0; }
.jc-sub { display: flex; align-items: center; gap: .4rem; margin: 1.1rem 0 .4rem; font-size: 1rem; color: var(--ink); }
.jc-summary { margin: .4rem 0 0; padding: .55rem .75rem; background: var(--paper); border-left: 3px solid var(--w-green); border-radius: var(--radius);
              color: var(--text); overflow-wrap: anywhere; }
.jc-work-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .75rem 0; }
.jc-work-actions button { margin: 0; }
.jc-time-t td .flag { margin-left: .35rem; }
.jc-time-act { display: flex; gap: .4rem; flex-wrap: wrap; }
.jc-time-act form { margin: 0; }
.jc-time-act button { margin: 0; padding: .3rem .7rem; min-height: 0; }
.jc-time-add { display: grid; grid-template-columns: minmax(10rem, 1.2fr) minmax(11rem, 1fr) minmax(11rem, 1fr) auto; gap: .5rem .75rem; align-items: end; }
.jc-time-add input, .jc-time-add select { width: 100%; min-width: 0; box-sizing: border-box; }
.jc-time-add button { margin: 0; }
/* POR-10.7.0-A3.2 — one row, one height: label line on top, every control and the button 3rem, bottoms aligned */
.jc-time-add > div > label { margin-top: 0; }
.jc-time-add input, .jc-time-add select { height: 3rem; min-height: 3rem; }
.jc-time-add button { height: 3rem; min-height: 3rem; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; white-space: nowrap; }
.jc-saved-by { margin: .25rem 0 .5rem; }
.jc-equip-t select { min-width: 9rem; }
.jc-equip-t input { width: 100%; min-width: 0; box-sizing: border-box; }
.jc-part-list { list-style: none; margin: .25rem 0 .75rem; padding: 0; display: grid; gap: .35rem; }
.jc-part-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1rem;
                   border: 1px solid var(--rule); border-radius: var(--radius); padding: .4rem .7rem; background: var(--white); }
.jc-part-list .check { margin: 0; }
.jc-part-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(4.5rem, .7fr) minmax(0, 1.6fr); gap: .5rem .75rem; align-items: end; margin-bottom: .35rem; }
.jc-part-row input { width: 100%; min-width: 0; box-sizing: border-box; }
.jc-status-acts { margin-top: 1rem; border-top: 1px dashed var(--rule); padding-top: .5rem; }
.jc-complete > summary { color: var(--ink); }
.jc-work-read dd { overflow-wrap: anywhere; }
.peek .jc-time-add { grid-template-columns: 1fr; }
.peek .ltable.jc-equip-t th.c-opt, .peek .ltable.jc-equip-t td.c-opt { display: none; }
.peek .jc-peek-sched { margin-top: 1.25rem; border-top: 1px dashed var(--rule); padding-top: .75rem; }
@media (max-width: 760px) { .jc-time-add { grid-template-columns: 1fr; } }
/* A2.2: part rows — one row per part on a wide page (labels on the first row only); a labelled block per part in the drawer and on a phone */
@media (min-width: 761px) {
  .panel .jc-part-row + .jc-part-row label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
                                               clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
.peek .jc-part-row { grid-template-columns: 5.5rem minmax(0, 1fr); padding-top: .6rem; border-top: 1px dashed var(--rule); }
.peek .jc-part-row > div:first-child { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .jc-part-row { grid-template-columns: 5.5rem minmax(0, 1fr); padding-top: .6rem; border-top: 1px dashed var(--rule); }
  .jc-part-row > div:first-child { grid-column: 1 / -1; }
}
/* A2.2: in the drawer, Record the work starts its own section (was tight under Instructions) */
.peek .jc-work { margin-top: 1.25rem; border-top: 1px dashed var(--rule); padding-top: .75rem; }
/* A2.3: equipment + time tables get the same cell padding as the technician tables; Action and Note controls the same height */
.ltable.jc-equip-t td, .ltable.jc-time-t td { padding: .55rem .7rem; vertical-align: middle; }
.ltable.jc-equip-t select, .ltable.jc-equip-t input { height: 2.6rem; min-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; width: 100%; box-sizing: border-box; }
.ltable.jc-equip-t td .l-main { display: block; }

/* POR-10.7.0-A3: print / export buttons (existing ghost buttons) */
.jc-outputs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; margin: .75rem 0 .25rem; }
.jc-outputs .button { margin: 0; }
.jc-outputs .hint { flex: 1 1 100%; margin: .1rem 0 0; }
.jc-outputs code { overflow-wrap: anywhere; }

/* ===================== POR-10.8.0: Ena (Enless Assistant) — chat page + Settings → Ena =====================
   Existing tokens only (--white, --panel, --rule, --muted, --soft-orange, --w-red, radii); works in Light / Navy / Auto. */
.asst { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.asst .panel { margin-bottom: 0; }
.asst-side { padding: 1rem; }
.asst-new { display: flex; justify-content: center; align-items: center; gap: .45rem; width: 100%; margin: 0 0 1rem; }
.asst-side-h { font-weight: 700; color: var(--ink); margin: 0 0 .4rem; }
.asst-chats { list-style: none; margin: 0 0 .75rem; padding: 0; max-height: 50vh; overflow-y: auto; }
.asst-chats a { display: block; padding: .5rem .6rem; border-radius: var(--radius-ctl); color: var(--text); text-decoration: none; }
.asst-chats a:hover, .asst-chats a[aria-current="page"] { background: var(--panel); }
.asst-chats a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--signal); }
.asst-chat-t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-chats .sub { display: block; font-size: .8rem; color: var(--muted); }
.asst-main { display: flex; flex-direction: column; min-height: 26rem; }
.asst-thread { flex: 1; overflow-y: auto; max-height: calc(100vh - 21rem); min-height: 18rem; padding: .25rem .25rem 1rem; display: flex; flex-direction: column; gap: .9rem; }
.asst-empty { margin: auto 0; text-align: center; padding: 1.5rem .5rem; }
.asst-hello { font-size: 1.15rem; font-weight: 650; color: var(--ink); margin: 0 0 .35rem; }
.asst-ex { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1rem; }
.asst-ex .asst-ex-b { margin: 0; }
.asst-msg { max-width: min(46rem, 88%); padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--white); overflow-wrap: anywhere; }
.asst-user { align-self: flex-end; background: var(--soft-orange); border-color: transparent; }
.asst-assistant { align-self: flex-start; background: var(--panel); border-color: transparent; }
.asst-error { align-self: flex-start; border-left: 4px solid var(--w-red); }
.asst-wait .asst-text { color: var(--muted); font-style: italic; }
.asst-who { margin: 0 0 .25rem; font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; gap: .5rem; align-items: baseline; }
.asst-who .sub { font-weight: 400; }
.asst-text { line-height: 1.55; }
.asst-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; border-top: 1px solid var(--rule); padding-top: 1rem; }   /* A2.5: box full width, Send under it */
.asst-form button { justify-self: end; }
.asst-form textarea { min-height: calc(15em + 1.5rem); max-height: calc(24em + 1.5rem); resize: vertical; margin: 0; line-height: 1.5; overflow-y: auto; }   /* A2.6: 10 lines, grows to ~16 */
@media (max-width: 640px) { .asst-form textarea { min-height: calc(6em + 1.5rem); } }   /* phone: 4 lines so the thread stays visible */
.asst-form button { margin: 0; height: 3rem; min-height: 3rem; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; gap: .45rem; }
.asst-foot { font-size: .85rem; color: var(--muted); }
.asst-foot .linkish { color: var(--link); font-size: inherit; }
.asst-kv th { width: 13rem; text-align: left; font-weight: 600; color: var(--muted); }
.asst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 1rem; }
.asst-grid label { margin-top: .75rem; }
.asst-grid input, .asst-grid select { width: 100%; }
.pbar-tools .pbar-ena { display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .asst { grid-template-columns: 1fr; }
  .asst-side { order: 2; }
  .asst-thread { max-height: none; }
  .asst-msg { max-width: 100%; }
}
/* POR-10.8.0-A1.3: Ena activity list */
.asst-log td.asst-log-when { white-space: nowrap; }
.asst-log td .sub { display: block; }
/* POR-10.8.0-A2: Ena proposal card (draft costing + quote) */
.asst-action { align-self: stretch; padding: .9rem 1rem; border: 1px solid var(--rule); border-left: 4px solid var(--signal); border-radius: var(--radius); background: var(--white); }
.asst-action[data-status="applied"] { border-left-color: var(--w-green); }
.asst-action[data-status="rejected"], .asst-action[data-status="expired"], .asst-action[data-status="failed"] { border-left-color: var(--rule); }
.asst-action-h { margin: .1rem 0 .6rem; font-size: 1.05rem; }
.asst-action-h .sub { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.asst-qt td .sub { display: block; font-size: .8rem; color: var(--muted); }
.asst-qt tfoot th { text-align: right; font-weight: 600; color: var(--muted); }
.asst-qt tfoot .asst-qt-total th, .asst-qt tfoot .asst-qt-total td { color: var(--ink); font-weight: 700; }
.asst-action-btns button { margin: 0; display: inline-flex; align-items: center; gap: .45rem; }
.asst-result { margin: .6rem 0 0; font-weight: 600; }
/* POR-10.8.0-A2.8: Settings → Ena web search block */
.asst-limits h3 { margin: 1.5rem 0 .25rem; }
.asst-domains { margin-top: .75rem; }
.asst-domains textarea { width: 100%; min-height: 10rem; font-family: inherit; }
