:root {
  color-scheme: dark;
  --bg: #070c13;
  --bg-soft: #0b121c;
  --panel: #0f1826;
  --panel-2: #121f30;
  --panel-3: #0a111b;
  --line: #213148;
  --line-soft: #1a273a;
  --text: #e9eff9;
  --muted: #8494ab;
  --muted-2: #63748c;
  --accent: #2dd4a0;
  --accent-soft: #123b32;
  --accent-line: #1f6b57;
  --blue: #5aa7ff;
  --warn: #f3bb5e;
  --danger: #ff8290;
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 700px at 80% -10%, #10233a 0%, transparent 55%), var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 252px; flex: none; display: flex; flex-direction: column;
  padding: 26px 16px 18px; background: rgba(9, 15, 24, .94);
  border-right: 1px solid var(--line-soft); position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 34px; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #2dd4a0, #15997a); color: #04120e;
  font-size: 21px; font-weight: 900; letter-spacing: -.04em;
  box-shadow: 0 0 28px rgba(45, 212, 160, .28);
}
.brand strong { display: block; font-size: 14px; letter-spacing: .16em; }
.brand small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 8.5px; font-weight: 800; letter-spacing: .17em; }
.side-block { margin-bottom: 26px; }
.side-block.grow { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 14px; }
.side-label { display: block; padding-left: 10px; color: var(--muted-2); font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; margin-top: 6px; padding: 10px 11px;
  border: 1px solid transparent; border-radius: 9px; color: #93a4bc;
  text-decoration: none; font-weight: 650; font-size: 12.5px;
}
.nav-item:hover { background: #121e2e; color: #d8e4f5; }
.nav-item.active { background: linear-gradient(90deg, #133329, #101f2b); border-color: #235445; color: #9cf0d0; }
.nav-icon { width: 18px; text-align: center; font-size: 16px; color: #6f88a5; }
.nav-item.active .nav-icon { color: var(--accent); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.side-devices { margin-top: 9px; overflow: auto; display: grid; gap: 5px; align-content: start; }
.side-empty { padding: 10px; color: var(--muted-2); font-size: 11px; }
.side-device {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: #b9c7da; text-align: left; font-size: 11.5px; text-decoration: none;
}
.side-device:hover, .side-device.active { background: #121f2e; border-color: #2a3d57; color: #fff; }
.side-device .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-device .code { color: var(--muted-2); font-family: Consolas, monospace; font-size: 9.5px; }
.side-bottom { margin-top: auto; }
.access-card { border: 1px solid var(--line-soft); border-radius: 10px; background: #0b141f; padding: 10px; }
.access-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: #9aabc1; font-size: 11.5px; font-weight: 700; text-align: left; }
.access-body { margin-top: 9px; }
.access-body label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.access-body input { width: 100%; padding: 8px 9px; border: 1px solid #31425a; border-radius: 7px; background: #070e17; color: var(--text); outline: none; }
.access-body input:focus { border-color: var(--accent-line); }
.access-body .btn { width: 100%; margin-top: 7px; }

.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #5b6d84; }
.dot.on { background: var(--accent); box-shadow: 0 0 10px rgba(45, 212, 160, .8); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(243, 187, 94, .6); }
.dot.bad { background: var(--danger); box-shadow: 0 0 10px rgba(255, 130, 144, .6); }

/* Main layout */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px; padding: 0 34px; border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 16, 25, .82); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.crumbs { color: #a5b4c9; font-size: 12px; }
.crumbs span { margin: 0 9px; color: #4d5f76; }
.pill { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border: 1px solid #31415a; border-radius: 99px; background: #111b29; color: #b6c5d9; font-size: 11px; font-weight: 750; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: #8799b1; }
.pill.online { background: #0d3027; border-color: #256249; color: #8be8c6; }
.pill.online i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pill.error { background: #331e25; border-color: #70404a; color: #f4aab1; }
.pill.error i { background: var(--danger); }

main { width: 100%; max-width: 1720px; margin: 0 auto; padding: 30px 34px 40px; }

/* Page heading */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: var(--accent); font-size: 9.5px; font-weight: 850; letter-spacing: .2em; }
h1 { margin: 7px 0 5px; font-size: 30px; line-height: 1.15; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
h3 { margin: 0 0 6px; font-size: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat {
  position: relative; overflow: hidden; padding: 18px 19px; border: 1px solid var(--line);
  border-radius: var(--radius); background: linear-gradient(160deg, #101c2b, #0d1622);
}
.stat:after { content: ""; position: absolute; inset: auto -30px -55px auto; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(45, 212, 160, .12), transparent 70%); }
.stat-label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.stat strong { display: block; margin: 8px 0 3px; font-size: 30px; letter-spacing: -.04em; }
.stat small { color: var(--muted-2); font-size: 10.5px; }

/* Sections */
.section-block { margin-bottom: 28px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.count { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; background: #0c1521; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 15px; }
.device-card {
  display: block; width: 100%; padding: 17px; border: 1px solid var(--line);
  border-radius: var(--radius); background: linear-gradient(165deg, #101c2b, #0c151f 70%);
  color: var(--text); text-align: left; text-decoration: none; transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.device-card:hover { transform: translateY(-2px); border-color: #35506d; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.device-card.offline { opacity: .72; }
.device-card.offline:hover { opacity: 1; }
.device-top { display: flex; align-items: center; gap: 12px; }
.device-avatar {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(145deg, #173a31, #0e2a24); border: 1px solid #275b4a;
  color: #8ef0cc; font-size: 19px; font-weight: 850;
}
.device-avatar.small { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.device-title { min-width: 0; flex: 1; }
.device-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.device-title small { display: block; margin-top: 3px; color: var(--muted-2); font-family: Consolas, "Cascadia Mono", monospace; font-size: 10px; }
.device-os { margin-top: 13px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.chip { padding: 3px 7px; border: 1px solid #284237; border-radius: 99px; background: #0e241f; color: #86dabd; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.chip.off { border-color: #2b3648; background: #111a26; color: #6d7e94; }
.device-stats { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: #8293aa; font-size: 10.5px; }
.device-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted-2); font-size: 10px; }
.device-foot .open { color: var(--accent); font-weight: 800; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid #2b3b52; border-radius: 99px; background: #111b28; color: #93a5bd; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.badge.online { border-color: #28604b; background: #0d2b22; color: #8ae7c4; }
.badge.off { border-color: #333d4c; background: #141b25; color: #75859a; }
.badge.warn { border-color: #6c5327; background: #2b2212; color: #f0c574; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.empty-state { grid-column: 1 / -1; padding: 48px 30px; border: 1px dashed #2a3b52; border-radius: var(--radius); background: #0b1420; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-top: 13px; color: #d3deee; font-size: 15px; }
.empty-state p { max-width: 440px; margin: 7px auto 0; font-size: 11.5px; line-height: 1.6; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border: 1px solid #30455f; border-radius: 15px; background: #101c2a; color: #6c8bb2; font-size: 28px; }

.info-strip { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: 21px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, #0f1a28, #0b141f); }
.info-strip p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.cap-list { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.cap-list span { padding: 6px 9px; border: 1px solid #2b3f58; border-radius: 7px; background: #0d1723; color: #a8bbd4; font-size: 10px; font-weight: 700; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 750; text-decoration: none; }
.btn.primary { border: 1px solid #35a889; background: linear-gradient(180deg, #2dd4a0, #20a97f); color: #05130f; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #43e3b1, #27b78a); }
.btn.subtle { border: 1px solid #32455f; background: #162335; color: #c6d4e6; }
.btn.subtle:hover:not(:disabled) { border-color: #527296; color: #fff; }
.btn.full { width: 100%; margin-top: 8px; }
.icon-btn { display: grid; place-items: center; min-width: 31px; height: 31px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #a0b2c9; font-size: 17px; }
.icon-btn:hover:not(:disabled) { border-color: #3a506b; background: #1b2a3d; color: #fff; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* Device banner */
.device-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(140deg, #10202e, #0c1621 65%); }
.device-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.device-identity h1 { margin: 5px 0 4px; font-size: 24px; }
.device-identity .device-avatar { width: 50px; height: 50px; font-size: 21px; }
.device-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; color: #94e7c8; font-size: 10.5px; letter-spacing: .04em; }
.sep { color: #475a71; }
.banner-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* Console */
.console-grid { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 17px; align-items: start; margin-bottom: 17px; }
.viewer-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; box-shadow: 0 18px 46px rgba(0, 0, 0, .28); }
.card-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.viewer-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.screen-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: #183349; color: #93c7ff; font-size: 19px; }
.viewer-title strong, .viewer-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title strong { font-size: 12.5px; }
.viewer-title small { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.toolbar-actions { display: flex; gap: 3px; }

.screen { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: min(66vh, 760px); min-height: 320px; background: #04070b; overflow: auto; outline: none; touch-action: none; }
.screen:focus-visible { box-shadow: inset 0 0 0 2px #4b8cff; }
.screen:fullscreen { height: 100vh; background: #000; }
.screen img { display: block; flex: none; max-width: none; max-height: none; user-select: none; -webkit-user-drag: none; cursor: crosshair; }
.screen img[hidden] { display: none; }
.screen-empty { max-width: 300px; padding: 20px; text-align: center; color: var(--muted); pointer-events: none; }
.screen-empty strong { display: block; margin-top: 14px; color: #d5e0ef; font-size: 15px; }
.screen-empty p { margin: 7px 0 0; font-size: 11.5px; line-height: 1.6; }
.screen-warning { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 10px 12px; border: 1px solid #6c5327; border-radius: 9px; background: rgba(43, 34, 18, .94); color: #f1c979; font-size: 11px; line-height: 1.5; pointer-events: none; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: #8597ae; font-size: 10.5px; font-weight: 750; }
.footer-left, .footer-right { display: flex; align-items: center; gap: 8px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #66778e; }
.live-dot.on { background: var(--accent); box-shadow: 0 0 9px rgba(45, 212, 160, .8); }

.control-col { display: grid; gap: 13px; }
.card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 12.5px; font-weight: 800; }
.card-num { color: #4f6580; font-family: Consolas, monospace; font-size: 9.5px; letter-spacing: .08em; }
.state-row { display: flex; align-items: center; gap: 10px; }
.state-row strong, .state-row small { display: block; }
.state-row strong { font-size: 12.5px; }
.state-row small { margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.toggle-row strong { display: block; font-size: 11.5px; }
.toggle-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.switch { position: relative; flex: none; width: 36px; height: 21px; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { display: block; width: 36px; height: 21px; border-radius: 99px; background: #39485d; transition: .15s; }
.switch span:after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span:after { transform: translateX(15px); }

.warn { margin-top: 11px; padding: 9px 10px; border: 1px solid #6c5327; border-radius: 8px; background: #241d10; color: #e9c375; font-size: 10.5px; line-height: 1.5; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick, .key { border: 1px solid #2f4259; border-radius: 7px; background: #142134; color: #b9cbe2; font-size: 10.5px; font-weight: 750; padding: 8px 6px; }
.quick:hover:not(:disabled), .key:hover:not(:disabled) { border-color: #4b6d94; background: #1b2d45; color: #fff; }
.key-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 7px; }
.key { padding: 8px 0; }
.micro { margin: 9px 0 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }

textarea { width: 100%; min-height: 68px; resize: vertical; padding: 9px 10px; border: 1px solid #31425a; border-radius: 8px; background: #080f18; color: var(--text); outline: none; }
textarea:focus { border-color: var(--accent-line); }

.details { display: grid; gap: 7px; font-size: 10.5px; }
.details > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.details span { color: var(--muted-2); }
.details strong { overflow-wrap: anywhere; color: #cddbec; font-weight: 650; }

/* Lower panels */
.lower-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; align-items: start; }
.camera-frame { display: flex; align-items: center; justify-content: center; min-height: 190px; border: 1px solid #2a3d56; border-radius: 9px; background: #04080d; overflow: hidden; }
.camera-frame img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.camera-empty { color: var(--muted-2); font-size: 11px; }
.note { margin-top: 11px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.note.success { color: #8ae7c4; }
.note.error { color: #f3aab2; }
.note.pending { color: #efc77c; }

.files-card { min-width: 0; }
.path-row { display: flex; gap: 6px; align-items: center; }
.path-row input { flex: 1; min-width: 0; padding: 8px 9px; border: 1px solid #31425a; border-radius: 7px; background: #080f18; color: var(--text); font-size: 10.5px; outline: none; }
.path-row input:focus { border-color: var(--accent-line); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 22px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.breadcrumb button { padding: 2px 4px; border: 0; border-radius: 4px; background: none; color: #bcd1e8; font-size: 10px; }
.breadcrumb button:hover { background: #1b2a3d; text-decoration: underline; }
.breadcrumb span { color: #455870; }
.files-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.files-toolbar #fs-location { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aebfd4; font-size: 10.5px; font-weight: 700; }
.entries { display: grid; gap: 5px; max-height: 300px; overflow: auto; margin-top: 9px; }
.entry { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid #24364c; border-radius: 7px; background: #0a131e; font-size: 10.5px; }
.entry:hover { border-color: #38516f; }
.entry .entry-icon { width: 16px; text-align: center; color: #7f9cbf; }
.entry.folder .entry-icon { color: #f0c574; }
.entry .entry-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9d8e9; }
.entry.folder .entry-name { cursor: pointer; }
.entry.folder .entry-name:hover { color: #fff; text-decoration: underline; }
.entry .entry-size { flex: none; color: var(--muted-2); font-size: 9.5px; }
.entry-actions { display: flex; gap: 4px; flex: none; }
.mini { padding: 3px 7px; border: 1px solid #344b68; border-radius: 5px; background: #17263a; color: #bfd2e8; font-size: 9px; font-weight: 800; }
.mini:hover { background: #203550; }
.mini.danger { border-color: #633a43; background: #29171c; color: #f3b3ba; }
.mini.danger:hover { background: #3a1f26; }
.fs-empty { padding: 16px 8px; color: var(--muted-2); text-align: center; font-size: 10.5px; }

/* Phone data */
.phone-card { grid-column: 1 / -1; min-width: 0; }
.phone-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.phone-tab { padding: 7px 13px; border: 1px solid #2c4059; border-radius: 7px; background: #0c1622; color: #9fb6d1; font-size: 10.5px; font-weight: 750; }
.phone-tab:hover { border-color: #3d597a; color: #dbe8f6; }
.phone-tab.active { border-color: var(--accent-line); background: #102b26; color: #9ff0d2; }
.phone-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.phone-toolbar .note { margin-top: 0; }
.phone-list { display: grid; gap: 6px; max-height: 420px; overflow: auto; margin-top: 10px; }
.phone-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 9px 10px; border: 1px solid #24364c; border-radius: 7px; background: #0a131e; font-size: 10.5px; }
.phone-row:hover { border-color: #38516f; }
.phone-who { min-width: 0; }
.phone-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d3e4f5; font-size: 11px; }
.phone-who small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-family: Consolas, monospace; font-size: 9.5px; }
.phone-body { min-width: 0; color: #b9cce0; line-height: 1.5; overflow-wrap: anywhere; }
.phone-row.contacts-row { grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; }
.phone-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted-2); font-size: 9.5px; white-space: nowrap; }
.phone-tag { padding: 2px 6px; border: 1px solid #2f4662; border-radius: 4px; background: #132033; color: #9fb8d2; font-size: 8.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.phone-tag.received, .phone-tag.incoming { border-color: #26523f; background: #0d211a; color: #86e0bb; }
.phone-tag.sent, .phone-tag.outgoing { border-color: #2c4763; background: #0e1d2c; color: #8dc3ee; }
.phone-tag.missed, .phone-tag.failed, .phone-tag.rejected, .phone-tag.blocked { border-color: #633a43; background: #29171c; color: #f3b3ba; }
.phone-tag.unread { border-color: #6b5626; background: #241d0d; color: #f0cf83; }
.phone-empty { padding: 18px 8px; color: var(--muted-2); text-align: center; font-size: 10.5px; }
.phone-empty.error { color: #f3aab2; }

.activity { min-height: 190px; max-height: 300px; overflow: auto; padding: 9px 10px; border: 1px solid #24364c; border-radius: 8px; background: #050a10; font-family: Consolas, "Cascadia Mono", monospace; font-size: 9.5px; line-height: 1.6; color: #9fb2c9; }
.activity .line { padding: 1px 0; overflow-wrap: anywhere; }
.activity .time { color: #4e647d; }
.activity .ok { color: #8ae7c4; }
.activity .warn { color: #eec87b; }
.activity .err { color: #f2a1aa; }

/* Login */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(4, 8, 13, .82); backdrop-filter: blur(8px); }
.login-card { width: min(390px, 100%); padding: 28px; border: 1px solid #2c415c; border-radius: 16px; background: linear-gradient(160deg, #101d2c, #0b141f); box-shadow: 0 30px 100px rgba(0, 0, 0, .6); }
.brand-mark.big { width: 48px; height: 48px; border-radius: 14px; font-size: 25px; }
.login-card h2 { margin: 16px 0 8px; font-size: 20px; }
.login-card p { margin: 0 0 16px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid #344963; border-radius: 8px; background: #070e17; color: var(--text); outline: none; }
.login-card input:focus { border-color: var(--accent-line); }
.login-card .btn { width: 100%; margin-top: 11px; padding: 11px; }
.login-card small { display: block; margin-top: 9px; color: #f2a1aa; font-size: 10.5px; }

/* Responsive */
@media (max-width: 1250px) {
  .console-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .console-grid { grid-template-columns: 1fr; }
  .control-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lower-grid { grid-template-columns: 1fr; }
  .info-strip { grid-template-columns: 1fr; }
  .cap-list { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .sidebar { width: 68px; padding: 18px 9px 14px; }
  .brand { padding: 0 5px 24px; }
  .brand > div, .side-label, .side-devices, .access-card, .side-head { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 19px; }
  .nav-item { justify-content: center; padding: 11px 5px; font-size: 0; }
  .nav-icon { font-size: 18px; width: auto; }
  .topbar { padding: 0 16px; height: 58px; }
  .crumbs { font-size: 11px; }
  main { padding: 20px 14px 30px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 24px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 13px; }
  .stat strong { font-size: 24px; }
  .device-grid { grid-template-columns: 1fr; }
  .device-banner { align-items: flex-start; flex-direction: column; }
  .banner-right { width: 100%; justify-content: space-between; }
  .control-col { grid-template-columns: 1fr; }
  .screen { height: 46vh; min-height: 250px; }
  .viewer-footer { font-size: 9.5px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .key-grid { grid-template-columns: repeat(3, 1fr); }
  .info-strip { padding: 16px; }
}
