/* ============================================================
   Dan's Dashboard: liquid glass
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #080a0f;
  --text: #e9edf5;
  --text-2: #b0b8c9;
  --muted: #8790a4;
  --faint: #5d6578;

  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .07);
  --glass-3: rgba(255, 255, 255, .1);
  --stroke: rgba(255, 255, 255, .085);
  --stroke-2: rgba(255, 255, 255, .15);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .07);
  --blur: blur(24px) saturate(160%);

  --accent: #4f8ef7;
  --violet: #8b6cf7;
  --grad: linear-gradient(135deg, #4f8ef7 0%, #6f7cf7 55%, #8b6cf7 100%);
  --ok: #34d399;
  --warn: #f5b94a;
  --bad: #f87171;

  --r-panel: 20px;
  --r-ctl: 12px;

  --shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 18px 40px -18px rgba(0, 0, 0, .7);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(79, 142, 247, .38); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .22); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- ambient field: the light the glass bends ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #0f1626 0%, transparent 60%),
    var(--bg);
}
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.ambient span:nth-child(1) {
  width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax;
  background: radial-gradient(circle, #1f4fb8 0%, transparent 68%);
  animation: drift-a 38s ease-in-out infinite alternate;
}
.ambient span:nth-child(2) {
  width: 40vmax; height: 40vmax; right: -14vmax; top: 18vh;
  background: radial-gradient(circle, #4b2fa8 0%, transparent 68%);
  opacity: .42;
  animation: drift-b 44s ease-in-out infinite alternate;
}
.ambient span:nth-child(3) {
  width: 34vmax; height: 34vmax; left: 22vw; bottom: -22vmax;
  background: radial-gradient(circle, #0f5d8f 0%, transparent 70%);
  opacity: .32;
  animation: drift-a 52s ease-in-out infinite alternate-reverse;
}
@keyframes drift-a { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-7vmax, -5vmax, 0) scale(.94); } }

/* ---------- glass primitive ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: var(--r-panel);
  box-shadow: var(--hi), var(--shadow);
}

/* ---------- top bar ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 13, 20, .55);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--stroke);
}
.appbar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1180px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px max(28px, env(safe-area-inset-left));
}

.appbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.appbar-brand b { font-size: 15px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; }
.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 20px -8px rgba(79, 142, 247, .9);
}
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px 6px 8px;
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
}
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.back:hover { color: var(--text); }
.back:hover svg { transform: translateX(-2px); }

.appbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar-title h1 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.appbar-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c1, #4f8ef7), var(--c2, #8b6cf7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px -8px var(--c1, #4f8ef7);
}
.appbar-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.appbar .logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  transition: color .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.appbar .logout svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.appbar .logout:hover { color: var(--text); background: var(--glass-2); border-color: var(--stroke-2); }

/* which parts of the bar show depends on the view */
body[data-view="home"] .back,
body[data-view="home"] .appbar-title,
body:not([data-view="home"]) .appbar-brand { display: none; }
body:not([data-view="ps4"]) .subnav { display: none; }

.subnav svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .85;
}
.subnav { position: relative; }
.subnav button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  font-weight: 500;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.subnav button:hover { color: var(--text); background: none; box-shadow: none; }
.subnav button.active { color: var(--text); }
.subnav button.active svg { stroke: #8fb6ff; opacity: 1; }
.subnav button:active { transform: none; }

.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .06));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 14px -4px rgba(79, 142, 247, .45);
  pointer-events: none;
}
.ready > .nav-pill {
  transition: transform .42s var(--ease), width .42s var(--ease), height .42s var(--ease);
}
.nav-pill::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(79, 142, 247, .8);
}

/* PS4 module's sub-tabs: the segmented glass bar */
.subnav {
  display: inline-flex;
  max-width: 100%;
  gap: 2px;
  padding: 4px;
  margin-left: 6px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}
.subnav button { gap: 7px; padding: 7px 13px; border-radius: 10px; }
.subnav svg { width: 16px; height: 16px; }

h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
  margin: 0;
  white-space: nowrap;
}

h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 32px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

/* ---------- layout ---------- */

main {
  min-width: 0;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 28px;
}

.module, .tab { display: none; }
.module.active, .tab.active {
  display: block;
  animation: tab-in .42s var(--ease) both;
}
/* opening a module from the launcher zooms in a touch; going home settles back */
.module.active:not(#mod-home) { animation-name: module-in; }
@keyframes module-in {
  from { opacity: 0; transform: scale(.985) translateY(8px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes tab-in {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

.mod-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.row, .section-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.section-head.small, .row.small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 24px 0 10px;
}
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 12.5px; }

.chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chip:not(:empty) {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
}

code.path {
  font: 12px/1.4 var(--mono);
  color: var(--muted);
  font-weight: 400;
  word-break: break-all;
}
.section-head code.path:not(:empty) {
  padding: 5px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--stroke);
  min-width: 0;
}

/* ---------- buttons ---------- */

button {
  font: inherit;
  font-weight: 550;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .04));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--stroke-2);
  border-radius: var(--r-ctl);
  padding: 8px 16px;
  min-height: 36px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 8px -2px rgba(0, 0, 0, .4);
  transition: background .2s, border-color .2s, box-shadow .25s var(--ease), transform .15s var(--ease), color .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
button:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .06));
  border-color: rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 20px -6px rgba(79, 142, 247, .45);
}
button:active { transform: scale(.97); }
button:disabled {
  opacity: .38;
  cursor: default;
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  background: rgba(255, 255, 255, .04);
  border-color: var(--stroke);
}

button.primary {
  background: var(--grad);
  border-color: rgba(160, 190, 255, .45);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 20px -8px rgba(79, 142, 247, .8);
}
button.primary:hover {
  background: var(--grad);
  filter: brightness(1.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 28px -8px rgba(111, 124, 247, .95);
}
button.primary:disabled { filter: none; background: var(--grad); opacity: .45; }

button.danger {
  color: #fca5a5;
  background: rgba(248, 113, 113, .07);
  border-color: rgba(248, 113, 113, .22);
}
button.danger:hover {
  color: #fecaca;
  background: rgba(248, 113, 113, .15);
  border-color: rgba(248, 113, 113, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 20px -6px rgba(248, 113, 113, .5);
}

button.link {
  background: none;
  border: 0;
  padding: 4px 6px;
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  border-radius: 6px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
button.link:hover { color: var(--text); background: rgba(255, 255, 255, .06); box-shadow: none; }

/* ---------- inputs ---------- */

input[type=url], input[type=text], input[type=password] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--stroke);
  border-radius: var(--r-ctl);
  padding: 9px 13px;
  min-height: 40px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
  caret-color: var(--accent);
  transition: border-color .2s, box-shadow .25s var(--ease), background .2s;
}
input::placeholder { color: #7a8398; }
input[type=url]:hover, input[type=text]:hover, input[type=password]:hover { border-color: var(--stroke-2); }
input[type=url]:focus, input[type=text]:focus, input[type=password]:focus {
  border-color: rgba(79, 142, 247, .7);
  background: rgba(0, 0, 0, .34);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35), 0 0 0 4px rgba(79, 142, 247, .16);
}

.error {
  color: var(--bad);
  min-height: 1.5em;
  margin: 8px 2px 0;
  font-size: 13px;
}

/* ---------- jailbreak: control panel ---------- */

.control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 20px 22px;
}
.control-state { display: flex; flex-direction: column; gap: 4px; }
.control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.control-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.control-actions button { min-width: 84px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 650;
}
.status b {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--text-2);
  transition: color .3s;
}
.status i {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: background .3s, box-shadow .3s;
}
.status i::before, .status i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  color: transparent;
  opacity: 0;
}

.status.on b { color: var(--ok); }
.status.on i {
  background: var(--ok);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), 0 0 10px rgba(52, 211, 153, .9), 0 0 24px rgba(52, 211, 153, .45);
  animation: breathe 2.4s ease-in-out infinite;
}
.status.on i::before, .status.on i::after {
  color: var(--ok);
  animation: ring 2.4s var(--ease) infinite;
}
.status.on i::after { animation-delay: 1.2s; }

.status.off b { color: var(--muted); }

.status.lost b { color: var(--warn); }
.status.lost i {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(245, 185, 74, .7);
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes ring {
  0% { transform: scale(1); opacity: .75; }
  100% { transform: scale(3.6); opacity: 0; }
}
@keyframes breathe { 50% { box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), 0 0 14px rgba(52, 211, 153, 1), 0 0 34px rgba(52, 211, 153, .55); } }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- jailbreak: terminal ---------- */

.terminal {
  margin-top: 16px;
  overflow: hidden;
  background: rgba(4, 6, 10, .55);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .03);
}
.terminal-title {
  font: 600 12px/1 var(--mono);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.terminal-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 8px rgba(79, 142, 247, .8);
}

pre#log {
  margin: 0;
  height: calc(100vh - 290px);
  height: calc(100dvh - 290px);
  min-height: 320px;
  overflow: auto;
  padding: 16px 18px 20px;
  font: 12.5px/1.65 var(--mono);
  color: #b9c4d6;
  white-space: pre-wrap;
  word-break: break-all;
  background:
    linear-gradient(rgba(4, 6, 10, .55), rgba(4, 6, 10, .55)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px);
  tab-size: 4;
}
pre#log:empty::before {
  content: "Waiting for output…";
  color: var(--faint);
}
pre#log::selection { background: rgba(79, 142, 247, .4); }

/* ---------- terminal tab (xterm.js) ---------- */

.terminal.shell { margin-top: 0; }
.shell-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.shell-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  transition: background .3s, box-shadow .3s;
}
.shell-state.on { color: var(--ok); }
.shell-state.on::before { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .9); }
.shell-state.lost { color: var(--warn); }
.shell-state.lost::before { background: var(--warn); box-shadow: 0 0 8px rgba(245, 185, 74, .7); }

