﻿/* Helply Â· console feel
   Loaded after apple.css. Dark-first details borrowed from the best developer-tool products: a tinted near-black,
   translucent white hairlines instead of solid borders, layered glass surfaces, a cursor-following spotlight on cards,
   glowing status dots, monospace for identifiers, a command palette and a thin navigation progress bar.
   Everything is decoration over the same tokens, and every animation stops under prefers-reduced-motion. */

:root {
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --glow-a: 0, 113, 227; --glow-b: 94, 92, 230;
}
:root[data-theme="dark"] {
  --bg: #07080c; --card: #0d0e14; --line: rgba(255, 255, 255, .075);
  --glow-a: 34, 211, 238; --glow-b: 129, 140, 248;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 60px -32px rgba(0, 0, 0, .95);
}
:root[data-theme="dark"] .fx { --surface: #0d0e14; --line: rgba(255, 255, 255, .075); --line-2: rgba(255, 255, 255, .05); }

/* ---------- Backdrop: aurora + dot grid ---------- */
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; display: block;
  background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1.2px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%); mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%); }
:root[data-theme="dark"] body::before { display: block; background-image: radial-gradient(rgba(148, 163, 255, .22) 1px, transparent 1.2px); }
body::after { content: ""; position: fixed; z-index: 0; pointer-events: none; width: 70vw; height: 46vh; top: -22vh; right: -12vw; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--glow-a), .16), rgba(var(--glow-b), .08) 55%, transparent 75%); filter: blur(40px); animation: tc-aurora 24s ease-in-out infinite alternate; }
:root:not([data-theme="dark"]) body::after { opacity: .5; }
@keyframes tc-aurora { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-8vw, 4vh, 0) scale(1.15); } }
.app-shell, main.container { position: relative; z-index: 1; }

/* ---------- Surfaces: glass cards with a cursor spotlight ---------- */
.card, .kpi, .fx-card, .fx-band, .fx-panel, .fx-sla-row, .fx-teamcard, .fx-table-wrap { position: relative; isolation: isolate; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .fx-band, :root[data-theme="dark"] .fx-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012)), var(--card); }
.card::after, .kpi::after, .fx-card::after, .fx-band::after, .fx-panel::after, .fx-sla-row::after, .fx-teamcard::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--glow-a), .13), rgba(var(--glow-b), .06) 45%, transparent 70%); }
.card:hover::after, .kpi:hover::after, .fx-card:hover::after, .fx-band:hover::after, .fx-panel:hover::after, .fx-sla-row:hover::after, .fx-teamcard:hover::after { opacity: 1; }
.card:hover, .kpi:hover, .fx-band:hover, .fx-panel:hover { border-color: rgba(var(--glow-a), .28); }
:root[data-theme="dark"] .card:hover, :root[data-theme="dark"] .kpi:hover { border-color: rgba(var(--glow-a), .3); }
.card, .kpi, .fx-card { transition: border-color .3s, box-shadow .3s, transform .35s cubic-bezier(.22, .61, .36, 1); }

/* ---------- Shell ---------- */
.sidebar { background: color-mix(in srgb, var(--card) 70%, transparent); }
:root[data-theme="dark"] .sidebar { background: rgba(9, 10, 15, .74); border-right-color: rgba(255, 255, 255, .06); }
.side-nav a { position: relative; transition: color .2s, background-color .2s; }
.side-nav a.active::before { content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, rgb(var(--glow-a)), rgb(var(--glow-b))); box-shadow: 0 0 14px rgba(var(--glow-a), .8); }
:root[data-theme="dark"] .side-nav a.active { background: linear-gradient(90deg, rgba(var(--glow-a), .14), rgba(var(--glow-a), .03)); }
.topbar { gap: 1rem; justify-content: space-between; }
:root[data-theme="dark"] .topbar { background: rgba(7, 8, 12, .72); border-bottom-color: rgba(255, 255, 255, .06); }

.cmdk-trigger { display: inline-flex; align-items: center; gap: .6rem; min-width: min(340px, 42vw); height: 36px; padding: 0 .5rem 0 .8rem; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--muted); font: 500 .9rem var(--font); transition: border-color .2s, background .2s, color .2s; }
.cmdk-trigger:hover { border-color: rgba(var(--glow-a), .45); color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.cmdk-trigger svg { width: 16px; height: 16px; flex: none; }
.cmdk-trigger .label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 .38rem; border-radius: 6px; font: 600 .7rem var(--mono); color: var(--muted);
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 9%, transparent), color-mix(in srgb, var(--text) 3%, transparent)); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }

