/* Hub: one dark/light token set, one accent (the viewer picks which), one
   radius scale (12px controls, 20px panels, 28px app tiles). */
:root {
  --bg: #0c0d10;
  --glow-1: rgba(122, 162, 255, 0.08);
  --glow-2: transparent;
  --panel: #13151a;
  --panel-2: #191c22;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ink: #eceef1;
  --ink-2: #a3a9b3;
  --ink-3: #6f7681;
  --accent: #7aa2ff;
  --accent-ink: #0b1020;
  --ok: #46c98a;
  --warn: #e9a947;
  --bad: #ef6b66;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --r-control: 12px;
  --r-panel: 20px;
  --r-tile: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

/* backgrounds (dark) */
:root[data-wall="midnight"] { --bg: #0a0d16; --glow-1: rgba(80, 120, 255, 0.16); --glow-2: rgba(40, 70, 160, 0.12); --panel: #121726; --panel-2: #182037; }
:root[data-wall="aurora"] { --bg: #0a0f0e; --glow-1: rgba(60, 210, 160, 0.13); --glow-2: rgba(70, 140, 255, 0.10); --panel: #111816; --panel-2: #17201e; }
:root[data-wall="ember"] { --bg: #110d0b; --glow-1: rgba(255, 140, 70, 0.13); --glow-2: rgba(240, 90, 90, 0.07); --panel: #1a1411; --panel-2: #221a16; }
:root[data-wall="plain"] { --glow-1: transparent; --glow-2: transparent; }

/* accents (dark) */
:root[data-accent="mint"] { --accent: #4fd1a5; --accent-ink: #04140e; }
:root[data-accent="amber"] { --accent: #f2b14c; --accent-ink: #1c1203; }
:root[data-accent="rose"] { --accent: #f47a9b; --accent-ink: #1e070d; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef0f4;
    --glow-1: rgba(47, 98, 224, 0.08);
    --panel: #ffffff;
    --panel-2: #f5f6f8;
    --line: rgba(16, 24, 40, 0.08);
    --line-strong: rgba(16, 24, 40, 0.16);
    --ink: #12151b;
    --ink-2: #4f5663;
    --ink-3: #7c8390;
    --accent: #2f62e0;
    --accent-ink: #ffffff;
    --ok: #17945a;
    --warn: #b7761a;
    --bad: #cf3d38;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 18px 40px -26px rgba(16, 24, 40, 0.35);
    color-scheme: light;
  }
  :root[data-wall="midnight"] { --bg: #e9edf7; --glow-1: rgba(60, 100, 230, 0.14); --glow-2: rgba(60, 100, 230, 0.06); --panel: #ffffff; --panel-2: #f3f5fb; }
  :root[data-wall="aurora"] { --bg: #eaf3f0; --glow-1: rgba(20, 160, 110, 0.13); --glow-2: rgba(50, 110, 230, 0.07); --panel: #ffffff; --panel-2: #f2f7f5; }
  :root[data-wall="ember"] { --bg: #f6efea; --glow-1: rgba(230, 110, 40, 0.13); --glow-2: rgba(220, 70, 70, 0.06); --panel: #ffffff; --panel-2: #faf5f2; }
  :root[data-accent="mint"] { --accent: #12855f; --accent-ink: #ffffff; }
  :root[data-accent="amber"] { --accent: #a76300; --accent-ink: #ffffff; }
  :root[data-accent="rose"] { --accent: #c2335a; --accent-ink: #ffffff; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 620px at 8% -10%, var(--glow-1), transparent 70%),
    radial-gradient(900px 600px at 100% 110%, var(--glow-2), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--ink);
  border-radius: var(--r-control); padding: 11px 18px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.wide { width: 100%; }

.icon-btn {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--ink-2);
  width: 40px; height: 40px; border-radius: var(--r-control); display: grid; place-items: center; cursor: pointer;
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line); }

.text-btn {
  appearance: none; border: 0; background: transparent; color: var(--accent); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; padding: 4px 6px; border-radius: 8px;
}
.text-btn svg { width: 16px; height: 16px; }
.text-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- sign in ---------- */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 28px 24px 22px; box-shadow: var(--shadow);
}
.login-mark { border-radius: 14px; margin-bottom: 6px; }
.login-card h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.login-card p { margin: 0 0 10px; }
.field { font-size: 13px; color: var(--ink-2); margin: 10px 0 2px; }
.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
  border-radius: var(--r-control); padding: 11px 14px; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); }
.login-card .btn { margin-top: 8px; }
.error { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: 6px 0 0; }

/* ---------- home ---------- */

.home {
  min-height: 100dvh; max-width: 1200px; margin: 0 auto;
  padding: calc(28px + var(--safe-t)) calc(28px + var(--safe-r)) calc(40px + var(--safe-b)) calc(28px + var(--safe-l));
}
.home-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.greeting { margin: 0; color: var(--ink-2); font-size: 17px; }
.clock {
  margin: 2px 0 0; font-size: clamp(64px, 9vw, 112px); line-height: 1; font-weight: 200;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.clock .sec { font-size: 0.42em; color: var(--ink-3); letter-spacing: -0.02em; margin-left: 0.12em; }
.date { margin: 10px 0 0; color: var(--ink-2); font-size: 17px; }
.head-actions { display: flex; align-items: center; gap: 6px; }

.search-btn {
  appearance: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 12px;
  border-radius: var(--r-control); border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
  cursor: pointer; box-shadow: var(--shadow); transition: border-color 0.15s, color 0.15s;
}
.search-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.search-btn svg { width: 18px; height: 18px; }
.search-btn span { font-size: 14px; }
kbd {
  font: 12px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--line-strong); color: var(--ink-3); background: var(--panel-2);
}

.notice {
  margin-top: 20px; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-control); background: color-mix(in srgb, var(--warn) 14%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}
.notice svg { color: var(--warn); }

.home-body {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr);
  gap: 28px; margin-top: 44px; align-items: start;
}
.col-main, .col-side { display: grid; gap: 30px; min-width: 0; }
.section-title { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.section-row { display: flex; justify-content: space-between; align-items: baseline; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow); }

/* app tiles */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile {
  position: relative; display: flex; gap: 16px; min-height: 212px; padding: 22px;
  border-radius: var(--r-tile); background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; cursor: pointer; overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.2s, background 0.2s;
}
/* soft light that follows the pointer */
.tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
.tile:hover::before { opacity: 1; }
.tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.tile:active { transform: translateY(-1px) scale(0.99); }
.tile-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; color: inherit; text-decoration: none; border-radius: 12px; }
.tile-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-icon {
  width: 60px; height: 60px; border-radius: 16px; object-fit: cover; background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line-strong), 0 8px 20px -10px rgba(0, 0, 0, 0.6);
}
.tile-menu {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tile-menu svg { width: 18px; height: 18px; }
/* The menu sits outside the tile's link (no buttons inside anchors), pinned to tile-main's top-right corner. */
.tile-menu-pos { position: absolute; top: 22px; right: 22px; z-index: 1; }
.tile:has(.tile-shot:not([hidden])) .tile-menu-pos { right: 130px; }
.tile-menu:hover { color: var(--ink); border-color: var(--line-strong); background: var(--panel-2); }
.tile-name { display: block; margin: auto 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.015em; }
.tile-desc { display: block; margin: 2px 0 0; color: var(--ink-2); }
.tile-state { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.tile-state b { color: var(--ink); font-weight: 600; }
.tile-running {
  position: absolute; top: 4px; right: 46px; font-size: 12px; color: var(--accent);
  padding: 4px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.tile-shot {
  position: relative; flex: none; width: 92px; aspect-ratio: 9 / 16; align-self: center; border-radius: 14px;
  object-fit: cover; background: var(--panel-2); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.7); transition: opacity 0.4s;
}
.tile-shot.loading { opacity: 0.35; }

.state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.state-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.state-dot.warn { background: var(--warn); }
.state-dot.bad { background: var(--bad); }
.state-dot.info { background: var(--accent); }

/* shortcuts */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
.link {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: inherit; text-decoration: none;
  transition: border-color 0.15s, transform 0.2s var(--ease);
}
.link:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.mono {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff; background: hsl(var(--h, 220) 55% 46%);
}
.link-a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; border-radius: 10px; }
.link span.t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.link-remove {
  appearance: none; border: 0; background: transparent; margin-left: auto; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-3); cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.link-remove svg { width: 15px; height: 15px; }
.link:hover .link-remove, .link-remove:focus-visible { opacity: 1; }
.link-remove:hover { background: var(--panel-2); color: var(--bad); }
.links-empty { grid-column: 1 / -1; color: var(--ink-3); font-size: 14px; padding: 4px 2px; }
@media (hover: none) { .link-remove { opacity: 1; } }

/* notes */
.note {
  display: block; width: 100%; min-height: 120px; resize: vertical; padding: 16px 18px; color: var(--ink);
  font-size: 15px; line-height: 1.55; outline: none;
}
.note:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.note::placeholder { color: var(--ink-3); }
.note-state { font-size: 13px; color: var(--ink-3); }

/* server */
.server-panel { padding: 20px; }
.srv-head { display: flex; align-items: center; gap: 12px; }
.srv-badge {
  width: 42px; height: 42px; border-radius: var(--r-control); display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.srv-name { margin: 0; font-weight: 650; font-size: 17px; }
.srv-sub { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.metrics { display: grid; gap: 16px; margin: 22px 0 6px; }
.metric-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.metric-label { color: var(--ink-2); }
.metric-value { font-variant-numeric: tabular-nums; }
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s var(--ease); }
.meter.hot > span { background: var(--warn); }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; overflow: visible; }
.spark .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark .line.out { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--accent); }
.legend i.out { background: var(--ink-3); }
.services { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.svc {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2);
  padding: 6px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
}

/* activity */
.activity-panel { padding: 8px 8px 10px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; }
.activity li:hover { background: var(--panel-2); }
.activity .text { font-size: 14px; min-width: 0; }
.activity time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.activity-empty { padding: 14px 10px; color: var(--ink-3); font-size: 14px; }
.more { margin: 4px 0 0 4px; }

/* loading placeholders shaped like the real content */
.skeleton { position: relative; overflow: hidden; background: var(--panel-2); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 6%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { display: block; width: 160px; height: 14px; }
.sk-title { display: block; width: 110px; height: 16px; }
.sk-sub { display: block; width: 160px; height: 12px; margin-top: 8px; }
.sk-block { display: block; height: 34px; }
.empty { padding: 28px; color: var(--ink-2); }

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

/* ---------- dialogs ---------- */

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(5, 6, 9, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { border: 0; padding: 0; background: transparent; width: min(440px, calc(100% - 24px)); max-height: 92dvh; }
.sheet-card {
  display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.sheet-card h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.sheet-card p { margin: 0; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sheet-head img { border-radius: 11px; box-shadow: 0 0 0 1px var(--line-strong); }
.sheet-head h2 { margin: 0; }
.row-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.row-btns form { display: contents; }
.menu-list { display: grid; gap: 4px; margin: 4px 0 12px; }
.menu-item {
  appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 12px; text-align: left;
  border: 0; border-radius: 14px; background: transparent; cursor: pointer; font-size: 15px; color: var(--ink); text-decoration: none;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--panel-2); }
.menu-item svg { color: var(--ink-2); }
.menu-item.danger, .menu-item.danger svg { color: var(--bad); }
.menu-item small { display: block; color: var(--ink-3); font-size: 12.5px; }

.choices { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.choices legend { font-size: 13px; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel-2);
}
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--panel-2)); }
.choice:has(input:disabled) { opacity: 0.5; cursor: default; }
.choice input { margin-top: 3px; accent-color: var(--accent); }
.choice b { display: block; font-weight: 600; }
.choice .muted { display: block; font-size: 13.5px; margin-top: 2px; }

.pair-link {
  display: block; word-break: break-all; margin-top: 12px; padding: 12px; border-radius: var(--r-control);
  background: var(--bg); border: 1px solid var(--line); color: var(--accent); font: 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
}

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  appearance: none; width: 54px; height: 40px; border-radius: 12px; cursor: pointer; padding: 0;
  border: 2px solid var(--line-strong); background: var(--sw); position: relative;
}
.swatch[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.swatch.round { width: 34px; height: 34px; border-radius: 50%; }
.swatch span { position: absolute; inset: auto 0 -20px; font-size: 11.5px; color: var(--ink-3); }
.swatches.with-labels { padding-bottom: 20px; }
.toggles { display: grid; gap: 8px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* command palette */
.palette { border: 0; padding: 0; background: transparent; width: min(600px, calc(100% - 24px)); margin-top: 12vh; }
.palette-box { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { color: var(--ink-3); }
.palette-input input { flex: 1; height: 56px; border: 0; outline: none; background: transparent; font-size: 17px; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 60dvh); overflow: auto; }
.palette-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.palette-list img, .palette-list .mono { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.palette-list li > svg { width: 28px; color: var(--ink-2); }
.palette-list .label { flex: 1; min-width: 0; }
.palette-list .hint { font-size: 12.5px; color: var(--ink-3); }
.palette-list .none { color: var(--ink-3); cursor: default; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); z-index: 30;
  max-width: min(460px, calc(100% - 32px)); padding: 12px 16px; border-radius: 14px; font-size: 14px;
  background: var(--panel-2); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
}
.toast.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }

/* ---------- open apps ---------- */

.workspace {
  position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg);
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
}
@media (prefers-reduced-motion: no-preference) {
  .workspace.entering { animation: open 0.28s var(--ease) both; }
  @keyframes open { from { opacity: 0; transform: scale(0.985); } }
}
.tabbar {
  flex: none; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 8px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.tab-home {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); width: 40px; height: 36px;
  border-radius: var(--r-control); display: grid; place-items: center; cursor: pointer;
}
.tab-home:hover { background: var(--panel-2); color: var(--ink); }
.tabs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 8px; max-width: 240px;
  border-radius: var(--r-control); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.tab img { width: 22px; height: 22px; border-radius: 6px; }
.tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.tab-close {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3);
}
.tab-close svg { width: 15px; height: 15px; }
.tab-close:hover { background: var(--line); color: var(--ink); }
.frames { position: relative; flex: 1; min-height: 0; }
.frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .home-body { grid-template-columns: 1fr; gap: 30px; margin-top: 32px; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 560px) {
  .home { padding: calc(20px + var(--safe-t)) 16px calc(28px + var(--safe-b)); }
  .app-grid { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .tile-name { margin-top: 0; }
  .tile-shot { width: 76px; }
  .tab span { max-width: 120px; }
  .sheet { margin: auto auto 8px; }
  .palette { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