#shell-screen {
  height: calc(100vh - 180px);
  height: calc(100dvh - 180px);
  min-height: 320px;
  padding: 12px 6px 8px 16px;
  background: #070a11;
}
#shell-screen .xterm { height: 100%; }
#shell-screen .xterm:focus, #shell-screen .xterm *:focus { outline: none; }
#shell-screen .xterm-viewport { background-color: transparent !important; }
#shell-screen .xterm .xterm-scrollable-element > .scrollbar > .slider { background: rgba(255, 255, 255, .14) !important; border-radius: 10px; }
#shell-screen .xterm .xterm-scrollable-element > .scrollbar > .slider:hover { background: rgba(255, 255, 255, .24) !important; }
.shell:focus-within { border-color: rgba(79, 142, 247, .3); }

/* switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--stroke-2);
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cfd6e4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  transition: transform .3s var(--ease), background .25s;
}
.switch input:checked { background: var(--grad); border-color: rgba(160, 190, 255, .45); }
.switch input:checked::after { transform: translateX(12px); background: #fff; }
.switch:hover { color: var(--text-2); }

/* ---------- tables ---------- */

.table-wrap { overflow: hidden; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 16px; }
th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .025);
  border-bottom: 1px solid var(--stroke);
}
td {
  font-size: 13px;
  word-break: break-all;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  transition: background .2s;
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  word-break: normal;
  color: var(--text-2);
}
td:last-child:has(button) { width: 1%; text-align: right; white-space: nowrap; }
td:last-child button { padding: 6px 13px; min-height: 30px; font-size: 12.5px; }
td.url { font: 12px/1.45 var(--mono); color: var(--muted); }
td.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 24px;
  word-break: normal;
}
tbody tr:hover td { background: rgba(255, 255, 255, .03); }

tbody tr {
  animation: row-in .4s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 14) * 22ms);
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- downloads ---------- */

.dl-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
}
#dl-game { flex: 0 0 220px; }
.dl-form button { min-height: 40px; padding: 8px 20px; }

#dl-list { display: flex; flex-direction: column; gap: 10px; }
#dl-list > p.muted {
  margin: 0;
  padding: 36px 24px;
  text-align: center;
  border: 1px dashed var(--stroke-2);
  border-radius: var(--r-panel);
  background: rgba(255, 255, 255, .02);
}

.dl {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--hi), var(--shadow);
  padding: 14px 16px 13px;
  animation: card-in .5s var(--ease) both;
  transition: border-color .3s;
}
.dl.downloading { border-color: rgba(79, 142, 247, .22); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}
.dl .top { display: flex; gap: 12px; align-items: center; }
.dl .name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; word-break: break-word; }
.dl .top button { padding: 5px 12px; min-height: 28px; font-size: 12px; }
.dl .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-variant-numeric: tabular-nums;
}
.dl .meta span:first-child { font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.dl .meta .err { color: var(--bad); }

.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke);
  white-space: nowrap;
}
.badge::first-letter { text-transform: uppercase; }
.dl.downloading .badge { color: #a9c6ff; background: rgba(79, 142, 247, .12); border-color: rgba(79, 142, 247, .3); }
.dl.done .badge { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .28); }
.dl.failed .badge, .dl.cancelled .badge { color: #fca5a5; background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .28); }

.bar {
  position: relative;
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.bar > div {
  position: relative;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(79, 142, 247, .6);
  transition: width .9s var(--ease), background .4s;
  overflow: hidden;
}
.dl.downloading .bar > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.8s ease-in-out infinite;
}
.dl.done .bar > div { background: linear-gradient(90deg, #22c08a, var(--ok)); box-shadow: 0 0 10px rgba(52, 211, 153, .5); }
.dl.failed .bar > div, .dl.cancelled .bar > div { background: var(--bad); box-shadow: none; opacity: .75; }
.bar.indeterminate > div { width: 30% !important; animation: slide 1.4s infinite cubic-bezier(.65, 0, .35, 1); }

@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ---------- launcher ---------- */

#mod-home.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px - 52px);
  min-height: calc(100dvh - 64px - 52px);
}
.launch-head { margin: 12px 0 26px; }
.launch-title {
  display: block;
  margin: 0;
  font-size: 32px;
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--text);
}

.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.mod-card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-height: 228px;
  padding: 22px 22px 18px;
  text-align: left;
  font: inherit;
  color: var(--text);
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--hi), var(--shadow);
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s var(--ease), background .3s;
  animation: card-in .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
