/* AFI IT Helpdesk — night rail, moonlight accent, status shown as moon phases */
:root {
  --night: #1c2e93;
  --night-2: #36438f;
  --night-deep: #172575;
  --night-ink: #d3d7ea;
  --paper: #f3f4f7;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #646c82;
  --line: #dfe2ea;
  --moon: #fdb902;
  --moon-soft: #fff6d2;
  --focus: #fdb902;
  --urgent: #b8432f;
  --high: #b9761c;
  --normal: #3f6aa6;
  --low: #7d859a;
  --note: #fff7e3;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: Calibri, Carlito, "Segoe UI", system-ui, -apple-system, sans-serif; /* Calibri (Carlito, its metric-compatible twin, where Calibri isn't installed) */
  --font-display: Calibri, Carlito, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --night: #172575;
    --night-2: #2236a3;
    --paper: #12163a;
    --surface: #12205f;
    --ink: #e7e9f0;
    --muted: #9aa1b5;
    --line: #2e3670;
    --moon-soft: #3a3622;
    --note: #2f2a1b;
    --normal: #8fb0ec;
    --low: #a3abbf;
    --urgent: #ff8f7a;
    --high: #f5b54a;
    color-scheme: dark; }
}
:root[data-theme="dark"] { --night: #172575;
    --night-2: #2236a3;
    --paper: #12163a;
    --surface: #12205f;
    --ink: #e7e9f0;
    --muted: #9aa1b5;
    --line: #2e3670;
    --moon-soft: #3a3622;
    --note: #2f2a1b;
    --normal: #8fb0ec;
    --low: #a3abbf;
    --urgent: #ff8f7a;
    --high: #f5b54a;
    color-scheme: dark; }

/* Selected-option colours: navy in light mode, moon yellow in dark mode so choices are always visible. */
:root { --sel-bg: #1c2e93; --sel-fg: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sel-bg: #fdb902; --sel-fg: #12205f; } }
:root[data-theme="dark"] { --sel-bg: #fdb902; --sel-fg: #12205f; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.005em; }
h2 { font-size: 1.05rem; font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.rail {
  background: var(--night);
  color: var(--night-ink);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: block; text-decoration: none; padding: 2px 8px 0; }
.brand img { display: block; width: 100%; max-width: 190px; height: auto; }
.brand small { display: block; color: var(--night-ink); font-size: .82rem; letter-spacing: .02em; margin-top: 8px; padding-left: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--night-ink);
}
.nav a:hover { background: var(--night-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--focus); }
.nav .count { font-size: .78rem; color: var(--focus); }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 4px; }
.nav-head { font-size: .78rem; color: #8790b0; padding: 0 10px 4px; }
.rail .new-btn {
  display: block; text-align: center; text-decoration: none; font-weight: 600;
  background: var(--moon); color: #1c2e93; border-radius: var(--radius-s); padding: 9px 12px;
}
.rail .new-btn:hover { background: #ffd93d; }
.who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.who b { display: block; color: #fff; font-weight: 500; }
.who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who a { display: inline-block; margin-top: 8px; color: var(--focus); }

.view { padding: 40px clamp(18px, 4vw, 56px) 80px; max-width: 1120px; width: 100%; }
.view:focus { outline: none; }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- moon phase status ---------- */
.moon { width: 16px; height: 16px; flex: none; }
.moon .ring { fill: none; stroke: var(--night); stroke-width: 1.4; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .moon .ring { stroke: var(--night-ink); }
}
:where(:root[data-theme="dark"]) .moon .ring { stroke: var(--night-ink); }
.moon .lit { fill: var(--moon); }
.moon.closed .lit { fill: var(--low); }
.moon.closed .ring { stroke: var(--low); }
.moon.new .ring { stroke-width: 1.8; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-s); padding: 8px 14px; cursor: pointer; text-decoration: none; font-weight: 500;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--night); border-color: var(--night); color: #fff; }
.btn-primary:hover { background: var(--night-2); border-color: var(--night-2); }
.btn[disabled] { opacity: .55; cursor: progress; }
.field { display: grid; gap: 6px; margin-bottom: 22px; }
.field > label, .field > legend { font-weight: 600; }
.hint { color: var(--muted); font-size: .86rem; margin: 0; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); padding: 9px 11px;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--night-2); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { padding: 0; margin-bottom: 8px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input, .impact input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer;
}
.chip input:checked + span { background: var(--sel-bg); border-color: var(--sel-bg); color: var(--sel-fg); font-weight: 600; }
.chip input:checked + span::after { content: "✓"; font-weight: 700; margin-left: 2px; }
.chip span:hover { border-color: var(--sel-bg); }
.chip input:focus-visible + span, .impact input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.impact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.impact { --pc: var(--night); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .impact { --pc: var(--moon); }
}
:where(:root[data-theme="dark"]) .impact { --pc: var(--moon); }
.impact.p-low { --pc: var(--low); }
.impact.p-normal { --pc: var(--normal); }
.impact.p-high { --pc: var(--high); }
.impact.p-urgent { --pc: var(--urgent); }
.impact span {
  display: block; height: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--surface); cursor: pointer;
}
.impact b { display: block; font-weight: 600; }
.impact b.with-ico { display: flex; align-items: center; gap: 6px; }
.impact small { color: var(--muted); }
.impact span { position: relative; padding-right: 40px; transition: border-color .12s, background-color .12s; }
.impact span::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); box-sizing: border-box; background: var(--surface);
}
.impact span:hover { border-color: var(--pc); }
.impact input:checked + span {
  border-color: var(--pc); box-shadow: inset 0 0 0 2px var(--pc);
  background: color-mix(in srgb, var(--pc) 9%, var(--surface));
}
.impact input:checked + span::after { border-color: var(--pc); background: var(--pc); box-shadow: inset 0 0 0 3px var(--surface); }
.prio-card span { border-left: 5px solid var(--pc); }
.impact .urg { font-style: normal; font-weight: 700; color: var(--pc); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .impact span { transition: none; } }

.form-narrow { max-width: 720px; }
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- home ---------- */
.hello { margin-bottom: 36px; display: flex; gap: 24px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.hello h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); max-width: 22ch; }
.hello p { color: var(--muted); margin: 10px 0 0; max-width: 52ch; }
.block { margin-bottom: 34px; }
.block > h2 { margin-bottom: 10px; }
.quiet { color: var(--muted); }

/* ---------- ticket list ---------- */
.tlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.tlist li + li { border-top: 1px solid var(--line); }
.trow { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 13px 16px; text-decoration: none; }
.trow:hover { background: color-mix(in srgb, var(--paper) 60%, var(--surface)); }
.tsub { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.tright { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.prio { font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.prio.urgent { color: var(--urgent); }
.prio.high { color: var(--high); }
.prio.normal { color: var(--normal); }
.prio.low { color: var(--low); }

/* ---------- queue ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-fg); font-weight: 600; }
.filters { display: flex; gap: 8px; flex: 1 1 420px; justify-content: flex-end; flex-wrap: wrap; }
.filters input { flex: 1 1 220px; max-width: 320px; }
.filters select { width: auto; }

/* ---------- ticket detail ---------- */
.crumb { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.t-head { margin-bottom: 26px; }
.t-head h1 { font-size: 1.6rem; max-width: 40ch; }
.t-num { color: var(--muted); font-size: .9rem; margin-bottom: 6px; display: flex; gap: 12px; align-items: center; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; }
.msg.mine { border-left: 3px solid var(--normal); }
.msg.it { border-left: 3px solid var(--moon); }
.msg.note { background: var(--note); border-style: dashed; border-left: 3px solid var(--high); }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; color: var(--muted); margin-bottom: 6px; }
.msg-head b { color: var(--ink); font-weight: 600; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { font-size: .84rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; background: var(--paper); }
.file:hover { border-color: var(--muted); }
.event { display: flex; gap: 8px; align-items: center; font-size: .84rem; color: var(--muted); padding: 0 16px; }
.event::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line); flex: none; }

.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; margin-top: 6px; }
.composer textarea { min-height: 110px; margin: 8px 0 10px; }
.composer.is-note { background: var(--note); }
.kind-switch { display: flex; gap: 4px; }
.kind-switch button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s); padding: 5px 11px; cursor: pointer; font-size: .88rem; }
.kind-switch button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); font-weight: 600; }
.composer-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; }
.file-input { font-size: .85rem; color: var(--muted); max-width: 100%; }

.callout { border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 14px; background: var(--moon-soft); border: 1px solid var(--moon); }
.callout p { margin: 0 0 10px; }

