/* =============================================================================
   Haddu Hub - workspace for Haddu's Server (visveswaran.in)
   Colours: indigo sidebar like the logo, lilac-mist work area, marigold for
   "this one is active". Each app keeps its own colour on its tile.
   ============================================================================= */
/* Fonts (self-hosted, SIL Open Font Licence): Bricolage Grotesque for headings, Atkinson Hyperlegible for text */
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage-grotesque-wght.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --indigo: #22204F;
  --lilac: #E9E7FF;
  --gold: #F4A62A;
  --leaf: #2BAE8A;
  --red: #D6454B;

  --bg: #EEEFF8;
  --surface: #FFFFFF;
  --surface-2: #F6F6FC;
  --ink: #23253A;
  --muted: #5D5F7A;
  --line: #DADCEB;
  --side: #22204F;
  --side-ink: #E9E7FF;
  --side-muted: #A9A7D9;
  --side-hover: rgba(233, 231, 255, .09);
  --side-active: rgba(233, 231, 255, .15);
  --shadow: 0 1px 2px rgba(34, 32, 79, .06), 0 6px 20px rgba(34, 32, 79, .07);

  --f-head: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --side-w: 256px;
  --bar-h: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121327; --surface: #1B1C36; --surface-2: #222446; --ink: #E9E9F5; --muted: #A3A5C2;
    --line: #2C2E4F; --side: #0D0E20; --side-hover: rgba(233,231,255,.07); --side-active: rgba(233,231,255,.12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121327; --surface: #1B1C36; --surface-2: #222446; --ink: #E9E9F5; --muted: #A3A5C2;
  --line: #2C2E4F; --side: #0D0E20; --side-hover: rgba(233,231,255,.07); --side-active: rgba(233,231,255,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; display: block; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 650; letter-spacing: -.01em; line-height: 1.15; margin: 0; }

/* ---------- loading ---------- */
#boot { position: fixed; inset: 0; display: grid; place-items: center; }
#boot img { animation: boot 1.2s ease-in-out infinite; }
@keyframes boot { 50% { opacity: .35; transform: scale(.94); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px;
  padding: 9px 16px; background: var(--indigo); color: #fff; font-weight: 700; text-decoration: none; line-height: 1.2; }
:root[data-theme="dark"] .btn { background: var(--lilac); color: var(--indigo); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: var(--lilac); color: var(--indigo); } }
.btn:hover { filter: brightness(1.12); }
.btn-big { padding: 13px 30px; font-size: 18px; border-radius: 12px; }
.btn-soft { background: var(--surface-2) !important; color: var(--ink) !important; border: 1px solid var(--line); }
.btn-danger { background: var(--red) !important; color: #fff !important; }
.btn[disabled] { opacity: .5; cursor: default; filter: none; }
.ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: inherit; padding: 0; flex: none; }
.ibtn:hover { background: var(--surface-2); }
.linkbtn { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* =============================== landing =============================== */
#landing { min-height: 100%; display: grid; place-items: center; padding: 48px 16px; }
.land-inner { width: min(860px, 100%); }
.land-head { text-align: center; margin-bottom: 56px; }
.land-head .land-lead { margin-bottom: 0; }
.land-head img { border-radius: 16px; }
.land-head h1 { font-size: clamp(40px, 7vw, 68px); font-weight: 750; margin: 18px 0 10px; letter-spacing: -.03em; }
.land-lead { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 auto 28px; }
.land-note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: inline-block; padding: 8px 14px; margin: 0 0 20px; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: -24px 0 56px; }
.door { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.door h2 { font-size: 24px; }
.door > p { margin: 0 0 8px; color: var(--muted); flex: 1; }
.door .btn { align-self: flex-start; }
.friend-row { display: flex; gap: 8px; flex-wrap: wrap; }
.friend-row input { flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); font-size: 17px; }
.friend-row input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.btn-gold { background: var(--gold) !important; color: var(--indigo) !important; }
.land-get h2 { font-size: 22px; margin-bottom: 14px; }
.get-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.get { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.get-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--indigo); color: var(--lilac); margin-bottom: 6px; }
.get-ico svg.i { width: 22px; height: 22px; }
.get h3 { font-size: 18px; }
.get p { margin: 0 0 8px; color: var(--muted); font-size: 15px; flex: 1; }
.get .btn { align-self: flex-start; }
.get small { color: var(--muted); }
.land-foot { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; color: var(--muted); font-size: 15px; }

