/* MajaOS — glass on a dusk landscape. Dark = evening, light = morning mist. */
:root {
  color-scheme: light;
  --sky-top: #b9d4e2; --sky-mid: #dbe8e9; --sky-low: #efe9d8;
  --glow-in: rgba(255, 214, 150, .55); --glow-out: rgba(255, 214, 150, 0);
  --land-far: #a9c1bd; --land-mid: #7fa39a; --land-near: #5b8077; --star: transparent;

  --text: #15222c; --muted: #4f6272; --faint: #7a8a97;
  --badge-ink: #ffffff; /* text on a red badge */
  --qr-bg: #ffffff; /* QR codes stay black on white, also in the dark theme */
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .85); --glass-hover: rgba(255, 255, 255, .72);
  --shade: 0 12px 34px -18px rgba(30, 60, 70, .45);
  --track: rgba(21, 34, 44, .12);

  --ok: #12786b; --warn: #9a5a00; --bad: #b3372b; --accent: #12786b; --accent-ink: #ffffff;
  --body-bg: #dbe8e9;
  --screen-bg: #000; --screen-ink: #c8c8c8; /* a VM's screen: black in both themes */
  --term-bg: #0d1117; --term-fg: #e6edf3; --term-sel: rgba(111, 211, 195, .35); /* terminal: dark in both themes */
  /* NAS case in the storage window: brushed aluminium */
  --nas-body: #d3d9de; --nas-body-2: #bfc7ce; --nas-edge: #a8b1ba; --nas-slot: #262c33; --nas-tray: #eef1f3; --nas-tray-2: #dde2e6;
  --nas-tray-edge: #b9c2ca; --nas-vent: rgba(22, 32, 42, .22); --nas-ink: #17232c; --nas-ink-2: #51606c; --led-off: #8a949d;
  --pool-1: #12786b; --pool-2: #2f63c8; --pool-3: #7c45c4; --pool-4: #a55a12; --pool-5: #a8306f;
  --folder-bg: rgba(255, 255, 255, .5); --folder-ring: rgba(255, 255, 255, .55); /* folder icon: frosted glass */
  --m2-pcb: #1d3b34; --m2-pcb-2: #142b26; --m2-chip: #0d1412; --m2-gold: #c9a227; --m2-ink: #e3efe9; --m2-ink-2: #9fb8ae;
  /* One size for the whole interface: it grows with the window instead of jumping at a breakpoint. */
  --ui: clamp(13px, 0.42vw + 9.2px, 17.5px);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --sky-top: #0b1330; --sky-mid: #1a2c52; --sky-low: #3b4a66;
    --glow-in: rgba(255, 163, 92, .38); --glow-out: rgba(255, 163, 92, 0);
    --land-far: #1d2a40; --land-mid: #141f31; --land-near: #0c1422; --star: rgba(255, 255, 255, .75);
    --text: #f1f5f9; --muted: #aab7c8; --faint: #7e8ca0;
    --glass: rgba(18, 28, 52, .46); --glass-strong: rgba(20, 30, 56, .86);
    --glass-line: rgba(255, 255, 255, .12); --glass-hover: rgba(255, 255, 255, .1);
    --shade: 0 18px 40px -20px rgba(0, 0, 0, .7);
    --track: rgba(255, 255, 255, .12);
    --ok: #6fd3c3; --warn: #f2b35b; --bad: #f2877b; --accent: #6fd3c3; --accent-ink: #082a26;
    --body-bg: #101a33;
    --nas-body: #20262e; --nas-body-2: #171b21; --nas-edge: #323a45; --nas-slot: #07090c; --nas-tray: #2c333d; --nas-tray-2: #232931;
    --nas-tray-edge: #3c4552; --nas-vent: rgba(0, 0, 0, .55); --nas-ink: #e8eef4; --nas-ink-2: #9aa7b6; --led-off: #3d4651;
    --pool-1: #6fd3c3; --pool-2: #7aa7ff; --pool-3: #c29bff; --pool-4: #f2b35b; --pool-5: #f28bc5;
    --folder-bg: rgba(255, 255, 255, .16); --folder-ring: rgba(255, 255, 255, .22);
  }
}
:root[data-theme="dark"] {
  --sky-top: #0b1330; --sky-mid: #1a2c52; --sky-low: #3b4a66;
  --glow-in: rgba(255, 163, 92, .38); --glow-out: rgba(255, 163, 92, 0);
  --land-far: #1d2a40; --land-mid: #141f31; --land-near: #0c1422; --star: rgba(255, 255, 255, .75);
  --text: #f1f5f9; --muted: #aab7c8; --faint: #7e8ca0;
  --glass: rgba(18, 28, 52, .46); --glass-strong: rgba(20, 30, 56, .86);
  --glass-line: rgba(255, 255, 255, .12); --glass-hover: rgba(255, 255, 255, .1);
  --shade: 0 18px 40px -20px rgba(0, 0, 0, .7);
  --track: rgba(255, 255, 255, .12);
  --ok: #6fd3c3; --warn: #f2b35b; --bad: #f2877b; --accent: #6fd3c3; --accent-ink: #082a26;
  --body-bg: #101a33;
  --nas-body: #20262e; --nas-body-2: #171b21; --nas-edge: #323a45; --nas-slot: #07090c; --nas-tray: #2c333d; --nas-tray-2: #232931;
  --nas-tray-edge: #3c4552; --nas-vent: rgba(0, 0, 0, .55); --nas-ink: #e8eef4; --nas-ink-2: #9aa7b6; --led-off: #3d4651;
  --pool-1: #6fd3c3; --pool-2: #7aa7ff; --pool-3: #c29bff; --pool-4: #f2b35b; --pool-5: #f28bc5;
  --folder-bg: rgba(255, 255, 255, .16); --folder-ring: rgba(255, 255, 255, .22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; font-size: var(--ui); }
html, body { margin: 0; min-height: 100%; min-height: 100dvh; }
body {
  font-family: "Onest", system-ui, sans-serif; font-size: 1rem; line-height: 1.45;
  color: var(--text); background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
button, a, summary { touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
code { font-size: .92em; padding: 1px 5px; border-radius: 6px; background: var(--track); }

/* ---- background */
.wallpaper { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.sky-top { stop-color: var(--sky-top); } .sky-mid { stop-color: var(--sky-mid); } .sky-low { stop-color: var(--sky-low); }
.glow-in { stop-color: var(--glow-in); } .glow-out { stop-color: var(--glow-out); }
.land.far { fill: var(--land-far); } .land.mid { fill: var(--land-mid); } .land.near { fill: var(--land-near); }
.trees path { fill: var(--land-mid); stroke: var(--land-mid); stroke-width: 2; }
.stars circle { fill: var(--star); }

/* ---- glass */
.widget, .panel, .apps-bar .search, .files-filter, .seg, .toast, .spot-bar, .spot-panel {
  background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: var(--shade);
}

/* ---- layout */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  container-type: inline-size;
  display: flex; align-items: center; gap: clamp(8px, 1vw, 16px);
  padding: 0.9rem clamp(16px, 3vw, 36px);
  padding-left: max(clamp(16px, 3vw, 36px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 3vw, 36px), env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 0 1 auto; }
.brand-mark { width: 1.6rem; height: 1.6rem; fill: var(--text); flex: none; }
.brand-name { font-weight: 700; font-size: 1.13rem; letter-spacing: -.01em; flex: none; }
.host { color: var(--muted); font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.host:not(:empty)::before { content: "/"; margin-right: 8px; color: var(--faint); }
.demo-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--warn); color: #1d1300; }
.topnav { display: flex; gap: clamp(2px, 0.4vw, 6px); justify-content: flex-end; flex: 0 0 auto; min-width: 0; margin-left: auto; }
.topnav .nav-btn { flex: none; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; margin-left: calc(4px - clamp(8px, 1vw, 16px)); }

/* ---- header search (Spotlight-style) */
.spot { position: relative; z-index: 45; flex: 1 1 auto; max-width: 28rem; min-width: 0; width: auto; }
.spot-bar {
  display: flex; align-items: center; gap: 0.5rem; height: 2.55rem; padding: 0 0.8rem; border-radius: 0.85rem;
}
.spot-bar svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.spot-bar input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; }
.spot-bar input::placeholder { color: var(--faint); }
.spot-bar:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.spot-kbd {
  font: 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--faint); border: 1px solid var(--glass-line);
  border-radius: 6px; padding: 3px 6px; background: var(--track); flex: none;
}
.spot.open .spot-kbd { display: none; }
.spot-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); border-radius: 16px; padding: 6px;
  max-height: min(70vh, 520px); overflow: auto; background: var(--glass-strong);
}
.spot-list { display: flex; flex-direction: column; }
.spot-group { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.spot-hit {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; text-align: left;
}
.spot-hit:hover, .spot-hit[aria-selected="true"] { background: var(--glass-hover); }
.spot-hit[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.spot-hit .spot-text { min-width: 0; flex: 1; display: grid; }
.spot-hit b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-hit span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-hit mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.spot-ico {
  width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--track); color: var(--muted);
}
.spot-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spot-hit .app-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; box-shadow: none; flex: none; overflow: hidden; }
.spot-hit .app-icon img { padding: 4px; }
.spot-hit .app-icon .dot, .spot-hit .app-icon .upd-badge, .spot-hit .app-icon .app-prog, .spot-hit .app-icon .cut-badge { display: none; }
.spot-empty { padding: 16px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.nav-btn[hidden] { display: none; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 0.45em; border: 0; background: transparent;
  padding: 0.5em 0.75em; border-radius: 0.75em; font-weight: 500; font-size: 0.95rem;
}
.nav-btn:hover { background: var(--glass-hover); }
.nav-btn svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.topnav .nav-btn span {
  display: inline-block; max-width: 12em; overflow: hidden; white-space: nowrap; vertical-align: bottom;
  transition: max-width .18s ease, opacity .18s ease;
}
/* Labels slide away once the search would be squeezed. The phone bar shows them again. */
@container (max-width: 1500px) {
  .topnav .nav-btn span { max-width: 0; opacity: 0; }
  .topnav .nav-btn { gap: 0; }
}
@container (max-width: 900px) {
  .host { display: none; }
}

.desk {
  flex: 1; width: 100%; max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(clamp(250px, 18vw, 300px), clamp(310px, 22vw, 380px)) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 40px);
  padding: 8px max(clamp(16px, 3vw, 36px), env(safe-area-inset-right, 0px)) 48px max(clamp(16px, 3vw, 36px), env(safe-area-inset-left, 0px));
  align-items: start;
}
.desk.no-widgets { grid-template-columns: minmax(0, 1fr); }
.disk-alerts { grid-column: 1 / -1; display: grid; gap: 8px; }
.disk-alert {
  display: grid; gap: 2px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  padding: 12px 16px; border-radius: 16px; border: 1px solid var(--bad); background: var(--glass);
}
.disk-alert b { color: var(--bad); font-weight: 650; }
.disk-alert span { color: var(--muted); font-size: 13px; }
#widgets[hidden] { display: none; }

