:root {
  --ink: #f2f0e6; --ink-2: #b9bddc; --ink-3: #868bb0;
  --bg: #090c22; --bg-2: #10142e; --panel: rgba(23, 28, 66, 0.82); --panel-solid: #171c42; --line: #2c3369;
  --accent: #e9b949; --accent-ink: #1a1405; --link: #a9b5ff;
  --series-a: #6f7ff0; --series-b: #b98500;
  --crit: #ff7583; --high: #ffb066; --norm: #e9c46a; --low: #9dbcff; --good: #5fe0b0;
  --glass-blur: blur(14px);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --glow: 0 0 24px rgba(233, 185, 73, .35);
  --edge: linear-gradient(140deg, rgba(233, 185, 73, .55), rgba(111, 127, 240, .32) 38%, rgba(111, 127, 240, .07) 75%);
  --aurora-a: rgba(80, 96, 255, .22); --aurora-b: rgba(233, 185, 73, .10); --aurora-c: rgba(0, 200, 255, .10);
}
:root[data-theme="light"] {
  --ink: #171a33; --ink-2: #464b72; --ink-3: #6a6f93;
  --bg: #eef0f8; --bg-2: #e3e6f3; --panel: rgba(255, 255, 255, 0.92); --panel-solid: #fff; --line: #cfd3e8;
  --accent: #b98500; --accent-ink: #fff; --link: #3343b5;
  --series-a: #4a5bd0; --series-b: #b98500;
  --crit: #c21f35; --high: #b35400; --norm: #806000; --low: #2f5bc0; --good: #0b7d55;
  --glow: 0 0 18px rgba(185, 133, 0, .25);
  --edge: linear-gradient(140deg, rgba(185, 133, 0, .5), rgba(74, 91, 208, .28) 40%, rgba(74, 91, 208, .1) 80%);
  --aurora-a: rgba(74, 91, 208, .12); --aurora-b: rgba(185, 133, 0, .08); --aurora-c: rgba(0, 150, 220, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100vh; }
body.disaster { --bg: #000; --bg-2: #000; --panel: #000; --panel-solid: #000; --line: #fff; --ink: #fff; --ink-2: #fff; --ink-3: #ddd; --accent: #ffdc00; --accent-ink: #000; --link: #ffdc00; --glass-blur: none; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .7rem; }
a { color: var(--link); }
small { display: block; color: var(--ink-3); font-size: .8rem; }
.mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--ink-3); }
.hidden, [hidden] { display: none !important; }
.boot { padding: 3rem; text-align: center; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .4rem; }
.row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; }

.brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.brand strong { display: block; line-height: 1.2; }
.brand small { line-height: 1.2; }
.logos { display: inline-flex; align-items: center; gap: .4rem; }
.logos img { width: 44px; height: 44px; object-fit: contain; }
.logo-text { font: 700 .66rem var(--mono); letter-spacing: .03em; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 6px; padding: .55rem .32rem; }

button, .button, summary.ghost { font: inherit; cursor: pointer; border-radius: 8px; padding: .48rem .85rem; border: 1px solid var(--line); background: transparent; color: var(--ink); text-decoration: none; display: inline-block; }
button:hover, .button:hover, summary.ghost:hover { border-color: var(--accent); }
.primary, a.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.ghost { border-color: transparent; color: var(--ink-2); }
.danger { color: var(--crit); border-color: var(--crit); }
.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font-size: .88rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: wait; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.15rem; backdrop-filter: var(--glass-blur); margin-bottom: 1rem; overflow: visible; }
.panel:has(.table), .panel:has(.chart-wrap), #unassigned { overflow-x: auto; }
.form { display: flex; flex-direction: column; gap: .75rem; }
.form label, .filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.filters label.check, label.check { flex-direction: row; align-items: center; gap: .4rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: .48rem .6rem; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }

.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; font-size: .77rem; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.pri-critical { color: var(--crit); border-color: var(--crit); }
.pri-high { color: var(--high); border-color: var(--high); }
.pri-normal { color: var(--norm); border-color: var(--norm); }
.pri-low { color: var(--low); border-color: var(--low); }
.st-resolved, .st-closed, .dev-operational { color: var(--good); border-color: var(--good); }
.st-in_progress, .st-assigned { color: var(--link); border-color: var(--link); }
.st-on_hold, .dev-degraded { color: var(--high); border-color: var(--high); }
.dev-offline { color: var(--crit); border-color: var(--crit); }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--ink-3); font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; padding: .4rem .55rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.overdue { color: var(--crit); font-weight: 700; }
.empty { color: var(--ink-3); padding: 1rem 0; }
.pager { display: flex; align-items: center; gap: 1rem; justify-content: center; padding: 1rem; }