.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; position: sticky; top: 20px; }
.side h2 { font-size: .95rem; margin-bottom: 12px; }
.side dl { margin: 0; display: grid; gap: 12px; }
.side dt { font-size: .8rem; color: var(--muted); }
.side dd { margin: 2px 0 0; }
.side .field { margin-bottom: 12px; gap: 4px; }
.side .field > label { font-weight: 500; font-size: .84rem; color: var(--muted); }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- overview ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 30px; }
.stat { background: var(--surface); padding: 16px 18px; text-decoration: none; display: block; }
.stat b { display: block; font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; color: var(--night); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .stat b { color: var(--ink); }
}
:where(:root[data-theme="dark"]) .stat b { color: var(--ink); }
.stat span { color: var(--muted); font-size: .86rem; }
a.stat:hover { background: var(--paper); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.trow > span { min-width: 0; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 150px 1fr 32px; gap: 10px; align-items: center; font-size: .9rem; }
/* bars and charts are SVG so they work under the strict CSP (no inline styles) */
.hbar { width: 100%; height: 8px; display: block; }
.hbar-track { fill: var(--line); }
.hbar-fill { fill: var(--night-2); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .hbar-fill { fill: var(--moon); }
}
:where(:root[data-theme="dark"]) .hbar-fill { fill: var(--moon); }
.mb { margin-bottom: 12px; }

.empty { text-align: left; padding: 30px 0; }
.empty p { color: var(--muted); }

/* ---------- SLA ---------- */
.sla { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.sla-risk { background: #fff3c4; color: #7a5a00; border-color: #f2d36b; }
.sla-breached { background: #fbe4df; color: #9a2f1d; border-color: #eab3a8; }
.side dd.warn { color: #8a6500; font-weight: 600; }
.side dd.bad { color: var(--urgent); font-weight: 600; }
.stat-bad b { color: var(--urgent) !important; }
.stat-warn b { color: #a87800 !important; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .sla-risk { background: #3d3412; color: #ffd15a; border-color: #6b5a1c; }
  :where(:root:not([data-theme="light"])) .sla-breached { background: #3f1f1a; color: #ff9f8c; border-color: #6e3329; }
  :where(:root:not([data-theme="light"])) .side dd.warn, :where(:root:not([data-theme="light"])) .stat-warn b { color: #ffd15a !important; }
  :where(:root:not([data-theme="light"])) .side dd.bad, :where(:root:not([data-theme="light"])) .stat-bad b { color: #ff9f8c !important; }
}
:where(:root[data-theme="dark"]) .sla-risk { background: #3d3412; color: #ffd15a; border-color: #6b5a1c; }
:where(:root[data-theme="dark"]) .sla-breached { background: #3f1f1a; color: #ff9f8c; border-color: #6e3329; }
:where(:root[data-theme="dark"]) .side dd.warn, :where(:root[data-theme="dark"]) .stat-warn b { color: #ffd15a !important; }
:where(:root[data-theme="dark"]) .side dd.bad, :where(:root[data-theme="dark"]) .stat-bad b { color: #ff9f8c !important; }

/* ---------- admin center ---------- */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 24px; overflow-x: auto; }
.subnav a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--moon); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; margin-bottom: 24px; }
.panel h2 { margin-bottom: 12px; }
.panel > .hint { margin-bottom: 14px; }
.panel h2:not(:first-child) { margin-top: 26px; }
.two-col .panel { margin-bottom: 0; }
.two-col { margin-bottom: 24px; }
.toolbar > .quiet { margin: 0; max-width: 60ch; font-size: .9rem; }
.stats + .stats { margin-top: -18px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .84rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.muted-row td { color: var(--muted); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .b-created { fill: var(--night); }
.chart .b-resolved { fill: var(--moon); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chart .b-created { fill: #8fa0f0; }
}
:where(:root[data-theme="dark"]) .chart .b-created { fill: #8fa0f0; }
.legend { display: flex; gap: 18px; font-size: .86rem; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-created { background: var(--night); }
.lg-resolved { background: var(--moon); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .lg-created { background: #8fa0f0; }
}
:where(:root[data-theme="dark"]) .lg-created { background: #8fa0f0; }
.dur { display: flex; align-items: center; gap: 6px; }
.dur input { width: 72px; padding: 7px 8px; }
.dur span { color: var(--muted); font-size: .88rem; }
.sla-table select { width: auto; }
.narrow-field { max-width: 420px; margin-top: 20px; }
.time-row { display: flex; gap: 16px; flex-wrap: wrap; }
.time-row .field { width: 170px; }
.holiday-add { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.holiday-add input { width: auto; }
.holidays { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; max-width: 420px; }
.holidays li { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.btn-small { padding: 3px 10px; font-size: .84rem; }
#hol-list { margin-bottom: 20px; }

/* ---------- request types ---------- */
.type-pick { display: grid; gap: 14px; }
.type-card {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px 22px;
}
.type-card:hover { border-color: var(--night); box-shadow: inset 4px 0 0 var(--moon); }
.type-card svg { width: 44px; height: 44px; }
.type-card .tc-ring { fill: none; stroke: var(--night); stroke-width: 2.2; }
.type-card .tc-mark { fill: none; stroke: var(--night); stroke-width: 2.6; stroke-linecap: round; }
.type-card .tc-dot { fill: var(--night); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .type-card .tc-ring, :where(:root:not([data-theme="light"])) .type-card .tc-mark { stroke: var(--moon); }
  :where(:root:not([data-theme="light"])) .type-card .tc-dot { fill: var(--moon); }
}
:where(:root[data-theme="dark"]) .type-card .tc-ring, :where(:root[data-theme="dark"]) .type-card .tc-mark { stroke: var(--moon); }
:where(:root[data-theme="dark"]) .type-card .tc-dot { fill: var(--moon); }
.type-card b { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.type-card small { display: block; color: var(--muted); font-size: .95rem; margin-top: 4px; max-width: 56ch; }
.type-card em { display: inline-block; font-style: normal; font-size: .8rem; font-weight: 600; color: var(--night); background: var(--moon-soft); border-radius: 999px; padding: 2px 9px; margin-top: 10px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .type-card em { color: var(--moon); }
}
:where(:root[data-theme="dark"]) .type-card em { color: var(--moon); }
.type-tag { font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.type-incident { background: #e6e9f6; color: var(--night); }
.type-service { background: var(--moon-soft); color: #6b5300; border: 1px solid var(--moon); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .type-incident { background: var(--night-2); color: #fff; }
  :where(:root:not([data-theme="light"])) .type-service { color: var(--moon); }
}
:where(:root[data-theme="dark"]) .type-incident { background: var(--night-2); color: #fff; }
:where(:root[data-theme="dark"]) .type-service { color: var(--moon); }
.hw-hint { margin: -6px 0 20px; }
.impact-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.field-row .field { min-width: 150px; }
.field-row .grow { flex: 1 1 220px; }
.field-row .qty { width: 110px; min-width: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: .86rem; }
textarea.short { min-height: 80px; }
.hw-details { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--moon); border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 14px; }
.hw-details dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.hw-details dt { font-size: .8rem; color: var(--muted); }
.hw-details dd { margin: 2px 0 0; font-weight: 500; }
.linkbar { background: #e9ecf8; border: 1px solid #c7cdea; border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 14px; }
.linkbar p { margin: 0; }
.linkbar a { font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .linkbar { background: var(--night-2); border-color: var(--line); }
}
:where(:root[data-theme="dark"]) .linkbar { background: var(--night-2); border-color: var(--line); }
.convert-form { border-color: var(--night); margin-bottom: 14px; }
.convert-form h2 { margin-bottom: 4px; }
.convert-form > .hint { margin-bottom: 16px; }
.dash-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.mix { color: var(--muted); margin: -4px 0 14px; font-size: .92rem; }
.mix b { color: var(--ink); }
@media (max-width: 760px) { .impact-grid.three { grid-template-columns: 1fr; } }

/* ---------- roles, view switch, IT options ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.view-switch {
  display: block; width: 100%; margin: 0 0 12px; padding: 7px 10px; border-radius: var(--radius-s);
  border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; cursor: pointer; font-size: .86rem; text-align: center;
}
.view-switch:hover { background: var(--night-2); }
.view-switch.on { background: var(--moon); color: #1c2e93; border-color: var(--moon); font-weight: 600; }
.view-note { font-size: .8rem; color: var(--night-ink); margin-bottom: 6px; }
.role-pill { display: inline-block !important; margin-top: 6px; font-size: .74rem; padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); color: var(--night-ink); }
.who .role-pill + a { display: block; }
.who .role-pill + .role-pill { margin-left: 4px; }
.it-options { border-left: 3px solid var(--moon); }
.it-options h2 { margin-bottom: 10px; }
.it-options .field { margin-bottom: 8px; }
.picked { margin: 0; padding: 8px 10px; background: var(--moon-soft); border-radius: var(--radius-s); line-height: 1.6; }
.picked .btn { margin-left: 6px; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 6px 18px rgba(20,28,70,.14); max-height: 260px; overflow: auto;
}
.combo-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 4px; cursor: pointer; }
.combo-list button:hover, .combo-list button:focus-visible { background: var(--paper); }
.combo-list small { display: block; color: var(--muted); }
.combo-list .none { padding: 8px 9px; color: var(--muted); font-size: .9rem; }
.team-table select { width: auto; min-width: 190px; }
.team-table .hint { margin-top: 4px; }
.count-n { opacity: .7; font-size: .85em; }

/* ---------- notifications page ---------- */
.kv th { width: 220px; color: var(--muted); font-weight: 500; text-align: left; vertical-align: top; }
.state { display: inline-block; font-size: .74rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: 6px; }
.state-ok { background: #e3f4e8; color: #1d6b3a; }
.state-bad { background: #fbe4df; color: #9a2f1d; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .state-ok { background: #1d3a28; color: #8fe0aa; }
  :where(:root:not([data-theme="light"])) .state-bad { background: #3f1f1a; color: #ff9f8c; }
}
:where(:root[data-theme="dark"]) .state-ok { background: #1d3a28; color: #8fe0aa; }
:where(:root[data-theme="dark"]) .state-bad { background: #3f1f1a; color: #ff9f8c; }
.result { padding: 12px 14px; border-radius: var(--radius-s); margin: 4px 0 20px; max-width: 70ch; }
.result-ok { background: #e3f4e8; color: #1d4d2e; }
.result-bad { background: #fbe4df; color: #6e2416; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .result-ok { background: #1d3a28; color: #c7f0d4; }
  :where(:root:not([data-theme="light"])) .result-bad { background: #3f1f1a; color: #ffd2c8; }
}
:where(:root[data-theme="dark"]) .result-ok { background: #1d3a28; color: #c7f0d4; }
:where(:root[data-theme="dark"]) .result-bad { background: #3f1f1a; color: #ffd2c8; }
.result details { margin-top: 6px; font-size: .86rem; }
.result code, .kv code { font-size: .86rem; }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
#test-to { width: min(340px, 100%); }

/* ---------- reopen ---------- */
.tag-reopen {
  display: inline-block; vertical-align: 1px; margin-left: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .01em;
  padding: 1px 8px; border-radius: 999px; background: #fdecc8; color: #7a4b00; border: 1px solid #f0c060; white-space: nowrap;
}
.t-num .tag-reopen, .tright .tag-reopen { margin-left: 0; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .tag-reopen { background: #3d3212; color: #ffd36b; border-color: #6b5a1c; }
}
:where(:root[data-theme="dark"]) .tag-reopen { background: #3d3212; color: #ffd36b; border-color: #6b5a1c; }
.callout-quiet { background: var(--surface); border-color: var(--line); }
.reopen-form { margin-top: 14px; display: grid; gap: 8px; }
.reopen-form label { font-weight: 600; }

/* ---------- theme switch (top right) ---------- */
.theme-toggle {
  position: fixed; top: 14px; right: 18px; z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; box-shadow: 0 2px 10px rgba(20, 28, 70, .10);
}
.theme-toggle:hover { border-color: var(--muted); }
.tt-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #d9dcea; transition: background-color .18s; flex: none; }
.tt-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tt-knob svg { width: 12px; height: 12px; fill: none; stroke: #b98a00; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle[aria-checked="true"] .tt-track { background: var(--night-2); }
.theme-toggle[aria-checked="true"] .tt-knob { transform: translateX(18px); background: var(--moon); }
.theme-toggle[aria-checked="true"] .tt-knob svg { fill: #1c2e93; stroke: none; }
@media (prefers-reduced-motion: reduce) { .tt-track, .tt-knob { transition: none; } }
@media (max-width: 760px) {
  .theme-toggle { position: static; box-shadow: none; order: 2; margin-left: auto; padding: 4px; border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
  .rail .new-btn { order: 3; margin-left: 0 !important; padding: 8px 12px; }
  .rail .nav { order: 4; }
  .rail .who { order: 5; }
  .brand img { max-width: 132px !important; }
  .tt-label { display: none; }
}

/* ---------- icons ---------- */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav a { justify-content: flex-start; gap: 10px; }
.nav a .ico { opacity: .85; }
.with-ico { display: inline-flex; align-items: center; gap: 6px; }
.chip span { display: inline-flex; align-items: center; gap: 7px; }
.chip .ico { opacity: .8; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 16px 14px;
  text-decoration: none; color: var(--ink); overflow: hidden;
}
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--night-2); }
.tile.good::before { background: #2e8b57; }
.tile.warn::before { background: var(--high); }
.tile.bad::before { background: var(--urgent); }
.tile b { grid-column: 1; font-family: var(--font-display); font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.05; white-space: nowrap; }
.tile span { grid-column: 1; color: var(--muted); font-size: .86rem; }
.tile.bad b { color: var(--urgent); }
.tile.warn b { color: var(--high); }
.tile .tile-icon, .tile .tile-ring, .tile > .moon { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.tile .tile-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); color: var(--night-2); }
.tile .tile-icon .ico { width: 20px; height: 20px; }
.tile .tile-ring svg { width: 58px; height: 58px; display: block; }
.tile > .moon { width: 34px; height: 34px; }
a.tile:hover { border-color: var(--muted); }
:where(:root[data-theme="dark"]) .tile .tile-icon { color: var(--moon); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .tile .tile-icon { color: var(--moon); } }
.home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- dashboard grid ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head p { margin: 6px 0 0; max-width: 70ch; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dash-filters-bar { margin: -6px 0 20px; }
.dash-actions .btn .ico, .btn svg { width: 16px; height: 16px; }
.btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dash-grid .panel { margin: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.panel-head h2 { margin: 0 !important; }
.panel-head .hint { margin: 4px 0 0; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-box .tlist { border-radius: var(--radius-s); }
.icon-btn {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[disabled] { opacity: .5; cursor: progress; }
.table.compact td, .table.compact th { padding: 6px 8px; }
.table.compact { margin-top: 10px; }
.good-note { color: #2e8b57; }

/* compact list for narrow panels */
.mini-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 10px 12px 10px 16px; text-decoration: none; }
.mini-top .sla { flex: none; }
.mini-list a:hover { background: var(--paper); }
.mini-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mini-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mini-list li.pe { box-shadow: inset 4px 0 0 var(--pe, transparent); }
.mini-list .tmeta .prio { padding: 0 6px; font-size: .74rem; }

/* add member + invitations */
.member-form { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px 6px; margin-bottom: 18px; background: var(--paper); }
.member-form h3, #invites h3 { font-size: .98rem; margin: 0 0 10px; }
.member-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.member-row .field { margin-bottom: 8px; }
.member-row .grow { flex: 1 1 260px; }
.member-row select { width: auto; min-width: 190px; }
.member-row .btn { margin-bottom: 8px; }
.member-form .hint { margin: 0 0 8px; }
#invites:not(:empty) { margin-bottom: 18px; }
.invite-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); }
.invite-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; }
.invite-list li + li { border-top: 1px solid var(--line); }
.invite-list li > span { display: grid; gap: 2px; min-width: 0; }
.invite-list b { font-weight: 600; overflow-wrap: anywhere; }
.invite-list .quiet { font-size: .86rem; }

/* permissions save bar */
.save-bar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin: 0 0 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: .92rem;
}
.save-bar.dirty { background: var(--moon-soft); border-color: var(--moon); color: var(--ink); box-shadow: 0 4px 14px rgba(20, 28, 70, .12); }
.save-actions { display: inline-flex; gap: 8px; }
.perm-cell.changed { background: color-mix(in srgb, var(--moon) 28%, transparent); box-shadow: inset 0 0 0 2px var(--moon); }

/* organization zoom */
.org-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.org-toolbar .ico { width: 17px; height: 17px; }
.zoom-level { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9rem; }
.zoom-tip { margin: 0 0 0 auto; font-size: .8rem; }
.org-toolbar .btn-small { display: inline-flex; align-items: center; gap: 5px; }
.org-toolbar .icon-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* roles & permissions grid */
.perm-scroll { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-m); }
.perm-table { border-collapse: separate; border-spacing: 0; min-width: 760px; }
.perm-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); vertical-align: bottom; border-bottom: 2px solid var(--line); }
.perm-table .perm-col { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 260px; max-width: 340px; white-space: normal; }
.perm-table thead .perm-col { z-index: 3; }
.perm-table tbody th.perm-col { font-weight: 400; }
.perm-table tbody th.perm-col b { display: block; font-weight: 600; color: var(--ink); }
.perm-table tbody th.perm-col .hint { display: block; font-size: .8rem; margin-top: 2px; }
.role-col { text-align: center !important; min-width: 128px; white-space: normal !important; }
.role-col.is-custom { background: color-mix(in srgb, var(--moon) 10%, var(--surface)) !important; }
.rc-name { display: block; font-weight: 700; color: var(--ink); font-size: .9rem; }
.rc-meta { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); margin: 2px 0 4px; }
.rc-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.perm-group th { background: var(--paper) !important; text-align: left; font-size: .8rem; letter-spacing: .02em; color: var(--muted); padding: 6px 10px; }
.perm-cell { text-align: center; }
.perm-tick { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 4px; }
.perm-tick input { width: 18px; height: 18px; accent-color: var(--night-2); cursor: pointer; }
.perm-tick.locked { cursor: not-allowed; }
.perm-tick .lock, .hint .lock { width: 13px; height: 13px; color: var(--muted); vertical-align: -2px; }
.custom-role { font-style: normal; }

/* organization chart */
.org-scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper); padding: 6px; margin: 6px 0 10px; }
.org-scroll svg { display: block; margin: 0 auto; max-width: none; }
.org-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lead-bar .actions { margin-top: 10px; }
.panel-head .dash-actions { flex-wrap: nowrap; flex: none; }
@media (max-width: 760px) { .panel-head { flex-wrap: wrap; } .panel-head .dash-actions { flex-wrap: wrap; } }

/* role tick boxes */
.role-ticks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.member-row .role-ticks { margin-bottom: 8px; padding-bottom: 9px; }
.role-ticks legend { font-weight: 600; margin-bottom: 6px; width: 100%; }
.role-ticks .check { white-space: nowrap; }
.role-ticks input:disabled + * , .role-ticks .check:has(input:disabled) { opacity: .75; }
.row-ticks { flex-direction: column; align-items: flex-start; gap: 2px; }

/* team leads */
.lead-badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--moon-soft); color: var(--ink); border: 1px solid var(--moon); vertical-align: 1px; }
.lead-bar { border-left: 4px solid var(--moon); }
.member-cards { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.member-card {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 10px 12px; color: var(--ink);
}
.member-card:hover { border-color: var(--muted); }
.member-card.on { border-color: var(--moon); box-shadow: inset 4px 0 0 var(--moon); }
.mc-name { display: grid; gap: 2px; min-width: 0; }
.mc-name b, .mc-name .quiet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-name .quiet { font-size: .84rem; }
.mc-stats { display: flex; gap: 6px; flex: none; }
.mc-stat { display: grid; justify-items: center; min-width: 52px; padding: 4px 6px; border-radius: 8px; background: var(--paper); }
.mc-stat b { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; }
.mc-stat small { font-size: .7rem; color: var(--muted); }
.mc-stat.warn b { color: var(--high); }
.mc-stat.good b { color: #2e8b57; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; margin-top: 6px; }
.team-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; background: var(--surface); display: grid; gap: 10px; align-content: start; }
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tc-lead { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.tc-lead > .ico { width: 22px; height: 22px; color: var(--night-2); margin-top: 2px; }
.tc-lead > span, .tc-person { display: grid; gap: 1px; min-width: 0; }
.tc-lead .quiet, .tc-person .quiet { font-size: .84rem; overflow-wrap: anywhere; }
.tc-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tc-head .btn, .tc-members .btn { white-space: nowrap; flex: none; }
.tc-members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tc-add { display: flex; gap: 8px; }
.tc-add input { flex: 1; min-width: 0; padding: 7px 10px; }

/* refresh */
.updated { white-space: nowrap; opacity: .85; }
#refresh-btn svg { transition: transform .5s; }
#refresh-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #refresh-btn.spinning svg { animation: none; } }

/* engineer filter */
.eng-filter { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--muted); }
.eng-filter select { border: 0; background: transparent; padding: 8px 6px; width: auto; min-width: 150px; max-width: 220px; color: var(--ink); }
.eng-filter:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.eng-filter select:focus-visible { outline: none; }

/* ---------- export dialog ---------- */
.export-dlg {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(10, 14, 40, .35);
}
.export-dlg::backdrop { background: rgba(14, 18, 45, .55); }
.export-dlg > .loading { padding: 30px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 8px; }
.dlg-head h2 { margin: 0; }
.dlg-head .hint { margin: 4px 0 0; }
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 12px 22px; overflow: auto; max-height: calc(100vh - 230px); }
.slide-card { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.slide-thumb { aspect-ratio: 16 / 9; background: #fff; }
.slide-thumb svg { width: 100%; height: 100%; display: block; }
.slide-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 600; font-size: .9rem; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- ticket progress tracker ---------- */
.stepper { list-style: none; margin: 16px 0 0; padding: 0; display: flex; max-width: 620px; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; font-size: .82rem; color: var(--muted); text-align: center; }
.stepper li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.current::before { background: var(--moon); }
.stepper .moon { width: 18px; height: 18px; position: relative; z-index: 1; background: var(--paper); border-radius: 50%; }
.stepper li.current { color: var(--ink); font-weight: 700; }
.stepper li.current .moon { box-shadow: 0 0 0 4px color-mix(in srgb, var(--moon) 30%, transparent); }

/* ---------- priority edges in IT lists ---------- */
.tlist li.pe { box-shadow: inset 4px 0 0 var(--pe, transparent); }
.tlist li.pe-urgent { --pe: var(--urgent); }
.tlist li.pe-high { --pe: var(--high); }
.tlist li.pe-normal { --pe: var(--normal); }
.tlist li.pe-low { --pe: var(--low); }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > .panel { grid-column: 1 / -1; }
  .home-tiles { grid-template-columns: 1fr; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--night); color: #fff; padding: 10px 16px; border-radius: var(--radius-s);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--urgent); }

/* ---------- login ---------- */
.login-body { background: var(--night); min-height: 100vh; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand {
  background: #1c2e93; color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(32px, 7vw, 96px);
}
.tagline {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.08; letter-spacing: .01em;
  max-width: 16ch; margin: 0;
}
.login-arc { width: min(420px, 90%); height: 46px; margin-top: 28px; }
.login-card { background: #fff; color: #1d2433; padding: clamp(32px, 7vw, 96px); display: flex; flex-direction: column; justify-content: center; }
.login-logo { width: min(380px, 100%); height: auto; margin-bottom: 40px; }
.login-card h1 { font-size: clamp(2rem, 4vw, 2.8rem); color: #1c2e93; }
.login-lead { font-size: 1.08rem; color: #5b6380; max-width: 40ch; margin: 12px 0 28px; }
.ms-btn {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  background: #1c2e93; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.02rem;
  padding: 12px 20px; border-radius: var(--radius-s); border-bottom: 3px solid #fdb902;
}
.ms-btn:hover { background: #36438f; }
.ms-btn svg { width: 20px; height: 20px; }
.login-help { color: #5b6380; font-size: .9rem; max-width: 44ch; margin-top: 24px; }
.login-error { background: #fbe9e5; color: #7a2617; padding: 10px 14px; border-radius: var(--radius-s); max-width: 48ch; margin: 0 0 18px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .t-grid, .two-col { grid-template-columns: 1fr; }
  .side { position: static; order: -1; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .nav-sep, .nav-head { display: none; }
  .rail .new-btn { margin-left: auto; }
  .brand img { max-width: 150px; }
  .brand small { display: none; }
  .who { margin: 0; padding: 0; border: 0; order: 4; flex: 1 1 100%; display: flex; gap: 12px; align-items: baseline; }
  .who span { display: none; }
  .who a { margin: 0; }
  .view { padding-top: 24px; }
  .trow { grid-template-columns: 22px 1fr; }
  .tright { grid-column: 2; }
  .filters { justify-content: stretch; }
  .filters input { max-width: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; }
  .tagline { font-size: 1.6rem; }
  .login-arc { height: 28px; margin-top: 14px; }
  .login-logo { margin-bottom: 28px; }
  .bars li { grid-template-columns: 110px 1fr 28px; }
  .impact-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- guest access (sign-in page + public request page) ---------- */
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guest-btn { margin-top: 0; }
.login-card .ms-btn { min-width: 274px; justify-content: center; }
.guest-btn svg { fill: initial; stroke: none; }
.guest-body { background: var(--paper); min-height: 100vh; }
.guest-top {
  display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 4vw, 40px); background: var(--night); color: #fff;
  border-bottom: 3px solid var(--moon); flex-wrap: wrap;
}
.guest-logo img { height: 40px; width: auto; display: block; background: #fff; border-radius: 8px; padding: 4px 8px; }
.guest-top-title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.guest-top-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.guest-top .theme-toggle { position: static; }
.guest-main { max-width: 880px; margin: 0 auto; padding: 28px clamp(14px, 4vw, 32px) 60px; }
.guest-main h1 { margin: 6px 0 6px; }
.guest-main .lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; max-width: 70ch; }
.guest-form h2 { font-size: 1.1rem; margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.guest-form h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.guest-form fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.guest-form legend { font-weight: 600; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-bottom: 10px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.center { text-align: center; justify-content: center; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 8px 0 20px; }
.choice-card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1.5px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .12s, transform .12s, box-shadow .12s;
}
.choice-card:hover, .choice-card:focus-visible { border-color: var(--moon); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 28, 70, .12); }
.choice-card b { font-size: 1.15rem; }
.choice-card span:last-child { color: var(--muted); }
.cc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--moon-soft); color: var(--night-2); }
.cc-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.country-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.country-card { --pc: var(--moon); }
.flag { width: 20px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); flex: none; object-fit: cover; vertical-align: -2px; }
.guest-form > .actions { margin-top: 18px; }
.ack-box { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; }
.ack-steps { margin: 0 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.ack-steps .btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.ack-steps .btn svg, .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sent-panel { text-align: center; max-width: 620px; margin: 30px auto; padding: 32px; }
.sent-tick { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; background: var(--moon); display: grid; place-items: center; }
.sent-tick svg { width: 34px; height: 34px; fill: none; stroke: #12205f; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sent-panel .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.track-steps { display: flex; list-style: none; padding: 0; margin: 10px 0 16px; gap: 0; counter-reset: s; }
.track-steps li { flex: 1; text-align: center; font-size: .85rem; color: var(--muted); position: relative; padding-top: 26px; }
.track-steps li::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); z-index: 1; }
.track-steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.track-steps li:first-child::after { display: none; }
.track-steps li.done::before { background: var(--moon); border-color: var(--moon); }
.track-steps li.done::after, .track-steps li.now::after { background: var(--moon); }
.track-steps li.now { color: var(--ink); font-weight: 700; }
.track-steps li.now::before { border-color: var(--moon); box-shadow: 0 0 0 4px var(--moon-soft); }
.meta-line { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.crumbs { color: var(--muted); margin: 0; font-weight: 600; }
.guest-main .composer { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.guest-main .composer label { font-weight: 600; }
.composer-foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .grid-2, .check-grid, .choice-cards, .country-cards { grid-template-columns: 1fr; }
  .guest-top-actions .btn { display: none; }
}

/* guest details on tickets (IT view) */
.req-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; letter-spacing: .02em; }
.req-tag.guest { background: var(--moon-soft); color: var(--ink); border: 1px solid var(--moon); }
.req-tag.starter { background: color-mix(in srgb, var(--low) 18%, transparent); color: var(--ink); border: 1px solid var(--low); }
.onboard { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; margin: 0 0 14px; }
.onboard h3 { margin: 0; padding: 9px 14px; font-size: .95rem; background: var(--paper); border-top: 1px solid var(--line); }
.onboard h3:first-child { border-top: 0; background: var(--night); color: #fff; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.onboard dl { margin: 0; display: grid; grid-template-columns: minmax(150px, 34%) 1fr; }
.onboard dt, .onboard dd { margin: 0; padding: 7px 14px; border-top: 1px solid var(--line); font-size: .92rem; }
.onboard dt { color: var(--muted); }
.onboard dd { overflow-wrap: anywhere; }

/* attachment chips + in-ticket viewer */
.file { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); overflow: hidden; max-width: 100%; }
.file-open { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-size: .88rem; min-width: 0; }
.file-open:hover, .file-open:focus-visible { background: color-mix(in srgb, var(--moon) 16%, transparent); }
.file-open .ico { width: 15px; height: 15px; flex: none; color: var(--muted); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-size { color: var(--muted); font-size: .8rem; flex: none; }
.file-dl { display: inline-flex; align-items: center; padding: 0 9px; border-left: 1px solid var(--line); color: var(--muted); }
.file-dl:hover, .file-dl:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--moon) 16%, transparent); }
.file-dl .ico { width: 15px; height: 15px; }
body.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 13, 35, .82); display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--surface); color: var(--ink); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.viewer-title { display: flex; flex-direction: column; min-width: 0; }
.viewer-title .file-name { font-weight: 600; max-width: 60vw; }
.viewer-meta { color: var(--muted); font-size: .82rem; }
.viewer-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewer-actions .btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.viewer-actions .ico { width: 16px; height: 16px; }
.viewer-body { flex: 1; min-height: 0; background: var(--paper); border-radius: 0 0 var(--radius-m) var(--radius-m); overflow: auto; display: flex; }
.viewer-body.image { align-items: center; justify-content: center; background: repeating-conic-gradient(var(--paper) 0 25%, var(--surface) 0 50%) 0 0 / 22px 22px; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.viewer-body img.zoomed { max-width: none; max-height: none; cursor: zoom-out; margin: auto; }
.viewer-body.pdf iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-text { margin: 0; padding: 16px; width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; font: .86rem/1.5 ui-monospace, Consolas, monospace; color: var(--ink); }
.viewer-none { margin: auto; text-align: center; padding: 30px; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.viewer-none > .ico { width: 54px; height: 54px; color: var(--muted); }
.viewer-none .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.guest-main .thread p.event { margin: 0; }

/* satisfaction ratings */
.rate-card { border: 1px solid var(--moon); background: var(--moon-soft); border-radius: var(--radius-m); padding: 14px 16px; margin: 0 0 14px; }
.rate-card.done { background: var(--surface); border-color: var(--line); }
.rate-intro { margin: 0 0 6px; color: var(--muted); }
.rate-done { margin: 0 0 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rate-form { display: flex; flex-direction: column; gap: 6px; }
.rate-stars { border: 0; padding: 0; margin: 0 0 4px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.rate-stars legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; width: 100%; color: var(--ink); }
.rate-label { margin-left: 10px; font-weight: 600; color: var(--ink); min-width: 9ch; }
.rate-comment-label { font-weight: 600; }
.rate-form textarea { min-height: 64px; }
.stars-static { display: inline-flex; gap: 1px; vertical-align: -3px; }
.rate-quote { margin: 6px 0 4px; padding: 6px 10px; border-left: 3px solid var(--moon); background: var(--paper); border-radius: 0 6px 6px 0; font-size: .92rem; white-space: pre-wrap; }
.rate-chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 0 6px; border-radius: 999px; margin-left: 4px; background: var(--moon-soft); color: var(--ink); border: 1px solid var(--moon); white-space: nowrap; }
.rate-chip.r1, .rate-chip.r2 { background: color-mix(in srgb, var(--urgent, #c0392b) 16%, transparent); border-color: var(--urgent, #c0392b); }
.feedback-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feedback-list a { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--ink); text-decoration: none; }
.feedback-list a:hover { border-color: var(--moon); background: var(--paper); }
.fb-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-top .quiet { margin-left: auto; font-size: .8rem; }
.fb-comment { font-size: .92rem; }
.fb-who { font-size: .8rem; }

.csat-head { display: flex; align-items: center; gap: 14px; margin: 2px 0 12px; }
.csat-big { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.csat-side { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.csat-side .stars-static .star { width: 20px; height: 20px; }

/* reports */
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.report-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem; }
.report-tabs button:hover { border-color: var(--sel-bg); }
.report-tabs button.on { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.rep-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; align-items: end; padding-bottom: 4px; }
.rep-filters .field { margin-bottom: 12px; }
.rep-filters label { font-size: .82rem; }
.rf-reset { align-self: end; }
.export-bar .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.export-bar .ico { width: 16px; height: 16px; }
.rep-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 4px 0 14px; }
.rep-stat { background: var(--paper); border-left: 3px solid var(--moon); border-radius: var(--radius-s); padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rep-stat b { font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-stat span { color: var(--muted); font-size: .8rem; }
.rep-table-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.rep-table { font-size: .86rem; min-width: 100%; }
.rep-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); white-space: nowrap; padding: 0; border-bottom: 2px solid var(--line); }
.rep-table thead th button { all: unset; display: block; padding: 8px 10px; cursor: pointer; font-weight: 700; color: var(--ink); }
.rep-table thead th button:hover { color: var(--night-2); text-decoration: underline; }
.rep-table thead th button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.rep-table td { white-space: nowrap; padding: 6px 10px; vertical-align: top; }
.rep-table td.wrap { white-space: normal; min-width: 240px; max-width: 420px; }
.rep-table .num { text-align: right; }
.rep-table thead th.num button { text-align: right; }
.rep-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.rep-table tr.total td { font-weight: 700; border-top: 2px solid var(--line); background: var(--paper); }
.rep-more, .rep-count { margin: 10px 0 0; font-size: .88rem; }
.rep-more { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }
.rep-empty { padding: 20px 0; }
@media (max-width: 760px) { .export-bar { flex-wrap: wrap; } }
.rep-filters select, .rep-filters input { height: 40px; box-sizing: border-box; }

/* stars with halves: an outline star plus a filled copy clipped to the right width */
.sw { position: relative; display: inline-block; line-height: 0; }
.sw > .star { fill: transparent; stroke: var(--muted); stroke-width: 1.6; }
.sw .sf { position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; pointer-events: none; width: 0; }
.sw .sf.f50 { width: 50%; }
.sw .sf.f100 { width: 100%; }
.sw .sf .star { fill: #fdb902; stroke: #d9a800; stroke-width: 1.6; }
.stars-static .sw > .star, .stars-static .sw .sf .star { width: 15px; height: 15px; }
.rate-row { display: inline-flex; gap: 3px; }
.rate-row .sw > .star, .rate-row .sw .sf .star { width: 36px; height: 36px; }
.rate-row .sw { transition: transform .1s; }
.rate-row .half { position: absolute; top: 0; height: 100%; width: 50%; cursor: pointer; z-index: 1; }
.rate-row .half.l { left: 0; border-radius: 6px 0 0 6px; }
.rate-row .half.r { right: 0; border-radius: 0 6px 6px 0; }
.rate-row .half input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-row .half:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.rate-row .sw:hover { transform: scale(1.08); }
.rate-hint { margin: 2px 0 6px; font-size: .8rem; }

/* staged changes */
.unsaved-note { color: var(--ink); font-weight: 600; font-size: .88rem; background: var(--moon-soft); border: 1px solid var(--moon); border-radius: 999px; padding: 2px 10px; align-self: center; }
.unsaved-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--moon-soft); color: var(--ink); border: 1px solid var(--moon); margin-left: 6px; vertical-align: 1px; }
.unsaved-tag.warn { background: color-mix(in srgb, var(--urgent) 14%, transparent); border-color: var(--urgent); }
tr.row-changed td { background: color-mix(in srgb, var(--moon) 14%, transparent) !important; }
tr.row-changed td:first-child { box-shadow: inset 3px 0 0 var(--moon); }
.removing > .tc-person b, .removing .tc-head .tc-lead b, li.removing b, .invite-list li.removing b { text-decoration: line-through; opacity: .7; }
.team-card.removing { opacity: .75; border-style: dashed; }
.team-card.pending { border-style: dashed; border-color: var(--moon); }
.tc-members li.pending { outline: 1px dashed var(--moon); outline-offset: -1px; border-radius: 8px; }
.invite-list li.removing { opacity: .75; }
form.form-dirty { box-shadow: inset 3px 0 0 var(--moon); }
.feedback-list a.no-link { cursor: default; }
.feedback-list a.no-link:hover { border-color: var(--line); background: transparent; }

/* team hierarchy */
.team-switch { margin: 0 0 14px; flex-wrap: wrap; }
.team-group { font-size: .9rem; margin: 14px 0 6px; color: var(--ink); }
.team-group:first-of-type { margin-top: 2px; }
.lead-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--moon-soft); color: var(--ink); border: 1px solid var(--moon); margin-left: 4px; vertical-align: 1px; }
.reports-to { font-size: .8rem; }
.mc-name .lead-tag { justify-self: start; margin: 3px 0 0; }
.tc-person .lead-tag { align-self: flex-start; justify-self: start; width: auto; margin: 3px 0 0; }

/* teams: roles and reporting lines */
.tc-settings { display: flex; gap: 12px; flex-wrap: wrap; margin: 2px 0 10px; }
.tc-settings label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--muted); flex: 1 1 140px; }
.tc-settings select { font-size: .88rem; padding: 6px 8px; }
.title-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; color: var(--ink); }
.title-tag.manager { background: var(--moon-soft); border: 1px solid var(--moon); }
.title-tag.lead { background: color-mix(in srgb, var(--normal, #3f6aa6) 16%, transparent); border: 1px solid var(--normal, #3f6aa6); }
.team-card.title-manager { border-top: 3px solid var(--moon); }
.team-card.title-lead { border-top: 3px solid var(--normal, #3f6aa6); }
.team-card.changed { box-shadow: 0 0 0 2px var(--moon); }
.team-card[data-depth="1"] { margin-left: 0; }
.tc-subs { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.tc-subs .ico { width: 14px; height: 14px; }

.title-tag.president { background: color-mix(in srgb, var(--good, #2e8b57) 18%, transparent); border: 1px solid var(--good, #2e8b57); }
.team-card.title-president { border-top: 3px solid var(--good, #2e8b57); }

/* On Hold */
.moon.on_hold .lit { fill: var(--warn, #c98a00); }
.moon.on_hold .ring { stroke: var(--warn, #c98a00); }
.hold-bar { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--warn, #c98a00); background: color-mix(in srgb, var(--warn, #c98a00) 12%, transparent); border-radius: var(--radius-m); padding: 11px 14px; margin: 0 0 14px; }
.hold-bar p { margin: 0; }
.hold-ico .moon { width: 22px; height: 22px; flex: none; }
.hold-fields { border-left: 3px solid var(--warn, #c98a00); padding: 4px 0 2px 12px; margin: 0 0 12px; }
.repair-fields { background: var(--paper); border-radius: var(--radius-s); padding: 8px 10px; margin: 0 0 10px; }
.repair-fields .check { font-weight: 600; margin-bottom: 6px; }
.linked-box { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 14px; margin: 0 0 14px; background: var(--surface); }
.linked-box h3 { margin: 0 0 6px; font-size: .92rem; }
.linked-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.linked-box li { font-size: .92rem; line-height: 1.6; }
.linked-box li .status { margin-left: 4px; display: inline-flex; vertical-align: -2px; }
.loaner-check { margin-top: 8px; }

/* manual parent / child links */
.linked-box.editable { display: flex; flex-direction: column; gap: 10px; }
.link-group { display: flex; flex-direction: column; gap: 5px; }
.link-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: none; }
.link-item { font-size: .92rem; line-height: 1.6; display: flex; align-items: center; gap: 8px; }
.link-text { flex: 1; min-width: 0; }
.link-item .btn { margin-left: auto; }
.link-item .status { margin-left: 4px; display: inline-flex; vertical-align: -2px; }
.link-picker { display: flex; gap: 6px; }
.link-picker input { flex: 1; min-width: 0; padding: 6px 10px; font-size: .9rem; }
.linked-box.editable .quiet { margin: 0; font-size: .88rem; }

/* time tracking */
.time-box { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0 0 14px; background: var(--surface); }
.time-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.time-head h3, .time-box > h3 { margin: 0; font-size: .95rem; }
.time-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 10px 0 6px; }
.time-stats > div { background: var(--paper); border-left: 3px solid var(--night-2); border-radius: var(--radius-s); padding: 7px 10px; display: flex; flex-direction: column; }
.time-stats > div.warn { border-left-color: var(--moon); }
.time-stats b { font-size: 1.05rem; }
.time-stats span { color: var(--muted); font-size: .76rem; }
.time-hint { margin: 0 0 8px; font-size: .8rem; }
.time-form { background: var(--paper); border-radius: var(--radius-s); padding: 10px 12px; margin: 0 0 10px; }
.time-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.tl-dur span { display: flex; align-items: center; gap: 5px; }
.tl-dur input { width: 64px; }
.time-form .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.time-form .actions .hint { margin: 0; }
.time-table td { vertical-align: top; }
.tl-note { white-space: normal; min-width: 140px; }
.tl-actions { white-space: nowrap; }
.tl-actions .btn { margin-left: 4px; }
.tl-chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.tl-chip.pending { background: var(--moon-soft); border-color: var(--moon); color: var(--ink); }
.tl-chip.approved { background: color-mix(in srgb, var(--good, #2e8b57) 15%, transparent); border-color: var(--good, #2e8b57); color: var(--ink); }
.tl-chip.rejected { background: color-mix(in srgb, var(--urgent) 14%, transparent); border-color: var(--urgent); color: var(--ink); }
tr.tl-rejected td { opacity: .7; }

.approvals .decide { display: flex; gap: 4px; }
.approvals .btn.on-approve { background: var(--good, #2e8b57); border-color: var(--good, #2e8b57); color: #fff; }
.approvals .btn.on-reject { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.approvals tr.staged-approve td { background: color-mix(in srgb, var(--good, #2e8b57) 9%, transparent); }
.approvals tr.staged-reject td { background: color-mix(in srgb, var(--urgent) 9%, transparent); }
.reject-reason { margin-top: 5px; width: 100%; min-width: 170px; padding: 5px 8px; font-size: .86rem; }

/* dashboard work hours */
.wh-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.wh-stats > div { background: var(--paper); border-left: 3px solid var(--night-2); border-radius: var(--radius-s); padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.wh-stats > div.warn { border-left-color: var(--moon); }
.wh-stats b { font-size: 1.25rem; }
.wh-stats span { color: var(--muted); font-size: .8rem; }
.wh-lookup label { font-weight: 700; display: block; margin-bottom: 5px; }
.wh-lookup .link-picker { max-width: 640px; }
.wh-card { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; max-width: 820px; }
.wh-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wh-card-head .quiet { margin-left: auto; font-size: .85rem; }
.wh-bar { display: grid; grid-template-columns: 210px 1fr 90px; align-items: center; gap: 10px; margin: 6px 0; font-size: .9rem; }
.wh-bar b { text-align: right; }
.wh-track { height: 12px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.wh-fill { display: block; height: 100%; border-radius: 6px; transition: width .4s ease; }
.wh-fill.logged { background: var(--good, #2e8b57); }
.wh-fill.pending { background: var(--moon); }
.wh-fill.active { background: var(--night-2); }
.wh-fill.ticket { background: var(--normal, #3f6aa6); opacity: .65; }
.wh-fill.paused { background: #8e5bb8; opacity: .7; }
@media (max-width: 640px) { .wh-bar { grid-template-columns: 1fr 70px; } .wh-bar .wh-track { grid-column: 1 / -1; grid-row: 2; } }
.wh-fill { width: 0; }

.time-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.time-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.tl-main { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: .92rem; }
.tl-main .tl-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.time-list .tl-note { color: var(--ink); font-size: .9rem; margin-top: 3px; }
.time-list li.tl-rejected { opacity: .75; }
.wh-card-head .status .moon { width: 16px; height: 16px; }

/* copyright */
.content-col { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.content-col > .view { flex: 1; }
.app-footer { padding: 14px clamp(16px, 3vw, 40px) 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.5; }
.app-footer p { margin: 0; max-width: 1100px; }
.app-footer b, .copyright b { color: var(--ink); font-weight: 600; }
.guest-footer { text-align: center; }
.guest-footer p { margin: 0 auto; }
.copyright { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; line-height: 1.5; }
@media print { .app-footer { border: 0; } }

.team-tabs { margin: 0 0 14px; }
.rel-tag { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.rel-tag.direct { color: var(--ink); font-weight: 600; }
.approvals td a { white-space: nowrap; }

/* email signature */
.profile-link { display: block; margin: 6px 0 2px; color: var(--moon) !important; font-size: .85rem; }
.sig-preview { width: 100%; height: 330px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.ext-row { display: flex; align-items: center; gap: 8px; }
.ext-row input { max-width: 120px; }
.brand-row { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; gap: 8px; margin-bottom: 6px; }
@media (max-width: 640px) { .brand-row { grid-template-columns: 1fr; } }

/* ---------- AI assistant ---------- */
.ai-help { border: 1px dashed var(--night-2); border-radius: var(--radius-m); padding: 10px 12px; margin: -4px 0 16px; background: color-mix(in srgb, var(--night-2) 4%, transparent); }
.ai-help-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-help-head .hint { margin: 0; }
.ai-btn { display: inline-flex; align-items: center; gap: 6px; }
.ai-btn .ico, .ai-chat-btn .ico { width: 18px; height: 18px; color: var(--moon); }
.ai-card { margin-top: 10px; }
.ai-card h4 { margin: 10px 0 4px; font-size: .9rem; }
.ai-card ol, .ai-card ul { margin: 0 0 4px 18px; padding: 0; }
.ai-card li { margin: 3px 0; }
.ai-suggest-row { display: flex; gap: 8px 22px; flex-wrap: wrap; align-items: center; }
.ai-suggest-row .btn, .ai-subject .btn { margin-left: 4px; }
.ai-subject { margin: 8px 0 0; }
.ai-security { border: 1px solid var(--urgent); background: color-mix(in srgb, var(--urgent) 10%, transparent); border-radius: var(--radius-s); padding: 8px 10px; margin-bottom: 8px; }
.ai-disclaimer { font-size: .76rem; color: var(--muted); margin: 10px 0 0; }
.ai-error { color: var(--urgent); margin: 8px 0 0; }
.ai-note { background: var(--moon-soft); border-left: 3px solid var(--moon); padding: 8px 12px; border-radius: var(--radius-s); }
.ai-thinking { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); margin: 6px 0 0; }
.ai-thinking span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: aidot 1s infinite ease-in-out; }
.ai-thinking span:nth-child(2) { animation-delay: .15s; } .ai-thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes aidot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ai-thinking span { animation: none; opacity: .6; } }
/* chat bubble + panel, bottom-right */
.ai-chat-btn { position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  background: var(--night); color: #fff; border: 0; border-bottom: 3px solid var(--moon); border-radius: 999px; padding: 12px 18px 11px; font: inherit; font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 26, 60, .28); cursor: pointer; }
.ai-chat-btn:hover { filter: brightness(1.08); }
.ai-chat-btn.on span { display: none; }
.ai-chat { position: fixed; right: 22px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 48px rgba(20, 26, 60, .3); overflow: hidden; }
.ai-chat[hidden] { display: none; }
.ai-chat > header { display: flex; align-items: center; justify-content: space-between; background: var(--night); color: #fff; padding: 12px 14px; border-bottom: 3px solid var(--moon); }
.ai-chat > header b { display: block; }
.ai-chat > header small { opacity: .8; font-size: .78rem; }
.ai-chat-x { background: none; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.ai-chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.ai-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: .9rem; line-height: 1.45; }
.ai-msg p { margin: 0; } .ai-msg p + p { margin-top: 6px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg.me { align-self: flex-end; background: var(--night); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.err { border-color: var(--urgent); color: var(--urgent); }
.ai-chat-actions { display: flex; gap: 6px; padding: 8px 12px 0; }
.ai-chat-form { display: flex; gap: 8px; padding: 8px 12px; align-items: flex-end; }
.ai-chat-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px; padding: 9px 10px; font: inherit; font-size: .92rem; }
.ai-chat-foot { margin: 0; padding: 0 12px 10px; font-size: .72rem; color: var(--muted); }
@media print { .ai-chat-btn, .ai-chat { display: none !important; } }

/* how a request was received */
.channel-field #channel-note { margin-top: 8px; width: 100%; }
.channel-field select:disabled { opacity: .6; cursor: not-allowed; }
.channel-tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }

.ai-conn-state { margin: 4px 0 14px; }
.mt-6 { margin-top: 6px; }
#ai-conn .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* AI connection status */
.ai-status { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: var(--radius-m); padding: 12px 14px; margin: 4px 0 16px; background: var(--paper); }
.ai-status.tone-ok { border-left-color: var(--good, #2e8b57); }
.ai-status.tone-bad { border-left-color: var(--urgent); background: color-mix(in srgb, var(--urgent) 6%, var(--paper)); }
.ai-status-head { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.ai-status-head .btn { margin-left: auto; }
.ai-status-lead { margin: 6px 0 10px; }
.ai-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 18px; margin: 0; }
.ai-status-grid dt { font-size: .76rem; font-weight: 700; color: var(--muted); }
.ai-status-grid dd { margin: 2px 0 0; font-size: .9rem; }
.ai-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.tone-ok .ai-dot { background: var(--good, #2e8b57); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good, #2e8b57) 22%, transparent); }
.tone-bad .ai-dot { background: var(--urgent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--urgent) 22%, transparent); }
.tone-idle .ai-dot { background: var(--muted); }
.subnav a .ai-dot { width: 8px; height: 8px; margin-left: 4px; vertical-align: 1px; box-shadow: none; }

/* who a new request is for */
.for-who { margin: 0 0 6px; }
.for-who a { margin-left: 6px; font-size: .9rem; }
.for-who-chip { display: inline-block; margin-left: 8px; font-size: .78rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--moon-soft); border: 1px solid var(--moon); color: var(--ink); vertical-align: 1px; }

/* My Tickets */
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--moon); color: var(--night); font-size: .74rem; font-weight: 700; text-align: center; line-height: 18px; }
.nav-count.warn { background: var(--urgent); color: #fff; }
.my-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-head input[type=search] { max-width: 280px; }
.empty-note { padding: 14px 4px; }
.my-charts { margin-bottom: 18px; }

.tt-options { display: grid; gap: 10px; margin: 6px 0 12px; }
.tt-opt small { display: block; margin-top: 3px; }

/* progress line: a step the request moved past without using (On Hold) */
.stepper li.skipped::before { background: var(--moon); }
.stepper li.skipped .moon { opacity: .45; }
.stepper li.skipped > span { text-decoration: line-through; opacity: .7; }
.track-steps li.skipped { text-decoration: line-through; opacity: .55; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.track-steps li.skipped::after { background: var(--moon); }
.track-steps li.skipped::before { border-style: dashed; }

/* positions (separate from access) */
.pos-select { font-size: .82rem; padding: 3px 6px; margin-left: auto; max-width: 170px; }
.tc-members li.pos-changed { box-shadow: inset 3px 0 0 var(--moon); }
.role-pill.pos-pill { background: var(--moon); color: var(--night); border-color: var(--moon); }

/* Super Admin */
.super-banner { border: 1px solid var(--moon); background: var(--moon-soft); border-radius: var(--radius-m); padding: 10px 14px; margin: 0 0 14px; font-size: .9rem; }
.super-panel { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0 0 14px; background: var(--paper); }
.super-panel h3 { margin: 0 0 4px; font-size: .95rem; }
.super-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.super-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.super-list li .btn { margin-left: auto; }
.super-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--night); color: #fff; vertical-align: 1px; }
.role-pill.super-pill { background: var(--night); color: var(--moon); border-color: var(--moon); }
#super-form { display: flex; gap: 8px; align-items: center; max-width: 560px; }
#super-form input { flex: 1; min-width: 0; }
.tl-edited { color: var(--warn, #c98a00); }

/* sign-in: the two options side by side (stacked only when the card is too narrow) */
.login-card { container-type: inline-size; }
.login-options { display: flex; flex-direction: column; max-width: 820px; }
.login-option { display: flex; flex-direction: column; }
.login-option .login-help { margin-top: 12px; }
.login-card .login-options .ms-btn { min-width: 0; width: 100%; max-width: 340px; }
@container (min-width: 470px) {
  .login-options { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); column-gap: clamp(14px, 2.2vw, 40px); align-items: start; }
  .login-options .login-or { flex-direction: column; justify-content: center; align-self: stretch; margin: 0; gap: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .login-options .login-or::before, .login-options .login-or::after { width: 1px; height: auto; flex: 1; min-height: 14px; }
  .login-option .login-help { max-width: none; }
  .login-options .ms-btn { white-space: nowrap; padding-inline: 14px; font-size: .9rem; gap: 9px; }
}
/* a little less padding on the sign-in card, so the two options fit side by side on common laptop screens */
.login-card { padding: clamp(28px, 5vw, 80px); }
.login-options .ms-btn svg { flex: none; } /* the Microsoft and guest icons never shrink away */
.mgr-note { font-size: .82rem; margin-left: 4px; }
#email-form .grid-2 { align-items: start; }

/* Admin Center: settings as tiles */
.tile-group { margin: 0 0 22px; }
.tile-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.set-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.set-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s; }
.set-tile:hover, .set-tile:focus-visible { border-color: var(--moon); box-shadow: 0 4px 14px rgba(42, 53, 119, .10); transform: translateY(-1px); }
.st-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--moon-soft); color: var(--night); }
.st-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.st-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-text b { font-size: .98rem; display: inline-flex; align-items: center; gap: 7px; }
.st-text small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.set-tile .ai-dot, .admin-title .ai-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.set-tile.tone-ok .ai-dot, .admin-title.tone-ok .ai-dot { background: var(--good, #2e8b57); }
.set-tile.tone-bad .ai-dot, .admin-title.tone-bad .ai-dot { background: var(--bad, #c0392b); }
.set-tile.tone-idle .ai-dot, .admin-title.tone-idle .ai-dot { background: var(--muted); }
.admin-title { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.admin-title .ai-dot { width: 11px; height: 11px; }
.tag-new { display: inline-block; font-size: .7rem; font-weight: 600; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--moon-soft); color: var(--ink); vertical-align: 1px; }

/* a tile with live status and actions (Directory Sync) */
.set-tile.st-live { cursor: default; }
.st-link { color: inherit; text-decoration: none; }
.st-link:hover b, .st-link:focus-visible b { text-decoration: underline; }
.st-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.set-tile.st-live.tone-bad { border-color: color-mix(in srgb, var(--bad, #c0392b) 45%, var(--line)); }
.set-tile.st-pulse { box-shadow: 0 0 0 3px var(--moon-soft); }

/* My Team → Assigned Work */
.work-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2.2fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .work-grid { grid-template-columns: 1fr; } }
.work-members { list-style: none; margin: 8px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.work-members button { width: 100%; display: grid; grid-template-columns: 1fr repeat(4, 58px); gap: 6px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; }
.work-members button[aria-pressed="true"] { border-color: var(--moon); box-shadow: inset 3px 0 0 var(--moon); }
.wm-name { display: flex; flex-direction: column; min-width: 0; }
.wm-name small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-n { display: flex; flex-direction: column; align-items: center; background: var(--bg-soft, #f3f4f8); border-radius: 8px; padding: 4px 0; }
.wm-n small { font-size: .7rem; color: var(--muted); }
.wm-n.bad b { color: var(--bad, #c0392b); } .wm-n.warn b { color: var(--warn, #b7791f); } .wm-n.good b { color: var(--good, #2e8b57); }
.work-table td { vertical-align: top; }
.work-subj { display: block; color: var(--muted); font-size: .86rem; }
.work-table tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad, #c0392b); }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-soft, #eef0f5); color: var(--ink); }
.chip-bad { background: color-mix(in srgb, var(--bad, #c0392b) 15%, transparent); color: var(--bad, #c0392b); }
.chip-warn { background: color-mix(in srgb, var(--warn, #b7791f) 18%, transparent); color: var(--warn, #b7791f); }
.chip-ok { background: color-mix(in srgb, var(--good, #2e8b57) 14%, transparent); color: var(--good, #2e8b57); }

/* Assigned Work: engineers across the top, tickets full width below */
.work-grid { grid-template-columns: 1fr !important; }
.work-members { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.work-members button { grid-template-columns: repeat(4, 1fr) !important; }
.work-members .wm-name { grid-column: 1 / -1; margin-bottom: 4px; }
.work-table td:first-child a { white-space: nowrap; }
.work-table td:nth-child(2), .work-table td:last-child { white-space: nowrap; }
.rep-charts { margin: 6px 0 16px; }

/* sidebar logo: the full-colour logo on a white panel */
.brand .brand-panel { display: block; background: #ffffff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.brand .brand-panel img { max-width: 100% !important; width: 100%; }
@media (max-width: 760px) { .brand .brand-panel { max-width: 200px; padding: 8px 10px; } }

/* sidebar: scrolls when it doesn't fit, so Sign Out (and everything else) is always reachable */
.rail { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); border-radius: 3px; }
.brand .brand-panel { padding: 7px 10px; }

/* Admin Center tile icons in dark mode: yellow on a soft yellow square (navy disappeared on dark tiles) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-ico { color: var(--moon); background: rgba(252, 205, 13, .14); } }
:root[data-theme="dark"] .st-ico { color: var(--moon); background: rgba(252, 205, 13, .14); }

/* report charts: Bar / Pie switch */
.chart-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin-left: auto; margin-right: 8px; background: var(--paper); }
.chart-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.chart-switch button[aria-pressed="true"] { background: var(--night); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chart-switch button[aria-pressed="true"] { background: var(--moon); color: #12205f; } }
:root[data-theme="dark"] .chart-switch button[aria-pressed="true"] { background: var(--moon); color: #12205f; }
.chart-panel .panel-head { align-items: flex-start; }
/* chart titles stay on one line; the Bar / Pie switch moves under the title when the panel is narrow */
.rep-charts .chart-panel .panel-head { flex-wrap: wrap; row-gap: 8px; }
.rep-charts .chart-panel .panel-head h2 { white-space: nowrap; }
.rep-charts .chart-panel .panel-head > div:first-child { flex: 1 0 auto; }

/* Theme colours used by newer screens (Assigned Work, tiles, chips): defined for light and dark */
:root { --bg-soft: #eef0f5; --good: #2e8b57; --warn: #b7791f; --bad: #c0392b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg-soft: #262e66; --good: #4cc38a; --warn: #f5b54a; --bad: #f2786a; } }
:root[data-theme="dark"] { --bg-soft: #262e66; --good: #4cc38a; --warn: #f5b54a; --bad: #f2786a; }

/* people picker (Microsoft 365 directory search) */
.pp-wrap { position: relative; flex: 1; min-width: 0; }
.pp-wrap > input { width: 100%; }
.pp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 10px 26px rgba(20, 24, 60, .18); max-height: 300px; overflow-y: auto; }
.pp-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pp-list li small { color: var(--muted); font-size: .8rem; }
.pp-list li.active, .pp-list li:hover { background: var(--bg-soft); }
.pp-list li.pp-none { cursor: default; color: var(--muted); font-size: .86rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pp-list { background: #12205f; } }
:root[data-theme="dark"] .pp-list { background: #12205f; }
.pp-list { right: auto; width: max(100%, 360px); max-width: min(480px, 90vw); }
.pp-list { width: max-content; min-width: max(100%, 300px); max-width: min(520px, 92vw); }
.pp-list li small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move-note { display: block; font-size: .8rem; }

/* Sign out everywhere, audit log, guest link */
.who .signout-all { font-size: .8rem; opacity: .85; }
.audit-table td { vertical-align: top; }
.audit-table pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; margin: 4px 0; max-height: 220px; overflow: auto; }
.audit-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gl-url { width: 100%; margin-top: 6px; font-size: .8rem; }

/* Backups: settings and delete */
.bk-settings { margin: 16px 0 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); }
.bk-settings h2 { margin-top: 0; }
.bk-actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }
/* Sign out everywhere: its own line under Sign Out */
.who .signout-all { display: block; margin-top: 6px; }

/* Data retention */
.ret-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 8px 0 4px; }
.ret-now { margin: 12px 0 14px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-soft); }
.ret-preview { margin: 6px 0 0; padding-left: 18px; }
.ret-preview li { margin: 2px 0; }
.ret-grid .field > label { min-height: 2.7em; display: flex; align-items: flex-end; }
/* align the three retention fields row by row (label, dropdown, hint), however the labels wrap */
.ret-grid { grid-template-rows: auto auto auto; row-gap: 6px; }
.ret-grid .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; margin: 0; }
.ret-grid .field > label { min-height: 0; align-items: flex-end; }

/* amber "attention" state (e.g. weekly backup download due) */
.tone-warn .ai-dot, .set-tile.tone-warn .ai-dot, .admin-title.tone-warn .ai-dot { background: var(--warn, #b7791f); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn, #b7791f) 22%, transparent); }
.bk-due { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 14px 0; padding: 12px 14px;
  border-radius: var(--radius-m); border: 1px solid color-mix(in srgb, var(--warn, #b7791f) 55%, var(--line)); background: color-mix(in srgb, var(--warn, #b7791f) 10%, transparent); }
.bk-due > div { flex: 1 1 320px; }
.bk-ok { margin: 12px 0; }
.bk-due { border-left: 4px solid var(--warn, #b7791f); background: color-mix(in srgb, var(--warn, #b7791f) 16%, transparent); }

/* ---------- Phones ---------- */
.menu-toggle { display: none; }
@media (max-width: 760px) {
  /* compact header: logo, New Request, Menu, dark mode; the menu opens below */
  .rail { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; max-height: 100vh; overflow-y: auto; }
  .brand { order: 1; margin: 0; flex: 0 1 auto; }
  .brand .brand-panel { max-width: 118px; padding: 5px 8px; }
  .rail .new-btn { order: 2; margin-left: auto; padding: 8px 12px; width: auto; }
  .menu-toggle { order: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
  .menu-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
  .theme-toggle { order: 4; }
  .rail .nav, .rail .who { display: none; }
  .rail.menu-open .nav { display: flex; order: 5; flex: 1 1 100%; flex-direction: column; flex-wrap: nowrap; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); }
  .rail.menu-open .nav a { padding: 11px 10px; }
  .rail.menu-open .nav-sep, .rail.menu-open .nav-head { display: block; }
  .rail.menu-open .who { display: flex; order: 6; flex: 1 1 100%; flex-direction: column; align-items: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 12px; margin: 0; border-top: 1px solid rgba(255,255,255,.14); }
  .rail.menu-open .who span { display: inline-flex; max-width: 100%; overflow-wrap: anywhere; }
  .rail.menu-open .who a { display: block; padding: 6px 0; }

  /* tab bars scroll sideways inside their own row instead of widening the page */
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > * { flex: 0 0 auto; white-space: nowrap; }
  .panel-head, .page-head, .queue-head { min-width: 0; }

  /* dashboard: the single column fits the screen; long headers wrap */
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > * { min-width: 0; }
  .dash-grid .panel-head { flex-wrap: wrap; }
  .dash-grid .panel-head > * { min-width: 0; }

  /* reports: export buttons wrap onto a second line */
  .export-bar { flex: 1 1 100%; min-width: 0; }
}

@media (max-width: 760px) {
  /* report export buttons: the bar takes the full width and wraps (beats the desktop "never shrink" rule) */
  .panel-head .dash-actions, .panel-head .dash-actions.export-bar { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  /* one-row header: the dark-mode switch lives inside the menu on phones */
  .rail .brand .brand-panel { max-width: 104px; }
  .rail > .theme-toggle { display: none; }
  .rail.menu-open > .theme-toggle { display: inline-flex; order: 7; margin-top: 4px; }
}
@media (max-width: 760px) {
  .rail { gap: 8px; }
  .rail .brand .brand-panel { max-width: 92px; padding: 4px 6px; }
  .rail .new-btn { padding: 8px 10px; font-size: .9rem; white-space: nowrap; }
  .menu-toggle { padding: 0 10px; }
}
@media (max-width: 380px) { .menu-toggle span { display: none; } .menu-toggle { padding: 0 9px; } }
/* fieldsets never shrink below their content by default: let them, and let long role names wrap */
fieldset { min-width: 0; min-inline-size: 0; }
.member-row .field label.check { overflow-wrap: anywhere; }
@media (max-width: 760px) { .member-row { flex-wrap: wrap; } .member-row > .field { flex: 1 1 100%; } }
/* long role names wrap instead of running off the screen */
fieldset label.check { white-space: normal; }
@media (max-width: 760px) {
  /* request page and team cards: their single column fits the screen */
  .t-grid { grid-template-columns: minmax(0, 1fr); }
  .t-grid > * { min-width: 0; }
  .team-card { grid-template-columns: minmax(0, 1fr); }
  .team-card > * { min-width: 0; }
  .team-card .tc-head, .team-card .tc-settings { flex-wrap: wrap; }
}
/* role checkboxes: long custom role names wrap (overrides the nowrap above) */
.role-ticks .check { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  /* team member rows: the Remove button wraps under the name on narrow phones */
  .tc-members li { flex-wrap: wrap; min-width: 0; }
  .tc-members li > * { min-width: 0; overflow-wrap: anywhere; }
}

/* ---------- All Apps (the launcher after sign-in) ---------- */
:root { --app-ico-fg: #0d1747; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --app-ico-fg: #fdb902; } }
:root[data-theme="dark"] { --app-ico-fg: #fdb902; }
.start { max-width: 720px; margin: 7vh auto 0; text-align: center; }
.start h1 { margin-bottom: 4px; }
.start-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 28px auto 0; }
.start-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 34px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--ink); font: inherit; text-decoration: none; text-align: center; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.start-card:hover, .start-card:focus-visible { transform: translateY(-2px); border-color: var(--moon, #fdb902); box-shadow: 0 10px 26px rgba(20,24,60,.14); }
.start-card b { font-size: 1.3rem; overflow-wrap: anywhere; }
.start-card > span:last-child { color: var(--muted); }
.start-ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--moon-soft, #fff4c2); color: var(--app-ico-fg); }
.start-ico svg { width: 28px; height: 28px; }
/* the Coming Soon tile: the brand night blue with a moon glow, so it reads as something to look forward to */
.start-card.teaser { border-color: transparent; color: #fff; background: radial-gradient(120% 90% at 85% 0%, rgba(252,205,13,.35), transparent 55%), linear-gradient(150deg, #1c2e93, #12205f 70%); }
.start-card.teaser > span:last-child { color: rgba(255,255,255,.82); }
.start-card.teaser .start-ico { background: var(--moon, #fdb902); color: #0d1747; }
.start-card.teaser:hover, .start-card.teaser:focus-visible { border-color: var(--moon, #fdb902); box-shadow: 0 12px 30px rgba(42,53,119,.45); }
@media (max-width: 560px) { .start-cards { grid-template-columns: minmax(0, 1fr); gap: 12px; } .start-card { padding: 24px 16px; } .start { margin-top: 3vh; } }

.soon-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--moon, #fdb902); color: #0d1747; font-weight: 700; white-space: nowrap; }
.soon-badge.big { font-size: .95rem; padding: 6px 18px; box-shadow: 0 6px 18px rgba(15,20,60,.3); }

/* the teaser window */
.teaser-dlg { border: 0; border-radius: 20px; padding: 0; width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface, #fff); color: var(--ink); box-shadow: 0 30px 80px rgba(10,14,40,.45); }
.teaser-dlg::backdrop { background: rgba(10,14,40,.65); }
.teaser-art { position: relative; height: 330px; overflow: hidden; background: #12205f; }
.pv-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; user-select: none; pointer-events: none; }
.pv-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pv-light { display: none; } :root:not([data-theme="light"]) .pv-dark { display: block; } }
:root[data-theme="dark"] .pv-light { display: none; } :root[data-theme="dark"] .pv-dark { display: block; }
.teaser-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; background: linear-gradient(180deg, rgba(20,24,61,.15), rgba(20,24,61,.55)); }
.teaser-kicker { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4vw, 2.1rem); line-height: 1.15; color: #fff; text-shadow: 0 2px 14px rgba(10,14,40,.6); }
.teaser-body { padding: 20px 26px 24px; }
.teaser-body h2 { margin: 0 0 8px; font-size: 1.35rem; }
.teaser-body p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; max-width: 64ch; }
.teaser-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
@media (max-width: 560px) { .teaser-art { height: 210px; } .teaser-body { padding: 16px; } .teaser-cta .btn { flex: 1 1 100%; justify-content: center; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .start-card { transition: none; } .start-card:hover { transform: none; } }

/* Start / Stop timer on a request */
.time-head-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; } .tl-timer { display: inline-flex; align-items: center; gap: 8px; }
.tl-run { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; } .tl-run i { width: 9px; height: 9px; border-radius: 50%; background: #e05a5a; animation: tl-blink 1.2s infinite; }
@keyframes tl-blink { 50% { opacity: .25; } } @media (prefers-reduced-motion: reduce) { .tl-run i { animation: none; } }
.tl-s-wide { flex: 2 1 260px; grid-column: span 2; } .tl-s-extra { display: grid; gap: 6px; margin: 4px 0 8px; }
@media (max-width: 600px) { .tl-s-wide { grid-column: auto; } }

/* ---- 1.0.1: bell, notifications, announcements, My Account, Staff Adoption, Install App, contact the requester ---- */
.bell-btn { position: fixed; top: 14px; right: 160px; z-index: 30; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 2px 10px rgba(20, 28, 70, .10); }
.bell-btn svg { width: 18px; height: 18px; }
.bell-btn:hover { border-color: var(--muted); } .bell-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bell-count, .start-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #d64032; color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.start-badge { top: 12px; right: 12px; min-width: 22px; height: 22px; line-height: 22px; font-size: .78rem; }
.nav-count.nav-alert { background: #d64032; color: #fff; }
@media (max-width: 760px) {
  .bell-btn { position: relative; top: auto; right: auto; order: 2; margin-left: auto; width: 36px; height: 36px; box-shadow: none; border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
  .rail > .theme-toggle { margin-left: 6px; }
}
.bell-pop { position: fixed; z-index: 60; width: min(380px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(20, 24, 60, .25); padding: 10px; }
.bell-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bell-pop-head span { display: inline-flex; gap: 6px; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li a { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.notif-list li a:hover, .notif-list li a:focus-visible { background: var(--sel-bg, rgba(127,127,127,.1)); }
.notif-list li.unread a { background: rgba(252, 205, 13, .10); } .notif-list li.unread b::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d64032; margin-left: 6px; vertical-align: middle; }
.notif-list li > a > span:last-child { display: grid; gap: 2px; min-width: 0; } .notif-text { overflow-wrap: anywhere; color: var(--muted); font-size: .9rem; }
.notif-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sel-bg, rgba(127,127,127,.12)); } .notif-ico svg { width: 15px; height: 15px; }
.ann-form { display: grid; gap: 12px; max-width: 720px; } .ann-form label { display: grid; gap: 6px; font-weight: 600; } .ann-form textarea { width: 100%; }
.ann-list { list-style: none; margin: 0; padding: 0; } .ann-list li a { display: grid; gap: 2px; padding: 10px 8px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.ann-list li.unread a b::after { content: ' •'; color: #d64032; } .ann-snip { color: var(--muted); overflow-wrap: anywhere; } .ann-body { line-height: 1.6; overflow-wrap: anywhere; }
.acc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; } .acc-tabs a { padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; text-decoration: none; }
.acc-tabs a[aria-current="page"] { background: var(--moon, #fdb902); border-color: var(--moon, #fdb902); color: #0d1747; }
.acc-radios { display: flex; gap: 18px; }
.install-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; } .install-btn svg, .contact-btns svg, .acc-tabs svg { width: 14px; height: 14px; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .contact-btns .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ad-tiles > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; background: var(--surface); }
.ad-tiles > div.ok { border-left-color: #2f9e5a; } .ad-tiles > div.warn { border-left-color: #e0a100; } .ad-tiles b { font-size: 1.4rem; } .ad-tiles span { color: var(--muted); font-size: .86rem; }
.ad-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; } .ad-bar .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.table-wrap { overflow-x: auto; } .ad-table td { vertical-align: top; }
.ad-tpl { display: grid; gap: 10px; } .ad-tpl label, .ad-set label { display: grid; gap: 6px; font-weight: 600; } .ad-tpl input, .ad-tpl textarea { width: 100%; }

/* Notifications → All: cleared items, shown quietly */
.notif-list li.cleared { opacity: .62; } .notif-list li.cleared b::after { content: ' · cleared'; font-weight: 400; color: var(--muted); font-size: .82em; }

/* ---- sections of the open app as small tiles at the top (as on the test site) ---- */
/* ---- 1.2.17: the workspace's sections as small tiles that wrap (no scroll bars), below the top-right controls ---- */
.subnav {
  position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  overflow: visible; scrollbar-width: none;
  margin: 60px 0 0; padding: 0 clamp(12px, 3vw, 28px) 14px;
  background: transparent; border-bottom: 1px solid var(--line);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  min-height: 36px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface, transparent);
  color: var(--muted); font-size: .86rem; font-weight: 600; text-decoration: none;
  border-bottom-width: 1px; margin: 0;
}
.subnav a:hover { color: var(--text, var(--ink)); border-color: var(--moon, #ffbe12); }
.subnav a:focus-visible { outline: 2px solid var(--moon, #ffbe12); outline-offset: 2px; }
.subnav a[aria-current="page"] { background: var(--moon, #ffbe12); border-color: var(--moon, #ffbe12); color: #0d1747; }
.subnav a[aria-current="page"] svg { opacity: 1; }
.subnav a svg { width: 15px; height: 15px; }
.subnav .nav-count { margin-left: 2px; }
.subnav .nav-head { display: inline-flex; align-items: center; min-height: 36px; margin: 0 0 0 6px; padding: 0 2px 0 12px; border-left: 1px solid var(--line); font-size: .68rem; opacity: .8; }
.subnav .nav-head:first-child { margin-left: 0; padding-left: 0; border-left: 0; }
@media (max-width: 760px) {
  /* phones: a grid of small tiles, at least 44px tall, no sideways scrolling */
  .subnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); align-items: stretch; gap: 6px; margin: 10px 0 0; padding: 0 10px 12px; }
  .subnav a { flex-direction: column; gap: 3px; min-height: 52px; min-width: 0; white-space: normal; overflow-wrap: anywhere; justify-content: center; text-align: center; line-height: 1.15; padding: 6px 4px; font-size: .76rem; }
  .subnav a svg { width: 16px; height: 16px; }
  .subnav .nav-head { grid-column: 1 / -1; min-height: 0; margin: 4px 0 -2px; padding: 0; border: 0; }
}
@media (min-width: 761px) { .subnav:not([hidden]) + .view { padding-top: 26px; } }
.subnav .nav-head { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
/* phones: the slim "current section · Sections" bar that stays under the top bar after the tiles scroll away */
.subnav-mini { display: none; }
@media (max-width: 760px) {
  .subnav-mini:not([hidden]) { display: block; position: fixed; top: var(--railh, 0px); left: 0; right: 0; z-index: 39; background: var(--surface, #fff); border-bottom: 1px solid var(--line); box-shadow: 0 4px 12px rgba(10, 13, 35, .18); }
  .snm-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--text, var(--ink)); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
  .snm-cur { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .snm-cur svg { width: 16px; height: 16px; flex: none; }
  .snm-more { flex: none; color: var(--muted); font-size: .82rem; }
  .snm-btn:focus-visible { outline: 2px solid var(--moon, #ffbe12); outline-offset: -2px; }
  .snm-panel:not([hidden]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; padding: 4px 10px 12px; max-height: calc(100vh - var(--railh, 0px) - 60px); overflow-y: auto; }
  .snm-panel a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, transparent); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: center; line-height: 1.15; text-decoration: none; overflow-wrap: anywhere; }
  .snm-panel a[aria-current="page"] { background: var(--moon, #ffbe12); border-color: var(--moon, #ffbe12); color: #0d1747; }
  .snm-panel a svg { width: 16px; height: 16px; }
  .snm-panel .nav-head { grid-column: 1 / -1; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 -2px; }
}
/* 768–900px: filter tabs wrap; dashboard charts and report export buttons stay inside the page (as on the test site) */
.tabs { flex-wrap: wrap; max-width: 100%; overflow: visible; }
.dash-grid > * { min-width: 0; }
.chart-box svg { max-width: 100%; height: auto; }
@media (max-width: 900px) { .panel-head { flex-wrap: wrap; } .panel-head .dash-actions { flex-wrap: wrap; } }
/* side menu alignment (as on the test site): app name centred under the logo; role pills wrap evenly; each link on its own line */
.brand small { text-align: center; padding-left: 0; }
.who .role-pill { margin: 6px 4px 0 0 !important; }
.who .role-pill + .role-pill { margin-left: 0; }
.who > a, .who .signout-all { display: block; width: fit-content; margin-top: 8px; }
.who > a + a { margin-top: 6px; }
.who .install-btn:not([hidden]) { display: inline-flex; margin-top: 10px; }

/* notifications on this device: the one-time offer */
.dn-offer { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 10px 14px; border-radius: 14px; background: var(--surface, #fff); color: var(--ink, #1d2433); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(20,24,60,.25); }

/* User Management */
.um-table td { vertical-align: middle; } .um-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
#um-q { width: 100%; max-width: 420px; margin-bottom: 10px; } .um-del { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.um-dlg { max-width: min(520px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--surface, #fff); color: var(--ink); }
.um-dlg::backdrop { background: rgba(10, 13, 35, .55); } .btn-danger { background: #b42318; color: #fff; border-color: #b42318; }
.table-scroll { overflow-x: auto; } .um-table .pill { display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.um-del li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
/* signatures: the pad, the saved signature, and the sign step on a policy */
.sigpad { display: grid; gap: 10px; max-width: 560px; }
.sig-canvas { width: 100%; aspect-ratio: 3 / 1; background: #fff; border: 1px dashed var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sig-type input, .sig-up input { width: 100%; }
.sig-show { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sig-show img { height: 56px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.sig-show.big img { height: 96px; }
/* signature preview: the signed copy itself (A4 in PDF points, scaled to fit), with a size slider */
.sig-prev { display: grid; gap: 10px; }
.sd-wrap { position: relative; width: 100%; max-width: 595px; overflow: hidden; border-radius: 4px; box-shadow: 0 8px 24px rgba(20,24,60,.18); }
.sd-page { position: absolute; top: 0; left: 0; width: 595px; height: 842px; box-sizing: border-box; padding: 50px; transform-origin: 0 0; background: #fff; color: #1d2433; font-family: Arial, Helvetica, sans-serif; overflow: hidden; }
.sd-bar { position: absolute; top: 0; left: 0; right: 0; height: 8px; background: #1a2b8a; box-shadow: 0 3px 0 #fdb902; }
.sd-logo { width: 150px; height: auto; display: block; margin: 0 0 16px; }
.sd-title { font-weight: 700; font-size: 20px; color: #1a2b8a; } .sd-sub { font-size: 9px; color: #6b7280; margin: 4px 0 14px; }
.sd-rows { width: 100%; border-collapse: collapse; font-size: 10px; } .sd-rows th { text-align: left; color: #6b7280; width: 150px; font-weight: 700; font-size: 9.5px; padding: 3px 0; vertical-align: top; }
.sd-rows td { padding: 3px 0; word-break: break-all; } .sd-rows tr { border-bottom: 0.6px solid #c9cee3; }
.sd-h { font-weight: 700; font-size: 11px; color: #1a2b8a; margin: 12px 0 5px; } .sd-st { font-size: 10px; line-height: 1.35; margin: 0; }
.sd-box { border: 0.8px solid #c9cee3; display: flex; align-items: center; padding: 0 12px; box-sizing: border-box; } .sd-sig { display: block; }
.sd-n { font-size: 9.5px; color: #6b7280; margin-top: 6px; } .sd-foot { font-size: 8.5px; color: #6b7280; margin: 18px 0 0; line-height: 1.4; }
.sd-copy { position: absolute; left: 50px; bottom: 26px; font-size: 8px; color: #6b7280; }
.sd-mark { position: absolute; right: 40px; top: 60px; transform: rotate(12deg); border: 2px solid #b42318; color: #b42318; font-weight: 700; font-size: 14px; letter-spacing: .12em; padding: 2px 8px; opacity: .65; }
.sig-size { display: flex; align-items: center; gap: 10px; font-weight: 600; } .sig-size input { flex: 0 1 260px; } .sig-size output { min-width: 3em; }
.sig-modes { display: flex; flex-wrap: wrap; gap: 14px; } .sig-modes label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.um-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; } .um-tag { font-size: .8rem; font-weight: 600; color: #b42318; }
.um-bar { position: sticky; top: 8px; z-index: 6; }

.um-del-col { width: 40px; padding-right: 0 !important; } .um-del-ico { color: #d64032; } .um-del-ico svg { width: 16px; height: 16px; }
.um-del-ico:hover { background: rgba(214, 64, 50, .12); } .um-going td { opacity: .6; } .um-going td:last-child { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Staff Adoption: the refresh icon (spins while it reads Microsoft 365 again) */
.ado-refresh { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.ado-refresh svg { width: 18px; height: 18px; } .ado-refresh.spin svg { animation: ado-spin .9s linear infinite; } @keyframes ado-spin { to { transform: rotate(360deg); } }
.ado-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dept-chart { display: block; margin: 0 auto; max-width: none; font-family: inherit; }
.dc-link { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .55; }
.dc-node > rect:first-child { fill: var(--surface, #fff); stroke: var(--line); stroke-width: 1.2; }
.dc-node .dc-accent { fill: var(--moon, #f2b000); }
.dc-root > rect:first-child { stroke: var(--moon, #f2b000); } .dc-root .dc-accent { fill: var(--night-2, #2236a3); }
.dc-it .dc-accent { fill: #8e9be8; } .dc-it > rect:first-child { stroke-dasharray: 0; stroke: #8e9be8; }
.dc-t { fill: var(--ink); font-weight: 700; font-size: 13px; } .dc-s { fill: var(--muted); font-size: 11.5px; }
.dp-struct { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; } .dp-struct > div { flex: 1 1 360px; }
.sr-dlg { width: min(820px, calc(100vw - 24px)); max-height: 88vh; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; background: var(--surface, #fff); color: var(--ink); }
.sr-dlg::backdrop { background: rgba(10, 13, 35, .55); }
.sr-list { list-style: none; margin: 10px 0; padding: 0; max-height: 58vh; overflow-y: auto; }
.sr-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.sr-item select { max-width: 320px; } .sr-l1 { padding-left: 24px; } .sr-l2 { padding-left: 48px; }
.ev-more-list { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; background: var(--surface, #fff); }
.dep-subs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; } .dep-sub { display: inline-flex; align-items: center; gap: 4px; }
.dep-sub-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.dep-sub-add { flex-basis: 100%; } .dep-sub-add summary { cursor: pointer; font-size: .85rem; color: var(--accent, #4a5bd4); }
.dep-sub-new { display: grid; gap: 4px; margin-top: 6px; font-size: .85rem; } .pd-main { display: grid; gap: 4px; font-weight: 600; margin: 8px 0; }
.dep-pick-l0 { font-weight: 600; } .dep-pick-l1 { padding-left: 18px; } .dep-pick-l2 { padding-left: 36px; font-size: .92em; } .dep-pick-l3 { padding-left: 54px; font-size: .9em; }
.dep-pick-arm { color: var(--muted); margin-right: 4px; }

/* production Departments app */
.dep-card { padding: 14px 16px; } .dep-l1 { margin-left: 20px; } .dep-l2 { margin-left: 40px; } .dep-l3 { margin-left: 60px; }
.dep-card-head { display: flex; justify-content: space-between; gap: 10px; } .dep-card-head h3 { margin: 0; } .dep-card-tools { display: flex; gap: 6px; }
.dep-card-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; } .dep-card-links label { display: grid; gap: 4px; font-weight: 600; flex: 1 1 220px; }
.dep-roles { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; } .dep-card-people { margin: 6px 0 0; }
.dp-new-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; } .dp-new-row label { display: grid; gap: 4px; font-weight: 600; flex: 1 1 220px; }
#dpp-q { width: 100%; max-width: 420px; margin-bottom: 10px; } .dpp-table td { vertical-align: top; } .dpp-table select { max-width: 260px; }
.org-scroll { overflow: auto; max-height: 75vh; } .da-table th, .da-table td { white-space: nowrap; text-align: center; } .da-table .da-dep { text-align: left; white-space: normal; min-width: 200px; } .da-inh { color: var(--muted); font-size: .72rem; }
.dep-pick-l0 { font-weight: 600; } .dep-pick-l1 { padding-left: 18px; } .dep-pick-l2 { padding-left: 36px; } .dep-pick-l3 { padding-left: 54px; } .dep-pick-arm { color: var(--muted); margin-right: 4px; }
.ev-more-pick summary { cursor: pointer; font-size: .85rem; } .ev-more-list { display: grid; gap: 2px; max-height: 240px; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }

/* Email Notifications */
.ne-group { margin: 18px 0 6px; } .ne-table td, .ne-table th { vertical-align: middle; } .ne-table td:nth-child(3), .ne-table td:nth-child(4), .ne-table th:nth-child(3), .ne-table th:nth-child(4) { text-align: center; width: 90px; }
.ne-cb { width: 18px; height: 18px; cursor: pointer; }

/* Admin Panel → Email Templates */
.et-wrap { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; align-items: start; } @media (max-width: 800px) { .et-wrap { grid-template-columns: 1fr; } }
.et-list { display: grid; gap: 4px; } .et-list h3 { margin: 12px 0 2px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.et-list button { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.et-list button[aria-current="true"] { border-color: var(--moon, #f2b000); background: rgba(246, 201, 14, .12); font-weight: 600; }
.et-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; margin-bottom: 10px; } .et-meta > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.et-frame { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Export / Import Structure */
.sio { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .sio-imp { cursor: pointer; } .sio-dlg { max-width: min(760px, calc(100vw - 24px)); } .sio-dlg .table-scroll { max-height: 55vh; overflow: auto; }

/* quick My Tickets button (IT) */
.mytk-btn { display: inline-flex; align-items: center; gap: 6px; } .mytk-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--moon, #f2b000); color: #1d2433; font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; }
.mytk-n.warn { background: #d64032; color: #fff; } @media (max-width: 600px) { .mytk-btn { padding-left: 10px; padding-right: 10px; } }

/* the save bar only stays on screen while there are unsaved changes ("No unsaved changes" no longer covers the list) */
.save-bar:not(.dirty) { position: static; box-shadow: none; }

/* merged requests */
.merge-label { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0 10px; } .merge-chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(91, 107, 214, .14); border: 1px solid rgba(91, 107, 214, .45); font-weight: 600; font-size: .85rem; }
.merge-label.merged .merge-chip { background: rgba(246, 201, 14, .15); border-color: rgba(246, 201, 14, .6); } .mg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* Email Notifications: CC */
.nc-cc .check { display: flex; margin: 6px 0; } .nc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; } .nc-grid label { display: grid; gap: 4px; font-weight: 600; } .nc-grid textarea { width: 100%; box-sizing: border-box; }

/* Email Notifications: who gets it */
.ne-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; } .ne-plus { color: var(--ink); font-weight: 600; }
.ne-who-edit { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 8px; } .ne-who-edit .check { display: flex; gap: 6px; color: var(--ink); }
.ne-chips { display: flex; flex-wrap: wrap; gap: 6px; } .ne-add { display: flex; gap: 6px; flex-wrap: wrap; } .ne-add input { flex: 1 1 220px; min-width: 0; }

.dpp-table [data-pmgr] { max-width: 230px; }

/* drop-down lists: readable options in light and dark mode (the open list is drawn by the browser on white) */
select option, select optgroup { color: #1d2433; background-color: #ffffff; } select optgroup { font-weight: 700; color: #1c2e93; } select option:disabled { color: #8a90a6; }

.dpp-bar { position: sticky; top: 8px; z-index: 6; } .dpp-table tr.row-changed td { background: rgba(246, 201, 14, .08); }

/* Staff Adoption send buttons: welcome on one row, reminders on the other */
.ad-send { display: grid; gap: 8px; } .ad-send-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .ad-send-l { min-width: 76px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Request Access; termination on a request */
.ac-form { display: grid; gap: 12px; } .ac-form .lv-kind { flex-wrap: wrap; }
.term-box { border-left: 4px solid #c0392b; } .term-box h3 { margin: 4px 0 6px; }
.term-acts { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; } .term-acts li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.term-acts li.done { border-color: rgba(46, 158, 106, .5); background: rgba(46, 158, 106, .08); } .term-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; } .term-granted { margin: 4px 0 0 18px; }

.term-dlg { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface, var(--panel, #fff)); color: var(--ink); }
.term-f { display: grid; gap: 12px; } .term-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.term-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; max-width: 100%; overflow-wrap: anywhere; }
.term-chip button { border: 0; background: var(--line); color: var(--ink); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-weight: 800; }
.term-add { display: flex; gap: 6px; } .term-add input { flex: 1 1 auto; min-width: 0; } .term-link { display: inline-block; margin-top: 2px; color: #c0392b; font-size: .8rem; font-weight: 700; }
.hre-frame { width: 100%; min-height: 320px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.term-f .lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; } .term-f label { display: grid; gap: 4px; } .term-f label.check { display: inline-flex; }
.ac-form .seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .ac-form .seg label { position: relative; } .ac-form .seg input { position: absolute; opacity: 0; inset: 0; }
.ac-form .seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.ac-form .seg input:checked + span { background: #1c2e93; color: #fff; border-color: #1c2e93; } .ac-form .seg input:focus-visible + span { outline: 2px solid #fdb902; }
.ac-form .lv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; } .ac-form .lbl { font-weight: 600; }

/* Administration → Automations */
.au-list { list-style: none; padding: 0; margin: 0; display: grid; } .au-row { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.au-row:last-child { border-bottom: 0; } .au-row.row-changed { background: rgba(252, 205, 13, .1); } .au-main { display: grid; gap: 2px; min-width: 0; } .au-main .hint { font-size: .8rem; }
.au-fields { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: flex-end; } .au-f { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; white-space: nowrap; }
.au-dlg { width: min(640px, 94vw); border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface, var(--panel, #fff)); color: var(--ink); } .au-form { display: grid; gap: 10px; }
#au-bar { position: sticky; bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface, var(--panel, #fff)); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 20; } #au-bar[hidden] { display: none; } #au-n { margin-right: auto; font-weight: 700; }
@media (max-width: 760px) { .au-row { grid-template-columns: 1fr; } .au-fields { justify-content: flex-start; } }
.au-form label:not(.check) { display: grid; gap: 4px; } .au-form input:not([type=checkbox]), .au-form select, .au-form textarea { width: 100%; box-sizing: border-box; } .au-form .lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.au-form .check { display: inline-flex; gap: 6px; align-items: center; }
.who-photo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1c2e93; color: #fdb902; font-weight: 800; font-size: .85rem; margin-bottom: 6px; overflow: hidden; border: 2px solid rgba(252, 205, 13, .7); }
.who-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* back to the top of the page (right side, above Help) */
.to-top { position: fixed; right: 26px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface, var(--panel, #fff)); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .2); cursor: pointer; display: grid; place-items: center; }
.to-top[hidden] { display: none; } .to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .to-top:hover { border-color: var(--moon, #fdb902); }
@media (max-width: 760px) { .to-top { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; } }
.back-dash { margin-bottom: 6px; border: 1px solid rgba(255, 255, 255, .25); font-size: .84rem !important; } .back-dash svg { width: 14px !important; height: 14px !important; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* phones: one top bar (logo, New Request, My Tickets, bell, menu) */
@media (max-width: 760px) {
  .rail > .new-btn { padding: 7px 10px !important; font-size: .8rem !important; min-height: 0 !important; width: auto !important; margin: 0 !important; }
  .rail > .mytk-btn .mytk-l { display: none; }
  .rail .menu-toggle span { display: none; } .rail .menu-toggle { padding: 6px 9px; }
  .rail .brand .brand-panel img { max-height: 28px; width: auto; }
  .std-kpis, .md-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lc-grid > label:not(.check) { display: grid; gap: 4px; } .lc-grid > label:not(.check) input:not([type=checkbox]), .lc-grid > label:not(.check) select { width: 100%; box-sizing: border-box; }
  #notify-stack { left: 10px !important; right: 10px !important; bottom: calc(128px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; }
}
@media (min-width: 761px) { #notify-stack { bottom: 140px; } }

/* Back to Dashboard (side menu) */
.side-back { display: flex; align-items: center; gap: 8px; padding: 8px 12px !important; margin: 0 0 6px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, .35); color: #fdb902 !important; font-weight: 700; font-size: .85rem; text-decoration: none; }
.side-back:hover { background: rgba(252, 205, 13, .12); border-style: solid; }
[hidden].side-back, .side-back[hidden] { display: none !important; }
/* device purchase approvals */
.dp-box { display: grid; gap: 10px; } .dp-card { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; }
.dp-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; } .dp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .85rem; } .dp-steps li { display: flex; flex-wrap: wrap; gap: 6px; } .dp-steps b { min-width: 90px; }
.dp-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .dp-act input { flex: 1 1 200px; }

.cancel-btn { margin: 6px 0; } .cancel-note { border-left: 4px solid #c0392b; }
.chip-cancelled, .status-cancelled { background: rgba(192, 57, 43, .12) !important; color: #b03024 !important; }

.tq-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .tq-row input { flex: 1 1 260px; }

/* sorting and filtering on every table and long list */
th.sf-th { cursor: pointer; user-select: none; white-space: nowrap; } th.sf-th::after { content: ' ↕'; opacity: .35; font-size: .8em; }
th.sf-th[aria-sort=ascending]::after { content: ' ▲'; opacity: .8; } th.sf-th[aria-sort=descending]::after { content: ' ▼'; opacity: .8; } th.sf-th:hover::after { opacity: .7; }
th.sf-th:focus-visible { outline: 2px solid var(--focus, #fdb902); outline-offset: -2px; }
.sf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 8px; } .sf-bar .sf-q { flex: 0 1 300px; min-width: 160px; } .sf-sort { display: inline-flex; gap: 4px; margin-left: auto; }
tr[hidden], li[hidden] { display: none !important; }

/* cards: Grid / List */
.sf-gridv { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 10px !important; }
.sf-list { display: flex !important; flex-direction: column !important; gap: 6px !important; } .sf-list > * { width: 100% !important; max-width: none !important; }
.sf-seg { margin-left: 8px; } .sf-seg button[aria-pressed=true] { background: var(--night, #1c2e93); color: #fff; }