/* ---- widgets */
.widgets { display: flex; flex-direction: column; gap: 14px; }
.widget { border-radius: 22px; padding: 18px 20px; text-align: left; width: 100%; }
.widget-btn { display: block; color: inherit; transition: background .15s ease; }
.widget-btn:hover { background: var(--glass-hover); }
.widget-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; min-width: 0; }
.widget-head h2 { font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-title {
  display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; background: none; padding: 0; margin: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.widget-title:hover { color: var(--text); }
.widget-head > .pill, .widget-head > .muted, .widget-head > .small {
  flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.clock-widget { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 4px 4px 10px; }
.greeting { font-size: 15px; color: var(--muted); }
.clock { font-size: clamp(56px, 7vw, 76px); font-weight: 600; letter-spacing: -.04em; line-height: 1; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.date { font-size: 16px; color: var(--muted); }

.sys-grid { display: flex; gap: 14px; margin-bottom: 14px; }
.ring-wrap { position: relative; width: 78px; height: 78px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.2; }
.ring-track { stroke: var(--track); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset .6s ease, stroke .3s; }
.ring-fill.warn { stroke: var(--warn); } .ring-fill.bad { stroke: var(--bad); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.big-stat { margin-bottom: 10px; color: var(--muted); }
.big-stat strong { font-size: 28px; font-weight: 600; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; margin-bottom: 8px; }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .6s ease; }
.bar span.warn { background: var(--warn); } .bar span.bad { background: var(--bad); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--track); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }
.ai-line { font-size: 17px; font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.vm-mini { list-style: none; margin: 0; padding: 0; display: grid; }

/* ---- apps */
.apps-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 22px; }
.apps-bar h1, .page-title h1 { font-size: clamp(1.5rem, 0.85rem + 1.2vw, 1.75rem); font-weight: 600; letter-spacing: -.02em; }
.count { font-size: 0.65em; font-weight: 500; color: var(--muted); margin-left: 4px; }
.apps-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.search { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.8rem; height: 2.55rem; border-radius: 0.85rem; }
.search svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search input { border: 0; outline: 0; background: transparent; width: 170px; height: 100%; }
.search input::placeholder { color: var(--faint); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 4px; border-radius: 13px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0.4em 0.75em; border-radius: 0.6em; font-size: 0.93rem; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--glass-strong); color: var(--text); font-weight: 600; }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 10px; }
.app-grid.home-mix {
  --home-cols: 4; --home-row: 60px;
  position: relative;
  grid-template-columns: repeat(var(--home-cols), minmax(0, 1fr));
  grid-auto-rows: var(--home-row); grid-auto-flow: dense; gap: 10px 10px; align-items: stretch;
}
.app-grid.home-mix > .app {
  grid-column: span 1; grid-row: span 2; min-width: 0; min-height: 0; z-index: 0;
}
.home-widget {
  position: relative; grid-column: span var(--w, 2); grid-row: span var(--h, 2);
  min-width: 0; min-height: 0; align-self: stretch; z-index: 0;
}
.home-widget .widget, .home-widget .widget-btn {
  height: 100%; max-height: 100%; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: 10px 12px; box-sizing: border-box;
}
.home-widget .widget-head { flex: none; margin-bottom: 4px; }
.home-widget .sys-grid, .home-widget .share-mini, .home-widget .vm-mini, .home-widget .facts,
.home-widget .big-stat, .home-widget .ai-line, .home-widget #storeLine, .home-widget #aiSub {
  min-width: 0;
}
.home-widget .sys-grid { flex: 1; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 0; align-content: center; min-height: 0; overflow: hidden; }
.home-widget .ring-wrap { width: 44px; height: 44px; flex: none; }
.home-widget .ring-label strong { font-size: 12px; }
.home-widget .facts { flex: 1; min-height: 0; overflow: hidden; font-size: 12px; margin-top: 4px; }
.home-widget .share-mini, .home-widget .vm-mini { flex: 1; min-height: 0; overflow: hidden; align-content: start; gap: 4px; }
.home-widget .vm-mini { overflow-y: auto; }
.home-widget .share-mini li, .home-widget .vm-mini li { min-width: 0; max-width: 100%; }
.home-widget .big-stat { flex: none; margin-bottom: 4px; }
.home-widget .big-stat strong { font-size: 18px; }
.home-widget .bar { flex: none; }
.home-widget #storeLine, .home-widget #aiSub {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  font-size: 12.5px; margin: 0;
}
.home-widget .ai-line { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.home-widget .clock-widget { justify-content: center; padding: 6px 10px; }
.home-widget .clock { font-size: 32px; margin: 0 0 2px; }
.home-widget .greeting, .home-widget .date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-widget.short .clock { font-size: 22px; margin: 0; }
.home-widget.short .date { font-size: 12px; }
.home-widget.short .greeting { display: none; }
.home-widget.short .sys-grid { margin-bottom: 0; }
.home-widget.short .ring-wrap { width: 36px; height: 36px; }
.home-widget.short .ring-label strong { font-size: 11px; }
.home-widget .facts, .home-widget .widget-more { display: none; }
.home-widget.wide .facts, .home-widget.tall .facts,
.home-widget.wide .widget-more, .home-widget.tall .widget-more { display: grid; }
.home-widget.short .facts, .home-widget.short .widget-more { display: none; }
.home-widget.wide .sys-grid { flex: none; }
.home-widget.wide .ring-wrap { width: 52px; height: 52px; }
.home-widget.wide .ring-label strong { font-size: 13px; }
.home-widget.wide .clock { font-size: 40px; }
.home-widget.xl .clock { font-size: 48px; }
.home-widget.xl .ring-wrap { width: 56px; height: 56px; }
.home-widget.short .share-mini, .home-widget.short .vm-mini { display: none; }
.home-pad {
  grid-column: span 1; grid-row: span 2; min-width: 0; min-height: 0; pointer-events: none;
}
.app-grid.placing > .home-pad {
  pointer-events: auto;
  border-radius: 20px;
  border: 1.5px dashed color-mix(in srgb, var(--glass-line) 80%, transparent);
}
.widget-frame {
  display: none; position: absolute; inset: 3px; z-index: 3; pointer-events: none;
  border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 20px; box-sizing: border-box;
}
.home-widget:hover .widget-frame, .home-widget.resizing .widget-frame { display: block; }
.home-widget.resizing { z-index: 6; }
.widget-handle {
  position: absolute; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 0;
  background: transparent; pointer-events: auto; touch-action: none;
}
.widget-handle::before { content: ""; position: absolute; inset: -12px; }
.widget-handle::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 3px solid var(--accent); background: transparent;
}
.widget-handle[data-resize="ne"] { top: -5px; right: -5px; cursor: nesw-resize; }
.widget-handle[data-resize="ne"]::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.widget-handle[data-resize="nw"] { top: -5px; left: -5px; cursor: nwse-resize; }
.widget-handle[data-resize="nw"]::after { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.widget-handle[data-resize="se"] { bottom: -5px; right: -5px; cursor: nwse-resize; }
.widget-handle[data-resize="se"]::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.widget-handle[data-resize="sw"] { bottom: -5px; left: -5px; cursor: nesw-resize; }
.widget-handle[data-resize="sw"]::after { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.widget-size-preview {
  position: absolute; z-index: 8; pointer-events: none; box-sizing: border-box;
  border-radius: 22px; border: 2px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.widget-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px;
  padding: 10px 12px; border-radius: 14px; background: var(--glass); border: 1px dashed var(--glass-line);
}
.widget-tray-list { display: flex; flex-wrap: wrap; gap: 6px; }
.vm-home-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.page-home-icon { color: #fff; }
.page-home-icon svg { width: 52%; height: 52%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-row.page-tile { grid-template-columns: 1fr; }
.app { position: relative; container-type: inline-size; display: flex; flex-direction: column; align-items: center; gap: 0.55rem; padding: 0.7rem 0.3rem 0.55rem; border-radius: 1.2rem; }
.app:hover { background: var(--glass-hover); }
.app-open { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; border-radius: 16px; }
.app-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.app-icon {
  position: relative; width: 4.4rem; height: 4.4rem; border-radius: 28%; display: grid; place-items: center;
  font-size: 1.7rem; font-weight: 700; color: #fff; overflow: visible;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.app .app-icon { width: min(4.4rem, 70cqi); height: auto; aspect-ratio: 1; font-size: 24cqi; }
/* Absolute over the whole tile: that way every icon stays square, even if the logo is narrow or wide. */
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; padding: 9px; }
.app-icon .dot { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--body-bg); background: var(--faint); }
.app-icon .dot.on { background: var(--ok); }
.app-icon .cut-badge {
  position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--text); color: var(--body-bg);
  border: 2px solid var(--body-bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
.app-icon .cut-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.app-icon .upd-badge {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--warn); border: 2px solid var(--body-bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.app-icon .upd-badge svg { width: 13px; height: 13px; fill: none; stroke: #1d1300; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.apps-title { display: grid; gap: 4px; }
.upd-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 22px; font-size: 13px; }
.upd-info .linkish { font-size: 13px; }
.upd-info .linkish[disabled] { color: var(--muted); text-decoration: none; cursor: progress; }
.upd-pill { display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer; }
.upd-pill svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.menu-upd { font-size: 12.5px; color: var(--warn); font-weight: 600; }
.menu-item.accent { color: var(--warn); font-weight: 600; }
.menu-item.accent svg { color: var(--warn); }
.app.stopped .app-icon { filter: grayscale(.85); opacity: .6; }
.app-name { font-size: 0.9rem; font-weight: 500; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app .app-name { font-size: clamp(11px, 14cqi, 0.95rem); }
.app-more {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 9px; border: 0;
  background: var(--glass-strong); display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.app-more svg { width: 16px; height: 16px; fill: currentColor; }
.app:hover .app-more, .app-more:focus-visible, .app:focus-within .app-more { opacity: 1; }
@media (hover: none) { .app-more { opacity: .9; } }
.empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--muted); border: 1.5px dashed var(--glass-line); border-radius: 20px; }

/* ---- own page (VMs) */
.nav-btn[aria-current="page"] { background: var(--glass-strong); }
.page { flex: 1; width: 100%; min-width: 0; max-width: 1180px; margin: 0 auto;
  padding: 8px max(clamp(16px, 3vw, 36px), env(safe-area-inset-right, 0px)) 48px max(clamp(16px, 3vw, 36px), env(safe-area-inset-left, 0px)); }
.page-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.btn.back { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 0.8rem; flex: none; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.vm-card { display: flex; flex-direction: column; gap: 14px; }
.vm-head { display: flex; align-items: center; gap: 12px; }
.vm-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--track); color: var(--faint); }
.vm-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vm-card.on .vm-icon { color: var(--ok); }
.vm-card.paused .vm-icon, .vm-card.stopping .vm-icon { color: var(--warn); }
.vm-card.bad .vm-icon { color: var(--bad); }
.vm-title { flex: 1; min-width: 0; }
.vm-title h2 { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-force { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--glass-line); }
.vm-force .row-sub { margin-right: auto; }
.vm-sub:empty { display: none; }
.vm-desc { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.vm-specs { font-size: 13px; color: var(--muted); }
.vm-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meter-head b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter .bar { margin: 0; height: 6px; }
.vm-mini { gap: 2px; align-content: start; }
.vm-mini li { min-width: 0; }
.vm-mini-btn {
  display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 1px;
  width: 100%; border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px;
  text-align: left; padding: 5px 6px; border-radius: 8px; cursor: pointer;
}
.vm-mini-btn:hover, .vm-mini-btn[aria-expanded="true"] { background: var(--glass-hover); }
.vm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.vm-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 28%, transparent); }
.vm-dot.warn { background: var(--warn); }
.vm-dot.bad { background: var(--bad); }
.vm-mini-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.vm-mini-extra { display: none; color: var(--muted); font-size: 12px; font-weight: 450; font-variant-numeric: tabular-nums; min-width: 0; }
.vm-mini-extra .vm-stat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-widget.wide .vm-mini-extra, .home-widget.tall .vm-mini-extra, .home-widget.xl .vm-mini-extra {
  display: flex; grid-column: 2; gap: 10px; overflow: hidden;
}
.home-widget.wide:not(.tall) .vm-mini-btn { grid-template-columns: 10px minmax(0, 1fr) auto; }
.home-widget.wide:not(.tall) .vm-mini-extra { grid-column: 3; grid-row: 1; }
.vm-tip {
  position: fixed; z-index: 60; min-width: 180px; max-width: 280px; padding: 10px 12px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shade);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  pointer-events: none; animation: fade .12s ease-out;
}
.vm-tip[hidden] { display: none; }
.vm-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.vm-tip .muted { display: block; font-size: 12px; margin-bottom: 6px; }
.vm-tip dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 6px 0 0; font-size: 12.5px; }
.vm-tip dt { color: var(--muted); }
.vm-tip dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- app store (laid out like the Mac App Store: sidebar, a wide feature, shelves, a numbered chart) */
.store-page { min-width: 0; }
.store-side {
  display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto;
  padding: 8px 10px 12px; border-right: 1px solid var(--glass-line); background: color-mix(in srgb, var(--glass) 55%, transparent);
}
.store-side .btn { margin-top: auto; }
.store-chips { display: flex; flex-direction: column; gap: 2px; }
.store-chips button {
  width: 100%; text-align: left; border: 0; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; font-size: 0.9rem; padding: 6px 10px; cursor: pointer;
}
.store-chips button:hover { background: var(--glass-hover); }
.store-chips button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.store-main { min-width: 0; min-height: 0; overflow: auto; padding: 12px 18px 16px; container-type: inline-size; }
.store-top { margin-bottom: 14px; }
.store-top .search { width: min(100%, 420px); }
.store-top .search input { width: 100%; }
.store-source { margin: 18px 2px 4px; }
.store-feature { display: grid; gap: 12px; margin-bottom: 18px; }
.store-feature-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.store-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 4px; align-items: center;
  width: 100%; min-height: 196px; padding: 20px 22px; border: 0; border-radius: 18px; text-align: left; color: inherit;
  cursor: pointer; font: inherit;
  background: linear-gradient(115deg, color-mix(in srgb, var(--hero) 58%, var(--glass-strong)), color-mix(in srgb, var(--hero) 16%, var(--glass)));
}
.store-feature-pair .store-hero { min-height: 148px; padding: 16px 18px; }
.store-kicker { grid-column: 1; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--text) 68%, transparent); }
.store-hero .store-icon { grid-column: 2; grid-row: 1 / span 4; width: 92px; height: 92px; border-radius: 22px; font-size: 34px; }
.store-feature-pair .store-icon { width: 68px; height: 68px; border-radius: 18px; font-size: 26px; }
.store-hero-name { grid-column: 1; font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; }
.store-feature-pair .store-hero-name { font-size: 1.15rem; }
.store-hero-sum { grid-column: 1; font-size: 13.5px; line-height: 1.35; color: color-mix(in srgb, var(--text) 78%, transparent); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-hero .store-get { grid-column: 1; justify-self: start; margin-top: 8px; }
.store-shelf { margin: 4px 0 22px; }
.store-shelf header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 8px; min-width: 0; }
.store-shelf h3 { min-width: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; }
.store-shelf header .linkish { flex: none; text-decoration: none; font-weight: 600; font-size: 0.86rem; }
.store-shelf header .linkish::after { content: " ›"; }
.store-rail {
  display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; max-width: 100%;
}
.store-rail::-webkit-scrollbar { display: none; }
.store-tile {
  flex: 0 0 250px; scroll-snap-align: start; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 8px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.store-tile:hover { background: var(--glass-hover); }
.store-tile .store-icon { width: 58px; height: 58px; border-radius: 14px; font-size: 22px; }
.store-tile-text { display: grid; gap: 2px; min-width: 0; }
.store-tile-name { font-size: 0.92rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-tile .store-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-tile[data-installed="1"] .store-icon { box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .55), inset 0 0 0 2px var(--ok); }
.store-mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 8px; }
.store-mosaic .store-tile { flex: none; width: auto; }
.store-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.store-list { display: flex; flex-direction: column; gap: 2px; }
.store-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 8px 6px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit;
}
.store-row.has-rank { grid-template-columns: 1.5rem auto minmax(0, 1fr) auto; }
.store-row:hover { background: var(--glass-hover); }
.store-rank { font-size: 0.95rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.store-row .store-icon { width: 48px; height: 48px; border-radius: 12px; font-size: 18px; }
.store-row .store-sum { -webkit-line-clamp: 1; }
.store-row-text { display: grid; gap: 1px; min-width: 0; }
.store-get {
  display: inline-flex; align-items: center; justify-content: center; min-width: 4.4rem; height: 1.7rem; padding: 0 0.7rem;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.78rem; font-weight: 700;
}
.store-get.is-in { background: var(--glass); color: var(--muted); font-weight: 600; }
@container (max-width: 680px) {
  .store-charts, .store-feature-pair { grid-template-columns: 1fr; }
}
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.store-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; text-align: left; color: inherit; transition: background .15s ease; }
.store-card:hover { background: var(--glass-hover); }
.app-icon.store-icon { width: 52px; height: 52px; border-radius: 15px; font-size: 21px; flex: none; }
.app-icon.store-icon img { padding: 7px; }
.store-body { display: grid; gap: 2px; min-width: 0; }
.store-name { font-weight: 600; overflow-wrap: anywhere; }
.store-row .store-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-name .pill { font-size: 11px; vertical-align: 1px; margin-left: 4px; }
.store-by { font-size: 12.5px; color: var(--muted); }
.store-sum { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.store-more { display: flex; justify-content: center; margin-top: 18px; }
.store-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.store-head .store-by { font-size: 14px; }
.store-overview { white-space: pre-line; font-size: 14px; color: var(--muted); margin-bottom: 14px; max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.warn-list { margin: 0 0 14px; padding: 12px 14px 12px 32px; border-radius: 14px; border: 1px solid var(--warn); color: var(--text); font-size: 14px; display: grid; gap: 4px; }
.req { color: var(--bad); font-style: normal; }
details.adv { border: 1px solid var(--glass-line); border-radius: 14px; padding: 10px 14px; background: var(--glass); }
details.adv summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.adv[open] summary { margin-bottom: 4px; }
#storeForm h3 { margin: 10px 0 2px; }

/* ---- settings: window with a sidebar, like System Settings on macOS */
.window.settings-win { width: min(920px, calc(100vw - 24px)); height: min(680px, 88vh, 88dvh); max-height: none; }
.window.settings-win[open] { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.set-side { display: flex; flex-direction: column; gap: 2px; padding: 18px 10px; border-right: 1px solid var(--glass-line); background: var(--glass); overflow: auto; overscroll-behavior: contain; }
.set-side-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px 10px; }
.set-side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: inherit; text-decoration: none; font-size: 14px; }
.set-side a:hover { background: var(--glass-hover); }
.set-side a[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.set-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.set-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.set-ico.teal { background: #149e8e; } .set-ico.gray { background: #8e8e93; } .set-ico.blue { background: #0a84ff; } .set-ico.slate { background: #5e6b7a; } .set-ico.cyan { background: #1d9bd1; } .set-ico.indigo { background: #5e5ce6; } .set-ico.green { background: #30a46c; } .set-ico.orange { background: #f29b30; }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-main .win-body { flex: 1; }
.set-pane:focus { outline: none; }
.set-pane > .pane-title:first-child { margin-top: 4px; }
.pane-title { font-size: 17px; font-weight: 600; margin: 22px 0 6px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass); font-size: 14px; }
.choice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.experience-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.choice-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); cursor: pointer; }
.choice-card input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.choice-card b { display: block; font-size: 15px; margin-bottom: 4px; }
.choice-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.expert-compose #cfToggle { display: none; }
.expert-compose #cfForm { margin-bottom: 14px; }
.notice { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); display: grid; gap: 8px; margin: 14px 0; font-size: 14px; }
.notice.warn { border-color: var(--warn); }
.about-kv { grid-template-columns: minmax(130px, max-content) 1fr; }
.nav-btn[data-nav] { text-decoration: none; color: inherit; }

