/* ==========================================================================
   ScreenLink console — 2026 redesign
   Dark, calm, high-contrast operator UI. No frameworks, no build step.
   ========================================================================== */

:root {
  --bg: #06080f;
  --bg-2: #080b13;
  --panel: #0b1018;
  --panel-2: #0e1420;
  --panel-3: #121a28;
  --line: rgba(148, 163, 184, .10);
  --line-2: rgba(148, 163, 184, .18);
  --text: #eef2fb;
  --muted: #a5b4cd;
  --dim: #6b7c96;
  --brand: #6d5efc;
  --brand-2: #a78bfa;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 18px 46px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .3);
  --sidebar: 244px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(109, 94, 252, .13), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(34, 211, 238, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.tiny { font-size: 10.5px; }
.muted { color: var(--muted); }
.sub { font-size: 11px; color: var(--dim); margin-top: 2px; line-height: 1.4; }
.spacer { flex: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .18); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .3); background-clip: padding-box; }

/* ---------------------------------------------------------------- shell -- */

.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a0f1a 0%, #070a12 100%);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  gap: 14px;
}
.sb-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; border-bottom: 1px solid var(--line); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), #8b5cf6 60%, #22d3ee);
  box-shadow: 0 8px 22px rgba(109, 94, 252, .35);
}
.logo-mark svg { width: 18px; height: 18px; }
.sb-brand { font-weight: 700; font-size: 14.5px; letter-spacing: -.2px; line-height: 1.15; }
.sb-brand small { display: block; font-size: 10px; font-weight: 500; color: var(--dim); letter-spacing: .3px; text-transform: uppercase; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; padding-bottom: 8px; }
.sb-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--dim); padding: 14px 10px 6px; font-weight: 700; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-weight: 550; font-size: 12.5px;
  cursor: pointer; position: relative; transition: background .15s, color .15s;
}
.sb-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.sb-item:hover { background: rgba(255, 255, 255, .045); color: var(--text); }
.sb-item.active { background: linear-gradient(90deg, rgba(109, 94, 252, .22), rgba(109, 94, 252, .06)); color: #dcd8ff; box-shadow: inset 0 0 0 1px rgba(109, 94, 252, .22); }
.sb-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.sb-item .count {
  margin-left: auto; min-width: 20px; text-align: center;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  background: rgba(148, 163, 184, .14); color: var(--muted);
}
.sb-item.active .count { background: rgba(109, 94, 252, .35); color: #eceaff; }
.sb-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 11px; }
.user-chip:hover { background: rgba(255, 255, 255, .04); }
.avatar {
  width: 31px; height: 31px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  background: linear-gradient(140deg, #2c3d5c, #1b2536); color: #dbe6ff;
  border: 1px solid var(--line-2);
}
.user-chip b { display: block; font-size: 12px; font-weight: 650; }
.user-chip span { display: block; font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.icon-btn {
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--muted);
}
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 20px;
  background: rgba(7, 10, 18, .82); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 680; letter-spacing: -.3px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 11px; height: 34px; width: 260px; transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: rgba(109, 94, 252, .6); box-shadow: 0 0 0 3px rgba(109, 94, 252, .12); }
.search svg { width: 14px; height: 14px; color: var(--dim); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-size: 12px; }
.search input::placeholder { color: var(--dim); }

.content { padding: 20px; flex: 1; min-height: 0; }
.view { display: none; }
.view.active { display: block; animation: fadeUp .18s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #7c6dff, var(--brand));
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 8px 20px rgba(109, 94, 252, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-soft { background: rgba(148, 163, 184, .10); border-color: var(--line-2); color: #e6ecf9; }
.btn-soft:hover { background: rgba(148, 163, 184, .17); }
.btn-ghost { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, .02); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); color: #fecaca; }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-block { width: 100%; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 10.5px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }

/* ---------------------------------------------------------------- stats -- */

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.stat::after { content: ""; position: absolute; inset: 0; background: radial-gradient(340px 120px at 100% 0%, rgba(109, 94, 252, .12), transparent 70%); pointer-events: none; }
.stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); font-weight: 700; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -1px; margin-top: 6px; line-height: 1; }
.stat .s { font-size: 11px; color: var(--dim); margin-top: 6px; }
.stat.live .v { color: #c7fff0; }
.stat.live { border-color: rgba(52, 211, 153, .22); }
.stat.live .k { color: #7fe3c0; }

/* ---------------------------------------------------------------- cards -- */

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-2b { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 13px; font-weight: 680; margin: 0; letter-spacing: -.1px; }
.card-body { padding: 16px; }

/* --------------------------------------------------------------- tables -- */

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.table thead th {
  text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--dim); font-weight: 700; padding: 9px 14px;
  background: rgba(255, 255, 255, .02); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(148, 163, 184, .07); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(109, 94, 252, .055); }
.table td.name { font-weight: 600; }
.table-actions { text-align: right; white-space: nowrap; }
.table-actions .btn + .btn { margin-left: 4px; }
.empty { text-align: center; padding: 40px 18px; color: var(--dim); }
.empty b { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.empty span { font-size: 11.5px; }

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
  padding: 2px 7px; border-radius: 20px;
  background: rgba(148, 163, 184, .12); color: var(--muted);
  border: 1px solid transparent; text-transform: lowercase;
}
.badge.online, .badge.active { background: rgba(52, 211, 153, .14); color: #86efac; border-color: rgba(52, 211, 153, .25); }
.badge.waiting { background: rgba(251, 191, 36, .13); color: #fde68a; border-color: rgba(251, 191, 36, .25); }
.badge.offline, .badge.ended { background: rgba(148, 163, 184, .12); color: #9aa8bd; }
.badge.consent { background: rgba(109, 94, 252, .16); color: #c7c2ff; border-color: rgba(109, 94, 252, .3); }
.badge.business { background: linear-gradient(90deg, rgba(251, 191, 36, .18), rgba(109, 94, 252, .18)); color: #fde68a; border-color: rgba(251, 191, 36, .3); }
.badge.rec { background: rgba(248, 113, 113, .16); color: #fecaca; border-color: rgba(248, 113, 113, .3); }
.badge.unattended, .badge.browser { background: rgba(34, 211, 238, .12); color: #a5f3fc; border-color: rgba(34, 211, 238, .22); }

/* --------------------------------------------------------------- inputs -- */

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .9px; color: var(--dim); margin-bottom: 6px; font-weight: 700; }
.input {
  width: 100%; background: #080d16; border: 1px solid var(--line-2); border-radius: 9px;
  padding: 9px 11px; font-size: 12.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: rgba(109, 94, 252, .65); box-shadow: 0 0 0 3px rgba(109, 94, 252, .13); }
.input::placeholder { color: #586880; }
select.input {
  appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b9cbd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.row { display: flex; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.hint { font-size: 11px; color: var(--dim); line-height: 1.55; }
.copy-line {
  display: flex; gap: 8px; align-items: center;
  background: #070c15; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; font-size: 11.5px; color: #9fb2d4; overflow-x: auto;
}
.copy-line code { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; }
.join-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 26px; letter-spacing: 6px; font-weight: 700; text-align: center;
  padding: 14px; background: #070c15; border: 1px dashed var(--line-2);
  border-radius: 12px; color: #dcd8ff;
}
.mini-stat { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, .08); font-size: 12px; }
.mini-stat:last-child { border-bottom: 0; }
.mini-stat .ic { width: 28px; height: 28px; border-radius: 8px; background: rgba(109, 94, 252, .12); display: grid; place-items: center; color: #a5b4fc; flex: 0 0 auto; }
.mini-stat .ic svg { width: 14px; height: 14px; }
.progress { height: 4px; background: #0a1120; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--cyan)); transition: width .2s; }

/* ---------------------------------------------------------------- modal -- */

.modal-wrap { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; padding: 20px; background: rgba(3, 5, 11, .72); backdrop-filter: blur(6px); }
.modal-wrap.open { display: grid; animation: fadeUp .15s ease; }
.modal { width: min(460px, 100%); background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.modal-wrap.wide .modal { width: min(660px, 100%); }
.modal-head { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 680; }
.modal-body { padding: 18px; max-height: min(70vh, 640px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .015); }

/* ---------------------------------------------------------------- toast -- */

#toast { position: fixed; right: 18px; bottom: 18px; z-index: 999; display: grid; gap: 8px; max-width: 380px; }
.toast {
  background: #121a28; border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 10px 13px; font-size: 12px; line-height: 1.45;
  box-shadow: var(--shadow); animation: toastIn .18s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================ SESSION ==== */

.session { position: fixed; inset: 0; z-index: 100; display: none; grid-template-rows: 56px 1fr; background: var(--bg); }
.session.open { display: grid; }
.session-head {
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: rgba(9, 13, 22, .95); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.session-head > div:first-of-type { min-width: 0; }
.session-head .s-title { font-size: 13px; font-weight: 680; letter-spacing: -.1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-head .s-sub { font-size: 10.5px; color: var(--dim); margin-top: 1px; }
.session-head .s-sub .mono { color: var(--muted); }
.session-head .spacer { flex: 1; }
.session-head .btn { flex: 0 0 auto; }
.session-body { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 0; }

.viewer { position: relative; display: flex; flex-direction: column; min-width: 0; background: #05070d; }

.display-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 22, .7); min-height: 42px;
}
.display-tabs { display: flex; align-items: center; gap: 6px; overflow-x: auto; min-width: 0; }
.display-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: .15s;
}
.display-tab:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
.display-tab.active {
  color: #e7e3ff; border-color: rgba(109, 94, 252, .45);
  background: linear-gradient(180deg, rgba(109, 94, 252, .26), rgba(109, 94, 252, .12));
  box-shadow: inset 0 0 0 1px rgba(109, 94, 252, .12);
}
.display-tab .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, .7); }
.display-tab small { color: var(--dim); font-weight: 500; }
.display-meta { font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stage {
  position: relative; flex: 1; min-height: 0; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(60% 60% at 50% 45%, #0a1120, #04060c 78%),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .03) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, .03) 0 1px, transparent 1px 28px);
}
.screen-scroll { position: absolute; inset: 0; overflow: auto; display: grid; place-items: center; padding: 14px; }
.screen-frame {
  position: relative; display: block;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .75), 0 0 0 1px rgba(148, 163, 184, .16);
  background: #000;
  flex: 0 0 auto;
}
#screen { display: block; width: 100%; height: 100%; outline: none; cursor: crosshair; background: #000; image-rendering: auto; }
#screen.zoomed { cursor: grab; }
#screen.zoomed:active { cursor: grabbing; }

.stage-tools {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3px; padding: 5px;
  background: rgba(12, 18, 30, .93); border: 1px solid var(--line-2);
  border-radius: 12px; backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); z-index: 6; max-width: calc(100% - 24px);
  flex-wrap: nowrap; overflow-x: auto;
}
.tool {
  height: 29px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 0; border-radius: 7px;
  color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tool:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.tool.active { background: rgba(109, 94, 252, .26); color: #ded9ff; box-shadow: inset 0 0 0 1px rgba(109, 94, 252, .3); }
.tool:disabled { opacity: .4; cursor: not-allowed; }
.tool svg { width: 14px; height: 14px; }
.tool.icon-only { padding: 0 7px; }
.tool.zoom-level { font-variant-numeric: tabular-nums; min-width: 46px; justify-content: center; }
.tool.select {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  padding-right: 16px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%238b9cbd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
}
.tool.select option { background: #0e1420; color: var(--text); }
.tool-sep { width: 1px; height: 17px; background: var(--line-2); margin: 0 3px; flex: 0 0 auto; }

.waiting-screen {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: rgba(5, 7, 13, .9); backdrop-filter: blur(4px); z-index: 8; padding: 20px;
}
.waiting-screen .pulse {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
  border: 2px solid rgba(109, 94, 252, .4); display: grid; place-items: center;
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(109, 94, 252, .3); } 50% { box-shadow: 0 0 0 16px rgba(109, 94, 252, 0); } }
.waiting-screen b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.waiting-screen span { font-size: 12px; color: var(--muted); display: block; max-width: 420px; line-height: 1.5; }

.mirror-warning {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  max-width: min(640px, 92%); z-index: 7; padding: 8px 12px; border-radius: 9px;
  border: 1px solid rgba(251, 191, 36, .3); background: rgba(251, 191, 36, .1);
  color: #fde68a; font-size: 11px; line-height: 1.45; text-align: center; pointer-events: none;
}

.self-guard {
  position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 20px;
  background: rgba(4, 6, 12, .93); backdrop-filter: blur(6px);
}
.self-guard-card {
  max-width: 430px; text-align: center; padding: 24px;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.self-guard .sg-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px;
  display: grid; place-items: center; color: #c7c2ff;
  background: rgba(109, 94, 252, .16); border: 1px solid rgba(109, 94, 252, .3);
}
.self-guard .sg-icon svg { width: 22px; height: 22px; }
.self-guard b { display: block; font-size: 14px; margin-bottom: 6px; }
.self-guard span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.sg-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ------------------------------------------------------------ side panel -- */

.side-panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, #0a0f18, #070b12); }
.tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); flex: 0 0 auto; overflow-x: auto; }
.tab {
  flex: 1; padding: 7px 6px; text-align: center; font-size: 11px; font-weight: 650;
  color: var(--dim); border-radius: 8px; cursor: pointer; white-space: nowrap;
  position: relative; transition: .15s;
}
.tab:hover { color: var(--muted); background: rgba(255, 255, 255, .04); }
.tab.active { color: #e4e0ff; background: rgba(109, 94, 252, .18); box-shadow: inset 0 0 0 1px rgba(109, 94, 252, .22); }
.tab.restricted { opacity: .42; }
.tab .unread { position: absolute; top: 2px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 6px rgba(167, 139, 250, .8); }

.panes { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.pane.active { display: flex; }
.pane-pad { padding: 12px; overflow-y: auto; flex: 1; }

.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 90%; font-size: 12px; line-height: 1.5; padding: 8px 11px; border-radius: 11px; }
.msg .who { display: block; font-size: 8.5px; text-transform: uppercase; letter-spacing: .8px; opacity: .6; margin-bottom: 2px; font-weight: 700; }
.msg.guest { align-self: flex-start; background: #141f33; color: #cdd9ee; border-bottom-left-radius: 3px; }
.msg.tech { align-self: flex-end; background: linear-gradient(180deg, rgba(109, 94, 252, .34), rgba(109, 94, 252, .22)); color: #eceaff; border-bottom-right-radius: 3px; }
.msg.system { align-self: center; color: var(--dim); font-size: 10.5px; background: transparent; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.chat-form .input { padding: 8px 10px; font-size: 12px; }

.term { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.term-out {
  flex: 1; overflow-y: auto; padding: 12px; background: #05070d;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; line-height: 1.55;
  color: #9fe6c0; white-space: pre-wrap; word-break: break-word;
}
.term-in { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.term-in .input { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

.file-list { display: grid; gap: 6px; margin-top: 10px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 11.5px; background: rgba(255, 255, 255, .02); }
.file-row svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; }
.file-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .sz { color: var(--dim); font-size: 10px; }
.dropzone {
  border: 1px dashed var(--line-2); border-radius: 11px; padding: 20px;
  text-align: center; color: var(--dim); font-size: 11.5px; cursor: pointer;
  transition: .15s; line-height: 1.6;
}
.dropzone b { color: var(--muted); }
.dropzone:hover, .dropzone.over { border-color: rgba(109, 94, 252, .6); color: #c7c2ff; background: rgba(109, 94, 252, .07); }
.dropzone.disabled { opacity: .45; pointer-events: none; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-item { background: #0a1120; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; min-width: 0; }
.info-item .k { font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); }
.info-item .v { font-size: 11.5px; margin-top: 3px; word-break: break-word; }

/* ========================================================== WORKFORCE ==== */

.wf-note {
  background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .22);
  color: #fde68a; padding: 9px 11px; border-radius: 9px; font-size: 11px; line-height: 1.55; margin-bottom: 12px;
}
.wf-check { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 10px 0; cursor: pointer; }
.wf-check input { accent-color: var(--brand); width: 15px; height: 15px; }
.wf-timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; padding: 14px; }
.wf-sample { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #0a1120; transition: .15s; }
.wf-sample:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.wf-shot { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #05070d; }
.wf-noimg { display: grid; place-items: center; aspect-ratio: 16 / 9; background: #05070d; color: var(--dim); font-size: 11px; }
.wf-meta { padding: 9px 10px; display: grid; gap: 3px; font-size: 10.5px; color: var(--muted); }
.wf-meta b { font-size: 11.5px; color: var(--text); }
.wf-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-empty { grid-column: 1 / -1; text-align: center; padding: 36px 20px; color: var(--dim); font-size: 12px; }
.wf-flags { display: flex; gap: 3px; margin-top: 5px; flex-wrap: wrap; }
.wf-flag {
  font-size: 8px; text-transform: uppercase; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); color: var(--dim);
}
.wf-flag.on { color: #86efac; border-color: rgba(52, 211, 153, .25); background: rgba(52, 211, 153, .08); }
.wf-flag.off { color: #fca5a5; border-color: rgba(248, 113, 113, .25); background: rgba(248, 113, 113, .07); text-decoration: line-through; }
.wf-manage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wf-manage-head b { display: block; font-size: 14px; }
.wf-manage-head span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.wf-section { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
.wf-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.wf-section h4 { font-size: 12px; margin: 0 0 4px; font-weight: 680; }
.wf-btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.wf-danger h4 { color: #fca5a5; }
.wf-session-banner {
  margin: 8px 12px 0; padding: 8px 11px; border-radius: 9px; font-size: 11px; line-height: 1.5;
  color: #fde68a; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .25);
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 1240px) {
  :root { --sidebar: 210px; }
  .session-body { grid-template-columns: minmax(0, 1fr) 330px; }
  .search { width: 190px; }
}
@media (max-width: 1080px) {
  .shell { grid-template-columns: 68px 1fr; }
  .sb-brand, .sb-label, .sb-item span:not(.count), .user-chip div, .sb-foot .icon-btn { display: none; }
  .sb-item { justify-content: center; padding: 10px; }
  .sb-item .count { display: none; }
  .sb-item .badge { display: none; }
  .sb-head { justify-content: center; padding: 4px 0 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2b { grid-template-columns: minmax(0, 1fr); }
  .session-body { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 820px) {
  .search { display: none; }
  .session-body { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: absolute; top: 56px; right: 0; bottom: 0; width: min(320px, 92vw); z-index: 25; transform: translateX(100%); transition: transform .2s; box-shadow: -20px 0 50px rgba(0, 0, 0, .5); }
  .side-panel.open { transform: none; }
  .content { padding: 14px; }
}
