:root {
  --navy: #00558F; --navy-d: #003A66; --blue: #0A6DB0; --sky: #36A9DC; --ice: #EAF6FC;
  --ink: #1d2b36; --muted: #6b7c88; --line: #d9e3ea; --bg: #f2f6f9; --card: #fff;
  --ok: #1f9d55; --warn: #d98c00; --bad: #c8382e;
  --radius: 12px; --shadow: 0 2px 10px rgba(0, 40, 70, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #e3edf4; --muted: #93a6b3; --line: #2a3a47; --bg: #0e1820; --card: #15232e; --ice: #183244; color-scheme: dark; }
}
:root[data-theme="dark"] { --ink: #e3edf4; --muted: #93a6b3; --line: #2a3a47; --bg: #0e1820; --card: #15232e; --ice: #183244; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select { font: inherit; color: inherit; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: linear-gradient(90deg, var(--navy-d), var(--navy)); color: #fff; box-shadow: var(--shadow); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.topbar .brand img { width: 36px; height: 36px; }
.topbar .brand small { font-weight: 400; opacity: .75; font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar .who { font-size: 12px; opacity: .85; margin-right: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--sky); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--navy); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.icon { padding: 6px 8px; }

/* Layout */
.wrap { max-width: 1500px; margin: 0 auto; padding: 18px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h1 { font-size: 20px; color: var(--navy); }
:root[data-theme="dark"] .toolbar h1 { color: var(--sky); }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty img { width: 96px; opacity: .9; }

/* Device grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dcard header { display: flex; align-items: flex-start; gap: 8px; }
.dcard header .t { flex: 1; min-width: 0; }
.dcard header h3 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard header .sub { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--ice); color: var(--navy); font-weight: 600; }
.pill.on { background: #dff5e8; color: var(--ok); }
.pill.busy { background: #fff2d6; color: var(--warn); }
.pill.off { background: #eceff2; color: #6b7c88; }
.controls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stage { display: flex; justify-content: center; padding: 6px 0; min-height: 200px; }

/* Device frame */
.frame { isolation: isolate; position: relative; background: #111; border-radius: calc(var(--r) * 1px + 10px); padding: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, .25), inset 0 0 0 2px #333; transform-origin: top left; }
.frame.home { padding: 52px 12px 62px; }
.frame.home::after { content: ""; position: absolute; left: 50%; bottom: 12px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%; border: 3px solid #444; }
.frame.bezel { padding: 22px 10px 26px; }
.screen { position: relative; overflow: hidden; background: #000; border-radius: calc(var(--r) * 1px); width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); color: #fff; user-select: none; }
.frame.home .screen, .frame.bezel .screen { border-radius: 4px; }
.cut-notch::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 46%; height: 30px; background: #111; border-radius: 0 0 18px 18px; z-index: 5; }
.cut-island::before { content: ""; position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 120px; height: 34px; background: #000; border-radius: 20px; z-index: 5; }
.cut-punch::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; background: #000; border-radius: 50%; z-index: 5; box-shadow: 0 0 0 2px #222; }
.landscape .screen { width: calc(var(--h) * 1px); height: calc(var(--w) * 1px); }

.status { position: absolute; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 15px; font-weight: 600; z-index: 6; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.android .status { height: 32px; font-size: 13px; padding: 0 14px; }
.status .r { display: flex; align-items: center; gap: 6px; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { display: block; width: 3px; background: currentColor; border-radius: 1px; opacity: .3; }
.bars i.on { opacity: 1; }
.bars i:nth-child(1) { height: 4px; } .bars i:nth-child(2) { height: 7px; } .bars i:nth-child(3) { height: 10px; } .bars i:nth-child(4) { height: 12px; }
.tech { font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.wifi { width: 15px; height: 11px; }
.batt { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.batt .shell { position: relative; width: 24px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; padding: 1px; }
.batt .shell::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: currentColor; border-radius: 0 1px 1px 0; }
.batt .fill { height: 100%; background: currentColor; border-radius: 1px; }
.batt.low .fill { background: #ff453a; }
.batt.chg .fill { background: #30d158; }
.carrier { font-size: 12px; font-weight: 500; }

.wall { position: absolute; inset: 0; background: radial-gradient(120% 80% at 20% 10%, #36A9DC 0%, #0A6DB0 45%, #003A66 100%); }
.android .wall { background: radial-gradient(120% 80% at 80% 0%, #3d8fd1 0%, #10507f 50%, #0b2236 100%); }
.homegrid { position: absolute; top: 60px; left: 0; right: 0; bottom: 90px; display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); grid-auto-rows: 92px; padding: 0 12px; gap: 4px; overflow: auto; }
.appicon { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; border: 0; background: none; color: #fff; padding: 4px; }
.appicon .ic { width: 58px; height: 58px; border-radius: 14px; background: #fff center/cover no-repeat; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--navy); }
.android .appicon .ic { border-radius: 50%; }
.appicon span { font-size: 11px; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.appicon.installing .ic { opacity: .55; }
.appicon.installing .ic::after { content: ""; width: 24px; height: 24px; border: 3px solid var(--sky); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
.appicon.failed .ic { outline: 3px solid #ff453a; }
.dock { position: absolute; left: 12px; right: 12px; bottom: 22px; height: 64px; border-radius: 22px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; font-size: 12px; color: rgba(255, 255, 255, .85); }
.android .dock { background: transparent; backdrop-filter: none; }
.homebar { position: absolute; left: 50%; bottom: 7px; width: 36%; height: 5px; margin-left: -18%; background: rgba(255, 255, 255, .85); border-radius: 3px; cursor: pointer; z-index: 7; }
.navbar { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; justify-content: space-around; align-items: center; background: rgba(0, 0, 0, .35); z-index: 7; font-size: 18px; }
.navbar button { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px 18px; }
.appview { position: absolute; inset: 0; background: #f4f7fa; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 50px 20px; text-align: center; }
.appview .ic { width: 84px; height: 84px; border-radius: 20px; background: #fff center/cover no-repeat; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: var(--navy); }
.appview h4 { margin: 0; font-size: 18px; color: var(--navy); }
.appview p { margin: 0; font-size: 12px; color: #4c5d69; }
.boot { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-size: 14px; color: #ddd; }
.boot .spinner { width: 34px; height: 34px; border: 3px solid #555; border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
.boot img { width: 72px; opacity: .9; }
.offscreen { position: absolute; inset: 0; background: #050505; }
.droptarget { position: absolute; inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; background: rgba(10, 109, 176, .78); border: 3px dashed #fff; font-size: 16px; font-weight: 600; text-align: center; padding: 20px; }
.screen.dragging .droptarget { display: flex; }
.toast-mini { position: absolute; left: 10px; right: 10px; top: 52px; z-index: 8; background: rgba(30, 30, 30, .88); color: #fff; padding: 9px 12px; border-radius: 12px; font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Drawer + modal */
.backdrop { position: fixed; inset: 0; background: rgba(0, 20, 35, .45); z-index: 40; display: none; }
.backdrop.show { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--card); z-index: 50; box-shadow: -6px 0 20px rgba(0, 0, 0, .2); transform: translateX(105%); transition: transform .2s; display: flex; flex-direction: column; }
.drawer.show { transform: none; }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { font-size: 16px; flex: 1; }
.drawer .body { overflow: auto; padding: 6px 16px 30px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--card); border-radius: 14px; z-index: 50; display: none; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal.show { display: flex; }
.modal.narrow { width: min(460px, calc(100vw - 24px)); }
.modal > header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal > header h2 { font-size: 17px; flex: 1; }
.modal .body { padding: 16px 18px; overflow: auto; }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }

section.group { border-bottom: 1px solid var(--line); padding: 14px 0; }
section.group:last-child { border-bottom: 0; }
section.group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row > label:first-child { width: 120px; color: var(--muted); font-size: 13px; }
.row .grow { flex: 1; min-width: 140px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--sky); outline-offset: 0; border-color: var(--sky); }
input[type=range] { accent-color: var(--blue); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #b9c6cf; border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; }

.applist { list-style: none; margin: 0; padding: 0; }
.applist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.applist .ic { width: 36px; height: 36px; border-radius: 9px; background: var(--ice) center/cover no-repeat; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); }
.applist .meta { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.applist .meta b { display: block; color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.hover { border-color: var(--sky); background: var(--ice); }
.events { font: 12px/1.5 ui-monospace, Consolas, monospace; max-height: 240px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 8px; }
code.k { font: 12px ui-monospace, Consolas, monospace; background: var(--bg); padding: 2px 6px; border-radius: 5px; word-break: break-all; }

/* Model picker */
.picker-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.picker-filters input { flex: 1; min-width: 180px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; }
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 330px; overflow: auto; padding: 2px; }
.model { border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; background: var(--card); text-align: left; display: flex; gap: 10px; align-items: center; }
.model:hover { border-color: var(--sky); }
.model.sel { border-color: var(--blue); box-shadow: 0 0 0 2px var(--sky); }
.model .glyph { width: 22px; height: 36px; border: 2px solid var(--navy); border-radius: 5px; flex: none; }
.model.tablet .glyph { width: 30px; height: 38px; }
.model b { display: block; font-size: 13px; }
.model small { color: var(--muted); font-size: 11px; }
.brandhead { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-top: 6px; }

/* Tables (admin) */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: var(--bg); }
.tbl td .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }

/* Auth pages */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(120% 90% at 10% 0%, #36A9DC 0%, #0A6DB0 40%, #003A66 100%); }
.auth .box { width: min(400px, 100%); background: var(--card); border-radius: 16px; padding: 28px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.auth .box img { display: block; width: 110px; margin: 0 auto 8px; }
.auth h1 { text-align: center; font-size: 20px; color: var(--navy); margin-bottom: 4px; }
.auth .tag { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.auth label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.auth input { width: 100%; }
.auth .btn { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }
.auth .links { text-align: center; margin-top: 14px; font-size: 13px; }
.msg { padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-top: 12px; display: none; }
.msg.show { display: block; }
.msg.err { background: #fde8e6; color: #9b2118; }
.msg.ok { background: #e2f6ea; color: #17643a; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; }
.toast.err { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .topbar .brand small, .topbar .who { display: none; }
  .wrap { padding: 12px; }
  .row > label:first-child { width: 100%; }
  .tbl th:nth-child(4), .tbl td:nth-child(4), .tbl th:nth-child(5), .tbl td:nth-child(5) { display: none; }
}

/* ---- real devices: live screen ---- */
.live-slot { position: absolute; inset: 0; background: #000; }
.live { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.live canvas { width: 100%; height: 100%; object-fit: contain; touch-action: none; cursor: pointer; outline: none; display: block; }
.live canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent, #2f80ed); }
.live-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #cfd8df; font-size: 13px; text-align: center; padding: 0 16px; pointer-events: none; }
.rt-note { position: absolute; left: 8px; right: 8px; top: 46px; z-index: 7; background: rgba(15, 40, 70, .9); color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 11px; line-height: 1.35; }
.rtbadge { margin: 6px auto 0; width: fit-content; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--line, #e3e8ee); color: #4c5d69; }
.rtbadge.real { background: #e3f6e9; color: #1d7a3e; }
.rtbadge.busy { background: #fff4dc; color: #8a5a00; }

/* ---- device name (rename on the card) ---- */
.namerow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.namerow h3 { cursor: text; min-width: 0; }
.namerow .rename { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 6px; opacity: .55; }
.dcard:hover .namerow .rename, .namerow .rename:focus-visible { opacity: 1; }
.namerow .rename:hover { background: var(--line, #e3e8ee); }
.rename-box { width: 100%; font: inherit; font-size: 15px; font-weight: 700; padding: 2px 6px; border: 1px solid var(--accent, #2f80ed); border-radius: 6px; }

/* ---- installed applications (hover / focus) ---- */
.appsum { position: relative; margin: 8px auto 0; width: fit-content; font-size: 12px; color: #4c5d69; padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--line, #d5dde5); cursor: default; outline: none; }
.appsum:hover, .appsum:focus-visible { border-style: solid; color: var(--ink, #1d2b36); }
.apppop { display: none; position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); width: 300px; max-height: 360px; overflow: auto; background: var(--card, #fff); color: var(--ink, #1d2b36); border: 1px solid var(--line, #d5dde5); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 10px 12px; text-align: left; }
.appsum:hover .apppop, .appsum:focus-within .apppop { display: block; }
.apppop h6 { margin: 6px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7a86; }
.apppop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.apppop ul.cols { grid-template-columns: 1fr 1fr; }
.apppop li { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.apppop li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apppop .ic { width: 20px; height: 20px; border-radius: 5px; flex: none; background: var(--ice, #e8f1f8) center/cover no-repeat; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.apppop small { color: #6b7a86; } .apppop small.failed { color: var(--bad, #d93025); }
.apppop p { margin: 2px 0 6px; font-size: 12px; color: #6b7a86; }

/* ---- home screen dock + built-in app stand-ins ---- */
.dockbar { position: absolute; left: 10px; right: 10px; bottom: 22px; height: 82px; border-radius: 24px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(8px); display: flex; justify-content: space-around; align-items: center; z-index: 5; }
.android .dockbar { background: transparent; backdrop-filter: none; bottom: 44px; }
.dockbar .appicon > span:not(.ic) { display: none; }
.sysapp { position: absolute; inset: 0; background: #f4f7fa; color: #1d2b36; padding: 52px 18px 50px; display: flex; flex-direction: column; align-items: center; gap: 12px; overflow: auto; }
.sysapp-head { display: flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 16px; }
.sysapp-head .ic { width: 30px; height: 30px; border-radius: 8px; background: #fff center/cover no-repeat; }
.dial-num { font-size: 26px; min-height: 36px; letter-spacing: 2px; font-variant-numeric: tabular-nums; text-align: center; width: 100%; overflow: hidden; }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; }
.keypad.calc { grid-template-columns: repeat(4, 54px); gap: 8px; }
.keypad button { height: 64px; border-radius: 50%; border: 0; background: #e3e8ee; font-size: 24px; cursor: pointer; color: #1d2b36; }
.keypad.calc button { height: 54px; font-size: 20px; border-radius: 14px; }
.keypad button:active { background: #c9d3dc; }
.dial-call { width: 64px; height: 64px; border-radius: 50%; border: 0; background: #34a853; color: #fff; font-size: 26px; cursor: pointer; }
.about { width: 100%; background: #fff; border-radius: 12px; padding: 6px 12px; }
.about h5 { margin: 6px 0; font-size: 13px; color: #6b7a86; }
.about div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #edf1f5; font-size: 13px; }
.about b { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urlbar { width: 100%; background: #fff; border: 1px solid #d5dde5; border-radius: 20px; padding: 10px 14px; font-size: 13px; color: #8795a1; }
.muted-sm { font-size: 12px; color: #6b7a86; text-align: center; margin: 0; }
.homegrid { bottom: 112px; }
.android .homegrid { bottom: 132px; }

/* ---- device looks: iPhone vs Android vs tablet vs foldables ---- */
.frame .hw { position: absolute; display: block; width: 4px; border-radius: 2px; z-index: -1; }
/* iPhone: titanium/steel rim, buttons on both sides */
.frame.ios.phone { background: #0c0c0d; box-shadow: 0 10px 24px rgba(0, 0, 0, .28), 0 0 0 3px #a9afb7, 0 0 0 5px #6e747c; }
.frame.ios .hw { background: linear-gradient(90deg, #7d838b, #b8bec6); }
.frame.ios .hw-l0 { left: -8px; top: 16%; height: 4%; }
.frame.ios .hw-l1 { left: -8px; top: 24%; height: 8%; }
.frame.ios .hw-l2 { left: -8px; top: 34%; height: 8%; }
.frame.ios .hw-r1 { right: -8px; top: 27%; height: 12%; }
/* Android: matte black, squarer corners, slimmer bezel, volume + power on the right */
.frame.android.phone { background: #161718; padding: 8px; border-radius: calc(var(--r) * 1px + 5px); box-shadow: 0 10px 24px rgba(0, 0, 0, .3), 0 0 0 2px #2c2e30, 0 0 0 3px #48494b; }
.frame.android.phone .screen { border-radius: calc(var(--r) * 1px - 4px); }
.frame.android .hw { background: #3a3c3f; }
.frame.android .hw-r0 { right: -6px; top: 20%; height: 13%; }
.frame.android .hw-r1 { right: -6px; top: 36%; height: 7%; }
.frame.brand-samsung.phone { box-shadow: 0 10px 24px rgba(0, 0, 0, .3), 0 0 0 2px #31343a, 0 0 0 3px #5b6069; }
/* Tablets: even, wider bezel, aluminium edge, front camera on the top bezel, buttons on the top edge */
.frame.tablet { padding: 22px; border-radius: calc(var(--r) * 1px + 18px); background: #1d1e20; box-shadow: 0 12px 28px rgba(0, 0, 0, .26), 0 0 0 3px #c4c9cf, 0 0 0 4px #8f959c; }
.frame.tablet.home { padding: 52px 22px 62px; }
.frame.tablet .screen { border-radius: 10px; }
.frame.tablet::before { content: ""; position: absolute; top: 9px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #2f3a46; box-shadow: 0 0 0 1px #000; }
.frame.tablet.home::before { top: 24px; }
.frame.tablet .hw { width: auto; height: 4px; background: linear-gradient(#b8bec6, #7d838b); }
.frame.tablet .hw-t1 { top: -7px; right: 14%; width: 8%; }
.frame.tablet .hw-t2 { top: -7px; right: 26%; width: 12%; }
.frame.landscape .hw { display: none; }
/* Foldables */
.frame.fold.closed { border-radius: calc(var(--r) * 1px + 4px); }
.frame.fold.closed::before { content: ""; position: absolute; left: -7px; top: 3%; bottom: 3%; width: 9px; border-radius: 6px 2px 2px 6px; background: linear-gradient(90deg, #2a2b2d, #4a4c4f); }
.frame.fold.open { padding: 8px; border-radius: calc(var(--r) * 1px + 6px); }
.frame.fold.open::before { content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 8px; margin-left: -5px; border-radius: 3px 3px 0 0; background: #3c3e41; }
.frame.fold.open::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 8px; margin-left: -5px; border-radius: 0 0 3px 3px; background: #3c3e41; }
.crease { position: absolute; top: 0; bottom: 0; left: 50%; width: 12px; margin-left: -6px; pointer-events: none; z-index: 8; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06) 30%, rgba(0, 0, 0, .18) 50%, rgba(255, 255, 255, .06) 70%, transparent); }
.frame.flip .crease { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 12px; margin: -6px 0 0; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .06) 30%, rgba(0, 0, 0, .18) 50%, rgba(255, 255, 255, .06) 70%, transparent); }
.frame.flip.open::before { content: ""; position: absolute; left: -6px; top: 47%; height: 6%; width: 8px; border-radius: 4px 0 0 4px; background: #3c3e41; }
.frame.flip.closed { padding: 14px 14px 120px; border-radius: 52px; background: #1b1c1e; }
.frame.flip.closed::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 14px; height: 92px; border-radius: 0 0 40px 40px; background: linear-gradient(160deg, #3b3f46, #24262a); }
.flipcams { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 9; pointer-events: none; }
.flipcams b { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #2e3b4a 0 25%, #0a0c0f 30%); box-shadow: 0 0 0 3px #1a1b1d, 0 0 0 4px #555; }
.coverscreen { position: absolute; inset: 0; background: radial-gradient(120% 90% at 70% 10%, #2c4c7a, #0b1424); display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; padding: 22px 26px; gap: 4px; }
.cv-time { font-size: 54px; font-weight: 300; line-height: 1; }
.cv-date, .cv-batt { font-size: 15px; opacity: .85; }

/* ---- boot screen (until the device has really booted) ---- */
.bootscr { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: #000; color: #e8eef3; }
.bootscr.android { background: radial-gradient(90% 60% at 50% 40%, #12202b, #000 70%); }
.bs-os { font-size: 26px; font-weight: 300; letter-spacing: .5px; }
.bootscr.android .bs-os { color: #9fe3b0; }
.bs-ring { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(159, 227, 176, .2); border-top-color: #9fe3b0; animation: spin 1s linear infinite; }
.bs-bar { width: 46%; height: 5px; border-radius: 3px; background: #333; overflow: hidden; }
.bs-bar span { display: block; height: 100%; width: 40%; background: #fff; border-radius: 3px; animation: bsbar 1.6s ease-in-out infinite; }
@keyframes bsbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.bs-msg { font-size: 13px; line-height: 1.45; color: #b8c4cd; max-width: 90%; }
.bs-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; font-size: 11px; color: #5f6f7a; }
.bs-steps li { padding: 3px 8px; border-radius: 99px; border: 1px solid #2a3540; }
.bs-steps li.done { color: #9fe3b0; border-color: #2f5b3a; }
.bs-steps li.now { color: #000; background: #9fe3b0; border-color: #9fe3b0; }
.bs-time { font-size: 12px; color: #6f7f8a; font-variant-numeric: tabular-nums; }
.perf { margin: 4px auto 0; width: fit-content; max-width: 100%; font-size: 11px; color: #5f6f7a; font-variant-numeric: tabular-nums; text-align: center; }
.perf .hot { color: var(--bad, #d93025); font-weight: 600; }