/* Public */
.public-top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); background: var(--panel); backdrop-filter: var(--glass-blur); }
.public-top nav { display: flex; gap: .2rem; flex-wrap: wrap; align-items: center; }
.public-top nav a { color: var(--ink-2); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; }
.public-top nav a.on { color: var(--accent); font-weight: 700; }
.public-main { position: relative; padding: 1.5rem 1rem 3rem; min-height: calc(100vh - 75px); }
.landing-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.landing-canvas canvas, .twin-canvas canvas, .bay-canvas canvas, .journey-canvas canvas, .welcome-canvas canvas { display: block; width: 100%; height: 100%; }
.portal { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.5rem; align-items: center; min-height: 70vh; }
.portal-intro h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); font-weight: 800; letter-spacing: -.025em; }
.portal-intro > p:not(.eyebrow) { color: var(--ink-2); font-size: 1.08rem; }
.emergency { margin-top: 1.25rem; border-left: 3px solid var(--crit); padding: .65rem .9rem; background: var(--panel); border-radius: 0 10px 10px 0; }
.emergency strong { display: block; }
.receipt { grid-column: 1 / -1; max-width: 480px; margin: 0 auto; text-align: center; }
.code { font: 700 1.3rem var(--mono); color: var(--accent); letter-spacing: .08em; overflow-wrap: anywhere; }
.narrow { max-width: 760px; margin: 0 auto; }
.row-form { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.row-form label { flex: 1 1 200px; }
.login { display: grid; place-items: center; min-height: 68vh; }
.login form { width: min(400px, 100%); }
.journey-canvas { height: 230px; margin: .5rem -.4rem; }
.stepper { list-style: none; display: flex; padding: 0; margin: .5rem 0 1rem; gap: .3rem; font-size: .84rem; flex-wrap: wrap; }
.stepper li { flex: 1 1 90px; padding: .4rem .55rem; border-top: 3px solid var(--line); color: var(--ink-3); }
.stepper li.done { border-color: var(--accent); color: var(--ink-2); }
.stepper li.now { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.resolution { border-left: 3px solid var(--good); padding-left: .8rem; }
.thread { list-style: none; padding: 0; margin: 0 0 1rem; }
.thread li { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .5rem; }
.thread li.team { border-left: 3px solid var(--accent); }
.thread li.internal { border-style: dashed; border-left: 3px dashed var(--high); }
.thread p { margin: .3rem 0 0; }
.thread small { display: inline; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Staff shell */
.staff { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.1rem; padding: 1rem .8rem; background: var(--bg-2); border-right: 1px solid var(--line); }
.side .brand { flex-direction: column; align-items: flex-start; gap: .4rem; }
.side nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.side nav a { color: var(--ink-2); text-decoration: none; padding: .5rem .7rem; border-radius: 8px; font-weight: 600; }
.side nav a:hover { background: var(--panel); }
.side nav a.on { background: var(--accent); color: var(--accent-ink); }
.side-foot .button { width: 100%; text-align: center; }
.topbar { display: flex; align-items: center; gap: .3rem; padding: .4rem 1rem; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.disaster-flag { background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: .15rem .6rem; border-radius: 4px; letter-spacing: .05em; }
.popover { position: relative; }
.popover summary { list-style: none; }
.popover summary::-webkit-details-marker { display: none; }
.popover-body { position: absolute; right: 0; top: 110%; width: 300px; max-width: 86vw; max-height: 60vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; display: flex; flex-direction: column; gap: .15rem; z-index: 20; }
.popover-body a { padding: .45rem .55rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .88rem; }
.popover-body a.unread { font-weight: 700; border-left: 2px solid var(--accent); }
.popover-body .link { text-align: left; padding: .45rem .55rem; }
.popover-body p { padding: .5rem; margin: 0; }
.badge { background: var(--crit); color: #1a0508; font-weight: 800; border-radius: 99px; font-size: .72rem; padding: 0 .4rem; }
.page { padding: 1.2rem; }
.page.narrow { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; align-items: center; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; flex: 0 1 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; padding: 0 1.2rem; }
.page .tiles, .narrow .tiles { padding: 0; margin: .8rem 0 1rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; text-decoration: none; color: var(--ink); display: block; }
.tile b { display: block; font-size: 1.75rem; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile span { color: var(--ink-3); font-size: .82rem; }
.tile.alert { border-color: var(--crit); }
.tile.alert b { color: var(--crit); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }

/* 3D stages */
.twin-page { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 1rem; }
.twin, .bay { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 10%, #182060 0%, #090c22 72%); border-bottom: 1px solid var(--line); }
.twin { height: min(66vh, 680px); min-height: 400px; }
.bay { height: min(54vh, 520px); min-height: 340px; }
.twin-canvas, .bay-canvas { position: absolute; inset: 0; }
.twin-canvas canvas { touch-action: none; }
.bay-canvas canvas { touch-action: pan-y; }
.schematic, .bay-hint, .bay-status { position: absolute; margin: 0; left: 1rem; top: .75rem; font-size: .8rem; color: #ffd98a; background: rgba(9, 12, 34, .7); padding: .2rem .6rem; border-radius: 6px; }
.bay-status { top: 2.6rem; color: #dfe3ff; }
.bay-status[hidden], .schematic[hidden] { display: none; }
.tip3d { position: absolute; z-index: 3; margin: 0; pointer-events: none; max-width: 320px; font-size: .84rem; color: #f2f0e6; background: rgba(9, 12, 34, .92); border: 1px solid #2c3369; padding: .3rem .6rem; border-radius: 6px; }
.twin-panel { position: absolute; right: .9rem; top: .9rem; bottom: 4.2rem; width: min(330px, calc(100% - 1.8rem)); overflow: auto; margin: 0; z-index: 4; }
.twin-panel .close { float: right; }
.scrubber { position: absolute; left: .9rem; right: .9rem; bottom: .8rem; display: flex; align-items: center; gap: .7rem; background: rgba(9, 12, 34, .78); color: #f2f0e6; border: 1px solid #2c3369; border-radius: 10px; padding: .3rem .7rem; backdrop-filter: blur(10px); }
.scrubber .ghost { color: #f2f0e6; }
.scrubber input { flex: 1; padding: 0; background: none; border: 0; accent-color: #e9b949; }
.scrubber output { font: .78rem var(--mono); min-width: 9.5rem; text-align: right; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: .7rem; }
.member { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.portrait { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #232b6b; border: 1px solid var(--line); flex: none; }
.portrait-initials { display: inline-grid; place-items: center; font-size: .72rem; font-weight: 800; color: var(--accent); }
.files { list-style: none; margin: .3rem 0 .6rem; padding: 0; font-size: .9rem; }
.files small { display: inline; }
.welcome { position: fixed; inset: 0; z-index: 50; background: radial-gradient(90% 90% at 35% 45%, #1c2570 0%, #070a1d 75%); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; color: #f2f0e6; }
.welcome-canvas { height: 100%; }
.welcome-card { max-width: 430px; margin: 1.2rem; }

/* Chart */
.chart-wrap { position: relative; overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--ink); fill-opacity: .06; }
.series-a { fill: var(--series-a); background: var(--series-a); }
.series-b { fill: var(--series-b); background: var(--series-b); }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--ink-2); margin-top: .4rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { width: 11px; height: 11px; border-radius: 3px; }
.tooltip { position: absolute; top: 0; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 6px; padding: .2rem .5rem; font-size: .78rem; white-space: nowrap; pointer-events: none; }
.table-view { margin-top: .5rem; font-size: .85rem; }
.table-view summary { cursor: pointer; color: var(--link); }

/* Ticket page */
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; margin-top: 1rem; }
dl { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .3rem .6rem; margin: 0; font-size: .88rem; }
dt { color: var(--ink-3); }
dd { margin: 0; overflow-wrap: anywhere; }
.details-inline { grid-template-columns: 8rem minmax(0, 1fr); }
.activity { list-style: none; padding: 0; margin: 0; font-size: .85rem; max-height: 300px; overflow: auto; }
.activity li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.code-block { font: .78rem/1.5 var(--mono); background: var(--bg-2); padding: .7rem; border-radius: 8px; overflow-x: auto; }
dialog.panel { width: min(600px, calc(100vw - 2rem)); color: var(--ink); background: var(--panel-solid); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .4rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--panel-solid); border: 1px solid var(--good); border-radius: 8px; padding: .55rem .85rem; }
.toast-error { border-color: var(--crit); }
.print-head, .print-sign, .print-only, .narrow-only { display: none; }

/* ---- Futuristic layer -------------------------------------------------- */
@font-face { font-family: "Space Grotesk"; src: url("/vendor/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/vendor/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

body { font-feature-settings: "cv11", "ss01"; }
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 10%, var(--aurora-a), transparent 70%),
    radial-gradient(35% 30% at 85% 15%, var(--aurora-c), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, var(--aurora-b), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 75%);
}
@keyframes aurora { from { transform: translate3d(-3%, -2%, 0) rotate(0deg); } to { transform: translate3d(3%, 2%, 0) rotate(6deg); } }

h1, h2, .brand strong, .tile b, .code, .palette-input input { font-family: var(--display); }
h1 { font-weight: 700; letter-spacing: -.02em; }
.grad { display: inline-block; padding: 0 .02em .08em; margin: 0 -.02em -.08em; background: linear-gradient(100deg, #ffd98a 0%, var(--accent) 35%, #8f9cff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.i { width: 1.05em; height: 1.05em; flex: none; vertical-align: -.15em; }
button, .button, summary.ghost { display: inline-flex; align-items: center; gap: .45rem; transition: border-color .2s, box-shadow .2s, transform .2s, background .2s; }
.primary, a.primary { background: linear-gradient(135deg, #ffd98a, var(--accent) 55%, #c9951f); box-shadow: 0 6px 22px -8px rgba(233, 185, 73, .7), inset 0 1px 0 rgba(255, 255, 255, .45); justify-content: center; }
.primary:hover { transform: translateY(-1px); box-shadow: var(--glow), 0 10px 28px -10px rgba(233, 185, 73, .9); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 185, 73, .18); }

/* Glass panels with a gradient edge and a pointer spotlight. */
.panel:not(dialog):not(.twin-panel), .tile { position: relative; isolation: isolate; }
.panel, .tile { border: 1px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--edge) border-box; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .6); }
.panel::before, .tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(380px circle at var(--mx, -999px) var(--my, -999px), rgba(233, 185, 73, .11), transparent 45%);
}
.tile { overflow: visible; transition: transform .25s, box-shadow .25s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.tile .i { position: absolute; right: .8rem; top: .8rem; width: 1.3rem; height: 1.3rem; color: var(--accent); opacity: .65; }
.tile b { font-size: 2rem; letter-spacing: -.02em; }
.tile::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none; border-radius: 8px; opacity: .55;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 10px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) left top / 1.5px 10px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 10px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) right bottom / 1.5px 10px no-repeat;
}
.tile.alert { animation: alertPulse 2.4s ease-in-out infinite; }
.tile.alert .i { color: var(--crit); }
@keyframes alertPulse { 50% { box-shadow: 0 0 0 1px var(--crit), 0 0 26px -4px var(--crit); } }

/* Shell */
.side { background: linear-gradient(180deg, rgba(16, 20, 46, .92), rgba(9, 12, 34, .92)); backdrop-filter: var(--glass-blur); }
:root[data-theme="light"] .side { background: rgba(255, 255, 255, .8); }
.side nav a { display: flex; align-items: center; gap: .65rem; position: relative; transition: background .2s, color .2s, transform .2s; }
.side nav a:hover { transform: translateX(3px); color: var(--ink); }
.side nav a .i { opacity: .8; }
.side nav a.on { background: linear-gradient(90deg, rgba(233, 185, 73, .95), rgba(233, 185, 73, .7)); box-shadow: var(--glow); }
.side nav a.on::before { content: ""; position: absolute; left: -.8rem; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.topbar { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: var(--glass-blur); }
.hud { display: inline-flex; align-items: center; gap: .45rem; font: 600 .72rem var(--mono); letter-spacing: .12em; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .75rem; }
.hud .i { width: .9rem; height: .9rem; }
.hud-sep { width: 1px; height: 12px; background: var(--line); }
.link-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.link-dot.up { background: var(--good); box-shadow: 0 0 10px var(--good); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }
.cmdk { border-color: var(--line); color: var(--ink-3); min-width: 230px; justify-content: flex-start; }
.cmdk kbd { margin-left: auto; }
kbd { font: 600 .68rem var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; color: var(--ink-2); background: var(--bg-2); }
.badge { position: relative; top: -.4rem; margin-left: -.35rem; }
.disaster-flag { display: inline-flex; gap: .4rem; align-items: center; }

/* Command palette */
dialog.palette { width: min(640px, calc(100vw - 2rem)); margin-top: 14vh; padding: 0; border: 1px solid transparent; border-radius: 16px; color: var(--ink); background: linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box, var(--edge) border-box; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), var(--glow); }
dialog.palette::backdrop { background: rgba(4, 6, 20, .55); backdrop-filter: blur(4px); }
.palette-input { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.palette-input .i { color: var(--accent); width: 1.2rem; height: 1.2rem; }
.palette-input input { border: 0; background: none; font-size: 1.08rem; padding: 0; box-shadow: none; }
#paletteList { list-style: none; margin: 0; padding: .4rem; max-height: 52vh; overflow: auto; }
#paletteList li { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px; cursor: pointer; }
#paletteList li small { display: inline; margin-left: .5rem; }
#paletteList li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#paletteList li.on { background: linear-gradient(90deg, rgba(233, 185, 73, .18), rgba(111, 127, 240, .1)); box-shadow: inset 2px 0 0 var(--accent); }
#paletteList li.empty { color: var(--ink-3); cursor: default; }
.palette-foot { margin: 0; padding: .55rem 1rem; border-top: 1px solid var(--line); font-size: .74rem; color: var(--ink-3); display: flex; gap: .3rem; align-items: center; }

/* 3D viewports get a HUD frame. */
.twin::after, .bay::after {
  content: ""; position: absolute; inset: 10px; pointer-events: none; z-index: 2; opacity: .7;
  background:
    linear-gradient(#ffd98a, #ffd98a) left top / 22px 2px no-repeat, linear-gradient(#ffd98a, #ffd98a) left top / 2px 22px no-repeat,
    linear-gradient(#ffd98a, #ffd98a) right top / 22px 2px no-repeat, linear-gradient(#ffd98a, #ffd98a) right top / 2px 22px no-repeat,
    linear-gradient(#ffd98a, #ffd98a) left bottom / 22px 2px no-repeat, linear-gradient(#ffd98a, #ffd98a) left bottom / 2px 22px no-repeat,
    linear-gradient(#ffd98a, #ffd98a) right bottom / 22px 2px no-repeat, linear-gradient(#ffd98a, #ffd98a) right bottom / 2px 22px no-repeat;
}
.twin { background: #0a0d2a; }
.bay { background: #0d1238; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.chip { background: color-mix(in srgb, currentColor 10%, transparent); }
.toast { backdrop-filter: var(--glass-blur); background: color-mix(in srgb, var(--panel-solid) 88%, transparent); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7); }
.login form { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), var(--glow); }
.login h1 { font-family: var(--mono); letter-spacing: .06em; font-size: 1.5rem; }
.public-top nav a { display: inline-flex; align-items: center; gap: .4rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- Uiverse.io elements (MIT), adapted to this palette ----------------- */
/* HUD bracket button, after Dashrath-Sharma: corner brackets grow into a full frame on hover. */
.button:not(.primary)::before, .button:not(.primary)::after { content: ""; position: absolute; pointer-events: none; transition: background-size .45s; filter: drop-shadow(0 0 5px var(--accent)); }
.button:not(.primary) { position: relative; }
.button:not(.primary)::before { inset: -1px; background: linear-gradient(var(--accent), var(--accent)) left top / 15% 2px no-repeat, linear-gradient(var(--accent), var(--accent)) left top / 2px 30% no-repeat; }
.button:not(.primary)::after { inset: -1px; background: linear-gradient(var(--accent), var(--accent)) right bottom / 15% 2px no-repeat, linear-gradient(var(--accent), var(--accent)) right bottom / 2px 30% no-repeat; }
.button:not(.primary):hover::before, .button:not(.primary):focus-visible::before { background-size: 100% 2px, 2px 100%; }
.button:not(.primary):hover::after, .button:not(.primary):focus-visible::after { background-size: 100% 2px, 2px 100%; }
.button.danger::before, .button.danger::after { filter: drop-shadow(0 0 5px var(--crit)); --accent: var(--crit); }

/* Neon border cycle, after Shashvhat, toned to brand colors and without the wobble. */
.cmdk:hover, .cmdk:focus-visible { animation: borderCycle .9s linear infinite; color: var(--ink); }
@keyframes borderCycle {
  0%, 100% { border-color: var(--accent) #8f9cff #00d4ff var(--accent); }
  25% { border-color: var(--accent) var(--accent) #8f9cff #00d4ff; }
  50% { border-color: #00d4ff var(--accent) var(--accent) #8f9cff; }
  75% { border-color: #8f9cff #00d4ff var(--accent) var(--accent); }
}

/* Equalizer loader, after NlghtM4re. */
.bars-loader { display: inline-flex; align-items: center; gap: 2px; height: 22px; vertical-align: middle; margin-right: .5rem; }
.bars-loader i { width: 4px; height: 6px; background: #ffd98a; box-shadow: 0 0 10px #e9b949; animation: bar 2.4s infinite; }
.bars-loader i:nth-child(2) { animation-delay: .1s; } .bars-loader i:nth-child(3) { animation-delay: .2s; } .bars-loader i:nth-child(4) { animation-delay: .3s; }
.bars-loader i:nth-child(5) { animation-delay: .4s; } .bars-loader i:nth-child(6) { animation-delay: .5s; } .bars-loader i:nth-child(7) { animation-delay: .6s; }
.bars-loader i:nth-child(8) { animation-delay: .7s; } .bars-loader i:nth-child(9) { animation-delay: .8s; } .bars-loader i:nth-child(10) { animation-delay: .9s; }
.bars-loader i:nth-child(11) { animation-delay: 1s; } .bars-loader i:nth-child(12) { animation-delay: 1.1s; }
@keyframes bar { 0%, 26%, 100% { transform: scaleY(1); box-shadow: 0 0 8px #e9b949; } 13% { transform: scaleY(3.4); box-shadow: 0 0 18px #e9b949; } }
.bay-status { display: flex; align-items: center; }

/* Glow ring loader, after aadium. */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.4rem; color: var(--ink-2); font: 600 .8rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.ring-loader { width: 84px; height: 84px; border-radius: 50%; animation: spin 1s linear infinite;
  box-shadow: 0 5px 10px #8f9cff, 0 -5px 10px #e9b949, 5px 0 10px #00d4ff, -5px 0 10px #00d4ff,
    inset 0 5px 10px #e9b949, inset 0 -5px 10px #8f9cff, inset 5px 0 10px #00d4ff, inset -5px 0 10px #00d4ff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Neon power switch, after vinodjangid07, used for Disaster Mode. */
.power-row { display: flex; align-items: center; gap: 1.1rem; margin-top: .4rem; }
.power-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.power { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  background: #3a3f5c; border: 2px solid #6b7092; box-shadow: inset 0 0 3px #000; transition: box-shadow .3s, background .3s, border-color .3s; }
.power svg { width: 1.25rem; height: 1.25rem; }
.power svg path { fill: #22263d; transition: fill .3s; }
.power-input:focus-visible + .power { outline: 2px solid var(--accent); outline-offset: 4px; }
.power-input:checked + .power { background: #c9503e; border-color: #fff;
  box-shadow: inset 0 0 10px #ff8a70, 0 0 40px #ff5a45, 0 0 90px rgba(255, 90, 69, .6), 0 0 5px #ff8a70; }
.power-input:checked + .power svg { filter: drop-shadow(0 0 5px #ffb3a3); }
.power-input:checked + .power svg path { fill: #fff; }

/* Neon checkbox, after javierBarroso: an off bar that morphs into an on ring. */
input[type=checkbox]:not(.power-input) { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: #4a4f6e; display: inline-grid; place-content: center; cursor: pointer; transition: background .4s, box-shadow .4s; flex: none; }
input[type=checkbox]:not(.power-input)::before { content: ""; width: 3px; height: 13px; border-radius: 3px; background: #fff; transition: all .3s; box-sizing: border-box; }
input[type=checkbox]:not(.power-input):checked { background: #2fbf71; box-shadow: 0 0 12px rgba(47, 191, 113, .85); }
input[type=checkbox]:not(.power-input):checked::before { width: 13px; height: 13px; border-radius: 50%; background: transparent; border: 2px solid #fff; }
input[type=checkbox]:not(.power-input):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Neon upload circle, after akshat-patel28. The flicker only plays on hover. */
.upload { position: relative; display: flex !important; flex-direction: row !important; align-items: center; gap: .9rem !important; padding: .6rem; border: 1px dashed var(--line); border-radius: 12px; cursor: pointer; }
.upload-ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #00e5ff;
  border: 2px solid #00e5ff; box-shadow: 0 0 26px rgba(0, 229, 255, .55), inset 0 0 10px rgba(0, 229, 255, .7), 0 0 4px #fff; }
.upload-ring .i { width: 1.4rem; height: 1.4rem; }
.upload:hover .upload-ring, .upload:focus-within .upload-ring { animation: flicker 2s linear infinite; }
.upload:focus-within { border-color: var(--accent); }
.upload-text { display: flex; flex-direction: column; min-width: 0; }
.upload-text strong { color: var(--ink); }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
@keyframes flicker { 0%, 10%, 30%, 100% { opacity: 1; } 5%, 25% { opacity: .25; box-shadow: none; } }

/* Office staff accounts */
.account { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem 2rem; align-items: start; }
.account-intro { grid-column: 1 / -1; max-width: 680px; }
.account-intro h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.account-intro > p:not(.eyebrow) { color: var(--ink-2); }
.account #signup { grid-row: span 2; }
.filing-as, .account-hint { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.filing-as > span, .account-hint > span { flex: 1; min-width: 0; }
.filing-as strong, .account-hint strong { display: block; color: var(--ink); }
.filing-as .i, .account-hint .i { color: var(--accent); width: 1.25rem; height: 1.25rem; }
.account-hint { text-decoration: none; color: var(--ink-2); transition: border-color .2s, box-shadow .2s; }
.account-hint:hover { border-color: var(--accent); box-shadow: var(--glow); }
.narrow.wide { max-width: 980px; }
.setup-link { color: var(--accent) !important; font-weight: 600; }
.ok-box { border-color: var(--good); }
.ok-box .i { color: var(--good); }
.narrow details { margin: .6rem 0; }
.narrow details summary { cursor: pointer; }
.narrow ol { margin: .4rem 0 .4rem 1.2rem; padding: 0; }
.narrow ol li { margin: .2rem 0; }
.chip.updated { color: var(--accent); border-color: var(--accent); animation: blink 2s ease-in-out infinite; }
.chip .i { width: .85rem; height: .85rem; }
.public-top .popover-body a { display: block; }
.row.center { justify-content: center; }
@media (max-width: 760px) { .account { grid-template-columns: minmax(0, 1fr); } .account #signup { grid-row: auto; } }

/* ---- Finish: motion-aware scrolling, live tables, lazy sections ----------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.strip, .portal { content-visibility: auto; contain-intrinsic-size: auto 620px; }

/* ---- Landing hero -------------------------------------------------------- */
.public-top { position: sticky; top: 0; }
.hero { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; min-height: min(86vh, 880px); overflow: visible; }
.hero-copy { position: relative; z-index: 2; order: -1; min-width: 0; padding: 2.2rem 1rem 2.6rem 0; overflow: visible; }
.hero-title { font-size: clamp(2.5rem, 5.4vw, 4.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 0 0 1rem; overflow: visible; }
.hero-sub { color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.14rem); max-width: 46ch; margin-bottom: 1.4rem; }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.big, a.big { padding: .78rem 1.35rem; font-size: 1.02rem; border-radius: 12px; }
/* The team lineup runs from beside the copy to the window's right edge, faded on every side so it has no frame. */
.public-main { overflow-x: clip; }
.hero-stage { position: absolute; z-index: 0; user-select: none; -webkit-user-select: none; top: -1.5rem; bottom: 0; left: 42%; right: calc(min(0px, (1280px - 100vw) / 2) - 1rem); min-width: 0; }
.hero-stage canvas { display: block; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 93%, transparent), linear-gradient(180deg, transparent, #000 10%, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 16%, #000 93%, transparent), linear-gradient(180deg, transparent, #000 10%, #000 78%, transparent);
  mask-composite: intersect; }
.hero-stage.flat { position: relative; inset: auto; grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: .8rem; align-content: center; justify-content: center; height: auto; min-height: 0; padding: 2rem 0; }
.crew-card { width: 150px; text-align: center; padding: 1rem .8rem; }
.crew-card strong { display: block; margin-top: .55rem; font-family: var(--display); }
.crew-face { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font: 800 1.1rem var(--display); color: var(--accent-ink); background: linear-gradient(135deg, #ffd98a, var(--accent)); }
.crew-face.iot { background: linear-gradient(135deg, #9dbcff, var(--series-a)); color: #fff; }
.hero-crew { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 9%; position: relative; z-index: 2; pointer-events: none; display: flex; justify-content: center; align-items: center; gap: .9rem; flex-wrap: wrap; padding-bottom: 1.2rem; overflow: visible; }
.crew-caption { background: var(--panel); border: 1px solid var(--line); backdrop-filter: var(--glass-blur); border-radius: 12px; padding: .5rem .95rem; min-width: 200px; overflow: visible; }
.crew-caption strong { display: block; font-family: var(--display); line-height: 1.25; }
.crew-caption small { display: block; }
.crew-hint { margin-top: .2rem; color: var(--ink-3); font-size: .74rem; }

/* ---- "What we fix" strip -------------------------------------------------- */
.strip { position: relative; z-index: 1; max-width: 1100px; margin: 3.5rem auto 4.5rem; text-align: center; }
.eyebrow.center { justify-content: center; width: 100%; }
.strip-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.4rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.cat-card { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.1rem .8rem; font: 600 .88rem var(--sans); color: var(--ink-2); cursor: pointer; }
.cat-card .i { position: static; width: 1.7rem; height: 1.7rem; opacity: 1; }
.cat-card:hover { color: var(--ink); border-color: var(--accent); }

/* ---- Request section ------------------------------------------------------ */
.portal { min-height: 0; align-items: start; padding-bottom: 2rem; }
.portal-title { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: .6rem; }
.mini-steps { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; color: var(--ink-2); }
.mini-steps li { display: flex; align-items: center; gap: .8rem; }
.mini-steps strong { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-family: var(--display); flex: none; }

@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-copy { padding: 1.4rem 0 .6rem; }
  .hero-stage { position: relative; inset: auto; height: 56vh; min-height: 380px; margin: 0 -1rem; }
  .hero-stage.flat { grid-column: 1; grid-row: auto; margin: 0; }
  .hero-crew { grid-column: 1; grid-row: auto; margin-top: -3.4rem; }
}

body.disaster::before, body.disaster::after { display: none; }
body.disaster .tile.alert { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 980px) {
  .dash-grid, .ticket-grid, .team-grid { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .portal { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
}
@media (max-width: 760px) {
  .staff { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); gap: .6rem; }
  .side .brand { flex-direction: row; flex: 1; }
  .side nav { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; }
  .side nav a { white-space: nowrap; }
  .topbar { flex-wrap: wrap; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: 100%; }
  .table.cards tr { border: 1px solid var(--line); border-radius: 10px; padding: .4rem .7rem; margin-bottom: .6rem; }
  .table.cards td { border: 0; padding: .22rem 0; }
  .table.cards td[data-label]::before { content: attr(data-label); display: block; color: var(--ink-3); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
  .welcome { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .welcome-card { margin: 0 1rem 1rem; max-width: none; }
  .scrubber output { min-width: 0; }
  .narrow-only { display: inline; }
  .bay-hint { right: 1rem; }
  .twin-panel { bottom: .9rem; z-index: 6; }
  .cmdk { min-width: 0; }
  .cmdk span, .cmdk kbd, .hud > .muted { display: none; }
  .side nav a.on::before { display: none; }
}
@media print {
  :root, body { --ink: #000; --ink-2: #222; --ink-3: #444; --bg: #fff; --panel: #fff; --panel-solid: #fff; --line: #999; --accent: #000; --crit: #000; --high: #000; --norm: #000; --low: #000; --good: #000; --link: #000; --glass-blur: none; }
  body { background: #fff; }
  body::before, body::after, .tile::after { display: none; }
  .side, .topbar, .no-print, #toasts { display: none !important; }
  .staff, .ticket-grid, .dash-grid { display: block; }
  .print-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
  .print-only { display: block; }
  .print-sign { display: flex; justify-content: space-between; margin-top: 4rem; }
  .print-sign span { border-top: 1px solid #000; width: 40%; padding-top: .3rem; }
}

/* ---- Public side nav ------------------------------------------------------ */
.public-top { flex-wrap: nowrap; justify-content: flex-start; min-height: 75px; }
.public-top .grow { flex: 1; }
.public-tools { display: flex; align-items: center; gap: .2rem; }
.side-toggle { padding: .45rem; }
.public-body { position: relative; }
.public-body .side { display: none; position: fixed; top: 75px; right: 0; bottom: 0; width: 240px; max-width: 80vw; height: auto; z-index: 8; border-right: 0; border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0, 0, 0, .35); }
.public-body.side-open .side { display: flex; }
.public-body .side nav a.on::before { left: auto; right: -.8rem; }
.public-body .side nav a:hover { transform: translateX(-3px); }
.public-body .public-main { min-height: calc(100vh - 75px); }
@media (max-width: 760px) {
  .public-top { min-height: 0; }
  .public-top .brand small { display: none; }
  .public-body .side { top: 64px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; border-bottom: 0; }
  .public-body .side nav { flex-direction: column; overflow: visible; }
  .public-body .side nav a.on::before { display: none; }
}

/* ---- Show password -------------------------------------------------------- */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 2.6rem; }
.pw-toggle { position: absolute; top: 50%; right: .25rem; transform: translateY(-50%); padding: .3rem; line-height: 0; }
.pw-toggle:hover { color: var(--ink); }

/* ---- Chat ----------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; height: calc(100vh - 9rem); min-height: 440px; max-width: 1280px; margin: 0 auto; }
.chat > .panel { margin: 0; display: flex; flex-direction: column; min-height: 0; padding: 0; }
.chat-list-head { padding: 1rem; border-bottom: 1px solid var(--line); }
.chat-list-head h1 { font-size: 1.3rem; margin: 0; }
.chat-threads { overflow-y: auto; padding: .4rem; display: flex; flex-direction: column; gap: .15rem; }
.chat-threads > .muted { padding: .8rem; margin: 0; font-size: .9rem; }
.chat-thread { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.chat-thread:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.chat-thread.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.chat-thread-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-thread-text strong { font-size: .92rem; }
.chat-thread-text small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.chat-thread.unread small { color: var(--ink); font-weight: 600; }
.chat-thread .badge, .side nav .badge, .side-toggle .badge { position: static; margin: 0 0 0 auto; }
.side-toggle { position: relative; }
.side-toggle .badge { position: absolute; top: -.2rem; right: -.3rem; }
.chat-thread .portrait .i, .chat-head .portrait .i { width: 16px; height: 16px; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-3); max-width: 36ch; padding: 2rem; }
.chat-empty .i { width: 40px; height: 40px; color: var(--accent); margin-bottom: .6rem; }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.chat-head span { display: flex; flex-direction: column; }
.chat-head small { color: var(--ink-3); font-size: .8rem; }
.chat-back { display: none; padding: .35rem; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; }
.chat-more { align-self: center; margin-bottom: .8rem; }
.chat-hint { margin: auto; }
.chat-messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; margin-top: auto; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-name { font-size: .75rem; color: var(--accent); font-weight: 700; margin: 0 0 .15rem .3rem; }
.msg-bubble { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: .5rem .75rem; overflow-wrap: anywhere; }
.msg.mine .msg-bubble { background: color-mix(in srgb, var(--accent) 22%, var(--bg-2)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 14px 14px 4px 14px; }
.msg-bubble p { margin: 0; white-space: pre-wrap; }
.msg-bubble img { display: block; max-width: 100%; max-height: 280px; border-radius: 8px; margin: .1rem 0 .3rem; }
.msg-file { display: flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; margin-bottom: .2rem; }
.msg-file small { color: var(--ink-3); }
.msg time { font-size: .7rem; color: var(--ink-3); margin: .15rem .3rem 0; }
.chat-compose { display: flex; align-items: flex-end; gap: .4rem; padding: .7rem; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; resize: none; min-height: 2.4rem; max-height: 160px; line-height: 1.4; }
.chat-compose button, .chat-attach { padding: .55rem .7rem; }
@media (max-width: 760px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 8rem); }
  .chat.has-thread .chat-list, .chat:not(.has-thread) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
  .msg { max-width: 88%; }
}
.chat-attach::before, .chat-attach::after, .chat-back::before, .chat-back::after { display: none; }
@media (max-width: 760px) {
  .hide-narrow, .public-top .brand > span:not(.logos) { display: none; }
  .public-tools { gap: 0; }
}

/* ---- Chat: Messenger touches ---------------------------------------------- */
.chat-list-head { display: flex; flex-direction: column; gap: .6rem; }
.chat-search { position: relative; display: block; }
.chat-search .i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.chat-search input { padding-left: 2.1rem; border-radius: 999px; }
.chat-section { margin: .5rem .6rem .2rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.chat-results { overflow-y: auto; padding: 0 .4rem .6rem; border-top: 1px solid var(--line); max-height: 45%; }
.chat-results > .muted { padding: 0 .6rem; font-size: .88rem; }
.chat-hit { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .6rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.chat-hit:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.chat-hit small { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 .1em; }
.chat-thread-top { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.chat-thread-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-top time { font-size: .72rem; color: var(--ink-3); flex: none; }
.chat-thread.unread .chat-thread-top time { color: var(--accent); font-weight: 700; }
.chat-avatar { position: relative; display: inline-flex; flex: none; }
.chat-avatar .portrait { width: 40px; height: 40px; }
/* Active status: a green dot on the picture, shown only while the person has the app open. */
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence-dot { display: none; }
.presence-dot.on { display: block; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--good); border: 2px solid var(--bg-2); box-shadow: 0 0 6px var(--good); }
td .row > .presence-dot.on, .row > .presence-dot.on { position: static; width: 10px; height: 10px; flex: none; }
.presence-label { font-size: .76rem; color: var(--ink-3); }
.presence-label.on { color: var(--good); font-weight: 700; }
td .presence-label:not(:empty) { display: block; margin-top: .1rem; }
.chat-head-text { display: flex; flex-direction: column; }
.chat-head .chat-avatar .portrait { width: 36px; height: 36px; }

.chat-day { align-self: center; margin: .8rem 0 .3rem; font-size: .72rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.chat-day span { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: .15rem .7rem; }
.chat-messages { gap: .15rem; }
.msg { max-width: min(80%, 580px); }
.msg:not(.joined-prev) { margin-top: .45rem; }
.msg-row { display: flex; align-items: center; gap: .3rem; max-width: 100%; }
.msg.mine .msg-row { flex-direction: row-reverse; }
.msg-bubble { border-radius: 18px; }
.msg:not(.mine).joined-prev .msg-bubble { border-top-left-radius: 5px; }
.msg:not(.mine).joined-next .msg-bubble { border-bottom-left-radius: 5px; }
.msg.mine .msg-bubble { border-radius: 18px; }
.msg.mine.joined-prev .msg-bubble { border-top-right-radius: 5px; }
.msg.mine.joined-next .msg-bubble { border-bottom-right-radius: 5px; }
.msg time { font-size: .68rem; }
.msg.flash .msg-bubble { animation: msg-flash 2.2s ease-out; }
@keyframes msg-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--accent); } 100% { box-shadow: none; } }

.msg-tools { position: relative; flex: none; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-tools, .msg-tools:focus-within, .msg-tools:has(.msg-pop:not([hidden])) { opacity: 1; }
.msg-tools { display: inline-flex; align-items: center; }
.tool-open { padding: .25rem; border-radius: 50%; color: var(--ink-3); }
.tool-open::before, .tool-open::after { display: none; }
.react-picker { position: absolute; bottom: calc(100% + 4px); z-index: 5; display: flex; gap: .1rem; padding: .25rem; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.msg:not(.mine) .react-picker { left: 0; }
.msg.mine .react-picker { right: 0; }
.react-picker[hidden] { display: none; }
.react-picker button { border: 0; padding: .2rem .3rem; font-size: 1.25rem; line-height: 1; border-radius: 50%; transition: transform .12s; }
.react-picker button:hover { transform: scale(1.3); }
.react-picker button.mine { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.msg-reactions { display: flex; flex-wrap: wrap; gap: .2rem; margin: -.35rem .5rem 0; position: relative; z-index: 1; }
.reaction { padding: .05rem .4rem; font-size: .85rem; border-radius: 999px; background: var(--panel-solid); border: 1px solid var(--line); gap: .2rem; }
.reaction b { font-size: .72rem; color: var(--ink-2); }
.reaction.mine { border-color: var(--accent); }

.msg-seen { align-self: flex-end; display: inline-flex; align-items: center; gap: .25rem; margin: .2rem .3rem 0; font-size: .72rem; color: var(--ink-3); }
.msg-seen .i { width: 14px; height: 14px; color: var(--accent); }
.chat-typing { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; font-size: .8rem; color: var(--ink-3); }
.chat-typing .dots { display: inline-flex; gap: 3px; padding: .45rem .6rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; }
.chat-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: typing-dot 1.2s infinite ease-in-out; }
.chat-typing .dots i:nth-child(2) { animation-delay: .15s; }
.chat-typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (hover: none) { .msg-tools { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .chat-typing .dots i, .msg.flash .msg-bubble { animation: none; } }
.staff-body .chat { margin: 1rem auto; width: calc(100% - 2rem); height: calc(100vh - 54px - 2rem); }

/* ---- Chat: people in search, media and files ------------------------------ */
.chat-person { width: 100%; text-align: left; border: 0; background: none; font: inherit; }
.chat-person::before, .chat-person::after { display: none; }
.chat-pane { position: relative; overflow: hidden; }
.chat-head .chat-head-text { flex: 1; min-width: 0; }
.chat-info-btn { padding: .4rem; border-radius: 50%; }
.chat-info-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.chat-info { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 100%); z-index: 6; display: flex; flex-direction: column; background: var(--panel-solid); border-left: 1px solid var(--line); box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .6); animation: info-in .18s ease-out; }
.chat-info[hidden] { display: none; }
@keyframes info-in { from { transform: translateX(24px); opacity: 0; } }
.chat-info-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.chat-info-close { padding: .35rem; border-radius: 50%; }
.chat-info-tabs { display: flex; gap: .3rem; padding: .6rem 1rem; }
.chat-info-tabs { flex-wrap: wrap; }
.chat-info-tabs button { flex: 1 1 40%; justify-content: center; border-radius: 999px; font-size: .84rem; padding: .4rem .5rem; }
.chat-info-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.chat-info-tabs b { color: var(--ink-3); font-weight: 600; }
.chat-info-body { flex: 1; overflow-y: auto; padding: 0 1rem 1rem; }
.chat-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.chat-media a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.chat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.chat-media a:hover img { transform: scale(1.06); }
.chat-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.chat-files a { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 10px; color: var(--ink); text-decoration: none; background: var(--bg-2); border: 1px solid var(--line); }
.chat-files a:hover { border-color: var(--accent); }
.chat-files span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-files strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-files small { color: var(--ink-3); font-size: .74rem; }
@media (max-width: 760px) { .chat-info { width: 100%; border-left: 0; } }

/* ---- Chat: links, pins, unsend ------------------------------------------- */
.msg-bubble p a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.msg.unsent .msg-bubble { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); font-style: italic; }
.msg-pinned { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; color: var(--accent); margin: 0 .4rem .15rem; }
.msg-pinned .i, .chat-pinbar .i { width: 13px; height: 13px; }
.msg-menu { position: absolute; bottom: calc(100% + 4px); z-index: 5; display: flex; flex-direction: column; min-width: 140px; padding: .3rem; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.msg-menu[hidden] { display: none; }
.msg:not(.mine) .msg-menu { left: 0; }
.msg.mine .msg-menu { right: 0; }
.msg-menu button { border: 0; justify-content: flex-start; padding: .45rem .6rem; font-size: .88rem; border-radius: 6px; }
.msg-menu button::before, .msg-menu button::after { display: none; }
.msg-menu button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.msg-menu .danger-text { color: var(--crit); }
.chat-pinbar { display: flex; align-items: center; gap: .5rem; padding: .4rem 1rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.chat-pinbar[hidden] { display: none; }
.chat-pinbar-main { flex: 1; min-width: 0; border: 0; padding: .2rem 0; justify-content: flex-start; font-size: .84rem; color: var(--ink-2); background: none; }
.chat-pinbar-main::before, .chat-pinbar-main::after { display: none; }
.chat-pinbar-main .i { color: var(--accent); flex: none; }
.chat-pinbar-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-align: left; }
.chat-pinbar-main strong { margin-right: .35rem; color: var(--ink); }
.chat-pinbar .link { flex: none; font-size: .8rem; }
.chat-files li { display: flex; flex-direction: column; gap: .15rem; }
.chat-jump { align-self: flex-end; font-size: .76rem; }
.chat-pin-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; padding: .55rem .6rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font: inherit; color: var(--ink); }
.chat-pin-item::before, .chat-pin-item::after { display: none; }
.chat-pin-item span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-pin-item strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chat-pin-item small { color: var(--ink-3); font-size: .74rem; }
.chat-pin-item .i { color: var(--accent); flex: none; }
.msg-menu { min-width: 180px; }
.msg-confirm { margin: .3rem .4rem .5rem; font-size: .82rem; color: var(--ink-2); max-width: 220px; white-space: normal; }
.msg-confirm-actions { display: flex; justify-content: flex-end; gap: .2rem; }
.msg-confirm-actions button { justify-content: center; }

/* ---- Chat: photo viewer and forward ---------------------------------------- */
.msg-photo { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.msg-photo::before, .msg-photo::after, .chat-media-item::before, .chat-media-item::after { display: none; }
.chat-media-item { display: block; padding: 0; border: 0; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-2); cursor: zoom-in; }
.chat-media-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.chat-media-item:hover img { transform: scale(1.06); }
.msg-forwarded { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; color: var(--ink-3); margin: 0 .4rem .15rem; }
.msg-forwarded .i { width: 13px; height: 13px; }

.chat-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: rgba(4, 6, 18, .94); backdrop-filter: blur(6px); animation: overlay-in .15s ease-out; }
@keyframes overlay-in { from { opacity: 0; } }
.viewer-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; color: #fff; }
.viewer-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-who small { color: rgba(255, 255, 255, .65); font-size: .78rem; }
.viewer-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font: inherit; font-size: .88rem; cursor: pointer; }
.viewer-btn:hover { background: rgba(255, 255, 255, .2); }
.viewer-btn::before, .viewer-btn::after { display: none; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0 1rem; }
.viewer-stage img { max-width: min(100%, 1400px); max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.viewer-nav { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; justify-content: center; padding: 0; }
.viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .25); }
.viewer-nav:disabled { opacity: .25; cursor: default; }
.viewer-nav::before, .viewer-nav::after { display: none; }
.viewer-name { margin: 0; padding: .6rem 1rem 1rem; text-align: center; color: rgba(255, 255, 255, .7); font-size: .85rem; }

.chat-overlay.forward { align-items: center; justify-content: center; padding: 1rem; background: rgba(4, 6, 18, .7); }
.forward-box { width: min(440px, 100%); max-height: min(620px, 90vh); display: flex; flex-direction: column; gap: .7rem; margin: 0; background: var(--panel-solid); }
.forward-head { display: flex; align-items: center; justify-content: space-between; }
.forward-head .viewer-btn { background: transparent; color: var(--ink-2); padding: .35rem; }
.forward-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.forward-list li { display: flex; align-items: center; gap: .65rem; padding: .4rem .3rem; border-radius: 10px; }
.forward-list li:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.forward-list li button { flex: none; padding: .35rem .9rem; font-size: .85rem; }
.forward-foot { display: flex; justify-content: flex-end; }
@media (max-width: 760px) {
  .viewer-btn span:not(.sr-only) { display: none; }
  .viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .viewer-nav.prev { left: .5rem; }
  .viewer-nav.next { right: .5rem; }
}

/* ---- Remote help ------------------------------------------------------------ */
.chat-remote-btn { padding: .4rem .7rem; border-radius: 999px; font-size: .85rem; }
.chat-remote-btn::before, .chat-remote-btn::after { display: none; }
@media (max-width: 760px) { .chat-remote-btn span { display: none; } }

.remote-ask { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1rem; background: rgba(4, 6, 18, .7); backdrop-filter: blur(4px); animation: overlay-in .15s ease-out; }
.remote-ask-box { width: min(460px, 100%); margin: 0; background: var(--panel-solid); text-align: center; }
.remote-ask-icon .i { width: 40px; height: 40px; color: var(--accent); }
.remote-ask-box h2 { margin: .4rem 0 .6rem; }
.remote-ask-box p { color: var(--ink-2); margin: 0 0 .6rem; }
.remote-ask-actions { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.remote-ask-actions button { justify-content: center; min-width: 9rem; font-size: 1rem; padding: .7rem 1.2rem; }
.remote-steps ol { text-align: left; margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .9rem; }
.remote-steps li { color: var(--ink-2); }
.remote-steps li strong { color: var(--ink); }
.remote-steps li .button { display: inline-flex; margin: .5rem 0 .3rem; }
.remote-steps li small { display: block; color: var(--ink-3); }
.remote-steps input { width: 100%; margin-top: .4rem; font-size: 1.4rem; letter-spacing: .08em; text-align: center; }

.remote-bar { position: fixed; top: .6rem; left: 50%; transform: translateX(-50%); z-index: 110; display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem .5rem 1rem; border-radius: 999px; background: #c81e3a; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); max-width: calc(100vw - 2rem); }
.remote-bar.waiting { background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line); }
.remote-bar strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.remote-bar button { border-radius: 999px; background: #fff; color: #9b1029; border: 0; font-weight: 700; padding: .4rem .9rem; flex: none; }
.remote-bar.waiting button { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); }
.remote-bar button::before, .remote-bar button::after { display: none; }
.remote-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; animation: blink 1.4s ease-in-out infinite; }
.remote-bar.waiting .remote-dot, .remote-viewer-bar .remote-dot { background: var(--crit); }

.remote-preview { position: fixed; right: 1rem; bottom: 1rem; z-index: 110; width: min(340px, calc(100vw - 2rem)); padding: .5rem; border-radius: 12px; background: var(--panel-solid); border: 2px solid #c81e3a; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.remote-preview-label { display: flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; color: var(--ink-2); margin: 0 0 .35rem .1rem; }
.remote-preview-label .i { width: 14px; height: 14px; }
.remote-stage { position: relative; }
.remote-stage video, .remote-stage img { display: block; width: 100%; border-radius: 6px; background: #000; }
.remote-stage canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

.remote-viewer { position: fixed; inset: 0; z-index: 105; display: flex; flex-direction: column; background: #05060f; animation: overlay-in .15s ease-out; }
.remote-viewer-bar { display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; color: #fff; flex-wrap: wrap; }
.remote-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.remote-who small { color: rgba(255, 255, 255, .65); font-size: .78rem; }
.remote-tools { display: flex; gap: .35rem; flex-wrap: wrap; }
.remote-tools .viewer-btn.on { background: var(--accent); color: var(--accent-ink); }
.remote-tools .viewer-btn.end { background: #c81e3a; font-weight: 700; }
.remote-stage.viewer { flex: 1; min-height: 0; margin: 0 1rem 1rem; display: flex; align-items: center; justify-content: center; }
.remote-stage.viewer video, .remote-stage.viewer img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; background: transparent; }
.remote-stage.viewer canvas { pointer-events: auto; cursor: crosshair; touch-action: none; }
@media (max-width: 760px) { .remote-tools .viewer-btn span { display: none; } }
@media (prefers-reduced-motion: reduce) { .remote-dot { animation: none; } }

/* ---- Remote setup ------------------------------------------------------------ */
.setup-steps, .steps { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .9rem; }
.setup-steps li > span, .steps li > span { display: block; margin-top: .3rem; }
.setup-steps .row { margin-top: .5rem; gap: .5rem; flex-wrap: wrap; }
.steps code.code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font-size: .78rem; }
.remote-bar.control { background: #1d4fd8; }
.remote-bar.control button { color: #1d4fd8; }
.remote-bar.control strong { white-space: normal; }
body > .remote-control.panel { position: fixed; right: 1rem; bottom: 1rem; z-index: 110; width: min(360px, calc(100vw - 2rem)); margin: 0; background: var(--panel-solid); border: 2px solid #1d4fd8; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.remote-control-head { display: flex; align-items: center; gap: .5rem; }
.remote-control-head .remote-dot { background: #1d4fd8; }
.remote-control-id { margin: .7rem 0; font-size: 2rem; font-weight: 800; letter-spacing: .06em; text-align: center; color: var(--ink); }
.remote-control-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.remote-control-steps { margin: .8rem 0 0; padding-left: 1.2rem; font-size: .84rem; color: var(--ink-2); display: flex; flex-direction: column; gap: .3rem; }