/* ---------- Identifiers, numbers, statuses ---------- */
a.ref, .mono { font-family: var(--mono); font-size: .9em; letter-spacing: -.01em; }
.kpi-value, .ov-big b, .ov-stats b, .bar-value, .fx-big { font-variant-numeric: tabular-nums; }
.badge.st-new, .badge.st-triaged, .badge.st-assigned, .badge.st-in_progress, .badge.st-on_hold, .badge.st-resolved, .badge.st-closed, .badge.st-cancelled,
.badge[class*="sla-"] { display: inline-flex; align-items: center; gap: .42rem; }
.badge.st-new::before, .badge.st-triaged::before, .badge.st-assigned::before, .badge.st-in_progress::before, .badge.st-on_hold::before, .badge.st-resolved::before,
.badge.st-closed::before, .badge.st-cancelled::before, .badge[class*="sla-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; flex: none; }
.badge[class*="sla-at_risk"]::before, .badge[class*="sla-breached"]::before { animation: tc-pulse 1.8s ease-in-out infinite; }
@keyframes tc-pulse { 50% { opacity: .35; } }
.chip-danger, .chip-warn { box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 25%, transparent); }
.live-badge::before { animation: tc-pulse 2s ease-in-out infinite; }

/* Top-edge highlight on cards: a hairline of light, as on glass. */
.card::before, .kpi::before { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 22%, transparent), transparent); opacity: .55; }
:root:not([data-theme="dark"]) .card::before, :root:not([data-theme="dark"]) .kpi::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap thead th, .fx-table thead th { position: sticky; top: 0; z-index: 2; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--card) 85%, transparent); }
tbody tr { transition: background-color .2s; }
tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 rgb(var(--glow-a)); }
tr[data-href]:hover td:first-child { box-shadow: inset 2px 0 0 rgb(var(--glow-a)); }