/* ---- forms */
.form { display: grid; gap: 14px; }
.fld { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.fld[hidden] { display: none; }
.fld > span { font-size: 14px; font-weight: 500; }
.fld em { font-style: normal; font-weight: 400; }
.fld small { font-size: 12.5px; color: var(--muted); }
.fld .field { flex: none; width: 100%; min-width: 0; }
.fld textarea.field { height: auto; padding: 10px 12px; resize: vertical; }
.field:disabled { opacity: .55; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.autostart { padding: 14px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle > span:last-child { display: grid; gap: 2px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 46px; height: 28px; border-radius: 999px; background: var(--track); position: relative; flex: none; transition: background .15s ease; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .28); transition: transform .15s ease; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
#aiSet .btn-row { margin-top: 16px; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.ask .check { font-size: 14px; font-weight: 400; }
.kind-seg { display: flex; width: 100%; }
.kind-seg button { flex: 1; }
.win-body h3 .pill { margin-left: 6px; vertical-align: 2px; }

/* ---- menu of an app */
.menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shade), 0 2px 10px rgba(0, 0, 0, .12);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.menu-head { display: grid; padding: 8px 10px 6px; }
.menu-head b { font-weight: 600; }
.menu-head span { font-size: 12.5px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--glass-line); margin: 5px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; text-align: left; font-size: 14px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--glass-hover); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.menu-item svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.menu-item.danger, .menu-item.danger svg { color: var(--bad); }
.menu-item[disabled] { opacity: .45; cursor: default; }
.app.busy .app-icon { animation: busy 1.2s ease-in-out infinite; }
@keyframes busy { 50% { opacity: .45; } }

/* ---- log, console and editor */
.log-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.log-tools .check { margin-right: auto; }
.log-tools .field { flex: none; width: auto; min-width: 0; height: 32px; font-size: 13px; }
.logs.logs-big { max-height: min(62vh, 640px); min-height: 240px; }
.console-out { min-height: 260px; max-height: min(55vh, 560px); margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.console-out .console-cmd { color: #9be3d6; }
.console-out .console-err { color: #ff9e93; }
.console-out .muted { color: #8aa0b5; }
.console-line { display: flex; align-items: center; gap: 8px; padding: 8px 14px; margin-bottom: 10px; border-radius: 0 0 14px 14px; background: rgba(0, 0, 0, .86); }
.console-prompt { color: #9be3d6; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.console-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #f1f5f9; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.console-input:disabled { opacity: .5; }
.cf-list { display: grid; gap: 8px; }
.cf-row { display: grid; align-items: center; gap: 8px; }
.cf-row .field { flex: none; width: 100%; min-width: 0; height: 36px; font-size: 14px; }
.cf-pair { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) minmax(90px, auto) 32px; }
.cf-kv { grid-template-columns: minmax(0, .8fr) auto minmax(0, 1.2fr) 32px; }
.cf-locked { grid-template-columns: auto 1fr 32px; padding: 6px 10px; border-radius: 11px; border: 1px dashed var(--glass-line); font-size: 13.5px; }
.cf-text { overflow-wrap: anywhere; }
.cf-sep { color: var(--muted); font-size: 14px; }
.cf-small { min-width: 0; }
.vm-tabs { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.vm-tabs button { flex: 1 0 auto; white-space: nowrap; }
.vm-tabs button[aria-selected="true"] { background: var(--glass-strong); color: var(--text); font-weight: 600; }
.nic-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) 32px; }
.disk-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); }
.disk-row.is-removed .row-title, .disk-row.is-removed .row-sub { text-decoration: line-through; opacity: .6; }
.disk-row.is-new { border-style: dashed; }
.disk-size { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.disk-size .field { width: 90px; }
.disk-new-side { display: flex; align-items: center; gap: 6px; }
.pin-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pin-core { display: grid; gap: 4px; justify-items: center; padding: 6px 8px; border-radius: 11px; background: var(--glass); border: 1px solid var(--glass-line); }
.pin-core > div { display: flex; gap: 4px; }
.pin { display: inline-grid; place-items: center; cursor: pointer; }
.pin input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pin span { min-width: 30px; height: 28px; padding: 0 6px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--glass-line); font-size: 13px; font-variant-numeric: tabular-nums; }
.pin input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.pin input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dev-list { display: grid; gap: 8px; }
.check.dev { align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); }
.check.dev > span { display: grid; gap: 2px; }
.check.dev input { margin-top: 2px; }
@media (max-width: 560px) { .nic-row { grid-template-columns: 1fr 32px; } .nic-row .field:not(:first-child) { grid-column: 1; } .disk-row { grid-template-columns: 1fr; } }
.cf-del { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; display: grid; place-items: center; color: var(--muted); }
.cf-del:hover { background: var(--glass-hover); color: var(--bad); }
.cf-del svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.cf-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--glass-line); }
#cfForm h3 { margin: 18px 0 8px; }
@media (max-width: 560px) {
  .cf-pair { grid-template-columns: 1fr 32px; }
  .cf-pair .cf-sep { display: none; }
  .cf-pair > :nth-child(3), .cf-pair > :nth-child(4) { grid-column: 1; }
  .cf-pair > .cf-del { grid-column: 2; grid-row: 1; }
  .cf-kv { grid-template-columns: 1fr 32px; }
  .cf-kv .cf-sep { display: none; }
  .cf-kv > :nth-child(3) { grid-column: 1; }
  .cf-kv > .cf-del { grid-column: 2; grid-row: 1; }
}
textarea.field.code { width: 100%; height: auto; padding: 10px 12px; resize: vertical; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; }