/* =============================== workspace =============================== */
#app { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100%; height: 100dvh; }
#app.narrow { --side-w: 68px; }

/* ---------- sidebar ---------- */
#side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; position: relative; z-index: 30; }
.side-top { display: flex; align-items: center; gap: 6px; padding: 12px 10px 8px 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; border-radius: 8px; }
.brand img { border-radius: 8px; flex: none; }
.brand span { font-family: var(--f-head); font-weight: 750; font-size: 19px; letter-spacing: -.01em; white-space: nowrap; }
#side .ibtn:hover { background: var(--side-hover); }
.side-close { display: none; }
.search { display: flex; align-items: center; gap: 8px; margin: 4px 12px 10px; padding: 0 10px; height: 38px; border-radius: 10px; background: rgba(233,231,255,.08); color: var(--side-muted); }
.search:focus-within { background: rgba(233,231,255,.14); outline: 2px solid var(--gold); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--side-ink); }
.search input::placeholder { color: var(--side-muted); }
.search input::-webkit-search-cancel-button { filter: invert(1); }
.search kbd { font: 12px var(--f-body); border: 1px solid rgba(233,231,255,.2); border-radius: 5px; padding: 0 5px; }

#nav { flex: 1; overflow-y: auto; padding: 2px 8px 12px; scrollbar-width: thin; scrollbar-color: rgba(233,231,255,.2) transparent; }
.nav-group { margin-top: 14px; }
.nav-group h2 { font: 700 13px var(--f-body); color: var(--side-muted); padding: 0 10px 4px; letter-spacing: .01em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; color: var(--side-ink);
  padding: 6px 8px; border-radius: 10px; text-align: left; text-decoration: none; min-height: 40px; }
.nav-item:hover { background: var(--side-hover); }
.nav-item.active { background: var(--side-active); }
.nav-item.active::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); flex: none; }
.nav-item .ext { opacity: .55; }
.nav-item .ext svg.i { width: 15px; height: 15px; }
.nav-empty { color: var(--side-muted); padding: 10px; font-size: 15px; }

/* the app glyph: a rounded tile in the app's own colour (like the logo tiles) */
.glyph { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--c, #7C6CF5); color: #fff; }
.glyph svg.i { width: 16px; height: 16px; stroke-width: 2.2; }
.glyph.glyph-home { background: var(--lilac); color: var(--indigo); }

.side-foot { padding: 8px; border-top: 1px solid rgba(233,231,255,.1); position: relative; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--side-ink); padding: 8px; border-radius: 10px; text-align: left; }
.me:hover, .me[aria-expanded="true"] { background: var(--side-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--indigo); display: grid; place-items: center; font-weight: 700; flex: none; }
.me-text { flex: 1; min-width: 0; line-height: 1.25; }
.me-text b, .me-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--side-muted); font-size: 13px; }
.menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; min-width: 230px; }
.menu > button, .menu > a { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; text-decoration: none; text-align: left; }
.menu > button:hover, .menu > a:hover { background: var(--surface-2); }
.menu-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.menu-row button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid transparent; background: none; padding: 6px 4px; border-radius: 8px; font-size: 13px; }
.menu-row button[aria-checked="true"] { border-color: var(--gold); background: var(--surface-2); }

