/* Hearth: bold & simple. Solid colour blocks, heavy type, high contrast: readable in sunlight, at a glance, by anyone. */
:root{
  --bg:#0e0d0c; --surf:#1c1a18; --surf2:#292622; --ink:#ffffff; --dim:#c9c2b8; --faint:#8f877d; --line:#3b3732;
  --help:#ff3b30; --c-talk:#4da3ff; --c-beacon:#ff8a1f; --c-sky:#ffd60a; --c-watch:#34d399; --c-sentry:#b28dff; --c-find:#ff7a59;
  --c-almanac:#5ee0f2; --c-defend:#c6f432; --c-library:#a5a8ff; --c-compass:#fda4af; --c-journal:#f3c98b; --c-archive:#d4d0ca; --c-play:#ff8fc7; --c-rumor:#2dd4bf; --c-rollcall:#f59e0b; --c-gauge:#38bdf8; --c-speed:#a3e635; --c-files:#fb923c; --c-settings:#e9e6e1;
  --ok:#34d399; --warn:#ffd60a; --bad:#ff5a52; --app:#ffffff; --onapp:#0e0d0c;
  --r:20px; --pad:16px; --tap:62px; font-size:18px;
}
[data-theme="day"]{ --bg:#ffffff; --surf:#f1efec; --surf2:#e4e0da; --ink:#0e0d0c; --dim:#3d3833; --faint:#6b645c; --line:#0e0d0c; }
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ margin:0; background:var(--bg); color:var(--ink); font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans","Noto Sans Arabic",Tahoma,sans-serif; line-height:1.4; }
body{ min-height:100vh; padding-bottom:env(safe-area-inset-bottom); }
button,input,textarea,select{ font:inherit; color:inherit; }
button{ cursor:pointer; }
button:active{ transform:scale(.97); }
:focus-visible{ outline:4px solid var(--c-sky); outline-offset:2px; }
/* top bar: the current app's colour, so you always know where you are */
.top{ position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:12px; padding:calc(12px + env(safe-area-inset-top)) var(--pad) 12px; background:var(--app); color:var(--onapp); }
.top.home{ background:var(--bg); color:var(--ink); }
.top .back{ display:grid; place-items:center; padding:0; width:52px; height:52px; border-radius:16px; border:0; background:rgba(0,0,0,.14); color:inherit; font-size:26px; font-weight:900; flex:0 0 auto; }
.top.home .back{ display:none; }
[dir=rtl] .top .back{ transform:scaleX(-1); }
.top h1{ font-size:22px; margin:0; font-weight:900; flex:1; letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-transform:uppercase; }
[lang=ar] .top h1{ text-transform:none; letter-spacing:0; }
.top.home h1{ font-size:26px; letter-spacing:.12em; }
.pill{ display:inline-flex; align-items:center; gap:8px; padding:9px 14px; border-radius:999px; background:rgba(0,0,0,.16); font-size:14px; font-weight:800; cursor:pointer; white-space:nowrap; }
/* sound link indicator: icon + light (+ number of devices nearby); details in a panel on tap */
.linkbtn{ position:relative; display:grid; place-items:center; width:52px; height:52px; flex:0 0 auto; border:0; border-radius:16px; background:rgba(0,0,0,.14); color:inherit; cursor:pointer; }
.top.home .linkbtn{ background:var(--surf); }
.linkbtn .i{ display:block; width:24px; height:24px; }
.sig rect{ fill:currentColor; opacity:.25; } .sig rect.f{ opacity:1; }
.linkbtn:not(.on) .sig{ opacity:.45; }
.linkbtn.tx .sig{ animation:blink .5s infinite alternate; } @keyframes blink{ to{ opacity:.35; } }
.linkbtn.jam .cnt{ background:var(--warn); color:#0e0d0c; }
.linkbtn .cnt{ position:absolute; top:4px; inset-inline-end:4px; min-width:18px; height:18px; padding:0 4px; border-radius:9px; background:#0e0d0c; color:#fff; font-size:11px; font-weight:900; line-height:18px; text-align:center; }
.linkbtn .cnt:empty{ display:none; }
.linkpanel .lp-head{ display:flex; gap:14px; align-items:center; } .linkpanel .lp-head h3{ margin:0 0 2px; font-size:24px; } .linkpanel .lp-head .linkbtn{ cursor:default; background:var(--bg); }
.linkpanel .lp-devs{ display:flex; flex-wrap:wrap; gap:8px; } .linkpanel .lp-devs .chip .i{ width:16px; height:16px; }
.linkpanel .lp-mode{ display:flex; gap:12px; align-items:flex-start; } .linkpanel .lp-mode > .i{ width:26px; height:26px; flex:0 0 auto; margin-top:3px; }
.linkpanel .lp-mode b{ display:block; font-size:18px; } .linkpanel .lp-mode span{ color:var(--dim); }
.linkpanel .lp-act{ margin-top:16px; flex-wrap:wrap; }
#app{ min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
main{ max-width:720px; margin:0 auto; padding:var(--pad); width:100%; flex:1 0 auto; }
main:has(> .chat){ display:flex; flex-direction:column; }
.hello{ margin:2px 2px 14px; } .hello b{ font-size:30px; font-weight:900; display:block; line-height:1.1; } .hello span{ color:var(--dim); font-size:16px; font-weight:600; }
.sos{ display:flex; align-items:center; gap:14px; width:100%; margin:0 0 14px; min-height:96px; border:0; border-radius:var(--r); background:var(--help); color:#fff; font-size:28px; font-weight:900; padding:0 22px; letter-spacing:.04em; text-transform:uppercase; }
[lang=ar] .sos{ letter-spacing:0; } .sos .ic{ font-size:40px; }
.grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media (min-width:600px){ .grid{ grid-template-columns:repeat(3,1fr); } }
.tile{ min-height:118px; border:0; border-radius:var(--r); background:var(--tc, var(--surf)); color:#0e0d0c; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; gap:8px; padding:16px; position:relative; text-align:start; }
.tile .ic{ font-size:38px; line-height:1; } .tile .nm{ font-size:19px; font-weight:900; line-height:1.1; text-transform:uppercase; letter-spacing:.02em; }
[lang=ar] .tile .nm{ text-transform:none; letter-spacing:0; font-size:20px; }
.tile .badge{ position:absolute; top:12px; inset-inline-end:12px; min-width:30px; height:30px; border-radius:15px; background:#0e0d0c; color:#fff; font-size:15px; font-weight:900; display:flex; align-items:center; justify-content:center; padding:0 8px; }
.linkbar{ display:flex; align-items:center; gap:12px; width:100%; min-height:var(--tap); border:3px dashed var(--line); border-radius:var(--r); background:transparent; padding:12px 16px; margin-bottom:14px; font-weight:800; text-align:start; }
.card{ background:var(--surf); border-radius:var(--r); padding:var(--pad); margin-bottom:12px; }
.card h2{ margin:0 0 10px; font-size:15px; color:var(--dim); font-weight:900; text-transform:uppercase; letter-spacing:.08em; }
[lang=ar] .card h2{ text-transform:none; letter-spacing:0; font-size:16px; }
.muted{ color:var(--dim); font-size:16px; } .faint{ color:var(--faint); font-size:14px; }
.btn{ min-height:var(--tap); padding:14px 20px; border:3px solid var(--ink); border-radius:16px; background:transparent; font-weight:900; font-size:17px; text-transform:uppercase; letter-spacing:.03em; }
[lang=ar] .btn{ text-transform:none; letter-spacing:0; }
.btn.go{ background:var(--app); color:var(--onapp); border-color:var(--app); }
.btn.warn{ background:var(--help); color:#fff; border-color:var(--help); }
.btn.ok{ background:var(--ok); color:#0e0d0c; border-color:var(--ok); }
.btn.wide{ width:100%; } .btn:disabled{ opacity:.4; }
.row{ display:flex; gap:10px; flex-wrap:wrap; } .row>*{ flex:1 1 140px; }
label{ display:block; margin:12px 0 6px; color:var(--dim); font-size:15px; font-weight:800; }
input,textarea,select{ width:100%; padding:15px; border-radius:14px; border:3px solid var(--line); background:var(--bg); outline:none; font-size:18px; }
input:focus,textarea:focus,select:focus{ border-color:var(--app); }
input[type=checkbox]{ width:28px !important; height:28px; accent-color:var(--app); flex:0 0 auto; }
textarea{ min-height:120px; resize:vertical; }
.list{ display:flex; flex-direction:column; gap:10px; }
/* sections that follow a list or a big button get breathing room */
.list + .btn, .list + .row, .list + label.btn, .btn + .row, .btn.wide + .btn.wide, .hpick + .btn, .stepper + .btn, .list + .hpick{ margin-top:12px; }
.item{ display:flex; gap:14px; align-items:flex-start; padding:14px; border-radius:16px; background:var(--surf2); cursor:pointer; }
.item .ic{ font-size:30px; line-height:1; } .item .tx{ flex:1; min-width:0; } .item b{ display:block; font-weight:900; font-size:17px; } .item .faint{ display:block; }
.chat{ display:flex; flex-direction:column; justify-content:flex-end; gap:10px; min-height:50vh; flex:1 0 auto; padding-bottom:8px; }
.msg{ max-width:84%; padding:12px 15px; border-radius:20px; background:var(--surf2); align-self:flex-start; word-wrap:break-word; font-size:17px; }
.msg.me{ align-self:flex-end; background:var(--app); color:var(--onapp); }
.msg.me .meta{ color:inherit; opacity:.7; }
.msg .who{ font-size:14px; font-weight:900; color:var(--app); margin-bottom:2px; } .msg .meta{ font-size:13px; color:var(--faint); margin-top:4px; font-weight:600; }
.msg.code{ font-size:21px; font-weight:900; }
.compose{ position:sticky; bottom:0; display:flex; gap:8px; padding:10px 0 calc(10px + env(safe-area-inset-bottom)); background:var(--bg); }
.compose input{ flex:1; } .compose .btn{ flex:0 0 auto; }
.chips{ display:flex; gap:8px; overflow-x:auto; padding:2px 0 12px; }
.chip{ flex:0 0 auto; padding:11px 16px; border-radius:999px; background:var(--surf2); border:0; font-size:16px; font-weight:800; white-space:nowrap; }
.chip.on{ background:var(--app); color:var(--onapp); }
.big{ font-size:72px; font-weight:900; line-height:1; letter-spacing:-.02em; } .state{ font-size:28px; font-weight:900; text-transform:uppercase; }
[lang=ar] .state{ text-transform:none; }
.ok-c{ color:var(--ok); } .warn-c{ color:var(--warn); } .bad-c{ color:var(--bad); }
canvas{ display:block; width:100%; border-radius:16px; background:var(--surf); touch-action:none; }
.overlay{ position:fixed; inset:0; z-index:50; display:flex; align-items:flex-end; justify-content:center; padding:16px; background:rgba(0,0,0,.75); }
@media (min-width:600px){ .overlay{ align-items:center; } }
.alertbox{ width:100%; max-width:520px; border-radius:26px; padding:26px 22px 22px; background:var(--surf); color:var(--ink); }
.alertbox .ic{ font-size:64px; line-height:1; } .alertbox h3{ font-size:28px; font-weight:900; margin:12px 0 6px; } .alertbox p{ color:var(--dim); font-size:18px; margin:0; }
.alertbox.danger{ background:var(--help); color:#fff; } .alertbox.danger p{ color:#fff; opacity:.92; }
.alertbox.danger .btn{ border-color:#fff; color:#fff; } .alertbox.danger .btn.go,.alertbox.danger .btn.warn{ background:#fff; color:var(--help); }
.alertbox.danger{ animation:flash 1s infinite alternate; } @keyframes flash{ to{ background:#b3150d; } }
.blackout{ position:fixed; inset:0; z-index:60; background:#000; color:#2a2a2a; display:flex; align-items:flex-end; justify-content:center; padding:30px; font-size:14px; }
.art{ line-height:1.6; font-size:18px; } .art p{ margin:10px 0; } .art ul{ margin:8px 0; padding-inline-start:22px; } .art li{ margin:8px 0; }
.art .ah{ font-size:19px; font-weight:900; margin:18px 0 6px; } mark{ background:var(--c-sky); color:#0e0d0c; border-radius:4px; padding:0 2px; }
.art .w{ background:rgba(255,59,48,.14); border-inline-start:6px solid var(--help); padding:12px 14px; border-radius:12px; margin:12px 0; font-weight:700; }
.toast{ position:fixed; bottom:calc(22px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); z-index:70; background:var(--ink); color:var(--bg); padding:14px 20px; border-radius:16px; font-weight:800; max-width:90vw; }
.calc{ max-width:360px; margin:40px auto; padding:0 12px; } .calc .scr{ font-size:48px; text-align:end; padding:20px; background:#111; color:#eee; border-radius:16px; min-height:96px; overflow:hidden; }
.calc .keys{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:12px; } .calc button{ min-height:72px; border-radius:16px; border:0; background:#2a2a2a; color:#eee; font-size:28px; }
.calc button.op{ background:#f39c12; color:#fff; }
.bubble{ position:absolute; border-radius:50%; cursor:pointer; opacity:.9; }
.mem{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; } .mem button{ aspect-ratio:1/1; font-size:36px; border-radius:16px; border:0; background:var(--app); cursor:pointer; }
.mem button.open{ background:var(--surf2); } .mem button.done{ background:var(--ok); }
.i{ width:1em; height:1em; fill:currentColor; vertical-align:-.14em; flex:0 0 auto; }
.tile .ic .i{ width:38px; height:38px; } .item .ic .i{ width:28px; height:28px; } .alertbox .ic .i{ width:64px; height:64px; } .sos .ic .i{ width:44px; height:44px; }
.top .back .i{ display:block; width:24px; height:24px; } .fp .i{ width:34px; height:34px; margin:0 4px; } .mem button .i{ width:40px; height:40px; }
.dbtn{ display:flex; align-items:center; gap:18px; width:100%; min-height:110px; margin-bottom:12px; border:0; border-radius:var(--r); background:var(--c-defend); color:#0e0d0c; font-size:24px; font-weight:900; padding:0 24px; text-align:start; text-transform:uppercase; }
[lang=ar] .dbtn{ text-transform:none; } .dbtn .i{ width:48px; height:48px; } .dbtn.red{ background:var(--help); color:#fff; }
.strobe{ position:fixed; inset:0; z-index:90; background:#000; color:#fff; display:flex; align-items:flex-end; justify-content:center; padding:40px 20px calc(40px + env(safe-area-inset-bottom)); touch-action:none; }
.strobe.wail{ animation:wail .5s infinite alternate; } @keyframes wail{ from{ background:#5a0000; } to{ background:#ff1a1a; } }
.strobe.flash{ animation:none; } .strobe.lit{ background:#fff; color:#000; }

.stopbtn{ display:flex; align-items:center; gap:12px; padding:18px 34px; border-radius:20px; border:4px solid #fff; background:#000; color:#fff; font-size:28px; font-weight:900; text-transform:uppercase; }
.strobe.lit .stopbtn{ background:#fff; color:#000; border-color:#000; }
.strobe .stoptx{ display:flex; flex-direction:column; align-items:center; gap:8px; font-size:20px; text-transform:uppercase; mix-blend-mode:difference; color:#fff; } .strobe .stoptx .i{ width:40px; height:40px; }
.hidden{ display:none !important; } .spacer{ height:12px; } .fp{ font-size:26px; letter-spacing:4px; }
.hero{ text-align:center; padding:4vh 0 10px; } .hero .logo{ line-height:0; color:var(--c-beacon); } .hero .logo svg{ display:inline-block; } .hero h1{ font-size:44px; font-weight:900; letter-spacing:.14em; margin:10px 0 4px; text-transform:uppercase; }
[lang=ar] .hero h1{ letter-spacing:0; }

/* Rumor Check */
.vpill{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-size:13px; font-weight:900; text-transform:uppercase; letter-spacing:.03em; color:#0e0d0c; white-space:nowrap; }
[lang=ar] .vpill{ text-transform:none; letter-spacing:0; } .vpill .i{ width:14px; height:14px; }
.v-false{ background:var(--help); color:#fff; } .v-misleading{ background:var(--warn); } .v-unproven{ background:var(--surf2); color:var(--ink); box-shadow:inset 0 0 0 1px var(--line); } .v-true{ background:var(--ok); }
.vlegend{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.claim{ padding:16px 18px; margin-bottom:10px; } .claim summary{ list-style:none; cursor:pointer; display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.claim summary::-webkit-details-marker{ display:none; } .claim summary b{ font-size:18px; line-height:1.35; }
.claim p{ font-size:17px; line-height:1.55; margin:12px 0 8px; } .claim .srcs{ border-top:1px solid var(--line, rgba(255,255,255,.12)); padding-top:10px; }
.claim .src{ margin-top:8px; font-size:14px; } .claim .url{ font-size:12px; color:var(--dim); word-break:break-all; }

/* Who's here? */
.rl-ask{ min-height:72px; font-size:20px; }
.rl-counts{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:16px 0 6px; }
.rl-c{ border-radius:var(--r); padding:14px 8px; text-align:center; background:var(--surf); } .rl-c b{ display:block; font-size:44px; font-weight:900; line-height:1; } .rl-c span{ font-weight:800; font-size:14px; }
.rl-c.ok b{ color:var(--ok); } .rl-c.help b{ color:var(--help); } .rl-c.miss b{ color:var(--warn); }
.rl-help .ic{ color:var(--help); } .rl-ok .ic{ color:var(--ok); } .rl-miss .ic{ color:var(--warn); }
.rl-x{ flex:0 0 auto; padding:8px 12px; min-height:0; }
/* tank & well gauge */
.gout{ margin-top:12px; } .gauge-res{ text-align:center; } .gauge-res canvas{ width:100%; height:auto; margin-top:14px; cursor:pointer; }
.gbar{ width:90px; height:120px; margin:14px auto 8px; border:3px solid var(--ink); border-top:0; border-radius:0 0 14px 14px; position:relative; overflow:hidden; }
.gbar span{ position:absolute; left:0; right:0; bottom:0; background:var(--c-gauge); }

/* speed test */
.sp-head{ text-align:center; margin:8px 0 2px; } .sp-head b{ display:block; font-size:64px; font-weight:900; line-height:1; color:var(--c-speed); }
.sp-head.warn b{ color:var(--warn); } .sp-head.help b{ color:var(--help); } .sp-head span{ font-weight:800; }
.sp-sub{ text-align:center; margin-top:4px; }
.sp-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0 6px; }
.sp-c{ border-radius:var(--r); padding:12px; background:var(--surf); display:flex; flex-direction:column; gap:2px; }
.sp-c span{ font-weight:800; font-size:13px; opacity:.8; } .sp-c b{ font-size:30px; font-weight:900; line-height:1.1; } .sp-c i{ font-style:normal; font-weight:700; font-size:13px; opacity:.7; }
.sp-c small{ font-size:12px; opacity:.75; margin-top:4px; }
.sp-est{ white-space:nowrap; font-weight:800; } .sp-tips{ margin:6px 0 10px; padding-left:20px; } .sp-tips li{ margin:6px 0; }
.sp-step.wait{ opacity:.5; } .sp-step.done .ic{ color:var(--ok); } .sp-step.now .ic{ color:var(--c-speed); }
button.item.sp-peer{ width:100%; text-align:start; font:inherit; color:inherit; cursor:pointer; }

/* form controls (ui/form.js): choice tiles and steppers */
.gedit > label, .gedit #tankonly > label{ display:block; margin:16px 0 8px; font-weight:800; }
.hpick{ display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:10px; }
.hpick label{ position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:16px 10px; min-height:96px;
  border-radius:14px; border:3px solid var(--line); background:var(--bg); text-align:center; cursor:pointer; transition:border-color .15s, background .15s; }
.hpick label input{ position:absolute; opacity:0; width:1px !important; height:1px; pointer-events:none; }
.hpick label .i{ width:30px; height:30px; color:var(--app); } .hpick label b{ font-weight:900; font-size:17px; line-height:1.2; }
.hpick label small{ font-size:13px; font-weight:600; opacity:.7; line-height:1.3; }
.hpick label.on, .hpick label:has(input:checked){ border-color:var(--app); background:color-mix(in srgb, var(--app) 16%, var(--bg)); }
.hpick label:has(input:focus-visible){ outline:3px solid var(--app); outline-offset:2px; }
.stepper{ display:flex; gap:8px; align-items:stretch; }
.st-b{ flex:0 0 60px; border:0; border-radius:14px; background:var(--surf2); font-size:28px; font-weight:900; line-height:1; cursor:pointer; }
.st-b:active{ background:var(--app); color:var(--onapp); }
.st-in{ position:relative; flex:1; min-width:0; } .st-in input{ text-align:center; font-size:24px; font-weight:900; padding-right:44px; padding-left:44px; }
.st-u{ position:absolute; right:16px; top:50%; transform:translateY(-50%); font-weight:800; opacity:.6; pointer-events:none; }
input[type=number]{ -moz-appearance:textfield; appearance:textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button{ -webkit-appearance:none; margin:0; }

/* chat: not sent + retry */
.msg .notsent{ display:inline-flex; align-items:center; gap:4px; background:var(--bad); color:#fff; padding:2px 8px; border-radius:999px; font-weight:800; } .msg .notsent .i{ width:13px; height:13px; vertical-align:-2px; }
.msg .btn.retry{ margin-top:8px; padding:8px 14px; font-size:14px; min-height:0; background:var(--onapp); color:#fff; border-color:var(--onapp); }

/* transfer bar (core/transfers.js): always visible during a big transfer, with one big Stop */
.xferbar{ position:fixed; left:0; right:0; bottom:0; z-index:65; display:none; align-items:center; gap:12px; padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  background:var(--ink); color:var(--bg); box-shadow:0 -6px 24px rgba(0,0,0,.35); }
.xferbar.on{ display:flex; } body.has-xfer main{ padding-bottom:110px; } body.has-xfer .toast{ bottom:calc(96px + env(safe-area-inset-bottom)); }
.xf-ic .i{ width:26px; height:26px; } .xf-tx{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.xf-tx b{ font-weight:900; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .xf-tx span{ font-size:13px; font-weight:700; opacity:.75; }
.xf-p{ display:block; height:5px; border-radius:3px; background:color-mix(in srgb, var(--bg) 25%, transparent); overflow:hidden; } .xf-p i{ display:block; height:100%; background:var(--bg); }
.xf-stop{ flex:0 0 auto; display:inline-flex; align-items:center; gap:8px; border:0; border-radius:14px; padding:14px 20px; background:var(--help); color:#fff; font:inherit; font-size:17px; font-weight:900; cursor:pointer; }
.xf-stop .i{ width:18px; height:18px; }

/* files */
.fs-who{ display:flex; align-items:center; gap:8px; margin:14px 0 6px; } .fs-who .i{ width:18px; height:18px; color:var(--app); }
.fs-st{ display:block; margin-top:3px; font-weight:700; } .fs-get{ flex:0 0 auto; padding:10px 14px; }
.fs-acts{ display:flex; gap:6px; flex:0 0 auto; } .fs-acts .btn, .fs-x{ padding:10px 12px; }
.fs-lab{ display:block; margin:18px 0 8px; font-weight:800; }
.fs-risk{ display:inline-flex; align-items:center; gap:4px; margin-top:4px; font-size:12px; font-weight:800; color:var(--warn); } .fs-risk .i{ width:12px; height:12px; }

/* ================= Home & lock screens (background, app grid, app-store sheet, keypad) ================= */
/* Home and lock screens use a black background and high-contrast palette. */
html.hs{ --bg:#000; --surf:#1c1a18; --surf2:#2c2926; --ink:#fff; --dim:#d2cbc1; --faint:#a39b90; --line:#4a453f;
  background:var(--hs-bg,#000); background-attachment:fixed; }
html.hs body{ background:transparent; }
html.hs .top.home{ background:#000; -webkit-backdrop-filter:none; backdrop-filter:none; }

.hs-hello{ margin:4px 2px 16px; } .hs-hello b{ font-size:32px; font-weight:900; display:block; line-height:1.1; } .hs-hello span{ color:var(--dim); font-size:17px; font-weight:600; }
.hs-link{ display:flex; align-items:center; gap:14px; width:100%; min-height:var(--tap); margin:0 0 20px; padding:12px 16px; border:0; border-radius:var(--r); background:var(--surf); text-align:start; }
.hs-link .hs-lic{ display:grid; place-items:center; width:48px; height:48px; border-radius:50%; background:var(--c-sky); color:#0e0d0c; flex:0 0 auto; } .hs-link .hs-lic .i{ width:26px; height:26px; }
.hs-link .tx b{ display:block; font-size:18px; } .hs-link .tx span{ color:var(--dim); font-size:15px; font-weight:600; }

.hs-grid{ display:flex; flex-direction:column; gap:22px; }
.hs-grid-row{ display:flex; justify-content:space-between; gap:12px; }
.hs-grid-row.partial{ justify-content:center; gap:clamp(12px,8vw,80px); }
.hs-tile{ display:flex; flex:0 0 min(108px,calc((100vw - 64px)/3)); flex-direction:column; align-items:stretch; gap:9px; padding:0; border:0; background:none; min-width:0; color:var(--ink); }
.hs-ico{ position:relative; display:grid; place-items:center; width:100%; aspect-ratio:1; border-radius:28px; background:var(--tc); color:#0e0d0c; box-shadow:0 4px 14px rgba(0,0,0,.35); }
.hs-ico .i{ display:block; width:46px; height:46px; }
.hs-nm{ width:100%; font-size:16px; font-weight:800; line-height:1.15; text-align:center; overflow-wrap:anywhere; }
.hs-ico .badge{ position:absolute; top:-7px; inset-inline-end:-7px; min-width:30px; height:30px; padding:0 8px; border-radius:15px; display:flex; align-items:center; justify-content:center; background:var(--help); color:#fff; font-size:15px; font-weight:900; border:3px solid #000; }
.hs-folder-overlay{ position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center; padding:24px; background:rgba(0,0,0,.42); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); opacity:0; transition:opacity .16s ease; }
.hs-folder-overlay.in{ opacity:1; }
.hs-folder-card{ width:min(340px,100%); padding:18px; border:1px solid rgba(255,255,255,.16); border-radius:28px; background:rgba(42,40,38,.9); box-shadow:0 20px 60px rgba(0,0,0,.4); transform:scale(.96); transition:transform .16s ease; }
.hs-folder-overlay.in .hs-folder-card{ transform:scale(1); }
.hs-folder-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.hs-folder-head h2{ margin:0; font-size:20px; font-weight:900; }
.hs-folder-close{ display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border:0; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; }
.hs-folder-close .i{ width:18px; height:18px; }
.hs-folder-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 10px; padding-top:16px; }
.hs-folder-item{ display:flex; min-width:0; flex-direction:column; align-items:center; gap:7px; padding:0; border:0; background:none; color:#fff; }
.hs-folder-icon{ display:grid; place-items:center; width:58px; height:58px; border-radius:18px; background:var(--tc); color:#0e0d0c; box-shadow:0 3px 10px rgba(0,0,0,.24); }
.hs-folder-icon .i{ width:29px; height:29px; }
.hs-folder-name{ width:100%; min-height:2.2em; font-size:12px; font-weight:800; line-height:1.1; text-align:center; overflow-wrap:anywhere; }
.hs-empty{ grid-column:1/-1; text-align:center; font-size:18px; padding:24px 0; }
.hs-priv{ text-align:center; margin:26px 0 0; }
.hs-dock{ position:sticky; bottom:calc(14px + env(safe-area-inset-bottom)); display:flex; justify-content:center; margin-top:18px; pointer-events:none; }
.hs-dockbtn{ pointer-events:auto; display:flex; align-items:center; gap:10px; min-height:var(--tap); padding:0 26px 0 20px; border:0; border-radius:999px; background:#fff; color:#0e0d0c; font-size:18px; font-weight:900; box-shadow:0 8px 26px rgba(0,0,0,.55); }
.hs-plus{ display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#0e0d0c; color:#fff; }
.hs-plus .i{ width:18px; height:18px; }

/* slide-up "app store" sheet */
.hs-scrim{ position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.5); opacity:0; transition:opacity .25s; } .hs-scrim.in{ opacity:1; }
.hs-sheet{ position:fixed; inset-inline:0; bottom:0; z-index:51; margin:0 auto; width:100%; max-width:720px; max-height:88vh; max-height:88dvh; display:flex; flex-direction:column;
  background:var(--surf); color:var(--ink); border-radius:28px 28px 0 0; box-shadow:0 -10px 40px rgba(0,0,0,.5); padding-bottom:env(safe-area-inset-bottom);
  transform:translateY(105%); transition:transform .32s cubic-bezier(.2,.8,.2,1); }
.hs-sheet.in{ transform:none; }
.hs-grab{ flex:0 0 auto; touch-action:none; padding:12px 0 8px; cursor:grab; } .hs-grab i{ display:block; width:48px; height:5px; border-radius:3px; background:var(--faint); margin:0 auto; }
.hs-head{ flex:0 0 auto; display:flex; align-items:center; gap:12px; padding:0 18px 10px; } .hs-head h3{ flex:1; margin:0; font-size:26px; font-weight:900; }
.hs-head .btn{ min-height:48px; padding:8px 22px; }
.hs-body{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:4px 16px 22px; }
.hs-body .sec{ margin:16px 0 4px; font-size:14px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; color:var(--dim); }
.hs-row{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); background:var(--surf); }
.hs-row.drag{ background:var(--surf2); box-shadow:0 6px 20px rgba(0,0,0,.5); border-radius:14px; position:relative; z-index:2; }
.hs-mini{ display:grid; place-items:center; width:46px; height:46px; flex:0 0 auto; border-radius:13px; background:var(--tc); color:#0e0d0c; touch-action:none; cursor:grab; } .hs-mini .i{ width:26px; height:26px; }
.hs-row .nm{ flex:1; min-width:0; font-size:17px; overflow-wrap:anywhere; }
.hs-row .tx{ flex:1; min-width:0; } .hs-row .tx b{ display:block; font-size:18px; } .hs-row .tx span{ display:block; color:var(--dim); font-size:14px; line-height:1.25; }
.hs-mv{ width:44px; height:44px; flex:0 0 auto; border:0; border-radius:12px; background:var(--surf2); }
.hs-mv .i{ width:16px; height:16px; } .hs-mv .i.up{ transform:rotate(90deg); } .hs-mv .i.down{ transform:rotate(-90deg); }
.hs-mv:disabled{ opacity:.25; }
.hs-get{ min-width:72px; min-height:44px; flex:0 0 auto; padding:0 14px; border:0; border-radius:999px; background:var(--ok); color:#0e0d0c; font-size:16px; font-weight:900; }
.hs-get.off{ background:var(--surf2); color:var(--ink); } .hs-get.ghost{ background:none; pointer-events:none; }
/* lock screen */
.lock{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:space-between; gap:18px; width:100%; max-width:380px; margin:0 auto; text-align:center;
  padding:calc(30px + env(safe-area-inset-top)) 20px calc(26px + env(safe-area-inset-bottom)); }
.lk-time{ font-size:60px; font-weight:800; line-height:1; letter-spacing:.02em; } .lk-date{ margin-top:6px; color:var(--dim); font-size:18px; font-weight:700; }
.lk-mid h2{ margin:0; font-size:24px; font-weight:900; }
.lk-dots{ display:flex; justify-content:center; gap:14px; min-height:24px; margin:18px 0 6px; direction:ltr; }
.lk-dots i{ width:20px; height:20px; border-radius:50%; border:3px solid var(--ink); } .lk-dots i.f{ background:var(--ink); }
.lk-dots.shake{ animation:lkshake .4s; } @keyframes lkshake{ 20%{ transform:translateX(-12px); } 40%{ transform:translateX(12px); } 60%{ transform:translateX(-8px); } 80%{ transform:translateX(8px); } }
.lk-err{ min-height:1.5em; margin:0; color:var(--bad); font-weight:800; font-size:17px; }
.lk-pad{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; width:100%; }
.lk-key{ min-height:74px; border:0; border-radius:22px; background:rgba(255,255,255,.14); color:#fff; font-size:32px; font-weight:800; }
.lk-key.sm{ background:rgba(255,255,255,.07); } .lk-key.ok{ background:var(--ok); color:#0e0d0c; }
.lk-key .i{ width:28px; height:28px; }
@media (max-height:640px){ .lk-key{ min-height:58px; font-size:26px; } .lk-time{ font-size:44px; } }