/* ---- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; height: 2.5rem; padding: 0 1rem;
  border-radius: 0.7rem; border: 1px solid var(--glass-line); background: var(--glass-strong); font-weight: 500; font-size: 0.93rem;
  text-decoration: none; color: inherit;
}
.btn:hover { filter: brightness(1.05); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: progress; }
.btn.sm { height: 2.05rem; padding: 0 0.72rem; font-size: 0.86rem; border-radius: 0.56rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- window */
.window {
  width: min(780px, calc(100vw - 24px)); max-height: min(86vh, 86dvh, 900px); padding: 0; border-radius: 26px;
  color: var(--text); background: transparent; border: 1px solid var(--glass-line); box-shadow: var(--shade); overflow: hidden;
}
/* The blur sits on its own layer. On the window itself it scrolls along with the contents. */
.window::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: var(--glass-strong); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.window > * { position: relative; z-index: 1; }
html:has(dialog[open]) { overflow: hidden; }
/* Storage window: wide enough for a case with 12 bays side by side (12 × 70 px). */
.window.win-wide { width: min(1060px, calc(100vw - 24px)); }
.window.file-win { width: min(960px, calc(100vw - 24px)); }
.window.pop-win { width: min(1120px, calc(100vw - 24px)); height: min(86vh, 86dvh, 880px); }
html:has(.pop-win[open]) { overflow: hidden; }
.pop-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 0 16px 16px; }
.pop-body > .page { max-width: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.pop-body > .store-page { display: grid; grid-template-columns: 200px minmax(0, 1fr); overflow: hidden; }
.pop-body > .files-page { overflow: hidden; display: flex; flex-direction: column; }
.pop-body .apps-bar { margin-bottom: 12px; }
.pop-body .finder { flex: 1; min-height: 0; height: auto; box-shadow: none; grid-template-rows: minmax(0, 1fr); }
.file-edit {
  display: block; width: 100%; min-height: min(60vh, 520px); resize: vertical; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--glass-line); background: var(--glass); color: var(--text); outline: 0;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 2;
}
.file-edit:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.file-view { display: block; max-width: 100%; max-height: min(68vh, 720px); margin: 0 auto; }
video.file-view { width: 100%; background: #000; }
.window[open] { display: flex; flex-direction: column; animation: pop .18s ease-out; }
.window::backdrop { background: rgba(5, 10, 20, .35); backdrop-filter: blur(3px); }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.win-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px 24px; }
.win-head h2 { font-size: clamp(1.15rem, 0.85rem + 0.6vw, 1.4rem); font-weight: 600; letter-spacing: -.01em; }
.win-tools { display: flex; align-items: center; gap: 8px; }
.close { width: 36px; height: 36px; border-radius: 11px; border: 0; background: var(--track); display: grid; place-items: center; color: inherit; text-decoration: none; }
.close[hidden] { display: none; }
.window.chat-win { width: min(720px, calc(100vw - 24px)); height: min(640px, 86vh, 86dvh); }
.window.chat-win .win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.window.chat-win .chat { flex: 1; min-height: 0; }
.window.chat-win .chat-log { flex: 1; max-height: none; min-height: 8rem; }
.close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
#winGear svg { stroke-width: 1.7; }
.win-body { padding: 4px 24px 24px; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.win-body h3 { font-size: 15px; font-weight: 600; margin: 22px 0 10px; }
.win-body h3:first-child { margin-top: 6px; }
.lead { color: var(--muted); margin-bottom: 14px; }

.rows { list-style: none; margin: 0; padding: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-line); }
.rows li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; padding: 12px 14px; background: var(--glass); }
.rows li + li { border-top: 1px solid var(--glass-line); }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--muted); }
.row-side { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-bar { grid-column: 1 / -1; }
.row-bar .bar { margin: 2px 0 0; height: 6px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 6px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.logs {
  margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .78); color: #d9e2ec;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 300px; overflow: auto; white-space: pre-wrap;
}
.logs .ts { color: #8aa0b5; }
.code-view { border-radius: 14px; overflow: hidden; border: 1px solid var(--glass-line); background: rgba(0, 0, 0, .78); margin-top: 12px; }
.code-view[hidden] { display: none; }
.code-view-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; background: rgba(255, 255, 255, .06); color: #d9e2ec; font-size: 13px; }
.code-view .logs { border-radius: 0; max-height: 420px; background: transparent; }
.code-view .btn { color: #e8eef4; background: transparent; border-color: rgba(255, 255, 255, .22); }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 6px; }
.stat { padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); }
.stat b { display: block; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { font-size: 13px; color: var(--muted); }

.temp-ok { color: var(--ok); } .temp-warn { color: var(--warn); } .temp-bad { color: var(--bad); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.field {
  flex: 1; min-width: min(100%, 11rem); height: 2.55rem; padding: 0 0.8rem; border-radius: 0.7rem;
  border: 1px solid var(--glass-line); background: var(--glass); outline: 0; font-size: 1rem;
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select.field { padding-right: 8px; }
.lang-fld { width: max-content; max-width: 100%; }
.lang-fld .field {
  width: auto; min-width: 12rem; max-width: 100%; padding-right: 2.4rem;
  appearance: none; -webkit-appearance: none;
}
.lang-fld { position: relative; }
.lang-fld::after {
  content: ""; position: absolute; right: 0.95rem; top: 50%; width: 0.45rem; height: 0.45rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.progress-note { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 1.4em; }

.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-empty { margin: auto; text-align: center; max-width: 28rem; }
.chat-empty .btn { margin-top: 8px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; padding: 2px; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--glass); border: 1px solid var(--glass-line); border-bottom-left-radius: 5px; }
.msg.tool { align-self: flex-start; max-width: 100%; padding: 2px 4px; background: none; color: var(--muted); font-size: 13px; }
.chat > .field { flex: none; width: 100%; }
.chat textarea { min-height: 72px; padding: 10px 12px; resize: vertical; height: auto; }

.ask { width: min(400px, calc(100vw - 32px)); }
.ask .win-body { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 18px; }
.ask p { font-size: 16px; font-weight: 500; }
.ask-row { justify-content: flex-end; }
@media (max-width: 560px) { .ask { margin: auto; border-radius: 22px; } }

/* ---- centred screens */
.center-screen { flex: 1; display: grid; place-items: center; padding: 24px 16px 60px; }
.panel { border-radius: 26px; padding: 28px; width: min(560px, 100%); }
.panel h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; }
.panel p { color: var(--muted); margin-bottom: 16px; }
/* ---- sign-in */
.login-card { width: min(400px, 100%); padding: 32px 28px 26px; animation: pop .25s ease-out; }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.login-mark { width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center; background: var(--accent); margin-bottom: 14px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.login-mark svg { width: 30px; height: 30px; fill: var(--accent-ink); }
.login-card h1 { margin-bottom: 4px; }
.login-card .login-sub { margin: 0; font-size: 15px; text-wrap: balance; }
.login { display: flex; flex-direction: column; gap: 8px; }
.login > label:not(.check) { font-size: 14px; color: var(--muted); }
.login input:not([type="checkbox"]) { width: 100%; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--text); font: inherit; }
.login input:not([type="checkbox"]):focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login .check { margin-top: 4px; }
.login-go { height: 46px; margin-top: 2px; font-size: 16px; }
.login-demo { text-align: center; margin: 6px 0 0 !important; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--text); background: var(--glass); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-eye:not([aria-pressed="true"]) .eye-off { display: none; }
.otp-input { text-align: center; font: 600 26px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace !important; letter-spacing: .32em; height: 58px !important; padding-left: .32em !important; }
.otp-input.recovery { font-size: 20px !important; letter-spacing: .12em; padding-left: .12em !important; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.login-shake { animation: shake .35s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .login-card, .login-shake { animation: none; } }

/* ---- welcome wizard */
.window.onboard { width: min(720px, calc(100vw - 24px)); height: min(700px, 92vh, 92dvh); max-height: none; }
/* The wizard stands alone on the background, without the dashboard behind it. */
body.onb-open .shell { visibility: hidden; }
.window.onboard::backdrop { background: transparent; backdrop-filter: none; }
.onb-pool { margin-top: 6px; }
.onb-pool .form { max-width: none; }
.onb-pool .pool-form-wizard { max-width: 100%; }
.onb-body .pool-form-wizard .fld > span { font-size: 13px; font-weight: 600; }
.pool-wizard-hint { margin: 0 0 10px; }
.pool-disk-tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.pool-disk-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 108px; padding: 10px 8px 12px; border-radius: 14px; border: 2px solid var(--glass-line); background: var(--glass); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pool-disk-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-line)); }
.pool-disk-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px color-mix(in srgb, var(--accent) 18%, transparent); }
.pool-disk-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pool-disk-art { width: 56px; height: auto; color: var(--muted); }
.pool-disk-tile.on .pool-disk-art { color: var(--text); }
.pool-disk-size { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.pool-disk-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pool-disk-model, .pool-disk-bay { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.pool-disk-warn { text-align: center; line-height: 1.3; }
.pool-wizard-panel { display: grid; gap: 12px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--glass-line); }
.pool-sum-compact { padding: 12px 14px; gap: 10px; }
.pool-space-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.pool-space-head b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.pool-space-note { margin: 0; font-size: 13px; line-height: 1.4; }
.pool-bar-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; }
.pool-bar-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pool-bar-legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.pool-bar-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pool-layout-chips, .layout-grid-wizard { display: flex; flex-wrap: wrap; gap: 8px; }
.pool-layout-chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass); cursor: pointer; font-size: 13px; }
.pool-layout-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pool-layout-chip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pool-layout-chip .pill { margin-left: 4px; vertical-align: middle; }
.pool-wizard-name { margin: 0; }
.pool-wizard-name .field { padding: 8px 10px; }
.check-compact { font-size: 13px; margin: 0; }
.pool-wizard-more { font-size: 13px; color: var(--muted); }
.pool-wizard-more summary { cursor: pointer; color: var(--text); font-weight: 500; }
.pool-disks-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.window.onboard[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.onb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px 4px; }
.onb-top .link-btn { font-size: 14px; color: var(--muted); }
.onb-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; }
.onb-dots li { width: 8px; height: 8px; border-radius: 4px; background: var(--glass-line); transition: width .25s ease, background .25s ease; }
.onb-dots li.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.onb-dots li.now { width: 26px; background: var(--accent); }
.onb-body { padding: 12px 32px 8px; overflow: auto; overscroll-behavior: contain; }
.onb-body h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin: 6px 0 6px; }
.onb-body .lead { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.onb-step { animation: onb-in .25s ease-out; }
.onb-step.back { animation-name: onb-in-back; }
@keyframes onb-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes onb-in-back { from { opacity: 0; transform: translateX(-18px); } }
.onb-hero { width: 64px; height: 64px; border-radius: 19px; background: var(--accent); display: grid; place-items: center; margin: 8px 0 14px; box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent); }
.onb-hero svg { width: 34px; height: 34px; fill: var(--accent-ink); }
.onb-hero.line svg { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 30px; height: 30px; }
.onb-body .form { max-width: 440px; }
.onb-body .pool-form-wizard { max-width: 520px; }
.onb-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px 20px; border-top: 1px solid var(--glass-line); }
.onb-spacer { flex: 1; }
.onb-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.onb-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); font-size: 14px; }
.onb-list li .grow { flex: 1; min-width: 0; }
.onb-list li .ok-mark { color: var(--ok); font-weight: 700; }
.onb-list li .no-mark { color: var(--muted); }
.pw-meter { height: 6px; border-radius: 3px; background: var(--glass-line); overflow: hidden; margin-top: 2px; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s ease, background .2s ease; }
.pw-meter[data-score="2"] span { background: var(--warn); } .pw-meter[data-score="3"] span, .pw-meter[data-score="4"] span { background: var(--ok); }
.onb-next-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.onb-next-links button { text-align: left; padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); color: var(--text); font: inherit; cursor: pointer; display: grid; gap: 2px; }
.onb-next-links button:hover { background: var(--glass-hover); }
.onb-next-links b { font-size: 14px; } .onb-next-links span { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .onb-body { padding: 8px 18px; } .onb-foot { padding: 12px 16px 16px; gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .onb-step, .onb-dots li { animation: none; transition: none; } }

/* ---- software update */
.has-dot { position: relative; }
.nav-dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--glass-strong); pointer-events: none; }
.nav-count {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--bad); color: var(--badge-ink); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--glass-strong); pointer-events: none;
}
.note-backdrop { position: fixed; inset: 0; z-index: 54; background: rgba(5, 10, 20, .35); }
.note-side {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(380px, 100%);
  display: flex; flex-direction: column; gap: 12px;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: var(--glass-strong); border-left: 1px solid var(--glass-line); box-shadow: var(--shade);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
}
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-head h2 { font-size: 18px; font-weight: 600; }
.note-list { overflow: auto; display: grid; gap: 8px; align-content: start; min-height: 0; }
.note-item {
  display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 10px; align-items: start;
  width: 100%; text-align: left; border: 1px solid var(--glass-line); background: var(--glass);
  border-radius: 14px; padding: 12px; color: inherit; font: inherit; cursor: pointer;
}
.note-item:hover { background: var(--glass-hover); }
.note-mark { grid-column: 1; grid-row: 1; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--warn); }
.note-item.bad .note-mark { background: var(--bad); }
.note-item.info .note-mark { background: var(--accent); }
.note-item b { grid-column: 2; grid-row: 1; font-size: 14px; font-weight: 600; }
.note-detail { grid-column: 2; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.tab-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: var(--badge-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.upd-card { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); margin: 4px 0 14px; flex-wrap: wrap; }
.upd-card.new { border-color: var(--accent); }
.upd-logo { width: 52px; height: 52px; border-radius: 15px; background: var(--accent); display: grid; place-items: center; flex: none; }
.upd-logo svg { width: 28px; height: 28px; fill: var(--accent-ink); }
.upd-card .upd-text { flex: 1; min-width: 200px; }
.upd-card b { font-size: 17px; display: block; margin-bottom: 2px; }
.upd-error { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--bad); color: var(--text); background: var(--glass); margin-bottom: 14px; font-size: 14px; }
.notes { border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); padding: 16px 18px; margin: 10px 0; }
.notes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.notes-head h3 { font-size: 16px; font-weight: 600; margin: 0; }
.md { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.md h4, .md h5, .md h6 { font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
.md p { margin: 0 0 8px; color: var(--text); }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--glass-strong); }
.md pre { background: var(--glass-strong); padding: 10px 12px; border-radius: 10px; overflow-x: auto; margin: 0 0 8px; }
.md pre code { padding: 0; background: none; }
.md a { color: var(--accent); }
.md hr { border: 0; border-top: 1px solid var(--glass-line); margin: 10px 0; }
.upd-how { font-size: 14px; }
.upd-how pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; background: var(--glass-strong); padding: 10px 12px; border-radius: 10px; overflow-x: auto; margin: 6px 0; }
/* progress of Update now */
.upd-run { padding: 20px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); display: grid; gap: 12px; }
.upd-run.ok { border-color: var(--ok); } .upd-run.bad { border-color: var(--bad); }
.upd-run-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.upd-run-head b { font-size: 17px; }
.upd-run p { margin: 0; }
.upd-bar { height: 10px; border-radius: 5px; background: var(--glass-strong); overflow: hidden; border: 1px solid var(--glass-line); }
.upd-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s ease; }
.upd-run.bad .upd-bar span { background: var(--bad); }
.upd-run:not(.ok):not(.bad) .upd-bar span { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-ink) 25%, transparent), transparent); background-size: 60px 100%; animation: upd-shine 1.2s linear infinite; }
@keyframes upd-shine { from { background-position: -60px 0; } to { background-position: 260px 0; } }
.upd-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.upd-steps li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--glass-line); color: var(--muted); }
.upd-steps li.now { border-color: var(--accent); color: var(--text); font-weight: 600; }
.upd-steps li.done { color: var(--ok); }
.upd-steps li.done::before { content: '✓ '; }
@media (prefers-reduced-motion: reduce) { .upd-bar span { transition: none; animation: none !important; } }
details.upd-older summary { cursor: pointer; font-weight: 600; margin: 14px 0 4px; }