/* narrow sidebar (icons only) */
#app.narrow .brand span, #app.narrow .search, #app.narrow .nav-group h2, #app.narrow .nav-item .name,
#app.narrow .nav-item .ext, #app.narrow .me-text, #app.narrow .me > [data-icon] { display: none; }
#app.narrow .side-top { flex-direction: column; padding: 12px 8px 8px; }
#app.narrow .brand { flex: none; }
#app.narrow .nav-item { justify-content: center; padding: 6px; }
#app.narrow .nav-item .dot { position: absolute; right: 8px; top: 7px; }
#app.narrow .me { justify-content: center; padding: 6px; }
#app.narrow .nav-group { margin-top: 10px; border-top: 1px solid rgba(233,231,255,.1); padding-top: 6px; }
#app.narrow .menu { right: auto; left: 60px; bottom: 6px; }

/* ---------- top bar with tabs ---------- */
#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#bar { height: var(--bar-h); display: flex; align-items: flex-end; gap: 6px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line); flex: none; }
.bar-menu { display: none; align-self: center; }
#tabs { flex: 1; display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; height: 100%; }
#tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 10px; border-radius: 10px 10px 0 0; border: 1px solid transparent;
  border-bottom: 0; background: none; color: var(--muted); max-width: 210px; min-width: 0; flex: none; position: relative; top: 1px; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { background: var(--surface); color: var(--ink); border-color: var(--line); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.tab .glyph { width: 20px; height: 20px; border-radius: 6px; }
.tab .glyph svg.i { width: 12px; height: 12px; }
.tab .tname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.tab.sleeping .tname { font-style: italic; }
.tab .tx { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; opacity: .55; }
.tab .tx:hover { opacity: 1; background: var(--line); }
.tab .tx svg.i { width: 14px; height: 14px; }
.tab.home-tab { padding-right: 12px; }
#tools { display: flex; align-items: center; gap: 2px; align-self: center; }

/* ---------- views ---------- */
#views { flex: 1; position: relative; min-height: 0; background: var(--surface); }
.view { position: absolute; inset: 0; overflow: auto; }
.view:focus { outline: none; }
.frame { width: 100%; height: 100%; border: 0; display: block; background: var(--surface); }
.frame-wrap { position: absolute; inset: 0; }
.frame-wrap .loading { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; pointer-events: none; }
.frame-wrap .loading::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--gold); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { left: -30%; } to { left: 100%; } }
.frame-wrap .slow { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 12px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; font-size: 15px; max-width: calc(100% - 32px); }

