/* Vicino – technician console. Design A "Nearfield": dark, spatial, lime accent. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0A0C10;
  --bg2: #0F1218;
  --surface: #12151B;
  --surface2: #1A1F28;
  --surface3: #1E2430;
  --border: #222731;
  --border2: #2E3541;
  --text: #EDEFF3;
  --text2: #C9CED8;
  --muted: #9AA3B2;
  --label: #8B93A1;
  --accent: #D4FF3F;
  --accent-ink: #0B0D11;
  --accent-text: #D4FF3F;
  --accent-soft: #1C2414;
  --accent-border: #3A4A1F;
  --ok: #D4FF3F;
  --ok-border: #3A4A1F;
  --view: #7CC4FF;
  --warn: #FFB547;
  --danger: #FF5A5F;
  --danger-ink: #1A0607;
  --danger-text: #FF8A8E;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --display: 'Space Grotesk', Inter, 'Segoe UI', sans-serif;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: Inter, 'Segoe UI', system-ui, sans-serif; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
a:hover { color: #E8FF9A; }
button { font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--label); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico svg { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #262C38; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- brand mark ---------- */
.mark { display: inline-flex; color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #3D4554; background: var(--surface3); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { background: #E2FF7A; border-color: #E2FF7A; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-ink); font-weight: 700; }
.btn.danger:hover { background: #FF7579; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface2); }
.btn.outline-accent { background: transparent; border-color: var(--accent-border); color: var(--accent-text); font-weight: 600; }
.btn.sm { min-height: 34px; padding: 0 12px; }
.btn.icon { width: 36px; min-height: 36px; padding: 0; }
.btn.lg { min-height: 44px; font-size: 14px; }
.chip {
  min-height: 34px; padding: 0 14px; border-radius: 999px; background: transparent;
  border: 1px solid var(--border2); color: var(--text2); font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: #3D4554; }
.chip.on { background: var(--surface3); border-color: #3D4554; color: var(--text); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border2); border-radius: 999px; padding: 2px 9px; font-size: 12px; color: var(--muted); }
.pill.ok { border-color: var(--ok-border); color: var(--ok); }
.badge { font-size: 12px; font-weight: 600; background: var(--surface3); border-radius: 999px; padding: 2px 8px; color: var(--text2); }
.badge.red { background: var(--danger); color: var(--danger-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }
.dot.off { background: transparent; border: 2px solid #6E7684; }
.dot.view { background: var(--view); }
.dot.busy { background: var(--warn); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.status.online { color: var(--text2); }
.status.offline { color: var(--muted); }
.status.reboot { color: var(--warn); }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.input {
  min-height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 10px; outline: none;
}
.input:focus { border-color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border2); border-radius: 12px; padding: 0 12px; min-height: 38px; }
.search:focus-within { border-color: #4A5363; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 13px; }
.kbd { display: inline-flex; gap: 3px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.kbd span { border: 1px solid var(--border2); border-radius: 6px; padding: 1px 6px; }

/* ---------- top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.brand-name { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.internal { font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--border2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; min-width: 0; }
.quick { flex: 1 1 320px; display: flex; gap: 8px; max-width: 600px; position: relative; }
.quick .search { flex: 1; min-height: 44px; background: var(--bg); border-radius: 14px; }
.quick-results { position: absolute; top: 50px; left: 0; right: 100px; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55); z-index: 50; max-height: 340px; overflow: auto; padding: 6px; }
.quick-results button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; background: transparent; border: 0; border-radius: 10px; text-align: left; cursor: pointer; }
.quick-results button:hover, .quick-results button.sel { background: var(--surface3); }
.top-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.server-state { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.user-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 6px; background: var(--surface); border: 1px solid var(--border2); border-radius: 999px; cursor: pointer; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface3); font-weight: 700; font-size: 12px; }
.user-lines { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-lines b { font-size: 13px; }
.user-lines span { font-size: 12px; color: var(--muted); }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55); z-index: 60; padding: 6px; min-width: 210px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; background: transparent; border: 0; border-radius: 9px; text-align: left; cursor: pointer; color: var(--text2); }
.menu button:hover { background: var(--surface3); color: var(--text); }
.alert-btn { position: relative; }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; background: var(--bg); border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px 0 12px; border: 1px solid transparent; border-radius: 12px; color: var(--text2); font-size: 13px; cursor: pointer; background: transparent; }
.tab:hover { background: var(--surface); }
.tab.on { background: var(--surface2); border-color: var(--border2); color: var(--text); font-weight: 600; }
.tab .tab-name { font-family: var(--mono); padding: 8px 4px; color: inherit; }
.tab.tab-console { padding: 0 14px; }
.tab .x { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.tab .x:hover { background: var(--surface3); }

/* ---------- console layout ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.console { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: stretch; }
.sidebar { flex: 1 1 220px; max-width: 100%; padding: 20px 14px; background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 900px) { .sidebar { max-width: 250px; } }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group .section-label { padding: 0 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; background: transparent; border: 0; border-radius: 10px; color: var(--text2); text-align: left; cursor: pointer; }
.nav-item:hover { background: var(--surface); }
.nav-item.on { background: var(--surface2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border2); }
.nav-item.on .ico { color: var(--accent); }
.nav-item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-card { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.sec-card b { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sec-card b .ico { color: var(--accent); }
.sec-card span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.main { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.list-col { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head-row h1 { margin: 0; font-size: 26px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filters .search { margin-left: auto; flex: 0 1 260px; }
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
table.grid { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); font-weight: 600; padding: 12px 16px; white-space: nowrap; }
table.grid td { padding: 9px 16px; border-top: 1px solid var(--border); white-space: nowrap; }
table.grid tr.row { cursor: pointer; }
table.grid tr.row:hover { background: #161A21; }
table.grid tr.row.sel { background: var(--surface2); box-shadow: inset 2px 0 0 var(--accent); }
table.grid td.actions { text-align: right; }
table.grid td.wrap { white-space: normal; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.note { font-size: 12px; color: var(--label); }

/* ---------- detail panel ---------- */
.detail { flex: 1 1 340px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.detail h2 { margin: 0; font-family: var(--mono); font-size: 20px; font-weight: 600; word-break: break-all; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.row-btns .btn { flex: 1 1 130px; }
dl.info { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; font-size: 13px; }
dl.info div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
dl.info dt { color: var(--label); }
dl.info dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-row .lbl { display: flex; justify-content: space-between; font-size: 13px; }
.bar { height: 6px; background: #232934; border-radius: 999px; overflow: hidden; }
.bar > div { height: 6px; background: var(--accent); border-radius: 999px; }
.bar > div.hot { background: var(--warn); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 66px; background: var(--surface2); border: 1px solid var(--border2); border-radius: 12px; font-size: 12px; cursor: pointer; }
.tool:hover { border-color: #3D4554; background: var(--surface3); }
.tool:disabled { opacity: .45; cursor: default; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.activity { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.activity div { display: flex; justify-content: space-between; gap: 12px; }
.activity span:last-child { color: var(--muted); white-space: nowrap; }
.alert-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #2A1416; border: 1px solid #5A2A2E; color: #FFB4B4; border-radius: 14px; font-size: 13px; }

/* ---------- session view (tab inside the console) ---------- */
.session { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.session:fullscreen { background: var(--bg); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.tb-info { display: flex; flex-direction: column; gap: 4px; padding-right: 10px; min-width: 190px; }
.tb-info .name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.tb-info .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-sep { width: 1px; height: 40px; background: var(--border2); margin: 0 4px; }
.tb-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; min-height: 50px; padding: 6px; background: transparent; border: 0; border-radius: 12px; color: var(--text2); font-size: 12px; cursor: pointer; }
.tb-btn:hover { background: var(--surface); }
.tb-btn.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.tb-btn.rec { background: #2A1416; color: var(--danger-text); font-weight: 600; cursor: default; }
.tb-btn:disabled { opacity: .4; cursor: default; }
.tb-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.s-body { flex: 1 1 auto; position: relative; display: flex; align-items: stretch; min-height: 420px; }
.screen-area { flex: 1 1 auto; min-width: 0; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.screen-wrap { position: relative; flex: 1 1 auto; display: flex; align-items: flex-start; justify-content: center; min-height: 300px; }
.screen-wrap.actual { justify-content: flex-start; overflow: auto; }
canvas.screen { display: block; background: #000; border-radius: 12px; box-shadow: 0 0 0 1px var(--border2); outline: none; cursor: default; image-rendering: auto; }
canvas.screen:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.mon-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rail { flex: 0 0 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; background: var(--bg); border-left: 1px solid var(--border); }
.rail-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 0; border-radius: 12px; color: var(--text2); cursor: pointer; }
.rail-btn:hover { background: var(--surface); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent-text); }
.rail-btn .cnt, .ib .cnt { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.float { position: absolute; top: 56px; right: 72px; width: 360px; max-width: calc(100% - 92px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border2); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.55); z-index: 35; }
.float-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-family: var(--display); }
.float-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; max-height: 60vh; overflow: auto; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.msg { max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; }
.msg .b { padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; }
.msg.me .b { background: var(--accent); color: var(--accent-ink); border-radius: 14px 14px 4px 14px; }
.msg.them .b { background: var(--surface3); border-radius: 14px 14px 14px 4px; }
.msg .t { font-size: 11px; color: var(--label); }
.sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.send-row { display: flex; gap: 8px; }
.send-row .input { flex: 1; min-width: 0; min-height: 44px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border: 1px dashed #3D4554; border-radius: 14px; color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--accent-text); }
.xfer { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.xfer .l { display: flex; justify-content: space-between; gap: 12px; }
.compact-bar { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px; background: rgba(15,18,24,.94); border: 1px solid var(--border2); border-top: 0; border-radius: 0 0 16px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.45); white-space: nowrap; z-index: 25; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,12,16,.86); z-index: 15; }
.overlay-card { max-width: 440px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 28px; background: var(--surface); border: 1px solid var(--border2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.overlay-card h3 { margin: 0; font-size: 19px; font-weight: 600; }
.code-big { font-family: var(--mono); font-size: 34px; letter-spacing: .12em; color: var(--accent); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.s-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 8px 16px; background: var(--bg); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.s-status .r { margin-left: auto; }
.s-status > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.s-status .s-notice { color: var(--warn); max-width: min(100%, 70ch); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- session window: floating island toolbar ---------- */
.session.island { position: relative; }
.session.island .s-body { min-height: 0; }
.session.island .screen-area { padding: 0 8px 8px; }
.session.island .screen-wrap { align-items: center; min-height: 0; }
.session.island .rail, .session.island .s-status, .session.island .mon-bar { display: none; }
.session.island.ctl canvas.screen { box-shadow: 0 0 0 1.5px var(--accent); }
.session.island .float { top: 70px; right: 18px; }
.session.island .toolbar {
  position: absolute; top: 12px; left: 0; right: 0; margin: 0 auto; width: max-content; z-index: 30;
  max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; gap: 4px; padding: 6px;
  background: rgba(15,18,24,.95); border: 1px solid var(--border2); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45); backdrop-filter: blur(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.session.island.tools-hidden .toolbar { opacity: 0; pointer-events: none; transform: translateY(-10px); }
.isep { width: 1px; height: 24px; background: var(--border2); margin: 0 4px; }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--bg); border-radius: 12px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text2); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.seg button.on.view { background: var(--view); }
.seg button:disabled { opacity: .45; cursor: default; }
.ib { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 11px; background: transparent; color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.ib:hover { background: var(--surface3); }
.ib.on { background: var(--accent-soft); color: var(--accent-text); }
.ib:disabled { opacity: .35; cursor: default; }
.ib.rec { color: var(--danger-text); cursor: default; }
.ib.rec:hover { background: transparent; }
.end-btn { height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--danger); color: var(--danger-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.end-btn:hover { background: #FF7579; }

/* ---------- standalone session page ---------- */
.sp { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.sp-head { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px 0 14px; flex-shrink: 0; overflow: hidden; }
.desktop .sp-head { -webkit-app-region: drag; padding-right: 150px; }
.desktop .sp-head button, .desktop .sp-head a { -webkit-app-region: no-drag; }
.sp-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.sp-title b { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.sp-title span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--accent-border); border-radius: 999px; font-size: 12px; color: var(--accent-text); white-space: nowrap; }
.sp-chip.view { border-color: #24445E; color: var(--view); }
.sp-chip.warn { border-color: #5A4420; color: var(--warn); }
.sp-rec { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; background: #2A1416; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--danger-text); white-space: nowrap; }
.sp-rec::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.sp-q { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.sp-q .ico { color: var(--accent); }
.sp .session { flex: 1 1 auto; min-height: 0; }

/* ---------- mini window ---------- */
.mini-body { background: #161A22; }
.desktop.mini-body { background: transparent; }
.mini { position: relative; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid #262B35; border-radius: 20px; overflow: hidden; }
.mini-body:not(.desktop) .mini { max-width: 400px; height: min(760px, 100vh); margin: 0 auto; }
.mini-head { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 8px 0 16px; flex-shrink: 0; }
.desktop .mini-head { -webkit-app-region: drag; cursor: grab; }
.desktop .mini-head button { -webkit-app-region: no-drag; }
.mini-head .brand-name { font-size: 17px; }
.mini-head .grow { flex: 1 1 auto; }
.hb { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.hb:hover { background: var(--surface3); color: var(--text); }
.hb.on { background: var(--surface3); color: var(--accent); }
.mini-search { padding: 0 14px 12px; flex-shrink: 0; position: relative; }
.mini-search .search { height: 46px; border-radius: 14px; border-color: #2A303B; background: #0B0D11; }
.mini-search .search input { font-size: 14px; }
.mini-sec { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px; flex-shrink: 0; }
.open-row { display: flex; gap: 8px; overflow-x: auto; }
.open-card { flex: 1 0 140px; max-width: 200px; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px 6px 6px; background: transparent; border: 1px solid #2A303B; border-radius: 12px; color: var(--text); text-align: left; cursor: pointer; }
.open-card:hover, .open-card.live { background: var(--surface2); border-color: #343B48; }
.open-card .nm { font-family: var(--mono); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-card .st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.open-card .dot { width: 6px; height: 6px; }
.thumb { position: relative; width: 44px; height: 30px; border-radius: 6px; background: #1A2333; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--label); }
.thumb.lg { width: 52px; height: 34px; border-radius: 7px; }
.thumb.user { background: #1D3550; color: #A9C8EC; }
.thumb.idle { background: #1A222C; }
.thumb.locked { background: #141C28; }
.thumb.off { background: transparent; border: 1.5px dashed #343B48; color: #5B6370; }
.thumb canvas { width: 100%; height: 100%; display: block; }
.thumb .bar-b { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #0B0F16; }
.mini-tabs { display: flex; gap: 4px; margin: 0 14px; padding: 4px; background: #0B0D11; border: 1px solid #222731; border-radius: 12px; flex-shrink: 0; }
.mini-tabs button { flex: 1 1 0; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.mini-tabs button.on { background: var(--surface3); color: var(--text); font-weight: 600; }
.mini-tabs button span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.mini-list { list-style: none; margin: 0; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; overflow-y: auto; }
.mini-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 8px; border-radius: 12px; }
.mini-row:hover, .mini-row.sel { background: var(--surface2); box-shadow: inset 0 0 0 1px #2E3541; }
.mini-row .txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-row .hn { font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row.offline .hn { color: #B7BECA; }
.mini-row .state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mini-row .acts { display: none; gap: 6px; }
.mini-row:hover .acts, .mini-row.sel .acts, .mini-row:focus-within .acts { display: flex; }
.mini-row:hover .state, .mini-row.sel .state, .mini-row:focus-within .state { display: none; }
.mini-row .tag { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--warn); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.rb { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 10px; border: 1px solid #343B48; border-radius: 10px; background: transparent; color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.rb:hover { background: var(--surface3); }
.rb.go { border: 0; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; padding: 0 12px; }
.rb.go:hover { background: #E2FF7A; }
.mini-foot { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 10px 0 16px; border-top: 1px solid #222731; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.mini-foot .grow { flex: 1 1 auto; }
.mini-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dock { display: none; }
.mini.docked { border-radius: 18px 0 0 18px; border-right: 0; }
.mini.docked.left { border-radius: 0 18px 18px 0; border-left: 0; border-right: 1px solid #262B35; }
.mini.docked > *:not(.dock) { display: none !important; }
.mini.docked .dock { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0; height: 100%; }
.desktop .dock .mark { -webkit-app-region: drag; cursor: grab; padding: 4px; }
.dock .dsep { width: 28px; height: 1px; background: #262B35; }
.dock .dthumb { position: relative; width: 44px; height: 30px; padding: 0; border: 1px solid #343B48; border-radius: 7px; background: #1A2333; cursor: pointer; overflow: hidden; }
.dock .dthumb.live { border: 1.5px solid var(--accent); }
.dock .dthumb.view { border-color: var(--view); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(5,7,10,.72); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { width: min(980px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal.sm { width: min(480px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; }
.modal-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.term { background: #06080B; border: 1px solid var(--border); border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 13px; line-height: 1.45; height: 55vh; overflow: auto; white-space: pre-wrap; word-break: break-all; color: #D7DEE6; }
.term-in { display: flex; gap: 8px; align-items: center; }
.term-in span { font-family: var(--mono); color: var(--accent-text); }
.term-in input { flex: 1; font-family: var(--mono); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: var(--mono); font-size: 13px; }
.crumbs button { background: transparent; border: 0; color: var(--accent-text); cursor: pointer; padding: 4px; }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.5); font-size: 13px; }
.toast.err { border-color: #5A2A2E; color: #FFB4B4; }
.toast.ok { border-color: var(--ok-border); }
.mini-body #toasts { left: 12px; right: 12px; bottom: 60px; }
.mini-body .toast { min-width: 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; position: relative; overflow: hidden; }
.login-info { flex: 1 1 420px; padding: 56px 56px 40px; background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 36px; position: relative; overflow: hidden; }
.login-info::after { content: ''; position: absolute; width: 900px; height: 900px; right: -520px; bottom: -520px; border-radius: 50%; box-shadow: 0 0 0 1px #1E232C, 0 0 0 100px #0A0C10, 0 0 0 101px #1C2129, 0 0 0 200px #0A0C10, 0 0 0 201px #1A1E25; pointer-events: none; }
.login-info > * { position: relative; z-index: 1; }
.login-info h1 { margin: 0; font-size: 36px; line-height: 1.12; font-weight: 600; }
.login-info .pts { display: flex; flex-direction: column; gap: 16px; }
.login-info .pts span { display: flex; align-items: center; gap: 12px; }
.login-info .pts .ico, .login-info .pts svg { color: var(--accent); }
.login-main { flex: 999 1 480px; padding: 40px 24px; display: flex; align-items: center; justify-content: center; background: var(--bg2); }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.login-card h2 { margin: 0; font-size: 28px; font-weight: 600; }
.ms-btn { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700; text-decoration: none; }
.ms-btn:hover { background: #E2FF7A; color: var(--accent-ink); }
.err-box { padding: 12px 14px; background: #2A1416; border: 1px solid #5A2A2E; border-radius: 12px; color: #FFB4B4; font-size: 13px; }
.info-box { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 760px) {
  .login-main { order: 1; padding: 28px 20px; }
  .login-info { order: 2; padding: 28px 24px; gap: 20px; border-right: 0; border-top: 1px solid var(--border); }
  .login-info h1 { font-size: 24px; }
}

/* ---------- provider links ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .flabel { font-size: 13px; color: var(--muted); }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 12px; }
.copy-row .code-big { flex: 1; }
.plinks { display: flex; flex-direction: column; gap: 8px; }
.plinks:empty { display: none; }
.plink { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface2, var(--bg)); border: 1px solid var(--border); border-radius: 12px; }
.plink .l { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13px; }
.plink .l b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plink:not(.active) { opacity: .6; }
.badge.ext { margin-left: 8px; background: #3A2A10; color: #F0C070; }

/* ---------- provider page (/g/...) ---------- */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg2); position: relative; overflow: hidden; }
.guest::before { content: ''; position: absolute; width: 900px; height: 900px; left: -560px; top: -560px; border-radius: 50%; box-shadow: 0 0 0 1px #1E232C, 0 0 0 100px #0A0C10, 0 0 0 101px #1C2129, 0 0 0 200px #0A0C10, 0 0 0 201px #1A1E25; pointer-events: none; opacity: .7; }
.guest-card { position: relative; width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 26px; padding: 32px; background: var(--surface); border: 1px solid var(--border2); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.guest-org { margin-left: auto; font-size: 13px; color: var(--muted); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-step { display: flex; flex-direction: column; gap: 16px; }
.guest-head { display: flex; flex-direction: column; gap: 8px; }
.guest-head h1 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.guest-head p { margin: 0; font-size: 14px; line-height: 1.5; }
.pin-input { font-family: var(--mono); font-size: 28px; letter-spacing: .18em; text-align: center; min-height: 60px; }
.guest-info { margin: 0; }
.guest-small { margin: 0; font-size: 12px; color: var(--label); line-height: 1.5; }
.guest .btn.ghost.sm { align-self: center; }
@media (max-width: 480px) { .guest-card { padding: 24px 20px; } .guest-head h1 { font-size: 22px; } }

/* ---------- System page ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.sys-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sys-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.sys-card-head .ico { color: var(--accent); }
.sys-card-head b { flex: 1; font-size: 15px; }
.sys-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.sys-row > span { color: var(--muted); flex: none; }
.sys-row > b { font-weight: 500; color: var(--text2); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.sys-row > b.mono { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; }
.sys-row > b.bad-text { color: var(--danger-text); font-weight: 700; }
.sys-row > b.warn-text { color: var(--warn); }
.sys-actions { display: flex; gap: 8px; margin-top: 4px; }
.sys-err { margin: 0; font-size: 12px; color: var(--danger-text); overflow-wrap: anywhere; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.pill.good { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.pill.warn { background: #33270F; color: var(--warn); border: 1px solid #5A4418; }
.pill.bad { background: #3A1416; color: var(--danger-text); border: 1px solid #6A2226; }
.meter { height: 8px; border-radius: 999px; background: var(--surface3, #1B1F27); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter i.warn { background: var(--warn); }
.meter i.bad { background: var(--danger); }

/* PC waiting for approval (duplicate name) */
.pending-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: #2A1214; border: 1px solid #6A2226; font-size: 13px; color: var(--text2); }
.pending-box b { display: flex; align-items: center; gap: 8px; color: var(--danger-text); }

/* Recorded CMD session: what the technician typed stands out from what the PC answered */
.term .term-typed { color: #7DD3FC; font-weight: 600; }
.term .term-note { color: #9AA7B4; font-style: italic; }
.modal-head .pill { margin-left: 10px; }