/* ---------- Buttons and focus ---------- */
.btn.primary, .fx-btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 22px -10px rgba(var(--glow-a), .9); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .fx-btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 1px rgba(var(--glow-a), .35), 0 10px 30px -12px rgba(var(--glow-a), .9); }
:focus-visible { outline: 2px solid rgba(var(--glow-a), .9); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
.flash { border: 1px solid var(--line); backdrop-filter: blur(10px); animation: tc-toast .5s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes tc-toast { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Navigation progress bar ---------- */
#tc-progress { position: fixed; z-index: 200; top: 0; left: 0; height: 2px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--glow-a)), rgb(var(--glow-b)), #c084fc); box-shadow: 0 0 12px rgba(var(--glow-a), .9); transition: width .25s ease, opacity .3s ease; }
#tc-progress.is-on { opacity: 1; }

/* ---------- Command palette ---------- */
.tc-overlay { position: fixed; inset: 0; z-index: 300; display: none; align-items: flex-start; justify-content: center; padding: 14vh 1rem 1rem; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tc-overlay.is-open { display: flex; animation: tc-fade .18s ease both; }
@keyframes tc-fade { from { opacity: 0; } to { opacity: 1; } }
.tc-palette { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; color: var(--text);
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(var(--glow-a), .12); animation: tc-pop .22s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes tc-pop { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.tc-search { display: flex; align-items: center; gap: .7rem; padding: .95rem 1.1rem; border-bottom: 1px solid var(--line); }
.tc-search svg { width: 20px; height: 20px; color: var(--muted); flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 1.08rem var(--font); padding: 0; min-height: 0; box-shadow: none; }
:root[data-theme] .tc-overlay .tc-search input, :root[data-theme] .tc-overlay .tc-search input:focus { border: 0; box-shadow: none; background: transparent; outline: none; border-radius: 0; height: auto; }
.tc-list { overflow-y: auto; padding: .45rem; margin: 0; list-style: none; }
.tc-group { padding: .6rem .8rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.tc-item { display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; border-radius: 12px; cursor: pointer; color: var(--text); font-size: .96rem; }
.tc-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tc-item .tc-hint { margin-left: auto; display: inline-flex; gap: .25rem; }
.tc-item .tc-sub { margin-left: .4rem; color: var(--muted); font-size: .84rem; }
.tc-item[aria-selected="true"] { background: linear-gradient(90deg, rgba(var(--glow-a), .18), rgba(var(--glow-b), .1)); box-shadow: inset 2px 0 0 rgb(var(--glow-a)); }
.tc-item[aria-selected="true"] svg { color: rgb(var(--glow-a)); }
.tc-empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); }
.tc-foot { display: flex; gap: 1rem; align-items: center; padding: .6rem 1rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.tc-foot span { display: inline-flex; align-items: center; gap: .35rem; }
.tc-sheet { padding: 1.4rem 1.5rem 1.6rem; }
.tc-sheet h2 { margin: 0 0 1rem; font-size: 1.15rem; }
.tc-sheet dl { display: grid; grid-template-columns: 1fr auto; gap: .55rem 1.5rem; margin: 0; }
.tc-sheet dt { color: var(--muted); } .tc-sheet dd { margin: 0; display: inline-flex; gap: .25rem; justify-content: flex-end; }

@media (max-width: 900px) { .cmdk-trigger { min-width: 0; } .cmdk-trigger .label, .cmdk-trigger kbd { display: none; } .cmdk-trigger { width: 36px; padding: 0; justify-content: center; } .side-nav a.active::before { display: none; } }
@media (prefers-reduced-motion: reduce) { body::after, .flash, .tc-overlay.is-open, .tc-palette, .badge::before, .live-badge::before { animation: none !important; } #tc-progress { transition: none; } }

/* Unified hover highlight: anything clickable lights up with the accent so selectable items are obvious. */
.side-nav a:not(.active):hover, .attn-row:hover, .note-row:hover, .ticket-progress:hover,
.filters a:not(.active):hover, .kb-item:hover, a.ov-row:hover {
  background-color: rgba(var(--glow-a), .12);
  box-shadow: inset 3px 0 0 rgb(var(--glow-a)), 0 0 0 1px rgba(var(--glow-a), .22);
  color: var(--text);
}
.side-nav a:not(.active):hover { box-shadow: inset 3px 0 0 rgb(var(--glow-a)); }
.side-nav a:not(.active):hover svg { color: rgb(var(--glow-a)); }
.attn-row:hover .attn-title, .kb-item:hover h3, .kb-item:hover .kb-title { color: rgb(var(--glow-a)); }
tbody tr[data-href]:hover td, tbody tr:hover td { background-color: rgba(var(--glow-a), .09); }
.btn:not(.primary):hover, .chip[href]:hover, a.chip:hover { border-color: rgba(var(--glow-a), .6); background-color: rgba(var(--glow-a), .12); }
.attn-row, .side-nav a, .filters a, .kb-item { transition: background-color .15s, box-shadow .15s, color .15s; }

/* Round two: every remaining clickable block, link and title gets the same accent hover (bars, device/asset cells, server rows, team cards, plain text links). */
.bar-row:hover, .device-top:hover, .fx-teamcard:hover, .bell:hover, a.kpi:hover {
  background-color: rgba(var(--glow-a), .14);
  box-shadow: inset 3px 0 0 rgb(var(--glow-a));
  border-radius: 10px; text-decoration: none;
}
.bar-row, .asset-cell, .device-top, a.srv { transition: background-color .15s, box-shadow .15s, color .15s; }
.bar-row { padding-left: .5rem; padding-right: .5rem; margin-left: -.5rem; margin-right: -.5rem; }
.bar-row:hover .bar-label, .asset-cell:hover b, .device-top:hover b, a.srv:hover b, a.srv:hover .name { color: rgb(var(--glow-a)); text-decoration: none; }
tbody tr:hover td a:not(.btn):not(.fx-btn), tr[data-href]:hover td:first-child, tbody tr:hover td b { color: rgb(var(--glow-a)); }
main a.small:hover, .panel-head a:hover, main a:not([class]):hover {
  color: rgb(var(--glow-a)); text-decoration: underline; text-underline-offset: 3px;
}
a, button, [role="button"], tr[data-href], summary, label[for], select { cursor: pointer; }
/* Stronger tint so the highlight reads at a glance on both themes. */
.side-nav a:not(.active):hover, .attn-row:hover, .note-row:hover, .ticket-progress:hover, .filters a:not(.active):hover, .kb-item:hover, tbody tr:hover td { background-color: rgba(var(--glow-a), .16); }

/* Helply Assistant panels (employee Q&A and technician copilot). Colours come from the theme variables. */
.ai-panel { margin-bottom: 1.1rem; }
.ai-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-bottom: .8rem; }
.ai-head .btn { margin-left: auto; }
.ai-badge { display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; font-size: .86rem; padding: .28rem .7rem .28rem .55rem;
  border-radius: 980px; color: rgb(var(--glow-a)); background: rgba(var(--glow-a), .12); border: 1px solid rgba(var(--glow-a), .28); }
.ai-badge svg { width: 14px; height: 14px; fill: currentColor; }
.ai-form { display: flex; gap: .6rem; align-items: flex-start; }
.ai-form textarea { flex: 1; min-height: 3rem; resize: vertical; }
.ai-out { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.ai-answer { white-space: pre-wrap; font-size: 1.02rem; line-height: 1.55; margin: 0 0 .9rem; }
.ai-draft { white-space: pre-wrap; margin: 0 0 .5rem; padding: .8rem 1rem; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); }
.ai-sec { margin: .9rem 0; }
.ai-sec h4 { margin: 0 0 .35rem; font-size: .76rem; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 650; }
.ai-sec p { margin: 0; }
.ai-list { margin: 0; padding-left: 1.2rem; }
.ai-list li { margin: .2rem 0; }
.ai-links { list-style: none; margin: 0; padding: 0; }
.ai-links li { padding: .3rem 0; }
.ai-tag { margin-left: .5rem; font-size: .72rem; padding: .08rem .45rem; border-radius: 980px; background: var(--soft); color: var(--muted); }
.ai-meta { color: var(--muted); font-size: .85rem; margin-left: .5rem; }
.ai-meta:first-child { margin-left: 0; }
.ai-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.ai-feedback { display: inline-flex; align-items: center; gap: .4rem; }
.ai-chip { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 980px; padding: .2rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; }
.ai-chip:hover { border-color: rgba(var(--glow-a), .6); background: rgba(var(--glow-a), .12); }
.ai-busy { color: var(--muted); margin: 0; animation: ai-pulse 1.4s ease-in-out infinite; }
.ai-error { margin: 0 0 .6rem; color: var(--muted); }
@keyframes ai-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ai-busy { animation: none; } }
@media (max-width: 600px) { .ai-form { flex-direction: column; } .ai-form .btn { width: 100%; } .ai-head .btn { margin-left: 0; } }

/* Helply Assistant: launcher in the top bar, chat drawer, and the administrator insights card. */
.ai-launch { display: inline-flex; align-items: center; gap: .45rem; height: 36px; padding: 0 .85rem 0 .7rem; border-radius: 980px; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 600; color: rgb(var(--glow-a)); background: rgba(var(--glow-a), .1); border: 1px solid rgba(var(--glow-a), .3);
  transition: background-color .15s, box-shadow .15s; }
.ai-launch svg { width: 17px; height: 17px; fill: currentColor; }
.ai-launch:hover { background: rgba(var(--glow-a), .18); box-shadow: 0 0 0 3px rgba(var(--glow-a), .12); }
@media (max-width: 900px) { .ai-launch .label { display: none; } .ai-launch { padding: 0 .6rem; } }

.ai-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(0, 0, 0, .28);
  transform: translateX(104%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.ai-drawer.open { transform: none; }
.ai-drawer[hidden] { display: none; }
.aid-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.aid-actions { display: flex; gap: .3rem; }
.aid-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.aid-icon svg { width: 18px; height: 18px; }
.aid-icon:hover { background: rgba(var(--glow-a), .14); color: rgb(var(--glow-a)); }
.aid-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.aid-hello { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; margin: .6rem 0 .3rem; }
.aid-starters { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.aid-starters button { text-align: left; padding: .7rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.aid-starters button:hover { border-color: rgba(var(--glow-a), .5); background: rgba(var(--glow-a), .12); }
.aid-msg { max-width: 94%; }
.aid-msg.user { align-self: flex-end; }
.aid-msg.user .aid-text { background: rgb(var(--glow-a)); color: #fff; border-radius: 16px 16px 4px 16px; padding: .55rem .85rem; }
.aid-msg.assistant .aid-text { white-space: pre-wrap; line-height: 1.55; }
.aid-msg .ai-sec h4 { margin-top: .2rem; }
.aid-typing { color: var(--muted); animation: ai-pulse 1.4s ease-in-out infinite; }
.aid-followups { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.aid-form { display: flex; gap: .5rem; align-items: flex-end; padding: .8rem 1rem 1rem; border-top: 1px solid var(--line); }
.aid-form textarea { flex: 1; resize: none; max-height: 140px; min-height: 2.4rem; }
body.ai-open .cmdk-trigger { opacity: .6; }
@media (max-width: 600px) { .ai-drawer { width: 100vw; } }

.ins-meta { display: inline-flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .85rem; }
.ins-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .2rem 0 .8rem; color: var(--muted); font-size: .9rem; }
.ins-stats b { color: var(--text); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ins-stats em { font-style: normal; font-size: .82rem; }
.ins-headline { font-size: 1.08rem; font-weight: 600; margin: 0 0 .9rem; }
.ins-item { padding: .85rem 1rem; border: 1px solid var(--line); border-left-width: 4px; border-radius: 14px; margin-bottom: .6rem; }
.ins-item p { margin: .35rem 0 0; }
.ins-item.sev-high { border-left-color: #ef4444; }
.ins-item.sev-medium { border-left-color: #f59e0b; }
.ins-item.sev-low { border-left-color: rgb(var(--glow-a)); }
.ins-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; }
.ins-sev { font-size: .7rem; font-weight: 600; letter-spacing: 0; text-transform: none; padding: .1rem .5rem; border-radius: 980px; background: var(--soft); color: var(--muted); }
.sev-high .ins-sev { background: rgba(239, 68, 68, .15); color: #ef4444; }
.sev-medium .ins-sev { background: rgba(245, 158, 11, .16); color: #d97706; }
.ins-count { margin-left: auto; color: var(--muted); font-size: .85rem; }
.ins-links { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; font-size: .88rem; }
.ins-watch { margin-top: .8rem; color: var(--muted); }
.ins-watch ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.ai-badge { white-space: nowrap; }
.ins .panel-head { flex-wrap: wrap; gap: .5rem 1rem; }

:root[data-theme="dark"] .aid-msg.user .aid-text { color: #04121f; }
.aid-form textarea { scrollbar-width: none; overflow-y: auto; }
.aid-form textarea::-webkit-scrollbar { display: none; }

.aid-note { margin-top: .5rem; padding: .4rem .7rem; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: .82rem; }

/* AI usage card on the administrator dashboard. */
.usage { margin-top: 1rem; }
.usage-bar { height: 12px; border-radius: 980px; background: var(--soft); overflow: hidden; margin: .3rem 0 .6rem; }
.usage-bar span { display: block; height: 100%; border-radius: 980px; background: linear-gradient(90deg, rgb(var(--glow-a)), rgb(var(--glow-b))); transition: width .4s; }
.usage.lv-warn .usage-bar span { background: #f59e0b; }
.usage.lv-critical .usage-bar span, .usage.lv-exhausted .usage-bar span { background: #ef4444; }
.usage-nums { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; color: var(--muted); font-size: .9rem; }
.usage-nums b { color: var(--text); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.usage-nums em { font-style: normal; }
.usage-alert, .usage-note { margin: .8rem 0 0; padding: .6rem .9rem; border-radius: 12px; font-size: .92rem; }
.usage-alert { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .35); }
.usage-note { background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .35); }
.usage-table { width: 100%; margin-top: 1rem; font-size: .9rem; }
.usage-table td:nth-child(n+2), .usage-table th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.usage-week { display: flex; gap: .5rem; align-items: flex-end; height: 70px; margin-top: 1rem; }
.usage-day { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .25rem; font-size: .72rem; color: var(--muted); }
.usage-day i { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 0 0; background: rgba(var(--glow-a), .55); }
.usage-foot { margin: .9rem 0 0; }

/* ===== Responsive: browser zoom, tablets and phones =====
   The top bar has two groups (search + assistant on the left, account on the right). The account group never wraps:
   instead it gives up its least important parts as the window narrows, so nothing is pushed onto a second row. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.topbar { flex-wrap: nowrap; gap: .75rem; justify-content: space-between; }
.topbar-tools { display: flex; align-items: center; gap: .6rem; flex: 1 1 auto; min-width: 0; }
.cmdk-trigger { flex: 1 1 auto; min-width: 0; max-width: 340px; }
.ai-launch { flex: 0 0 auto; }
.who { flex: 0 0 auto; flex-wrap: nowrap; width: auto; margin-left: auto; white-space: nowrap; }
.who-name { color: inherit; text-decoration: none; }
.who-name:hover { text-decoration: none; }
.who .short { display: none; }
@media (max-width: 1279px) { .who .role { display: none; } }
@media (max-width: 1099px) { .who-text { display: none; } }
@media (max-width: 640px) { .who .long { display: none; } .who .short { display: inline; } }
@media (max-width: 420px) {
  .topbar { padding: .5rem .6rem; gap: .4rem; }
  .topbar-tools { gap: .35rem; }
  .who { gap: .4rem; }
  .who a.small.pw-link { display: none; }  /* the avatar links to the same page; this selector must outrank the touch rules below */
}
/* Detail pages: the side column must be allowed to shrink (min-content would push the page wider than the screen). */
.grid-detail { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1024px) { .grid-detail { grid-template-columns: minmax(0, 1fr); } }
.usage-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.usage-table { min-width: 280px; }
/* Between a phone and a tablet there is room to keep the search and assistant labels. */
@media (min-width: 521px) and (max-width: 900px) {
  .cmdk-trigger { width: auto; padding: 0 .8rem; justify-content: flex-start; }
  .cmdk-trigger .label { display: block; }
  .ai-launch { padding: 0 .85rem 0 .7rem; }
  .ai-launch .label { display: inline; }
}
@media (max-width: 520px) { .cmdk-trigger { flex: 0 0 36px; } }
/* Buttons keep their label on one line; rows that hold a title and a button wrap instead of squeezing the button. */
.btn { white-space: nowrap; flex-shrink: 0; }
.dash-head, .row-between, .panel-head { flex-wrap: wrap; row-gap: .6rem; }
.dash-head > :first-child, .row-between > :first-child { min-width: 0; flex: 1 1 14rem; }
/* The icon row that replaces the sidebar on small screens scrolls by touch; the scrollbar only gets in the way. */
@media (max-width: 900px) { .sidebar { scrollbar-width: none; } .sidebar::-webkit-scrollbar { display: none; } }
/* Fingers need more room than a mouse pointer. */
@media (pointer: coarse) {
  .cmdk-trigger, .ai-launch, .theme-toggle, .bell { min-height: 40px; min-width: 40px; }
  .side-nav a { min-height: 44px; }
}
/* Touch: everything you tap is at least about 36px in one direction, and checkboxes are big enough to hit. */
@media (max-width: 600px), (pointer: coarse) {
  .who a.small, .who button.link, .who-name { display: inline-flex; align-items: center; min-height: 36px; }
  .who-name { justify-content: center; min-width: 36px; }
  .who button.link, .who a.small { padding: 0 .35rem; }
  input[type="checkbox"], input[type="radio"] { width: 1.3rem; height: 1.3rem; flex: none; }
}
@media (max-width: 600px), (pointer: coarse) {
  .btn.small-btn, .ai-chip { min-height: 36px; padding-left: .9rem; padding-right: .9rem; }
  a.small:not(.pw-link), .panel-head a { display: inline-flex; align-items: center; min-height: 36px; }
  a.ref { display: inline-block; padding: .55rem 0; }  /* ticket numbers in table rows: grow the tap area, not the text */
}
@media (max-width: 600px), (pointer: coarse) {
  .kb-item > a:first-child { display: inline-block; padding: .45rem 0; }  /* article titles in lists */
}
@media (max-width: 600px), (pointer: coarse) {
  .fx-count { display: inline-block; padding: .5rem 0; }
  main p:has(> a:only-child) > a, main p > a:first-child:last-child { display: inline-block; padding: .5rem 0; }  /* "back to ..." links */
}
@media (max-width: 600px), (pointer: coarse) {
  .fx-crumbs a { display: inline-block; padding: .55rem 0; }
}
/* Phone browsers show and hide the address bar, so 100vh is taller than the visible area; dvh follows it. */
@supports (min-height: 100dvh) { .app-shell { min-height: 100dvh; } }
@media (min-width: 901px) { @supports (height: 100dvh) { .sidebar { height: 100dvh; } } }
