/* ==========================================================================
   Nexis 1.0 console — design system
   ========================================================================== */
:root {
  --bg: #070b12;
  --bg-soft: #0a0f18;
  --panel: #0e1520;
  --panel-2: #121b28;
  --panel-3: #16202f;
  --line: #1e2b3d;
  --line-soft: #17222f;
  --text: #e6edf6;
  --text-dim: #9fb0c6;
  --muted: #6b7d94;
  --accent: #35d0ba;
  --accent-dim: rgba(53, 208, 186, 0.14);
  --ok: #3ddc97;
  --warn: #ffb020;
  --danger: #ff5c6c;
  --info: #58a6ff;
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, "SF Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(53, 208, 186, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(88, 166, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1d2a3c; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #2a3b52; background-clip: content-box; }

/* ---------------------------------------------------------------- boot ---- */
.app-loading { display: grid; place-items: center; height: 100vh; }
.boot { text-align: center; }
.boot-mark {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; font-weight: 800; font-size: 26px;
  color: #06121a; background: linear-gradient(140deg, var(--accent), #58a6ff);
  box-shadow: 0 10px 30px rgba(53, 208, 186, 0.35);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.boot-text { color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 34px; box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-mark {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #06121a;
  background: linear-gradient(140deg, var(--accent), #58a6ff);
}
.login-title { font-size: 21px; font-weight: 700; letter-spacing: 0.2px; }
.login-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: 0.3px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: #55677e; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.hint.warn { color: var(--warn); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* --------------------------------------------------------------- shell ---- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, rgba(18, 27, 40, 0.9), rgba(10, 15, 24, 0.9));
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; backdrop-filter: blur(8px);
}
.brand { padding: 20px 18px 16px; display: flex; gap: 11px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #06121a; background: linear-gradient(140deg, var(--accent), #58a6ff);
  flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: 0.4px; }
.brand-owner { font-size: 11px; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase; color: #4d6076; padding: 12px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px;
  color: var(--text-dim); cursor: pointer; border: 1px solid transparent; user-select: none;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(53, 208, 186, 0.25); }
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-badge { margin-left: auto; font-size: 11px; background: var(--panel-3); border-radius: 20px; padding: 1px 8px; color: var(--text-dim); }
.nav-badge-waiting { background: rgba(255, 176, 62, .16); color: #ffb03e; }
.side-foot { padding: 12px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.conn { display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.16); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 92, 108, 0.16); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
  background: rgba(7, 11, 18, 0.86); backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 16px; font-weight: 650; margin: 0; }
.crumb { color: var(--muted); font-size: 13px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 22px; flex: 1; }
.content > * + * { margin-top: 18px; }

/* -------------------------------------------------------------- pieces ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-weight: 620; font-size: 14px; }
.card-sub { color: var(--muted); font-size: 12px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.two { grid-template-columns: 1.4fr 1fr; }
.grid.halves { grid-template-columns: 1fr 1fr; }
.grid.ops { grid-template-columns: minmax(320px, 400px) 1fr; align-items: start; }
@media (max-width: 1100px) { .grid.two, .grid.halves, .grid.ops { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.4px; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--text-dim); }
.stat-spark { margin-top: 10px; height: 34px; width: 100%; display: block; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  font-size: 13px; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--panel-3); border-color: #2b3d55; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(140deg, var(--accent), #24b7a3); border-color: transparent; color: #04140f; font-weight: 620; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: rgba(255, 92, 108, 0.35); }
.btn.danger:hover { background: rgba(255, 92, 108, 0.12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.2px; border: 1px solid transparent;
}
.pill.online { color: var(--ok); background: rgba(61, 220, 151, 0.12); border-color: rgba(61, 220, 151, 0.3); }
.pill.offline { color: var(--muted); background: rgba(107, 125, 148, 0.12); border-color: rgba(107, 125, 148, 0.25); }
.pill.info { color: var(--info); background: rgba(88, 166, 255, 0.12); border-color: rgba(88, 166, 255, 0.3); }
.pill.warn { color: var(--warn); background: rgba(255, 176, 32, 0.12); border-color: rgba(255, 176, 32, 0.3); }
.pill.danger { color: var(--danger); background: rgba(255, 92, 108, 0.12); border-color: rgba(255, 92, 108, 0.3); }
.pill.violet { color: var(--violet); background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.3); }

table { width: 100%; border-collapse: collapse; }
/* The fleet tables carry two more columns than the other lists, so their
   cells sit a little tighter. The wrapper keeps the last column reachable
   on a narrow window instead of letting the card crop it. */
.table-wrap { overflow-x: auto; }
.table-wrap th, .table-wrap td { padding-left: 12px; padding-right: 12px; }
th {
  text-align: left; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line-soft); font-weight: 600;
}
td { padding: 11px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.5); vertical-align: middle; }
tbody tr:hover { background: rgba(18, 27, 40, 0.6); }
tbody tr.clickable { cursor: pointer; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.dim { color: var(--muted); }
.small { font-size: 12px; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text-dim); margin-bottom: 6px; font-size: 14px; }

/* -------------------------------------------------------------- gauges ---- */
.gauge { display: flex; flex-direction: column; gap: 7px; }
.gauge-top { display: flex; justify-content: space-between; align-items: baseline; }
.gauge-label { font-size: 12px; color: var(--text-dim); }
.gauge-value { font-size: 13px; font-weight: 650; font-family: var(--mono); }
.bar { height: 7px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), #58a6ff); transition: width .4s ease; }
.bar.warn > i { background: linear-gradient(90deg, var(--warn), #ff8a5c); }
.bar.danger > i { background: linear-gradient(90deg, #ff5c6c, #ff9a6c); }

/* ------------------------------------------------------------- console ---- */
.term {
  background: #05080d; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; height: 460px; overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--panel); font-size: 12px; color: var(--muted);
}
.term-out {
  flex: 1; overflow-y: auto; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; color: #cfe0f0; line-height: 1.55;
}
.term-out .cmd-line { color: var(--accent); }
.term-out .err { color: var(--danger); }
.term-out .meta { color: var(--muted); }
.term-in { display: flex; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--line-soft); background: var(--panel); }
.term-in .prompt { color: var(--accent); font-family: var(--mono); padding: 8px 2px 0 4px; }
.term-in input { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-family: var(--mono); outline: none; }
.term-in input:focus { border-color: var(--accent); }

/* ---------------------------------------------------------------- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 6px; overflow-x: auto; }
.tab {
  padding: 11px 14px; cursor: pointer; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------- explorer ---- */
.explorer {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  height: calc(100vh - 250px); min-height: 520px;
}
.ex-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft); background: var(--panel-2);
}
.ex-nav-buttons { display: flex; gap: 4px; }
.ex-crumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.ex-crumb {
  background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 8px;
  color: var(--text-dim); cursor: pointer; font-size: 12.5px; white-space: nowrap;
}
.ex-crumb:hover { background: var(--panel-3); color: var(--text); }
.ex-crumb.current { color: var(--text); font-weight: 620; }
.ex-crumb-sep { color: var(--muted); font-size: 12px; }
.ex-search-wrap { display: flex; align-items: center; gap: 7px; color: var(--muted); flex: none; }
.ex-search { width: 210px; padding: 6px 10px; }
.ex-ribbon {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.ex-commands { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ex-ribbon-sep { width: 1px; height: 20px; background: var(--line); }
.ex-views { margin-left: auto; display: flex; gap: 4px; }
select.ex-sort { width: auto; padding: 5px 9px; font-size: 12px; }
.ex-body {
  display: grid; grid-template-columns: 214px minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr); flex: 1; min-height: 0;
}
.ex-nav-pane {
  border-right: 1px solid var(--line-soft); padding: 10px 6px; overflow-y: auto;
  min-height: 0; background: rgba(10, 15, 24, 0.55);
}
.ex-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ex-list { flex: 1; overflow: auto; min-height: 0; }
.ex-preview {
  border-left: 1px solid var(--line-soft); padding: 14px; overflow-y: auto;
  min-height: 0; background: rgba(10, 15, 24, 0.35);
}

/* the tree on the left */
.ex-nav-group {
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #4d6076;
  padding: 12px 8px 5px;
}
.ex-nav-empty { font-size: 12px; color: var(--muted); padding: 4px 10px; line-height: 1.5; }
.ex-tree-row {
  display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px;
  color: var(--text-dim); cursor: pointer; font-size: 12.5px; user-select: none;
}
.ex-tree-row:hover { background: var(--panel-2); color: var(--text); }
.ex-tree-row.current { background: var(--accent-dim); color: var(--accent); }
.ex-tree-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-tree-ico { display: flex; flex: none; opacity: .9; }
.ex-twisty {
  width: 16px; height: 16px; flex: none; display: grid; place-items: center; padding: 0;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
}
.ex-twisty.empty { cursor: default; }

/* the details view */
.ex-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ex-table th {
  position: sticky; top: 0; z-index: 2; background: var(--panel); text-align: left;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-weight: 600;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.ex-table th:hover { color: var(--text-dim); }
.ex-table th.on { color: var(--accent); }
.ex-table th.right, .ex-table td.right { text-align: right; }
.ex-sort-arrow { margin-left: 6px; font-size: 9px; }
.ex-table td {
  padding: 7px 12px; border-bottom: 1px solid rgba(30, 43, 61, .45); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-table tbody tr:hover { background: rgba(18, 27, 40, .6); }
.ex-table tbody tr.sel { background: var(--accent-dim); }
.ex-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ex-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the columns keep their width, the name takes what is left over */
.ex-col-name { width: auto; }
.ex-col-when { width: 152px; }
.ex-col-type { width: 140px; }
.ex-col-size { width: 92px; }
.ex-col-act { width: 210px; }

/* the list view */
.ex-rows { padding: 6px 8px; }
.ex-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 152px 140px 92px; gap: 10px;
  align-items: center; padding: 6px 10px; border-radius: 8px; cursor: default; font-size: 13px;
}
.ex-row:hover { background: rgba(18, 27, 40, .6); }
.ex-row.sel { background: var(--accent-dim); }
.ex-when, .ex-kind, .ex-size { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-size { text-align: right; }

/* a narrow window: the panes give room to the list, the columns get tighter */
@media (max-width: 1440px) {
  .ex-body { grid-template-columns: 196px minmax(0, 1fr) 272px; }
  .ex-col-when { width: 140px; }
  .ex-col-type { width: 120px; }
  .ex-col-size { width: 84px; }
  .ex-row { grid-template-columns: minmax(0, 1fr) 140px 120px 84px; }
}
@media (max-width: 1180px) {
  .ex-body { grid-template-columns: 180px minmax(0, 1fr) 244px; }
  .ex-col-when { width: 128px; }
  .ex-col-type { width: 104px; }
  .ex-col-size { width: 76px; }
  .ex-row { grid-template-columns: minmax(0, 1fr) 128px 104px 76px; }
  .ex-search { width: 150px; }
}

/* the large icon view */
.ex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px; padding: 14px;
}
.ex-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px;
  border-radius: 10px; cursor: default; text-align: center;
}
.ex-tile:hover { background: rgba(18, 27, 40, .6); }
.ex-tile.sel { background: var(--accent-dim); }
.ex-tile-ico { display: flex; }
.ex-tile-name {
  font-size: 12px; line-height: 1.35; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* the colours of the file kinds */
.ex-ico { display: flex; flex: none; }
.fi-folder { color: #f0b429; }
.fi-text { color: #8ab4f8; }
.fi-image { color: #7ee0b8; }
.fi-app { color: #ff8a5c; }
.fi-archive { color: #c3a6ff; }
.fi-file { color: var(--text-dim); }

/* the preview pane */
.ex-about { color: var(--text-dim); }
.ex-about-title { font-size: 15px; font-weight: 650; color: var(--text); margin-bottom: 5px; }
.ex-look-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ex-look-name { font-size: 14px; font-weight: 620; word-break: break-all; }
.ex-editor { display: flex; flex-direction: column; gap: 10px; }
.ex-editor-head { display: flex; align-items: center; gap: 8px; }
.ex-editor-name { flex: 1; font-weight: 620; font-size: 13px; word-break: break-all; }
.ex-editor textarea { min-height: 300px; }
.ex-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* the bar at the bottom */
.ex-status {
  display: flex; align-items: center; gap: 16px; padding: 8px 14px;
  border-top: 1px solid var(--line-soft); background: var(--panel-2);
  font-size: 12px; color: var(--text-dim); min-height: 42px;
}
.ex-status-left { display: flex; gap: 14px; align-items: center; }
.ex-status-right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ex-status-right .bar { flex: none; width: 120px; }

/* the menu that opens on a right click */
.ctx-menu {
  position: fixed; z-index: 400; min-width: 208px; padding: 5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow);
}
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 10px; border: none; background: transparent; color: var(--text-dim);
  border-radius: 7px; cursor: pointer; font-size: 13px;
}
.ctx-item:hover { background: var(--accent-dim); color: var(--accent); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(255, 92, 108, .12); color: var(--danger); }
.ctx-hint { margin-left: auto; color: var(--muted); font-size: 11px; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* the little windows of the machine */
.dlg-backdrop {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center;
  background: rgba(3, 6, 11, .68); backdrop-filter: blur(2px);
}
.dlg {
  width: min(440px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.dlg-title {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(140deg, rgba(53, 208, 186, .16), rgba(88, 166, 255, .10));
  border-bottom: 1px solid var(--line-soft); font-weight: 650; font-size: 13.5px;
}
.dlg-title > span { flex: 1; }
.dlg-x {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; padding: 3px; border-radius: 6px;
}
.dlg-x:hover { color: var(--text); background: var(--panel-3); }
.dlg-body { display: flex; gap: 14px; padding: 18px; }
.dlg-mark { color: var(--info); flex: none; }
.dlg-mark.danger { color: var(--warn); }
.dlg-text { flex: 1; min-width: 0; }
.dlg-message { font-size: 13.5px; line-height: 1.55; }
.dlg-detail { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.5; }
.dlg-field { margin-top: 14px; }
.dlg-field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line-soft); background: var(--panel-2);
}

.btn.sm.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(53, 208, 186, .35); }

/* ----------------------------------------------------------- live view ---- */
.live-frame {
  position: relative; background: #05080d; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: grid; place-items: center; min-height: 320px;
}
.live-frame img { max-width: 100%; display: block; }
.live-badge {
  position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 7px;
  background: rgba(7, 11, 18, 0.78); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; font-size: 11.5px;
}
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.1s infinite; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: 0.25 } }

/* ---------------------------------------------------------- recordings ---- */
.rec-bar {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.rec-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.rec-row:last-child { border-bottom: none; }
.rec-info { flex: 1; min-width: 0; }
.rec-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rec-player {
  display: block; width: 100%; background: #05080d; border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------- toasts ----- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 100; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 11px 15px; min-width: 240px; max-width: 380px; box-shadow: var(--shadow);
  font-size: 13px; animation: slidein .22s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slidein { from { transform: translateX(18px); opacity: 0 } to { transform: none; opacity: 1 } }

/* --------------------------------------------------------------- misc ----- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.code {
  font-family: var(--mono); font-size: 12.5px; background: #05080d; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px; overflow-x: auto; color: #b9d4e8; white-space: pre;
}
.code .c { color: var(--accent); }
.code.wrap { white-space: pre-wrap; word-break: break-all; }
.pairing-code {
  font-family: var(--mono); font-size: 32px; letter-spacing: 5px; font-weight: 700; color: var(--accent);
  text-align: center; padding: 16px 0; user-select: all;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 4px; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.bar-track { height: 6px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar-track > i { display: block; height: 100%; background: var(--accent); }
.event-row { display: grid; grid-template-columns: 88px 74px 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.45); font-size: 13px; align-items: baseline; }
.event-row .ts { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.cmdline { display: grid; grid-template-columns: 120px 1fr 90px; gap: 12px; padding: 9px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.45); font-size: 13px; align-items: center; }
.cmdline .type { font-family: var(--mono); font-size: 12px; color: var(--accent); }

/* -------------------------------------------------------- operations ------ */
.ticket { padding: 13px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.45); }
.ticket-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ticket-device { font-weight: 620; font-size: 13.5px; }
.ticket-cmd {
  margin-top: 8px; padding: 9px 11px; background: #05080d; border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: #b9d4e8; font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow-y: auto;
}
.ticket-out { margin-top: 8px; }
.ticket-out .code { margin-top: 7px; max-height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
textarea.input.mono { font-family: var(--mono); font-size: 12.5px; resize: vertical; min-height: 120px; }

/* ----------------------------------------------------------- browser ------ */
.brow-cols {
  display: grid; grid-template-columns: 1.3fr 1.3fr 130px 110px 110px; gap: 10px;
  padding: 9px 16px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); border-bottom: 1px solid rgba(30, 43, 61, 0.6);
}
.brow-row {
  display: grid; grid-template-columns: 1.3fr 1.3fr 130px 110px 110px; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.45);
  font-size: 13px; align-items: center;
}
.brow-row[onclick], .brow-row.clickable { cursor: pointer; }
.brow-row:hover { background: rgba(53, 208, 186, 0.05); }
.brow-row.sel { background: rgba(53, 208, 186, 0.09); }
.brow-row .b-name { font-weight: 620; }
.brow-row .b-note { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }
.brow-list { max-height: 420px; overflow-y: auto; }
/* A pack row lives in the narrow left column, so it has its own two-column
   layout instead of the five fixed columns of the profile table. */
.pack-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px;
  align-items: center; padding: 10px 16px;
  border-bottom: 1px solid rgba(30, 43, 61, 0.45);
}
.pack-row:last-child { border-bottom: 0; }
.pack-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pack-actions { display: flex; gap: 6px; align-items: center; }
.val-list { margin-top: 7px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.val-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 110px; gap: 10px;
  padding: 6px 11px; border-bottom: 1px solid rgba(30, 43, 61, 0.35); font-size: 12.5px; align-items: baseline;
}
.val-row:last-child { border-bottom: none; }
.val-row .val-host { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-row .val-name { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-row .val-text { color: #b9d4e8; word-break: break-all; font-size: 12px; }
.val-row .val-flag { text-align: right; }

/* -------------------------------------------------------------- screen ---- */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 16px; }
.shot { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.shot-pic { position: relative; background: #05080d; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.shot-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-flag { position: absolute; top: 8px; right: 8px; }
.shot-meta { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 3px; }
.shot-when { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; }
.shot > .row { padding: 8px 12px 12px; }

/* ------------------------------------------------------------- monitor ----- */
.live-now { display: flex; flex-direction: column; gap: 4px; }
.live-now-top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.live-now-top strong { font-size: 16px; font-weight: 650; }
.story-row {
  display: grid; grid-template-columns: 58px 1fr; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.45);
}
.story-row:last-child { border-bottom: none; }
.story-time { color: var(--accent); font-size: 12px; padding-top: 1px; }
.story-body { min-width: 0; }
.story-text { font-size: 13.5px; font-weight: 550; }
.story-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-meta { font-size: 11.5px; }
.tl-row {
  display: grid; grid-template-columns: 58px 140px 1fr 54px; gap: 12px; align-items: center;
  padding: 7px 16px; border-bottom: 1px solid rgba(30, 43, 61, 0.35); font-size: 12.5px;
}
.tl-row:last-child { border-bottom: none; }
.tl-time { color: var(--muted); font-size: 11.5px; }
.tl-app { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.tl-bar { display: block; height: 7px; border-radius: 5px; background: var(--panel-3); overflow: hidden; }
.tl-bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), #58a6ff); }
.tl-span { text-align: right; }