/* ---- date and time */
.dt-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); margin: 12px 0; }
.dt-clock { font-size: 28px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dt-form { max-width: 460px; }
.dt-form [data-dt] { display: grid; gap: 6px; }
.dt-form [data-dt][hidden] { display: none; }

/* ---- setting up two-step verification */
.mfa-state { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); margin: 12px 0; }
.mfa-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.mfa-state.on .dot { background: var(--ok); }
.mfa-state div { flex: 1; min-width: 0; }
.mfa-setup { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin: 12px 0; }
.mfa-qr { padding: 10px; background: var(--qr-bg); border-radius: 14px; line-height: 0; }
.mfa-qr svg { width: 180px; height: 180px; }
.mfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.mfa-secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--glass); padding: 6px 8px; border-radius: 8px; display: inline-block; margin-top: 4px; cursor: copy; border: 1px solid var(--glass-line); color: var(--text); }
.mfa-code { width: 150px !important; flex: none !important; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .2em; }
.recovery-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; padding: 14px 18px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); font: 15px/1.6 ui-monospace, "SF Mono", Menlo, monospace; list-style: none; margin: 10px 0; }
@media (max-width: 560px) { .mfa-setup { grid-template-columns: 1fr; justify-items: center; } .recovery-list { grid-template-columns: 1fr; } }
.form-error { color: var(--bad) !important; min-height: 1.3em; margin: 0 !important; font-size: 14px; }

/* ---- notifications */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 11px 16px; border-radius: 14px; background: var(--glass-strong); font-size: 14px; animation: pop .2s ease-out; }
.toast.bad { border-color: var(--bad); }