/* ---------- home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 36px 32px 64px; }
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 30px; }
.hello h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 750; letter-spacing: -.025em; }
.hello p { margin: 4px 0 0; color: var(--muted); }
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { font-size: 21px; }
.sec-head p { margin: 0; color: var(--muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; gap: 14px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 14px; min-height: 84px; color: inherit; text-decoration: none; width: 100%; }
.tile:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 5%, var(--surface)); }
.tile .glyph { width: 44px; height: 44px; border-radius: 12px; }
.tile .glyph svg.i { width: 22px; height: 22px; }
.tile .tt { flex: 1; min-width: 0; padding-right: 26px; }
.tile .tt b { display: block; font-size: 17px; }
.tile .tt span { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
.tile .pin { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted);
  display: grid; place-items: center; opacity: 0; }
.tile:hover .pin, .tile:focus-within .pin, .tile .pin[aria-pressed="true"] { opacity: 1; }
.tile .pin[aria-pressed="true"] { color: var(--gold); }
.tile .pin:hover { background: var(--surface-2); color: var(--ink); }
.tile .pin svg.i { width: 16px; height: 16px; }
@media (hover: none) { .tile .pin { opacity: 1; } }
.pinned .tile { min-height: 72px; align-items: center; }
.empty-pins { border: 1px dashed var(--line); border-radius: 14px; padding: 16px; color: var(--muted); }

.devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.devices .get { background: var(--surface-2); }
.switch { display: flex; align-items: center; gap: 10px; }
.switch input { width: 20px; height: 20px; accent-color: var(--indigo); }

/* ---------- settings (admin) ---------- */
.set { max-width: 1000px; margin: 0 auto; padding: 32px 32px 64px; }
.set h1 { font-size: 34px; font-weight: 750; margin-bottom: 4px; }
.set > p { color: var(--muted); margin: 0 0 22px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; margin-bottom: 20px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 8px; font-weight: 700; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.rows { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rows-group { padding: 10px 14px; background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.rows-group:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.row .glyph { width: 32px; height: 32px; }
.row .rt { flex: 1; min-width: 0; }
.row .rt b { display: block; }
.row .rt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: 13px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.gold { border-color: var(--gold); }
.chip.off { color: var(--red); border-color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.actions .grow { flex: 1; }
.notice { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }

/* ---------- dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(18, 19, 39, .55); }
#dlg-form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
#dlg-form h2 { font-size: 22px; }
#dlg-form > p { margin: -6px 0 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 700; font-size: 15px; }
.field small { color: var(--muted); font-size: 13px; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="password"], .field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface-2); width: 100%; }
.field input:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; accent-color: var(--indigo); flex: none; }
.icons-pick { display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 6px; max-height: 128px; overflow-y: auto; padding: 2px; }
.icons-pick button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.icons-pick button[aria-pressed="true"] { border: 2px solid var(--gold); }
.colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.colors button { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; }
.colors button[aria-pressed="true"] { border-color: var(--ink); }
.colors input[type="color"] { width: 36px; height: 30px; border: 0; background: none; padding: 0; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.dlg-actions .left { margin-right: auto; }
.err { color: var(--red); font-weight: 700; margin: 0; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--indigo); color: #fff; padding: 10px 18px; border-radius: 12px;
  box-shadow: var(--shadow); z-index: 100; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--red); }

/* ---------- bottom bar (phones) ---------- */
#bottom { display: none; }

/* =============================== phones and small windows =============================== */
@media (max-width: 760px) {
  #app, #app.narrow { grid-template-columns: 1fr; grid-template-rows: 1fr auto; --side-w: 290px; }
  #side { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--side-w), 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  #app.drawer #side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  #app.narrow .brand span, #app.narrow .search, #app.narrow .nav-group h2, #app.narrow .nav-item .name, #app.narrow .me-text { display: revert; }
  #app.narrow .side-top { flex-direction: row; }
  #app.narrow .nav-item { justify-content: flex-start; padding: 6px 8px; }
  .side-collapse, .search kbd { display: none; }
  .side-close { display: inline-grid; }
  #scrim { position: fixed; inset: 0; background: rgba(18, 19, 39, .5); z-index: 25; }
  .bar-menu { display: none; }
  #tabs .tab:not(.active) { display: none; }
  #tabs .tab.active { max-width: none; flex: 1; background: none; border-color: transparent; top: 0; height: 100%; padding-left: 4px; }
  #tabs .tab.active::after { display: none; }
  #tabs .tab .tx { display: none; }
  #bar { align-items: center; padding-top: env(safe-area-inset-top); height: calc(var(--bar-h) + env(safe-area-inset-top)); }
  #bottom { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  #bottom button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 13px; color: var(--muted); position: relative; }
  #bottom button.on { color: var(--ink); font-weight: 700; }
  #bottom button.on svg.i { color: var(--gold); }
  #bottom i { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: var(--indigo);
    font: 700 12px/18px var(--f-body); text-align: center; padding: 0 4px; font-style: normal; }
  .home, .set { padding: 22px 16px 40px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { flex-direction: column; gap: 10px; min-height: 0; padding: 12px; }
  .tile .tt { padding-right: 0; }
  .tile .tt span { display: none; }
  .tile .pin { top: 6px; right: 6px; }
  .pinned .tile { flex-direction: row; align-items: center; }
  .two { grid-template-columns: 1fr; }
  .menu { position: fixed; left: 16px; right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  #app.drawer .menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); }
}
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .doors { grid-template-columns: 1fr; margin-top: -24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Hub settings > People (1.2) */
.set-h2 { font-size: 20px; margin: 0 0 10px; }
.set-note { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.avatar-friend { background: var(--lilac); color: var(--indigo); }