/* specular highlight that follows the pointer */
.mod-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .09), transparent 45%);
  opacity: 0;
  transition: opacity .35s;
}
/* module colour pooling in the corner */
.mod-card::after {
  content: "";
  position: absolute;
  right: -30%;
  bottom: -45%;
  z-index: -2;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c1), transparent 65%);
  opacity: .14;
  transition: opacity .4s, transform .6s var(--ease);
}
.mod-card:hover {
  transform: translateY(-4px);
  background: var(--glass-2);
  border-color: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 2px rgba(0, 0, 0, .2), 0 26px 50px -22px rgba(0, 0, 0, .8), 0 14px 40px -20px var(--c1);
}
.mod-card:hover::before { opacity: 1; }
.mod-card:hover::after { opacity: .26; transform: scale(1.12); }
.mod-card:active { transform: translateY(-1px) scale(.99); }

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -8px 16px -8px rgba(0, 0, 0, .25), 0 12px 26px -10px var(--c1);
  transition: transform .45s var(--ease);
}
.card-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mod-card:hover .card-icon { transform: translateY(-2px) rotate(-4deg) scale(1.04); }

.card-body { display: flex; flex-direction: column; gap: 5px; }
.card-name { font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.card-desc { font-size: 13.5px; line-height: 1.45; color: var(--text-2); max-width: 34ch; }

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.card-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background .3s, box-shadow .3s; }
.card-meta.on { color: var(--ok); }
.card-meta.on .dot { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, .9); animation: breathe 2.4s ease-in-out infinite; }
.card-arrow {
  margin-left: auto;
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke);
  transition: transform .35s var(--ease), background .3s, border-color .3s;
}
.card-arrow svg { width: 15px; height: 15px; fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mod-card:hover .card-arrow { transform: translateX(3px); background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; }
.mod-card:hover .card-arrow svg { stroke: #fff; }

/* ---------- launcher stats bar ---------- */

.statbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: auto;
  padding: 12px 18px;
  border-radius: 16px;
  font-variant-numeric: tabular-nums;
}
#mod-home .launcher { margin-bottom: 28px; }
.sb-item { display: flex; align-items: center; gap: 9px; }
.sb-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sb-value { font-size: 13.5px; font-weight: 650; min-width: 3.2ch; }
.sb-meter {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.sb-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--grad);
  transition: width .9s var(--ease);
}
.sb-meter.warn i { background: linear-gradient(90deg, #f5b94a, #f59e4a); }
.sb-meter.crit i { background: linear-gradient(90deg, #f87171, #ef5f7a); }
.sb-drives { flex: 1; min-width: 0; }
.sb-drive-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; }
.sb-drive { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.sb-drive-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.sb-drive .sb-meter { width: 44px; }
.sb-drive-pct { font-weight: 600; font-size: 12px; }
.statbar .live { margin-left: auto; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.live i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, .9);
}
.live i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ok);
  animation: ring 2s var(--ease) infinite;
}
.live.stale { color: var(--warn); }
.live.stale i { background: var(--warn); box-shadow: 0 0 8px rgba(245, 185, 74, .7); }
.live.stale i::after { display: none; }

.usage {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.usage > div {
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(79, 142, 247, .5);
  transition: width .9s var(--ease);
}
.usage.warn > div { background: linear-gradient(90deg, #f5b94a, #f59e4a); box-shadow: 0 0 10px rgba(245, 185, 74, .45); }
.usage.crit > div { background: linear-gradient(90deg, #f87171, #ef5f7a); box-shadow: 0 0 10px rgba(248, 113, 113, .5); }
.usage.big { height: 9px; }

.purpose {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text-2);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--stroke);
  white-space: nowrap;
}
.purpose.p-unassigned { color: var(--muted); background: transparent; border-style: dashed; border-color: var(--stroke-2); }
.purpose.p-ps4-games { color: #a9c6ff; background: rgba(79, 142, 247, .12); border-color: rgba(79, 142, 247, .32); }
.purpose.p-minecraft { color: #6ee7b7; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
.purpose.p-media { color: #c4b5fd; background: rgba(139, 108, 247, .12); border-color: rgba(139, 108, 247, .32); }
.purpose.p-backups { color: #fcd77f; background: rgba(245, 185, 74, .1); border-color: rgba(245, 185, 74, .3); }

/* ---------- storage ---------- */

.drive-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.drive-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 14px;
  animation: card-in .5s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 8) * 50ms);
}
.drive-top { display: flex; align-items: center; gap: 12px; }
.drive-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #8fb6ff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke);
  box-shadow: var(--hi);
}
.drive-icon.ext { color: #c4b5fd; }
.drive-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drive-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drive-name {
  width: calc(100% + 14px);
  margin: -3px -7px;
  padding: 3px 7px;
  font: 600 16px/1.3 var(--sans);
  letter-spacing: -.01em;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  caret-color: var(--accent);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.drive-name::placeholder { color: var(--text); opacity: 1; }
.drive-name:hover { background: rgba(255, 255, 255, .04); }
.drive-name:focus { background: rgba(0, 0, 0, .3); border-color: rgba(79, 142, 247, .6); box-shadow: 0 0 0 3px rgba(79, 142, 247, .15); }
.drive-name:focus::placeholder { color: var(--faint); }
.drive-pct { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.drive-pct.warn { color: var(--warn); }
.drive-pct.crit { color: var(--bad); }

.drive-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.drive-nums dt { font-size: 11.5px; color: var(--muted); }
.drive-nums dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.drive-facts { display: flex; flex-wrap: wrap; gap: 6px; font: 11.5px/1.4 var(--mono); color: var(--muted); }
.drive-facts > span:not(.chip) { padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .25); border: 1px solid var(--stroke); }
.drive-facts .chip.use { font: 500 11.5px/1.4 var(--sans); padding: 2px 9px; color: #a9c6ff; background: rgba(79, 142, 247, .1); border-color: rgba(79, 142, 247, .28); }

.drive-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.purpose-field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap .purpose { padding: 5px 26px 5px 11px; font-size: 12px; transition: filter .2s; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.select-wrap select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font: inherit; }
.select-wrap select option { background: #141822; color: var(--text); }
.select-wrap:hover .purpose { filter: brightness(1.25); }
.select-wrap:has(select:focus-visible) .purpose { outline: 2px solid var(--accent); outline-offset: 2px; }

.assign { font-size: 12px; font-weight: 500; }
button.assign {
  min-height: 0;
  padding: 4px 7px;
  color: #a9c6ff;
  background: none;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
button.assign:hover { background: rgba(79, 142, 247, .12); box-shadow: none; }
.assign.none { color: var(--faint); }
.saved { font-size: 12px; color: var(--muted); }
.saved.ok { color: var(--ok); }
.saved.bad { color: var(--bad); }

/* ---------- analytics ---------- */

.an-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.an-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
  animation: card-in .5s var(--ease) both;
}
.an-cpu { grid-column: span 7; }
.an-mem { grid-column: span 5; animation-delay: 40ms; }
.an-gpu { grid-column: span 4; animation-delay: 80ms; }
.an-temps { grid-column: span 8; animation-delay: 120ms; }
.an-disk { grid-column: span 6; animation-delay: 160ms; }
.an-net { grid-column: span 6; animation-delay: 200ms; }
.an-procs { grid-column: span 12; animation-delay: 240ms; }

.an-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; }
#an-gpu { display: flex; flex-direction: column; gap: 14px; }
.an-mem .an-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.an-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.an-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-big {
  font-size: 30px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.chart {
  position: relative;
  height: 110px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .05);
  overflow: hidden;
}
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart .grid { stroke: rgba(255, 255, 255, .05); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.chart .line { fill: none; stroke-width: 1.7; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .l0 { stroke: #4f8ef7; filter: drop-shadow(0 0 4px rgba(79, 142, 247, .7)); }
.chart .a0 { fill: rgba(79, 142, 247, .16); }
.chart.violet .l0 { stroke: #8b6cf7; filter: drop-shadow(0 0 4px rgba(139, 108, 247, .7)); }
.chart.violet .a0 { fill: rgba(139, 108, 247, .16); }
.chart.pink .l0 { stroke: #f472b6; filter: drop-shadow(0 0 4px rgba(244, 114, 182, .6)); }
.chart.pink .a0 { fill: rgba(244, 114, 182, .14); }
.chart.dual .l0 { stroke: #5cc8e6; filter: drop-shadow(0 0 4px rgba(92, 200, 230, .6)); }
.chart.dual .a0 { fill: rgba(92, 200, 230, .12); }
.chart.dual .l1 { stroke: #f472b6; filter: drop-shadow(0 0 4px rgba(244, 114, 182, .6)); }
.chart.dual .a1 { fill: rgba(244, 114, 182, .08); }
.chart-max, .chart-span {
  position: absolute;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.chart-max { top: 6px; left: 9px; }
.chart-span { bottom: 5px; right: 9px; }

.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg::before { content: ""; width: 10px; height: 3px; border-radius: 2px; }
.lg0::before { background: #5cc8e6; box-shadow: 0 0 6px rgba(92, 200, 230, .8); }
.lg1::before { background: #f472b6; box-shadow: 0 0 6px rgba(244, 114, 182, .8); }
.lg b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 8ch; }

/* per-core bars */
.cores { display: flex; gap: 4px; height: 44px; }
.cores span {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
}
.cores i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(0deg, #4f8ef7, #8b6cf7);
  transform-origin: bottom;
  transform: scaleY(.03);
  transition: transform .8s var(--ease);
}
.cores small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  font-size: 9.5px;
  font-weight: 600;
  text-align: center;
  color: rgba(255, 255, 255, .7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.an-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.an-facts dt { font-size: 11.5px; color: var(--muted); }
.an-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-facts dd.ok { color: var(--ok); }
.an-facts dd.warn { color: var(--warn); }
.an-facts dd.crit { color: var(--bad); }

.an-swap { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.an-swap-label { font-weight: 600; }
.an-swap .usage { flex: 1; }
.an-swap-text { font-variant-numeric: tabular-nums; color: var(--text-2); }

.an-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--stroke-2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .015);
}
.an-empty b { font-size: 14px; color: var(--text-2); }
.an-empty span { font-size: 12.5px; color: var(--muted); max-width: 36ch; }

/* temperature gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.gauge {
  --g: var(--ok);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .05);
}
.gauge.warn { --g: var(--warn); }
.gauge.crit { --g: var(--bad); }
.gauge svg { width: 100%; max-width: 120px; height: auto; overflow: visible; }
.g-track, .g-val { fill: none; stroke-width: 9; stroke-linecap: round; }
.g-track { stroke: rgba(255, 255, 255, .07); }
.g-val {
  stroke: var(--g);
  stroke-dasharray: 2 100;
  filter: drop-shadow(0 0 5px var(--g));
  transition: stroke-dasharray .9s var(--ease), stroke .4s;
}
.g-num {
  margin-top: -30px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.gauge.warn .g-num, .gauge.crit .g-num { color: var(--g); }
.g-label { margin-top: 8px; font-size: 12px; color: var(--text-2); text-align: center; }

/* disk / network rows */
.io-list { display: flex; flex-direction: column; }
.io-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  padding: 9px 2px;
  border-top: 1px solid rgba(255, 255, 255, .05);
}
.io-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.io-name b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.io-name code { font: 11px var(--mono); color: var(--faint); }
.io-rate { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.io-rate::before { font-size: 10px; margin-right: 4px; }
.io-rate.r0 { color: #8fdcf0; }
.io-rate.r0::before { content: "▼"; }
.io-rate.r1 { color: #f9a8d4; }
.io-rate.r1::before { content: "▲"; }
.io-total { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* processes */
.table-scroll { overflow-x: auto; margin: 0 -20px; }
.proc-table th:first-child, .proc-table td:first-child { padding-left: 20px; }
.proc-table th:last-child, .proc-table td:last-child { padding-right: 20px; }
.proc-table th { background: transparent; }
.proc-table td { padding-top: 9px; padding-bottom: 9px; }
.an-procs tbody tr { animation: none; }
.pname { font-weight: 550; word-break: break-word; }
.puser { color: var(--muted); font-size: 12.5px; }
.pcpu { position: relative; min-width: 96px; color: var(--text); font-weight: 600; }
.pbar {
  position: absolute;
  right: 16px;
  top: 50%;
  width: var(--w);
  max-width: 80px;
  height: 18px;
  transform: translateY(-50%);
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(79, 142, 247, .08), rgba(79, 142, 247, .28));
  pointer-events: none;
  z-index: -1;
}
.proc-table td.pcpu { isolation: isolate; }
.an-note { margin: 0; font-size: 12px; color: var(--muted); }

/* filled brand mark (PlayStation logo) inside the stroke-icon tiles */
.card-icon svg.brand-logo, .appbar-icon svg.brand-logo { fill: #fff; stroke: none; }
.card-icon svg.brand-logo { width: 32px; height: 32px; }

/* ---------- restart server ---------- */

.restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fecaca;
  background: linear-gradient(180deg, rgba(248, 113, 113, .16), rgba(248, 113, 113, .07));
  border: 1px solid rgba(248, 113, 113, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 14px -6px rgba(248, 113, 113, .45);
  white-space: nowrap;
}
.restart-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.restart-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(248, 113, 113, .28), rgba(248, 113, 113, .14));
  border-color: rgba(248, 113, 113, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 26px -6px rgba(248, 113, 113, .7);
}
.restart-btn.small { min-height: 30px; padding: 5px 12px 5px 10px; font-size: 12px; }
.restart-btn.small svg { width: 14px; height: 14px; }
.restart-btn.solid {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #e1477a);
  border-color: rgba(255, 170, 170, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 24px -8px rgba(239, 68, 68, .9);
}
.restart-btn.solid:hover { filter: brightness(1.1); background: linear-gradient(135deg, #ef4444, #e1477a); }

.restart-mark {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fca5a5;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px -10px rgba(248, 113, 113, .6);
}
.restart-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.an-restart {
  grid-column: span 12;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border-color: rgba(248, 113, 113, .18);
  background: linear-gradient(90deg, rgba(248, 113, 113, .06), rgba(255, 255, 255, .03));
  animation-delay: 280ms;
}
.an-restart-text { flex: 1; min-width: 0; }
.an-restart-text h3 { margin: 0 0 3px; font-size: 15px; font-weight: 650; }
.an-restart-text p { margin: 0; font-size: 13px; color: var(--text-2); max-width: 70ch; }
.an-restart .restart-btn { min-height: 40px; padding: 8px 18px 8px 14px; }

.statbar .restart-btn { margin-left: 4px; }

/* confirmation dialog */
dialog.confirm {
  width: min(420px, calc(100vw - 32px));
  padding: 26px 24px 20px;
  color: var(--text);
  background: rgba(20, 24, 34, .78);
  border: 1px solid var(--stroke-2);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 80px -20px rgba(0, 0, 0, .9);
}
dialog.confirm[open] { animation: dialog-in .35s var(--ease) both; }
dialog.confirm::backdrop {
  background: rgba(4, 6, 10, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in .25s ease both;
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } }
dialog.confirm h2 { display: block; margin: 14px 0 8px; font-size: 19px; font-weight: 650; color: var(--text); letter-spacing: -.02em; }
dialog.confirm p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.confirm-error { margin-top: 10px !important; color: var(--bad) !important; }
.confirm-error:empty { display: none; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.confirm-actions button { min-height: 38px; padding: 8px 16px; }

/* full-screen "Restarting…" */
.restarting {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 10, .6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: fade-in .4s ease both;
}
.restarting[hidden] { display: none; }
.restarting-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 26px 28px;
  text-align: center;
  border-radius: 24px;
}
.restarting-card h2 { display: block; margin: 10px 0 0; font-size: 20px; font-weight: 650; color: var(--text); }
.restarting-card p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .1);
  border-top-color: #f87171;
  border-right-color: #e1477a;
  animation: spin .9s linear infinite;
  filter: drop-shadow(0 0 8px rgba(248, 113, 113, .5));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}
.login {
  width: min(340px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 28px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .055);
  animation: card-in .7s var(--ease) both;
}
.login.has-error { animation: card-in .7s var(--ease) both, shake .45s .1s cubic-bezier(.36, .07, .19, .97); }
.login-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -8px rgba(79, 142, 247, .9);
  margin-bottom: 4px;
}
.login-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login h1 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 10px; }
.login button { min-height: 42px; margin-top: 2px; }
.login .error { margin: 2px 0 0; text-align: center; }

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .an-cpu, .an-temps, .an-procs { grid-column: span 12; }
  .an-mem, .an-gpu, .an-disk, .an-net { grid-column: span 6; }
}

@media (max-width: 1000px) {
  .subnav button { padding: 7px 10px; }
  .subnav svg { display: none; }
  .appbar .logout span { display: none; }
  .appbar .logout { padding: 7px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }

  .appbar-row {
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }
  .appbar-title h1 { font-size: 16px; }
  .appbar-icon { width: 28px; height: 28px; border-radius: 9px; }
  .appbar-icon svg { width: 16px; height: 16px; }
  .back span { display: none; }
  .back { padding: 6px; }
  /* PS4 sub-tabs drop to their own scrollable row */
  .subnav {
    order: 10;
    flex: 1 1 100%;
    display: flex;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav button { flex: 1 0 auto; justify-content: center; }

  main { padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }

  #mod-home.active { min-height: calc(100dvh - 56px - 40px); }
  .launch-head { margin: 6px 0 18px; }
  .launch-title { font-size: 26px; }
  .launcher { grid-template-columns: 1fr; gap: 10px; }
  .mod-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 14px;
    min-height: 0;
    padding: 16px;
    border-radius: 20px;
  }
  .card-icon { grid-row: 1 / span 2; width: 52px; height: 52px; border-radius: 16px; }
  .card-icon svg { width: 26px; height: 26px; }
  .card-name { font-size: 17px; }
  .card-desc { font-size: 13px; }
  .card-foot { grid-column: 2; padding-top: 8px; border-top: 0; }
  .card-arrow { width: 26px; height: 26px; }
  .mod-card:hover { transform: none; }

  .statbar { gap: 10px 20px; padding: 12px 14px; }
  .statbar .restart-btn { margin-left: 0; }
  .an-restart { flex-wrap: wrap; }
  .an-restart .restart-btn { width: 100%; }

  .an-grid { gap: 10px; }
  .an-grid > .an-card { grid-column: span 12; padding: 16px; }
  .an-big { font-size: 26px; }
  .chart { height: 96px; }
  .table-scroll { margin: 0 -16px; }
  .proc-table th:first-child, .proc-table td:first-child { padding-left: 16px; }
  .puser, .proc-table th:nth-child(3) { display: none; }
  .io-row { grid-template-columns: minmax(0, 1fr) 84px 84px; }
  .an-head .legend { flex-basis: 100%; justify-content: flex-start; }
  .an-mem .an-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-drives { flex-basis: 100%; }
  .statbar .live { position: absolute; top: 12px; right: 14px; }
  .statbar { position: relative; padding-right: 70px; }

  .control { padding: 18px; }
  .control-actions {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
  }
  .control-actions button { min-width: 0; padding: 8px 10px; }

  #shell-screen {
    height: calc(100dvh - 150px);
    min-height: 260px;
    padding: 10px 4px 6px 10px;
  }
  #shell-state { display: none; }

  pre#log {
    height: calc(100dvh - 400px);
    min-height: 280px;
    font-size: 12px;
    padding: 14px;
  }

  .dl-form { flex-direction: column; padding: 10px; }
  #dl-game { flex: none; }
  .dl-form button { min-height: 44px; }
  input[type=url], input[type=text], input[type=password] { font-size: 16px; min-height: 44px; }

  .section-head code.path { flex: 1 1 100%; order: 2; }

  /* tables turn into stacked rows */
  table, tbody { display: block; }
  thead { display: none; }
  tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    row-gap: 3px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
  }
  tbody tr:last-child { border-bottom: 0; }
  td { display: block; padding: 0; border: 0; font-size: 14px; }
  td:first-child { grid-column: 1; font-weight: 500; }
  td.num, td.url { grid-column: 1; text-align: left; font-size: 12px; color: var(--muted); }
  td:last-child:has(button) {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    width: auto;
  }
  td:last-child button { min-height: 36px; }
  td.empty { grid-column: 1 / -1; padding: 28px 8px; }
  tbody tr:hover td { background: none; }
  tbody tr:has(td.empty) { display: block; }

  .cols-library td.num + td.num::before { content: "Modified "; }

  /* the process list stays a real table on phones */
  .proc-table { display: table; }
  .proc-table thead { display: table-header-group; }
  .proc-table tbody { display: table-row-group; }
  .proc-table tbody tr { display: table-row; padding: 0; }
  .proc-table th, .proc-table td { display: table-cell; padding: 9px 8px; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
  .proc-table td.num { text-align: right; color: var(--text-2); font-size: 13px; }
  .proc-table .puser, .proc-table th:nth-child(3) { display: none; }
}

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

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .dl, .appbar, .subnav { background-color: rgba(18, 22, 32, .94); }
}

/* ---------- history table ---------- */
.cols-history { table-layout: fixed; }
.cols-history th:nth-child(1), .cols-history td:nth-child(1) { width: 160px; }
.cols-history th:nth-child(2), .cols-history td:nth-child(2) { width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }
.cols-history th:nth-child(3), .cols-history td:nth-child(3) { width: 160px; }
.cols-history th:nth-child(4), .cols-history td:nth-child(4) { width: 110px; }
.cols-history th:nth-child(5), .cols-history td:nth-child(5) { width: 36px; text-align: center; }
.cols-history td:nth-child(4) button { width: 100%; font-size: 0.75rem; padding: 4px 6px; }
.cols-history td:nth-child(5) button { padding: 4px 8px; }
#history-alpha-bar { font-size: 0.68em; }
#history-alpha-bar span { transition: font-size 0.1s; cursor: pointer; padding: 1px 4px; border-radius: 4px; }
#history-alpha-bar span:hover { background: rgba(255,255,255,0.08); }

.cols-history { table-layout: auto; }
.cols-history td:nth-child(2) { width: 80px; }
.cols-history td:nth-child(4) button, .cols-history td:nth-child(2) button { white-space: nowrap; }
.cols-history td:nth-child(5) { width: 36px; }
.view-url-btn { font-size: 0.72rem; padding: 4px 8px; opacity: 0.7; }

.cols-history td:nth-child(2) { width: 90px; min-width: 90px; }
.view-url-btn { width: 100%; }
#history-alpha-bar { margin-right: 4px; }

#history > div { overflow: visible; }

/* history grouped list */
.history-group { padding: 0; }
.history-group-header { padding: 8px 16px 4px; font-size: 0.72em; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; position: sticky; top: 0; background: var(--glass-bg, rgba(20,20,40,0.85)); backdrop-filter: blur(8px); z-index: 1; }
.history-row { display: flex; align-items: center; padding: 10px 16px; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.history-row:last-child { border-bottom: none; }
.history-game { flex: 1; font-size: 0.9em; }
.history-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.history-date { font-size: 0.72em; color: var(--muted); white-space: nowrap; }
.history-empty { padding: 32px; text-align: center; color: var(--muted); }
#history-alpha-bar span.dim { opacity: 0.2; cursor: default; }

.history-actions button { white-space: nowrap; }
.history-row { flex-wrap: nowrap; }

/* download pill */
.dl-pill { display:flex;align-items:center;gap:7px;padding:5px 12px;background:rgba(255,255,255,0.07);border-radius:999px;cursor:pointer;font-size:0.78em;font-weight:500;border:1px solid rgba(255,255,255,0.1);white-space:nowrap;max-width:220px;opacity:0;transform:translateY(-6px) scale(0.95);transition:opacity 0.3s ease,transform 0.3s ease,background 0.2s; }
.dl-pill.visible { opacity:1;transform:translateY(0) scale(1); }
.dl-pill:hover { background:rgba(255,255,255,0.12); }
.dl-pill-dot { width:7px;height:7px;border-radius:50%;background:#3b82f6;flex-shrink:0;animation:pill-pulse 1.2s ease-in-out infinite; }
.dl-pill-name { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px; }
.dl-pill-pct { color:var(--muted);flex-shrink:0; }
@keyframes pill-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