/* ---- phone: the bar moves to the bottom. Above this, labels ease shut on their own. */
@media (max-width: 880px) {
  .topbar {
    flex-wrap: wrap; position: sticky; top: 0; z-index: 40; overflow: visible;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--body-bg) 78%, transparent);
    filter: none; transform: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .topbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  }
  .spot { flex: 1 1 100%; max-width: none; order: 3; }
  .brand { flex: 1 1 auto; order: 1; }
  .brand-name { display: unset; }
  .top-actions { margin-left: auto; order: 2; }
  .topnav {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%; z-index: 42; margin-left: 0;
    flex: none; justify-content: stretch; gap: 0; order: 4;
    padding: 4px 4px max(6px, env(safe-area-inset-bottom, 0px));
    padding-left: max(4px, env(safe-area-inset-left, 0px));
    padding-right: max(4px, env(safe-area-inset-right, 0px));
    background: var(--glass-strong); border-top: 1px solid var(--glass-line);
    backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .nav-btn {
    flex: 1 0 auto; flex-direction: column; gap: 2px; min-width: 52px; min-height: 48px;
    padding: 6px 4px; border-radius: 12px; font-size: 0.72rem; font-weight: 600;
  }
  .topnav .nav-btn span {
    position: static; width: auto; height: auto; margin: 0; padding: 0; opacity: 1;
    clip: unset; clip-path: none;
    display: block; max-width: 5.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15;
  }
  .nav-btn svg { width: 20px; height: 20px; }
  .top-actions .nav-btn { flex-direction: row; min-width: 40px; min-height: 40px; padding: 8px; }
  .desk, .page { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .spot-kbd { display: none; }
  .spot-panel { max-height: min(60vh, calc(100dvh - 9rem)); left: 0; right: 0; }
  .field, .search input, .spot-bar input, .login input:not([type="checkbox"]), select.field, textarea.field { font-size: 16px; }
  .desk { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
  .desk:not(.no-widgets) #widgets:not([hidden]) { display: contents; }
  .widget-slot[data-widget="clock"] { order: 0; }
  .apps-area { min-width: 0; order: 1; }
  #widgets > .widget-slot:not([data-widget="clock"]) { order: 2; }
  .app-grid.home-mix { --home-row: 54px; }
  .home-widget .clock { font-size: 26px; }
  .home-widget.wide .clock { font-size: 32px; }
  .home-widget.xl .clock { font-size: 36px; }
  .apps-tools, .search, #filters { width: 100%; } .search input { width: 100%; }
  .pop-body > .store-page { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .store-side { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--glass-line); overflow-x: auto; padding: 8px; }
  .store-side .btn { margin-top: 0; }
  .store-chips { flex-direction: row; }
  .store-chips button { width: auto; white-space: nowrap; border-radius: 999px; padding: 6px 12px; }
  #filters { overflow-x: auto; scrollbar-width: none; } #filters button { flex: 1; padding: 8px 8px; white-space: nowrap; }
  .view-seg { width: auto; flex: none; }
  .window.settings-win { height: min(92vh, 92dvh); }
  .window.settings-win[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .set-side { flex-direction: row; padding: 10px; border-right: 0; border-bottom: 1px solid var(--glass-line); overflow-x: auto; scrollbar-width: none; }
  .set-side-title { display: none; }
  .set-side a { flex: none; }
  .window.onboard { width: min(720px, calc(100vw - 16px)); height: min(700px, 92dvh); }
  .folder-panel { width: min(620px, calc(100vw - 16px)); max-height: min(70vh, calc(100dvh - 8rem)); }
}
@media (min-width: 561px) {
  .app-grid.home-mix { --home-row: 60px; }
}
@media (max-width: 560px) {
  .host, .demo-badge { display: none; }
  .clock { font-size: clamp(44px, 14vw, 64px); }
  .home-widget .clock { font-size: 26px; }
  .home-widget.wide .clock { font-size: 32px; }
  .home-widget.xl .clock { font-size: 36px; }
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 12px 4px; }
  .window, .window.win-wide, .window.file-win, .window.pop-win, .window.settings-win, .window.onboard, .window.console-win {
    width: 100vw; max-width: 100vw; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 24px 24px 0 0;
  }
  .win-head { padding: 14px 14px 10px 16px; }
  .win-body { padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .kv { grid-template-columns: 1fr; gap: 0 0; } .kv dd { margin-bottom: 8px; }
  .rows li { grid-template-columns: 1fr; }
  .rows .row-side { text-align: left; }
  .center-screen { padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .login-card { padding: 24px 18px 20px; }
  .rights { display: block; overflow-x: auto; }
  .bays-cfg { flex-wrap: wrap; }
  .bays-cfg .fld { width: 100%; }
  .folder-panel { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); left: 8px; right: 8px; width: auto;
    transform: none; max-height: calc(100dvh - 10rem); border-radius: 22px; }
  .folder-panel:not([hidden]) { animation: none; }
  .page-title h1 { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); }
  .sys-grid { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- console: a VM's screen (console.html) */
.console-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--body-bg); }
.console-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--glass-strong); border-bottom: 1px solid var(--glass-line); flex-wrap: wrap; }
.console-bar .back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.console-bar .btn.sm.back { width: 32px; padding: 0; display: grid; place-items: center; }
.console-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-title .pill { margin-left: 6px; }
.console-tools .btn[aria-pressed="true"] { border-color: var(--accent); }
.console-typebar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--glass); border-bottom: 1px solid var(--glass-line); }
.console-typebar .field { flex: 1; min-width: 0; }
.console-screen { flex: 1; min-height: 0; position: relative; background: var(--screen-bg); overflow: hidden; display: grid; place-items: center; }
.console-screen > div { width: 100%; height: 100%; } /* noVNC scales and scrolls within this area itself */
.console-screen > canvas { max-width: 100%; max-height: 100%; outline: none; } /* simulated screen in the demo */
.console-status { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 20px; border-radius: 18px;
  background: var(--glass-strong); box-shadow: var(--shade); text-align: center; display: grid; gap: 14px; justify-items: center; }
@media (max-width: 560px) { .console-tools { width: 100%; } .console-typebar { flex-wrap: wrap; } }

/* ---- disk bays in the storage window */
.bays-sec { margin-top: 6px; }
.bays-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.bays-head h3 { margin: 0 !important; }
.bays-cfg { display: flex; gap: 12px; margin-bottom: 8px; }
.bays-cfg .fld { width: 130px; }
.nas { width: fit-content; max-width: 100%; overflow-x: auto; margin-top: 10px; padding: 12px 14px 16px; border-radius: 10px; color: var(--nas-ink);
  background: linear-gradient(180deg, var(--nas-body), var(--nas-body-2)); border: 1px solid var(--nas-edge);
  box-shadow: var(--shade), inset 0 1px 0 rgba(255, 255, 255, .25); }
.nas-top { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.nas-name { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--nas-ink-2); }
.nas-power .led { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
/* Drawers have a fixed size, like real drawers: if the case doesn't fit, you scroll through it instead of them shrinking. */
.bay-grid { display: grid; grid-template-columns: repeat(var(--bay-cols, 4), 70px); gap: 5px; width: max-content; }
.bay { display: block; padding: 0; border: 0; border-radius: 4px; background: var(--nas-slot); color: inherit; font: inherit; text-align: left;
  height: 218px; cursor: default; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55); }
.bay[draggable="true"], .bay-chip { cursor: grab; }
/* the drawer itself */
.tray { position: relative; display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 6px 5px 26px; border-radius: 3px;
  background: linear-gradient(180deg, var(--nas-tray), var(--nas-tray-2)); border: 1px solid var(--nas-tray-edge); color: var(--nas-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 2px 4px rgba(0, 0, 0, .25); }
.tray-top { display: flex; align-items: center; justify-content: space-between; }
.bay-no { font-size: 11px; font-weight: 700; color: var(--nas-ink-2); font-variant-numeric: tabular-nums; }
.led { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.ok .tray-leds .led { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.warn .tray-leds .led { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.bad .tray-leds .led, .missing .tray-leds .led { background: var(--bad); box-shadow: 0 0 7px var(--bad); }
.tray-vents { height: 24%; min-height: 34px; border-radius: 2px; flex: none;
  background: repeating-linear-gradient(90deg, var(--nas-vent) 0 3px, transparent 3px 6px); opacity: .9; }
.tray-info { display: grid; gap: 1px; min-width: 0; }
.bay-name { font-weight: 700; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bay-sub { font-size: 10.5px; color: var(--nas-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-tags { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin-top: auto; min-width: 0; }
.tray-handle { position: absolute; left: 14%; right: 14%; bottom: 7px; height: 9px; border-radius: 2px;
  background: var(--nas-slot); opacity: .55; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.missing .tray { border-color: var(--bad); }
/* empty bay: recessed opening */
.slot-hole { display: flex; flex-direction: column; height: 100%; padding: 6px 5px; border-radius: 4px;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 9px); }
.slot-hole .bay-no { color: var(--led-off); }
.bay-empty { margin: auto; font-size: 11px; color: var(--led-off); text-align: center; }
.bay.over, .bay-pool.over, .bay-pool.droppable { outline: 2px solid var(--accent); outline-offset: 2px; }
.bay.picked, .bay-chip.picked { outline: 2px solid var(--accent); outline-offset: 2px; }
.bay.dragging, .bay-chip.dragging { opacity: .45; }
/* labels */
.tag { display: inline-flex; align-items: center; height: 17px; padding: 0 4px; border-radius: 3px; font-size: 10px; font-weight: 600;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--nas-ink-2); background: var(--track); }
.tag.pool { color: var(--tag-c); background: color-mix(in srgb, var(--tag-c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-c) 35%, transparent); }
.tag.p1 { --tag-c: var(--pool-1); } .tag.p2 { --tag-c: var(--pool-2); } .tag.p3 { --tag-c: var(--pool-3); } .tag.p4 { --tag-c: var(--pool-4); } .tag.p5 { --tag-c: var(--pool-5); }
.tag.temp.ok { color: var(--ok); } .tag.temp.warn { color: var(--warn); } .tag.temp.bad { color: var(--bad); }
.bay-led { width: 8px; height: 8px; border-radius: 50%; background: var(--led-off); flex: none; }
.bay-chip.ok .bay-led { background: var(--ok); } .bay-chip.warn .bay-led { background: var(--warn); } .bay-chip.bad .bay-led { background: var(--bad); }
.bay-pool { margin-top: 12px; padding: 10px; border-radius: 12px; border: 1px dashed var(--glass-line); }
.bay-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bay-chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 6px 10px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-line); font-size: 13px; color: inherit; }
@media (max-width: 560px) { .nas { padding: 10px; } }

/* ---- creating a pool */
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.layout-grid-simple { grid-template-columns: 1fr; gap: 10px; }
.layout-simple { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 16px; }
.layout-simple .layout-simple-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.layout-simple .layout-simple-head .pill { font-size: 11px; font-weight: 600; }
.pool-beginner-intro { margin: 6px 0 4px; line-height: 1.45; }
.pool-form-beginner .fld-row { grid-template-columns: 1fr; }
.layout { position: relative; display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); cursor: pointer; }
.layout input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layout.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.layout:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.layout.short > span:last-child { color: var(--warn); }
.pool-sum { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); }
.pool-big b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.pool-big span { color: var(--muted); }
.pool-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--track); }
.pool-bar span, .pool-legend i { display: block; }
.pool-bar .u, .pool-legend i.u { background: var(--accent); }
.pool-bar .r, .pool-legend i.r { background: var(--faint); }
.pool-bar .x, .pool-legend i.x { background: var(--warn); }
.pool-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pool-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pool-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ---- the case, with the disk's details underneath */
.bays-wrap { display: flex; justify-content: center; }
#bayHint { text-align: center; margin-top: 8px; }
.bays-wrap .nas { flex: none; }
.disk-panel { width: 100%; min-width: 0; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-line); }
.disk-panel h4 { margin: 0; font-size: 15px; }
.dp-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.dp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dp-kv { font-size: 13px; }
.dp-sub { font-size: 13px !important; margin: 14px 0 6px !important; }
.dp-watch, .dp-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.dp-watch li, .dp-tests li { display: flex; justify-content: space-between; gap: 10px; }
.dp-tests li { justify-content: flex-start; } .dp-tests li span:first-child { flex: 1; }
.dp-attrs { margin-top: 12px; min-width: 0; max-width: 100%; }
.attr-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.attr-list li { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--glass-line); min-width: 0; }
.attr-name { overflow-wrap: anywhere; }
.attr-name .muted { margin-right: 6px; font-variant-numeric: tabular-nums; }
.attr-vals { display: flex; flex-wrap: wrap; gap: 2px 12px; font-variant-numeric: tabular-nums; }
.attr-vals i { font-style: normal; color: var(--muted); margin-right: 4px; }
.attr-vals span { overflow-wrap: anywhere; min-width: 0; }
.bay[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.bay[aria-pressed] { cursor: pointer; }
.link-btn { border: 0; padding: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---- M.2 slots under the bays */
/* Fixed width (like an M.2 2280): more bays per row makes the case wider, not the NVMe longer. */
.m2-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nas-edge);
  contain: inline-size; } /* the bays determine the width of the case; the slots continue on the next line */
