/* De Lune IT Helpdesk — night rail, moonlight accent, status shown as moon phases */
:root {
  --night: #2a3577;
  --night-2: #36438f;
  --night-deep: #222b63;
  --night-ink: #d3d7ea;
  --paper: #f3f4f7;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #646c82;
  --line: #dfe2ea;
  --moon: #fccd0d;
  --moon-soft: #fff6d2;
  --focus: #fccd0d;
  --urgent: #b8432f;
  --high: #b9761c;
  --normal: #3f6aa6;
  --low: #7d859a;
  --note: #fff7e3;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --night: #222b63;
    --night-2: #2f3a80;
    --paper: #12163a;
    --surface: #1b2050;
    --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: #222b63;
    --night-2: #2f3a80;
    --paper: #12163a;
    --surface: #1b2050;
    --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: #2a3577; --sel-fg: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sel-bg: #fccd0d; --sel-fg: #1b2050; } }
:root[data-theme="dark"] { --sel-bg: #fccd0d; --sel-fg: #1b2050; }

* { 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: #2a3577; 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: #ffd75a; 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: #ffd75a !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: #ffd75a; 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: #ffd75a !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: #8c9be0; }
}
:where(:root[data-theme="dark"]) .chart .b-created { fill: #8c9be0; }
.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: #8c9be0; }
}
:where(:root[data-theme="dark"]) .lg-created { background: #8c9be0; }
.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: #2a3577; 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: #2a3577; 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: #2a3577; 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: #2a3577; }
.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: #2a3577; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.02rem;
  padding: 12px 20px; border-radius: var(--radius-s); border-bottom: 3px solid #fccd0d;
}
.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: "Barlow Semi Condensed", var(--font); 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: #1b2050; 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: #fccd0d; 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: #1b2050; } }
:root[data-theme="dark"] .chart-switch button[aria-pressed="true"] { background: var(--moon); color: #1b2050; }
.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: #1b2050; } }
:root[data-theme="dark"] .pp-list { background: #1b2050; }
.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; }
}

/* ---------- Attendance ---------- */
.ws-switch { display: flex; gap: 4px; padding: 4px; margin: 0 0 10px; border-radius: 12px; background: rgba(255,255,255,.08); }
.ws-switch a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px !important; border-radius: 9px; font-size: .86rem; font-weight: 600; color: rgba(255,255,255,.8); }
.ws-switch a svg { width: 15px; height: 15px; }
.ws-switch a.on { background: #fff; color: #14183d; }
.start { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.start h1 { margin-bottom: 4px; }
.start-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; }
.start-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, #fff); color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s; }
.start-card:hover, .start-card:focus-visible { transform: translateY(-2px); border-color: var(--moon, #f6c90e); box-shadow: 0 10px 26px rgba(20,24,60,.14); }
.start-card b { font-size: 1.25rem; }
.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: #14183d; }
.start-ico svg { width: 28px; height: 28px; }
.att-now { text-align: center; padding: 26px 18px; border-top: 4px solid var(--line); }
.att-now.tone-ok { border-top-color: var(--good); } .att-now.tone-warn { border-top-color: var(--warn); }
.att-state { display: flex; gap: 10px; justify-content: center; align-items: center; }
.att-clock { font-size: 2.6rem; font-weight: 700; margin: 12px 0 2px; font-variant-numeric: tabular-nums; }
.att-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn-big { min-width: 150px; padding: 12px 22px; font-size: 1.02rem; }
.att-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg-soft); }
.att-pill.tone-ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.att-pill.tone-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.att-pill.tone-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.att-pill.tone-idle { color: var(--muted); }
.att-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.att-tiles .tile { padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-soft); display: flex; flex-direction: column; }
.att-tiles .tile b { font-size: 1.4rem; } .att-tiles .tile span { color: var(--muted); font-size: .85rem; }
.att-tiles .tile-warn b { color: var(--warn); }
.att-weekend td { color: var(--muted); }
.att-missed { color: var(--bad); }
.att-month-pick { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.att-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 10px; }
.att-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.att-card:hover { border-color: var(--moon, #f6c90e); }
@media (max-width: 760px) { .rail.menu-open .ws-switch { order: -1; } .att-clock { font-size: 2.1rem; } .btn-big { min-width: 0; flex: 1 1 140px; } }
/* workspace switch: text only so both labels fit the sidebar */
.ws-switch a svg { display: none; }
.ws-switch a { font-size: .8rem; padding: 7px 4px !important; white-space: nowrap; }

/* app switcher with three or four apps: a 2-column grid */
.ws-switch.ws-grid { display: grid; grid-template-columns: 1fr 1fr; }
.rail .nav .nav-head { margin-top: 10px; }

/* launcher: two apps side by side, three in a row, four as a 2 × 2 grid */
.start-cards[data-n="2"], .start-cards[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin-left: auto; margin-right: auto; }
.start-cards[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .start-cards[data-n] { grid-template-columns: minmax(0, 1fr); } }

/* attendance dashboard and approvals */
.att-dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.att-approvals { border-left: 4px solid var(--warn); }
.appr-list { list-style: none; margin: 8px 0 0; padding: 0; }
.appr-list > li { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.appr-list > li:first-child { border-top: 0; }
.appr-reason { margin-top: 4px; font-style: italic; }
.appr-actions { display: flex; gap: 8px; }
.fix-form { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fix-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .86rem; flex: 1 1 220px; }

/* launcher with five or six apps */
.start-cards[data-n="5"], .start-cards[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .start-cards[data-n="5"], .start-cards[data-n="6"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .start-cards[data-n] { grid-template-columns: minmax(0, 1fr); } }
/* News */
.news-feed { display: flex; flex-direction: column; gap: 16px; max-width: 820px; }
.news-card { padding: 18px 20px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface, #fff); }
.news-card.pinned { border-left: 4px solid var(--moon, #f6c90e); }
.news-card.birthday { background: linear-gradient(135deg, color-mix(in srgb, var(--moon, #f6c90e) 16%, var(--surface, #fff)), var(--surface, #fff)); }
.news-card header { display: flex; gap: 12px; align-items: flex-start; }
.news-card header > div:first-of-type { flex: 1; min-width: 0; }
.news-card h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.news-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--moon-soft, #fff4c2); color: #14183d; flex: none; }
.news-ico svg { width: 22px; height: 22px; }
.news-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.news-body { margin: 10px 0 12px; line-height: 1.55; overflow-wrap: anywhere; }
.news-react { display: flex; gap: 6px; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: .95rem; color: inherit; }
.react.on { border-color: var(--moon, #f6c90e); background: color-mix(in srgb, var(--moon, #f6c90e) 18%, transparent); }
.news-comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.comment { font-size: .92rem; overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; }
.comment-form { display: flex; gap: 8px; } .comment-form input { flex: 1; min-width: 0; }
.news-form { max-width: 820px; display: flex; flex-direction: column; gap: 10px; }
.news-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
/* Messages */
.dm { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.dm-list { padding: 12px; } .dm-find input { width: 100%; }
.dm-people, .dm-threads { list-style: none; margin: 8px 0 0; padding: 0; }
.dm-people { border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 8px; }
.dm-people a, .dm-threads a { display: block; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.dm-threads a .hint { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-threads a.on, .dm-threads a:hover, .dm-people a:hover { background: var(--bg-soft); }
.dm-thread { display: flex; flex-direction: column; min-height: 420px; }
.dm-thread header h2 { margin: 0; } .dm-back { display: none; }
.dm-msgs { flex: 1; overflow-y: auto; max-height: 55vh; display: flex; flex-direction: column; gap: 8px; padding: 12px 2px; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: 14px; background: var(--bg-soft); overflow-wrap: anywhere; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--moon, #f6c90e) 22%, transparent); }
.msg .hint { display: block; font-size: .72rem; margin-top: 2px; }
.dm-send { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; } .dm-send textarea { flex: 1; min-width: 0; resize: vertical; }
.dm-empty { margin: auto; }
@media (max-width: 760px) { .dm { grid-template-columns: minmax(0, 1fr); } .dm.has-thread .dm-list { display: none; } .dm:not(.has-thread) .dm-thread { display: none; } .dm-back { display: inline-block; } .msg { max-width: 88%; } }
/* Birthdays */
.bd-table select { min-width: 130px; } .bd-table input[type=number] { width: 70px; margin-left: 6px; }

/* leave */
.att-pill.tone-leave { color: #2f6fb5; background: color-mix(in srgb, #2f6fb5 14%, transparent); }
.leave-bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.leave-bal .tile { padding: 12px 14px; border-radius: var(--radius-m); background: var(--bg-soft); display: flex; flex-direction: column; gap: 2px; }
.leave-bal .tile b { font-size: 1.5rem; } .leave-bal .tile span { color: var(--muted); font-size: .86rem; }
.lv-form { display: flex; flex-direction: column; gap: 10px; }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.lv-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.lv-types input[type=number] { width: 100px; } .lv-types input[name=name] { min-width: 160px; }

/* Dashboard app */
.home { display: flex; flex-direction: column; gap: 4px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.home-tiles .tile b .att-pill { font-size: .95rem; }
.home-note { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-note svg { width: 18px; height: 18px; }
.home-news { margin-top: 14px; } .home-news h3 { font-size: .95rem; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; } .home-news h3 svg { width: 16px; height: 16px; }
.home-news ul { margin: 0; padding-left: 18px; } .home-news li { margin: 3px 0; }
.tile.tile-bad b { color: var(--bad); }
/* launcher with seven or eight apps */
.start-cards[data-n="7"], .start-cards[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 980px; margin-left: auto; margin-right: auto; }
@media (max-width: 1100px) { .start-cards[data-n="7"], .start-cards[data-n="8"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .start-cards[data-n="7"], .start-cards[data-n="8"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .start-cards[data-n] { grid-template-columns: minmax(0, 1fr); } }

/* All Apps: across the top of the app switcher */
.ws-switch .ws-all { grid-column: 1 / -1; gap: 6px; }
.ws-switch .ws-all svg { display: inline-block !important; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ws-switch:not(.ws-grid) .ws-all { flex-basis: 100%; }
.ws-switch:not(.ws-grid) { flex-wrap: wrap; }

.bd-del { color: var(--bad); } .bd-del:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
/* Birthdays on phones: each person as a small card instead of a wide table row */
@media (max-width: 760px) {
  .bd-table, .bd-table tbody, .bd-table tr, .bd-table td { display: block; width: 100%; }
  .bd-table thead { display: none; }
  .bd-table tr { position: relative; padding: 10px 44px 10px 0; border-bottom: 1px solid var(--line); }
  .bd-table td { padding: 3px 0; border: 0; }
  .bd-table td:last-child { position: absolute; top: 8px; right: 0; width: auto; }
  .bd-table select { min-width: 0; width: calc(100% - 82px); }
}
/* keep positioned helpers (like screen-reader-only labels) inside each table's own scroll box */
.table-wrap { position: relative; }
/* file pickers never wider than their box */
input[type=file] { max-width: 100%; }
/* file pickers fit their box on narrow phones */
input[type=file] { max-width: 100%; }

.manual-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
/* file pickers never wider than their box (narrow phones) */
input[type=file] { max-width: 100%; }
/* app icons (launcher cards, birthday posts): navy in light mode, brand yellow in dark mode so they stand out */
:root { --app-ico-fg: #14183d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --app-ico-fg: #fccd0d; } }
:root[data-theme="dark"] { --app-ico-fg: #fccd0d; }
.start-ico, .news-ico { color: var(--app-ico-fg); }

.bd-steps { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; } .bd-steps li { line-height: 1.5; }

.lv-pname { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .lv-pname input[name=pname] { font-weight: 700; font-size: 1.05rem; min-width: 0; max-width: 220px; }
.lv-inline { display: flex; gap: 8px; flex-wrap: wrap; } .lv-inline input { flex: 1 1 200px; min-width: 0; }

/* News: formatting, images, composer, preview */
.news-body h3 { font-size: 1.08rem; margin: 10px 0 4px; } .news-body h4 { font-size: .98rem; margin: 8px 0 4px; }
.news-body p { margin: 0 0 8px; } .news-body ul { margin: 0 0 8px; padding-left: 22px; }
.news-imgs { display: grid; gap: 6px; margin: 0 0 12px; border-radius: var(--radius-m); overflow: hidden; }
.news-imgs.n1 { grid-template-columns: 1fr; } .news-imgs.n2, .news-imgs.n4 { grid-template-columns: 1fr 1fr; } .news-imgs.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.news-imgs.n3 a:first-child { grid-row: 1 / 3; }
.news-imgs a { display: block; background: var(--bg-soft); } .news-imgs img { display: block; width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.news-imgs.n1 img { max-height: 480px; object-fit: contain; }
.fmt-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fmt-bar button { border: 1px solid var(--line); background: var(--surface, #fff); color: inherit; border-radius: 8px; padding: 4px 10px; cursor: pointer; min-width: 34px; }
.fmt-bar button:hover { border-color: var(--moon, #f6c90e); }
.news-pick { display: flex; flex-direction: column; gap: 6px; }
.news-thumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.news-thumbs .thumb { position: relative; width: 96px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.news-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-thumbs .thumb .icon-btn { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); color: #fff; width: 24px; height: 24px; padding: 3px; }
.add-img { cursor: pointer; }
.news-preview { max-width: 820px; } .news-preview .news-card { margin: 8px 0 12px; }
.news-drafts { max-width: 820px; border-left: 4px solid var(--warn); }
.btn-quiet { background: transparent; border-color: transparent; }

.dm-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 4px 2px; }
.dm-threads a b svg, .dm-thread h2 svg { width: 16px; height: 16px; vertical-align: -2px; }
.msg-from { display: block; font-size: .78rem; margin-bottom: 2px; }

/* birthday wishes */
.bday-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.bday-box.sent, .bday-box.mine { color: var(--muted); }
.wish-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface, #fff); color: inherit; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .88rem; }
.chip:hover, .chip:focus-visible { border-color: var(--moon, #f6c90e); background: color-mix(in srgb, var(--moon, #f6c90e) 14%, transparent); }
.wish-form { display: flex; gap: 8px; } .wish-form input { flex: 1; min-width: 0; }
/* Birthdays: month and day side by side */
.bd-table select { width: auto; min-width: 130px; }
.bd-table td:nth-child(2) { white-space: nowrap; }

/* launcher with nine apps: 3 × 3 */
.start-cards[data-n="9"] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 760px; margin-left: auto; margin-right: auto; }
@media (max-width: 760px) { .start-cards[data-n="9"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .start-cards[data-n="9"] { grid-template-columns: minmax(0, 1fr); } }
/* My Team */
.mt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.mt-card { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.mt-card.me { border-color: var(--moon, #f6c90e); }
.mt-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt-card .btn { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; } .mt-card .btn svg, .page-head .btn svg { width: 15px; height: 15px; }

/* launcher: centred; nine apps as a 3 × 3 grid */
.start { max-width: 1000px; }
.start-cards[data-n="9"] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 760px; margin-left: auto; margin-right: auto; }
@media (max-width: 760px) { .start-cards[data-n="9"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .start-cards[data-n="9"] { grid-template-columns: minmax(0, 1fr); } }

/* Organization Map: manage teams */
.org-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.org-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); }
.org-form h3 { margin: 0; font-size: 1rem; }
.org-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.org-form .btn { align-self: flex-start; }