.nas:has(.m2-row) { min-width: min(100%, 330px); }
.m2 { flex: none; width: 290px; max-width: 100%; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; min-width: 0; cursor: default; }
.m2[aria-pressed] { cursor: pointer; }
.m2[draggable="true"] { cursor: grab; }
.m2-label { font-size: 10px; font-weight: 700; color: var(--nas-ink-2); letter-spacing: .04em; }
.m2-empty { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 4px; font-size: 11px; color: var(--led-off);
  background: var(--nas-slot); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5); }
.m2-stick { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; min-width: 0; padding: 0 22px 0 14px; border-radius: 3px;
  background: linear-gradient(180deg, var(--m2-pcb), var(--m2-pcb-2)); color: var(--m2-ink); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.m2-gold { position: absolute; left: 0; top: 6px; bottom: 6px; width: 7px; border-radius: 1px;
  background: repeating-linear-gradient(180deg, var(--m2-gold) 0 3px, transparent 3px 5px); }
.m2-chip { flex: none; width: 26px; height: 26px; border-radius: 2px; background: var(--m2-chip); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.m2-info { display: grid; min-width: 0; flex: 1; }
.m2-info .bay-sub { color: var(--m2-ink-2); }
.m2-tags { display: flex; gap: 3px; flex: none; }
.m2 .tray-leds { position: absolute; right: 9px; top: 7px; }
.m2-notch { position: absolute; right: 0; top: 50%; width: 9px; height: 12px; margin-top: -6px; border-radius: 6px 0 0 6px; background: var(--nas-body-2); }
.m2[aria-pressed="true"] .m2-stick, .m2.picked .m2-stick, .m2.over .m2-empty, .m2.over .m2-stick { outline: 2px solid var(--accent); outline-offset: 2px; }
.m2.dragging { opacity: .45; }
.ok .m2-stick .led, .m2.ok .led { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.m2.warn .led { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.m2.bad .led, .m2.missing .led { background: var(--bad); box-shadow: 0 0 7px var(--bad); }

/* ---- 2.5" slots: horizontal, narrow drawers for SATA SSDs */
.sff-row { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nas-edge); contain: inline-size; }
.sff { flex: none; width: 214px; max-width: 100%; height: 46px; padding: 0; border: 0; border-radius: 4px; background: var(--nas-slot); color: inherit; font: inherit;
  text-align: left; cursor: default; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55); }
.sff[aria-pressed] { cursor: pointer; }
.sff[draggable="true"] { cursor: grab; }
.sff-tray { position: relative; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 22px 0 7px; border-radius: 3px;
  background: linear-gradient(180deg, var(--nas-tray), var(--nas-tray-2)); border: 1px solid var(--nas-tray-edge); color: var(--nas-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 2px 4px rgba(0, 0, 0, .25); }
.sff-hole { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 7px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 9px); }
.sff-no { flex: none; width: 12px; font-size: 10px; font-weight: 700; color: var(--nas-ink-2); font-variant-numeric: tabular-nums; }
.sff-hole .sff-no { color: var(--led-off); }
.sff-empty { font-size: 11px; color: var(--led-off); }
.sff-vents { flex: none; width: 16px; height: 30px; border-radius: 2px; background: repeating-linear-gradient(180deg, var(--nas-vent) 0 2px, transparent 2px 4px); }
.sff-info { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.sff-tags { display: flex; gap: 3px; flex: none; }
.sff .tray-leds { position: absolute; right: 8px; top: 7px; }
.sff-handle { position: absolute; right: 6px; top: 18px; bottom: 7px; width: 6px; border-radius: 2px; background: var(--nas-slot); opacity: .55; }
.sff.ok .led { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.sff.warn .led { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.sff.bad .led, .sff.missing .led { background: var(--bad); box-shadow: 0 0 7px var(--bad); }
.sff.missing .sff-tray { border-color: var(--bad); }
.sff[aria-pressed="true"], .sff.picked, .sff.over { outline: 2px solid var(--accent); outline-offset: 2px; }
.sff.dragging { opacity: .45; }

/* ---- console: clipboard and window */
.paste-sink { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
.console-clip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--glass); border-bottom: 1px solid var(--glass-line); font-size: 14px; }
.console-clip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-bar .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* console in a MajaOS window */
.window.console-win { width: min(1240px, calc(100vw - 24px)); height: min(860px, 90vh, 90dvh); max-height: none; }
.window.console-win[open] { display: flex; }
.console-win iframe { flex: 1; width: 100%; border: 0; background: var(--screen-bg); }

/* ---- dragging apps and widgets on the home screen */
.app, .widget-slot { user-select: none; -webkit-user-select: none; }
.app-grid img, .widget img { -webkit-user-drag: none; user-select: none; }
.app.dragging, .home-widget.dragging, .widget-slot.dragging { opacity: .35; pointer-events: none; }
.app.dragging .app-icon { animation: none !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; transform-origin: top left; opacity: .95;
  overflow: hidden; border-radius: 22px; box-shadow: 0 22px 34px -12px rgba(0, 0, 0, .6); }
/* holding above an app: it grows and gets a frosted-glass border, as a sign that a folder is coming */
.app-grid .app-icon { transition: scale .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s; }
.app.merge .app-icon { scale: 1.16; box-shadow: 0 0 0 8px var(--folder-ring), 0 14px 26px -12px rgba(0, 0, 0, .55); animation-play-state: paused; }
/* folder tile: frosted glass with a 3 × 3 grid of small icons, like on an iPad */
.folder-icon { place-items: stretch; align-content: stretch; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 4px; padding: 8px; background: var(--folder-bg); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.folder-icon .mini { position: relative; display: grid; place-items: center; min-width: 0; border-radius: 4px; overflow: hidden;
  font-size: 9px; font-weight: 700; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.folder-icon .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 1.5px; }
.folder-icon .mini svg { width: 68%; height: 68%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .app-icon.bump { animation: bump .45s cubic-bezier(.2, .8, .2, 1) !important; }
  .app-icon.pop-in { animation: pop-in .4s cubic-bezier(.2, 1.4, .4, 1) !important; }
  .folder-panel:not([hidden]) { animation: folder-open .28s cubic-bezier(.2, .9, .25, 1); }
  .folder-overlay:not([hidden]) { animation: fade .2s ease-out; }
}
@keyframes bump { 0% { scale: 1; } 40% { scale: 1.18; } 100% { scale: 1; } }
@keyframes pop-in { from { scale: .4; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes folder-open {
  from { opacity: 0; transform: translate(calc(-50% + var(--from-x, 0px)), calc(-50% + var(--from-y, 0px))) scale(.2); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
/* the panel of an open folder */
.folder-overlay { position: fixed; inset: 0; z-index: 48; background: rgba(5, 10, 20, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.folder-overlay.drop-out { background: rgba(5, 10, 20, .2); outline: 3px dashed var(--accent); outline-offset: -12px; }
.folder-panel { position: fixed; z-index: 49; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100vw - 24px));
  max-height: min(80vh, 720px); overflow: auto; padding: 18px 20px 14px; border-radius: 28px; background: var(--glass-strong);
  border: 1px solid var(--glass-line); box-shadow: var(--shade); backdrop-filter: blur(28px) saturate(1.3); -webkit-backdrop-filter: blur(28px) saturate(1.3); }
.folder-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.folder-name { flex: 1; min-width: 0; font: inherit; font-size: 22px; font-weight: 700; text-align: center; border: 0; border-radius: 10px; padding: 4px 8px;
  background: transparent; color: var(--text); }
.folder-name:hover, .folder-name:focus { background: var(--track); outline: none; }
.folder-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }

/* ---- terminal on the server (terminal.html) */
.term-screen { display: block; padding: 8px 10px; background: var(--term-bg); }
.term-screen .xterm { height: 100%; }
.terminal-page .console-status .inline-form { width: 100%; }
.terminal-page .console-status .field { flex: 1; min-width: 0; }
.sec-confirm { margin-top: 12px; }

/* ---- shared folders */
.share-access { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.share-addr { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.files-page { max-width: none; display: flex; flex-direction: column; min-height: 0; }
.finder {
  flex: 1; min-height: min(720px, calc(100dvh - 132px));
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 18px; overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: var(--shade);
}
.files-side { padding: 14px 10px; overflow: auto; border-right: 1px solid var(--glass-line); background: color-mix(in srgb, var(--glass) 70%, transparent); }
.files-side-group + .files-side-group { margin-top: 14px; }
.files-side-title { margin: 2px 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.files-side-row { display: flex; align-items: stretch; border-radius: 8px; }
.files-side-row > button[data-files-share] { flex: 1; min-width: 0; width: auto; }
.files-side-row > button[data-files-share] span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-side .files-eject { flex: none; width: 34px; padding: 0; display: flex; align-items: center; justify-content: center; }
.files-side button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; cursor: pointer;
}
.files-side button svg { width: 16px; height: 16px; flex: none; fill: var(--accent); }
.files-side button svg.stroke { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.files-side-row:hover { background: var(--glass-hover); }
.files-side-row.is-current { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.files-side-row.is-current:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.files-side-row > button:hover,
.files-side-row > button[aria-current="page"] { background: transparent; }
.files-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.files-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.files-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--glass-line); }
.files-actions { display: flex; flex: none; gap: 8px; margin-left: auto; }
.files-actions .btn { flex: none; }
.files-actions .btn[hidden] { display: none; }
.files-check { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.files-cap { display: flex; align-items: flex-start; justify-content: center; gap: 6px; max-width: 100%; }
.files-tick { width: 28px; }
.files-hit, .files-name-btn { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.files-name-btn { min-width: 0; text-align: inherit; }
.files-table .files-name-btn { display: block; width: 100%; text-align: left; }
.files-hist { display: flex; gap: 4px; }
.files-crumb { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; font-size: 13px; min-width: 0; flex: 1; }
.files-crumb button { background: none; border: 0; color: var(--text); cursor: pointer; padding: 2px 4px; font: inherit; border-radius: 6px; }
.files-crumb button:hover { background: var(--glass-hover); }
.files-crumb span { color: var(--muted); }
.files-filter { height: 34px; }
.files-filter input { width: 140px; }
.files-new { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 8px 12px; align-items: center; border-bottom: 1px solid var(--glass-line); }
.files-new .field { flex: 1; min-width: 160px; }
.files-stage { position: relative; flex: 1; overflow: auto; padding: 8px 12px 16px; outline: none; }
.files-stage.is-over::after {
  content: attr(data-drop); position: absolute; inset: 8px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, var(--glass-strong)); border: 2px dashed var(--accent);
  border-radius: 12px; color: var(--text); font-weight: 600; pointer-events: none; z-index: 2;
}
.files-empty { margin: 48px 16px; text-align: center; color: var(--muted); }
.files-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.files-icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%;
  padding: 10px 6px 8px; border: 0; border-radius: 12px; background: transparent; color: inherit;
  font: inherit; cursor: pointer; text-align: center;
}
.files-icon:hover { background: var(--glass-hover); }
.files-icon.is-sel, .files-table tr.is-sel td { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.files-glyph { width: 58px; height: 48px; }
.files-glyph.dir { fill: var(--accent); }
.files-glyph.file { fill: var(--muted); }
.files-icon .files-name, .files-table .files-name {
  font-size: 12px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.files-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.files-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; position: sticky; top: 0; background: var(--glass-strong); }
.files-table td { padding: 6px 8px; border-top: 1px solid var(--glass-line); vertical-align: middle; }
.files-table tbody tr { cursor: pointer; }
.files-table tbody tr:hover td { background: var(--glass-hover); }
.files-table .files-glyph { width: 22px; height: 18px; display: block; }
.files-meta { color: var(--muted); white-space: nowrap; }
.files-status { padding: 6px 14px 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--glass-line); }
@media (max-width: 760px) {
  .finder { grid-template-columns: 1fr; grid-template-rows: auto minmax(240px, 1fr); min-height: 0; }
  .pop-body .finder { grid-template-rows: auto minmax(0, 1fr); }
  .files-side { display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--glass-line); padding: 8px; }
  .files-side-group { display: flex; gap: 4px; }
  .files-side-group + .files-side-group { margin-top: 0; }
  .files-side-title { display: none; }
  .files-side button { width: auto; white-space: nowrap; }
  .files-filter input { width: 100%; }
}
.access-table { display: grid; gap: 6px; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; background: var(--glass); }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
@media (max-width: 560px) { .access-row { grid-template-columns: 1fr; } }
.win-body > .bays-head:first-child, .win-body > .pane-title:first-child { margin-top: 4px; }

/* ---- customising widgets: order and hiding */
.widget-slot { position: relative; }
.widgets.editing .widget { pointer-events: none; }
.widgets.editing .widget-slot { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.widgets.editing .widget-slot .widget { outline: 1.5px dashed var(--glass-line); outline-offset: -1px; }
.widget-slot.is-hidden { display: none; }
.widget-slot.lifting { z-index: 5; }
.widget-slot.lifting .widget { box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .55); transform: scale(1.02); }
.widget-ctl { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; z-index: 4; opacity: 0; pointer-events: none; }
.widget-slot:hover > .widget-ctl, .widget-slot:focus-within > .widget-ctl { opacity: 1; pointer-events: auto; }
@media (hover: none) { .widget-ctl { opacity: 1; pointer-events: auto; } }
.widget-ctl button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--glass-line);
  background: var(--glass-strong); color: var(--text); cursor: pointer; }
.widget-ctl button:hover { background: var(--glass-hover); }
.widget-ctl button[disabled] { opacity: .35; cursor: default; }
.widget-ctl svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.widget-ctl .eye[aria-pressed="false"] { color: var(--muted); }
/* shared folders in a widget */
.share-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.share-mini li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 10px; font-size: 14px; min-width: 0; }
.share-mini .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.share-mini .muted { white-space: nowrap; }
.home-widget[data-w="2"] .share-mini { font-size: 13px; }
.home-widget[data-w="2"] .share-mini .muted { font-size: 12px; }
.vm-mini-name { flex: 1; min-width: 0; }
/* IP addresses of VMs */
.vm-ip { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vm-ip b { color: var(--text); font-weight: 600; }
.widgets.editing .widget-head > :not(h2) { visibility: hidden; } /* room for the little buttons */
.field.sm { height: 32px; min-width: 150px; font-size: 13px; border-radius: 9px; flex: 0 1 auto; }

/* ---- backups */
.bk-providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.bk-providers .store-card { width: 100%; border: 1px solid var(--glass-line); }
.bk-providers .store-card > span { display: grid; gap: 3px; }
.bk-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.bk-steps code, .bk-steps + p code { overflow-wrap: anywhere; }
.bk-steps .field { width: 100%; }
.rows .bk-steps li { display: list-item; padding: 0; background: none; border: 0; }
.bk-browse { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--glass-line); background: var(--glass); display: grid; gap: 10px; }
.bk-browse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk-browse-head b { margin-right: auto; overflow-wrap: anywhere; }
.bk-dirs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; }
.logs .err { color: #ff9e93; }
.bk-code { font-size: 26px; letter-spacing: .14em; }
.bk-secret-val { font-size: 17px; justify-self: start; padding: 6px 10px; user-select: all; overflow-wrap: anywhere; }
@media (max-width: 560px) { .bk-rows > li { grid-template-columns: 1fr; } .bk-rows .row-side { justify-content: flex-start; } }

/* ---- power */
.power-win { width: min(440px, calc(100vw - 32px)); }
.power-body { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 28px 24px; }
.power-body h2 { font-size: 19px; font-weight: 600; }
.power-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--accent); animation: power-spin 1s linear infinite; }
@keyframes power-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .power-spin { animation-duration: 3s; } }

/* ---- users and groups */
.rights { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 10px; }
.rights th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--glass-line); }
.rights td { padding: 6px 8px; border-bottom: 1px solid var(--glass-line); vertical-align: middle; }
.rights tr:last-child td { border-bottom: 0; }
.rights .field { height: 32px; min-width: 0; width: 100%; font-size: 13.5px; }
.rights .via { color: var(--muted); font-size: 12.5px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.user-edit { grid-column: 1 / -1; padding-top: 4px; }
@media (max-width: 560px) { .rights th:nth-child(3), .rights td:nth-child(3) { display: none; } }

/* ---- installing apps: advanced */
.adv-switch { align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); }
.adv-switch input { margin-top: 2px; }
.adv-switch > span { display: grid; gap: 2px; }
.adv-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.adv-bar .seg button[disabled] { opacity: .45; cursor: not-allowed; }

/* Progress of an installation */
.job .job-bar { height: 10px; margin: 4px 0 0; }
.job .progress-note { font-variant-numeric: tabular-nums; }
.job-log { margin-top: 10px; }
.job-log summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 4px 0; }
.job-log summary:hover { color: var(--text); }
.job-log .logs { margin-top: 8px; white-space: pre; }
.job #jobBtns { margin-top: 14px; }

/* Software update > Debian */
.debian-box .check { margin: 4px 0; }
.deb-reboot { display: grid; gap: 6px; }
.deb-reboot .btn-row { margin-top: 2px; }
.deb-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.deb-job { margin-top: 10px; }
.deb-job .logs { margin-top: 6px; white-space: pre; }

/* An app being updated: the icon dims and a bar at the bottom fills up (instead of the pulse of other actions) */
.app.updating .app-icon img, .app.updating .app-icon { filter: saturate(.6); }
.app.updating .app-icon img { opacity: .55; }
.app-prog { position: absolute; left: 7px; right: 7px; bottom: 8px; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); overflow: hidden; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 2px 6px rgba(0, 0, 0, .35); }
.app-prog > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .6s ease; }

/* ---- apps as a list (Grid / List next to the filters) */
.view-seg button { display: grid; place-items: center; padding: 6px 10px; }
.view-seg svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.view-seg [data-view="list"] circle { fill: currentColor; stroke: none; }
.app-grid.app-list { display: flex; flex-direction: column; gap: 6px; }
.app-row {
  display: grid; grid-template-columns: minmax(200px, 2.2fr) minmax(110px, 1fr) minmax(140px, 1.6fr) minmax(70px, .8fr) auto;
  align-items: center; gap: 14px; padding: 8px 12px 8px 8px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-line);
}
.app-row:hover { border-color: var(--accent); }
.app-row .row-open { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; min-width: 0; border-radius: 12px; }
.app-row .row-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-row .app-icon { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; flex: none; }
.app-row .app-icon img { padding: 6px; }
.app-row .app-icon .dot { width: 12px; height: 12px; border-width: 2px; right: -3px; bottom: -3px; }
.app-row .app-icon .cut-badge { width: 16px; height: 16px; right: -4px; bottom: -4px; }
.app-row .app-icon .cut-badge svg { width: 10px; height: 10px; }
.app-row .app-icon .upd-badge { display: none; }
.app-row .app-prog { left: 4px; right: 4px; bottom: 4px; height: 5px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.app-row .row-name { display: grid; min-width: 0; }
.app-row .row-name b, .app-row .row-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .row-status { display: flex; gap: 6px; flex-wrap: wrap; }
.app-row .row-where { display: grid; min-width: 0; }
.app-row .row-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row .row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.app-row .app-more { position: static; opacity: 1; }
.app-row.stopped .app-icon { filter: grayscale(.85); opacity: .6; }
.app-row.busy .app-icon { animation: busy 1.2s ease-in-out infinite; }
@media (max-width: 760px) {
  .app-row { grid-template-columns: 1fr auto; }
  .app-row .row-where, .app-row .row-folder { display: none; }
  .app-row .row-status { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .app-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
