/* lumavault-home — styles
   Theme values are set as CSS variables on :root by js/themes.js. */

:root {
  --bg: #070a12;
  --bg-2: #0c1220;
  --text: #eef2f8;
  --text-2: #a7b0c0;
  --text-3: #808a9b;
  --accent: #7cc4ff;
  --accent-2: #a78bfa;
  --accent-ink: #06121f;
  --surface-rgb: 255, 255, 255;
  --surface-a: 0.06;
  --surface: rgba(var(--surface-rgb), var(--surface-a));
  --surface-hi: rgba(var(--surface-rgb), calc(var(--surface-a) + 0.05));
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.18);
  --overlay: rgba(3, 5, 10, 0.55);
  --panel: rgba(14, 18, 30, 0.82);
  --up: #4ade80;
  --slow: #fbbf24;
  --down: #f87171;
  --radius: 18px;
  --blur: 18px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --in-out: cubic-bezier(0.7, 0, 0.2, 1);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  --tile-pad: 16px;
  --tile-h: 80px;
  --icon: 46px;
  --gap: 14px;
  --maxw: 1240px;
  color-scheme: dark;
}
:root[data-dark='false'] {
  color-scheme: light;
  --shadow: 0 24px 50px -28px rgba(15, 23, 42, 0.35);
}
:root[data-density='compact'] { --tile-pad: 12px; --tile-h: 64px; --icon: 38px; --gap: 10px; }
:root[data-density='comfy'] { --tile-pad: 20px; --tile-h: 96px; --icon: 54px; --gap: 18px; }
:root[data-width='wide'] { --maxw: 1520px; }
:root[data-width='full'] { --maxw: 100%; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.6s var(--out), color 0.4s;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
[hidden] { display: none !important; }

/* ---------- background layers ---------- */
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -3; display: block; }
#bg-image {
  position: fixed; inset: -4%; z-index: -2; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s var(--out);
}
#bg-image.on { opacity: 1; animation: kenburns 40s ease-in-out infinite alternate; }
#bg-image::after { content: ''; position: absolute; inset: 0; background: var(--bg); opacity: var(--dim, 0.4); }
#grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>");
}
:root[data-dark='false'] #grain { opacity: 0.04; mix-blend-mode: multiply; }
#cursor-glow {
  position: fixed; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: -1; pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  will-change: transform;
}
#cursor-glow.on { opacity: 1; }
:root[data-dark='false'] #cursor-glow { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--accent); }
.boot-logo { width: 56px; height: 56px; }
.boot-arc { transform-origin: center; animation: spin 1s linear infinite; }

/* ---------- shell ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 3vw, 36px) 120px;
  display: flex; flex-direction: column; gap: 34px;
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; border-radius: 12px; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); flex-shrink: 0; }
.brand-mark .orbit { transform-origin: 16px 16px; animation: spin 9s linear infinite; }
.brand-mark .core { transform-origin: 16px 16px; animation: corePulse 3.2s ease-in-out infinite; }
.search-trigger {
  flex: 1 1 280px; max-width: 520px; margin: 0 auto; height: 46px; display: flex; align-items: center; gap: 12px;
  padding: 0 10px 0 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-3); text-align: left; backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  transition: border-color 0.3s, background-color 0.3s, transform 0.4s var(--spring), box-shadow 0.4s;
}
.search-trigger:hover { border-color: var(--border-hi); background: var(--surface-hi); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.search-trigger span { flex: 1; font-size: 14px; }
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-2); border: 1px solid var(--border-hi);
  border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; background: var(--surface);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 13px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.45s var(--spring);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-hi); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent); border-color: transparent; box-shadow: 0 8px 26px -8px var(--accent); }
.icon-btn svg { width: 19px; height: 19px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 2px; position: relative;
  background: conic-gradient(from var(--ang, 0deg), var(--accent), var(--accent-2), var(--accent));
  animation: avatarSpin 6s linear infinite;
}
.avatar span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--bg-2); color: var(--text); font-weight: 800; font-size: 16px; }

.status-pill {
  height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 0 15px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill, var(--up)) 32%, transparent);
  background: color-mix(in srgb, var(--pill, var(--up)) 10%, transparent);
  color: color-mix(in srgb, var(--pill, var(--up)) 55%, var(--text)); font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background-color 0.5s, border-color 0.5s, color 0.5s, transform 0.45s var(--spring);
  position: relative;
}
.status-pill:active { transform: scale(0.95); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pill, var(--up)); box-shadow: 0 0 0 0 var(--pill, var(--up)); animation: ping 2.4s var(--out) infinite; }
.status-pill.warn { --pill: var(--slow); }
.status-pill.bad { --pill: var(--down); }
.status-pill.spin .dot { animation: spin 0.8s linear infinite; border-radius: 2px; }

/* ---------- hero ---------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.greet { margin: 0; font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.greet .ch { display: inline-block; white-space: pre; animation: letterIn 0.9s var(--spring) both; animation-delay: calc(var(--i) * 28ms + 120ms); }
.greet-name {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 45%, var(--accent) 90%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmerText 7s linear infinite;
}
.greet-name .ch { background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 220% 100%; animation: letterIn 0.9s var(--spring) both, shimmerText 7s linear infinite; animation-delay: calc(var(--i) * 28ms + 120ms), 0s; }
.hero-sub { margin: 10px 0 0; color: var(--text-2); font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; animation: fadeUp 0.8s var(--out) 0.5s both; }
.hero-sub .sep { opacity: 0.5; }
.clock { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; animation: fadeUp 0.9s var(--out) 0.3s both; }
.clock-time { font-size: clamp(34px, 5vw, 60px); font-weight: 300; letter-spacing: -0.04em; line-height: 1; display: inline-flex; }
.clock-time .d { display: inline-block; overflow: hidden; height: 1em; position: relative; }
.clock-time .d span { display: block; }
.clock-time .d.tick span { animation: digitIn 0.55s var(--spring); }
.clock-time .colon { animation: blink 2s steps(1) infinite; padding: 0 1px; }
.clock-ampm { font-size: 15px; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; }

/* ---------- section headings ---------- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; min-height: 28px; }
.sec-title { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.sec-title .swatch { width: 10px; height: 10px; border-radius: 4px; background: var(--tint); box-shadow: 0 0 14px var(--tint); }
.sec-meta { font-size: 13px; color: var(--text-3); display: inline-flex; align-items: center; gap: 8px; }
.collapse-btn { background: none; border: 0; color: inherit; padding: 4px; margin: -4px; display: inline-flex; align-items: center; gap: 10px; border-radius: 8px; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.collapse-btn svg { width: 14px; height: 14px; transition: transform 0.4s var(--spring); }
.group.collapsed .collapse-btn svg { transform: rotate(-90deg); }

/* ---------- widgets ---------- */
.widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.wcard {
  grid-column: span var(--span, 1);
  position: relative; min-height: 196px; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: calc(var(--radius) + 2px); background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(var(--blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  overflow: hidden; isolation: isolate;
  transition: border-color 0.4s, transform 0.6s var(--spring), box-shadow 0.5s;
  animation: riseIn 0.9s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 70ms + 260ms);
}
.wcard::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, -500px) var(--my, -500px), color-mix(in srgb, var(--accent) 80%, white), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--glow, 0); transition: opacity 0.4s;
}
.wcard:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.wcard-amb { position: absolute; inset: -30px; z-index: -1; background-size: cover; background-position: center; filter: blur(34px) saturate(160%); opacity: 0; transition: opacity 1.2s; }
.wcard-amb.on { opacity: 0.28; }
:root[data-dark='false'] .wcard-amb.on { opacity: 0.18; }
.whead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.whead-title { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); min-width: 0; }
.whead-title svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.whead-meta { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.wbody { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-num { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.big-unit { font-size: 14px; color: var(--text-2); font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: rgba(var(--surface-rgb), 0.09); overflow: hidden; position: relative; }
:root[data-dark='false'] .bar { background: rgba(15, 23, 42, 0.08); }
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit;
  background: linear-gradient(90deg, var(--bar, var(--accent)), color-mix(in srgb, var(--bar, var(--accent)) 60%, var(--accent-2)));
  transition: width 1.1s var(--spring);
  overflow: hidden;
}
.bar > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: translateX(-100%); animation: shimmer 2.4s ease-in-out infinite; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; min-width: 0; }
.row:first-child { border-top: 0; }
.row .k { color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.row .v { font-family: var(--mono); font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.ldot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; background: var(--c, var(--accent)); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; color: color-mix(in srgb, var(--c, var(--accent)) 70%, var(--text)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 28%, transparent); white-space: nowrap; }
.wstate { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; color: var(--text-2); font-size: 14px; }
.wstate strong { color: var(--text); font-size: 15px; }
.wstate.err strong { color: var(--down); }
.skel { border-radius: 8px; background: linear-gradient(90deg, rgba(var(--surface-rgb), 0.05), rgba(var(--surface-rgb), 0.12), rgba(var(--surface-rgb), 0.05)); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
:root[data-dark='false'] .skel { background-image: linear-gradient(90deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.05)); }
.first .stagger > * { animation: fadeUp 0.7s var(--out) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }

/* jellyfin */
.np { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: center; min-width: 0; }
.np + .np { padding-top: 12px; border-top: 1px solid var(--border); }
.poster { width: 54px; height: 80px; border-radius: 10px; object-fit: cover; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, var(--bg)), color-mix(in srgb, var(--accent-2) 40%, var(--bg))); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.7); }
.np-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.np-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.np-time { font-family: var(--mono); font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; border-radius: 2px; background: var(--accent); animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq.paused i { animation-play-state: paused; height: 3px !important; }
.lib { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lib div { padding: 12px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.04); border: 1px solid var(--border); }
.lib b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lib span { font-size: 12px; color: var(--text-3); }

/* stacked status bar (seerr) */
.stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 3px; }
.stack i { height: 100%; border-radius: 99px; width: var(--w); background: var(--c); transition: width 1s var(--spring); min-width: 4px; }

/* speed chart (nzbget) */
.spark { width: 100%; height: 54px; display: block; overflow: visible; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 50%, transparent)); }
.spark path.area { fill: url(#sparkfill); opacity: 0.6; }
.q-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }

/* uptime */
.mon { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; min-width: 0; }
.mon-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.mon-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-stats { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.beats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(40, minmax(0, 1fr)); gap: 2px; height: 18px; }
.beats i { border-radius: 2px; background: var(--c, var(--up)); opacity: 0.85; transform-origin: bottom; }
.first .beats i { animation: growUp 0.6s var(--spring) both; animation-delay: calc(var(--i) * 12ms + 200ms); }
.beats i.empty { background: rgba(var(--surface-rgb), 0.08); }
.mon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px 30px; max-height: 340px; overflow: auto; scrollbar-width: thin; margin-right: -6px; padding-right: 6px; }

/* weather */
.wx { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; align-items: center; }
.wx-icon { width: 76px; height: 76px; }
.wx-temp { font-size: 46px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.wx-cond { font-weight: 700; font-size: 14px; }
.wx-sub { font-size: 12.5px; color: var(--text-3); }
.fc { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; text-align: center; }
.fc div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; font-size: 12px; }
.fc div:first-child { background: rgba(var(--surface-rgb), 0.06); }
.fc svg { width: 28px; height: 28px; }
.fc b { font-weight: 800; font-size: 13px; }
.fc .lo { color: var(--text-3); }

/* weather icon animations */
.wi-sun .rays { transform-origin: 32px 32px; animation: spin 14s linear infinite; }
.wi-sun .disc { transform-origin: 32px 32px; animation: corePulse 4s ease-in-out infinite; }
.wi-cloud { animation: drift 6s ease-in-out infinite alternate; }
.wi-cloud.back { animation-duration: 8s; animation-direction: alternate-reverse; opacity: 0.7; }
.wi-drop { animation: rain 1.1s linear infinite; }
.wi-drop:nth-of-type(2) { animation-delay: -0.4s; }
.wi-drop:nth-of-type(3) { animation-delay: -0.75s; }
.wi-flake { animation: snow 2.6s linear infinite; }
.wi-flake:nth-of-type(2) { animation-delay: -0.9s; }
.wi-flake:nth-of-type(3) { animation-delay: -1.7s; }
.wi-bolt { animation: flash 3s steps(1) infinite; }
.wi-fog line { animation: fogSlide 4s ease-in-out infinite alternate; }
.wi-fog line:nth-child(2) { animation-delay: -1.3s; }
.wi-moon { transform-origin: 32px 32px; animation: sway 7s ease-in-out infinite alternate; }
.wi-star { animation: twinkle 2.4s ease-in-out infinite; }
.wi-star:nth-of-type(2) { animation-delay: -1.2s; }

/* system rings */
.rings { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: rgba(var(--surface-rgb), 0.09); }
:root[data-dark='false'] .ring .track { stroke: rgba(15, 23, 42, 0.08); }
.ring .val { stroke: url(#ringgrad); stroke-linecap: round; stroke-dasharray: 226.2; stroke-dashoffset: var(--off, 226.2); transition: stroke-dashoffset 1.2s var(--spring); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-label > span { font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.sys-side { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* ---------- groups & tiles ---------- */
.groups { display: flex; flex-direction: column; gap: 34px; }
.group-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 34px 24px; }
.group { animation: fadeUp 0.7s var(--out) backwards; animation-delay: calc(var(--gi, 0) * 80ms + 380ms); min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); gap: var(--gap); min-height: 20px; }
.group.collapsed .tiles { display: none; }

.tile {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --press: 1;
  position: relative; display: flex; align-items: center; gap: 14px; padding: var(--tile-pad); min-height: var(--tile-h);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: blur(var(--blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%);
  color: var(--text); text-decoration: none; isolation: isolate; outline-offset: 4px;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translate3d(0, var(--lift), 0) scale(var(--press));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--spring), background-color 0.35s, border-color 0.35s, box-shadow 0.5s var(--out), opacity 0.4s;
  animation: tileIn 0.85s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 45ms + 420ms);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.tile:hover, .tile.hot { --lift: -5px; background: var(--surface-hi); border-color: color-mix(in srgb, var(--tint) 40%, var(--border)); box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--tint) 75%, transparent), var(--shadow); z-index: 2; }
.tile:active { --press: 0.97; }
.tile-fx { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: -1; }
.tile-fx::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tint) 20%, transparent), transparent 62%);
  opacity: 0; transition: opacity 0.4s;
}
.tile:hover .tile-fx::before { opacity: 1; }
.tile::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(200px circle at var(--mx, -500px) var(--my, -500px), color-mix(in srgb, var(--tint) 90%, white), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--glow, 0); transition: opacity 0.4s;
}
.ticon {
  width: var(--icon); height: var(--icon); flex-shrink: 0; display: grid; place-items: center; position: relative;
  border-radius: calc(var(--radius) * 0.72); background: color-mix(in srgb, var(--tint) 17%, transparent);
  color: color-mix(in srgb, var(--tint) 78%, var(--text)); border: 1px solid color-mix(in srgb, var(--tint) 22%, transparent);
  transform: translateZ(28px); transition: transform 0.6s var(--spring), box-shadow 0.5s;
}
.ticon svg { width: 48%; height: 48%; }
.ticon img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25)); }
.ticon .mono-letters { font-weight: 800; font-size: calc(var(--icon) * 0.38); letter-spacing: -0.03em; }
.tile:hover .ticon { transform: translateZ(40px) scale(1.1) rotate(-5deg); box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--tint) 80%, transparent); }
.tbody { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; transform: translateZ(18px); }
.tname { font-size: 15.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thost { display: flex; align-items: center; gap: 5px; min-width: 0; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.thost span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thost svg { width: 11px; height: 11px; flex-shrink: 0; }
.tdesc { display: none; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tstatus { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; transform: translateZ(22px); }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); position: relative; transition: background-color 0.5s; }
.sdot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: inherit; opacity: 0; }
.tile[data-state='up'] .sdot { background: var(--up); }
.tile[data-state='up'] .sdot::after { animation: ripplePing 2.6s var(--out) infinite; animation-delay: calc(var(--i, 0) * -310ms); }
.tile[data-state='slow'] .sdot { background: var(--slow); }
.tile[data-state='slow'] .sdot::after { animation: ripplePing 1.6s var(--out) infinite; }
.tile[data-state='down'] .sdot { background: var(--down); animation: blinkDot 1.1s steps(2) infinite; }
.tile[data-state='down'] { border-color: color-mix(in srgb, var(--down) 45%, var(--border)); }
.tile[data-state='down'] .ticon { filter: grayscale(0.7); opacity: 0.75; }
.tlat { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); opacity: 0; transform: translateY(3px); transition: opacity 0.3s, transform 0.4s var(--spring); white-space: nowrap; }
.tile:hover .tlat, .tile[data-state='slow'] .tlat, .tile[data-state='down'] .tlat { opacity: 1; transform: none; }
.tile[data-state='slow'] .tlat { color: var(--slow); }
.tile[data-state='down'] .tlat { color: var(--down); }
.tspark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 30px; opacity: 0.32; transition: opacity 0.4s; }
.tile:hover .tspark { opacity: 0.75; }
.tspark path { fill: none; stroke: var(--tint); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tspark path.a { fill: color-mix(in srgb, var(--tint) 18%, transparent); stroke: none; }
.tile.flash { animation: flash2 0.9s var(--out); }
.tile.shake { animation: shake 0.5s var(--out); }
.ripple { position: absolute; border-radius: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; background: color-mix(in srgb, var(--tint, var(--accent)) 45%, transparent); transform: scale(0); animation: rippleOut 0.75s var(--out) forwards; pointer-events: none; }

/* tile style: icons */
:root[data-tiles='icon'] .tiles { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
:root[data-tiles='icon'] .tile { flex-direction: column; justify-content: center; text-align: center; gap: 10px; padding: 18px 10px 14px; min-height: 0; }
:root[data-tiles='icon'] .ticon { width: calc(var(--icon) + 14px); height: calc(var(--icon) + 14px); }
:root[data-tiles='icon'] .tbody { align-items: center; width: 100%; }
:root[data-tiles='icon'] .tname { font-size: 13.5px; max-width: 100%; }
:root[data-tiles='icon'] .thost, :root[data-tiles='icon'] .tlat, :root[data-tiles='icon'] .tspark { display: none; }
:root[data-tiles='icon'] .tstatus { position: absolute; top: 10px; right: 10px; }
/* tile style: list */
:root[data-tiles='list'] .tiles { grid-template-columns: 1fr; gap: 8px; }
:root[data-tiles='list'] .tile { min-height: 0; }
:root[data-tiles='list'] .tbody { flex-direction: row; align-items: baseline; gap: 14px; flex-wrap: wrap; }
:root[data-tiles='list'] .tdesc { display: block; flex: 1; min-width: 120px; }
:root[data-tiles='list'] .tstatus { flex-direction: row-reverse; align-items: center; gap: 10px; }
:root[data-tiles='list'] .tlat { opacity: 1; transform: none; }
:root[data-hosts='false'] .thost { display: none; }

/* after the first paint, re-renders don't replay entrance animations */
.settled .tile, .settled .wcard, .settled .group { animation: none; }
.shake { animation: shake 0.5s var(--out) !important; }

/* ---------- edit mode ---------- */
.editing .tile { cursor: grab; animation: jiggle 0.32s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -97ms); touch-action: none; }
.editing .tile:hover { animation-play-state: paused; }
.editing .tile .tspark { display: none; }
.tile-tools { position: absolute; top: -9px; right: -9px; display: flex; gap: 6px; z-index: 3; transform: translateZ(50px); }
.tool {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-hi);
  background: var(--panel); color: var(--text); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.6); animation: popIn 0.5s var(--spring) both; transition: transform 0.35s var(--spring), background-color 0.2s;
}
.tool:hover { transform: scale(1.15); }
.tool.danger:hover { background: var(--down); color: #fff; }
.tool svg { width: 14px; height: 14px; }
.tile.placeholder { animation: none; background: transparent; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: none; }
.tile.placeholder > * { opacity: 0; }
.tile.ghost { position: fixed !important; z-index: 1000; pointer-events: none; margin: 0; animation: none !important; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--accent); transition: none; }
.add-tile {
  min-height: var(--tile-h); border-radius: var(--radius); border: 2px dashed var(--border-hi); background: transparent; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 14px;
  transition: border-color 0.3s, color 0.3s, background-color 0.3s, transform 0.4s var(--spring); animation: popIn 0.5s var(--spring) both;
}
.add-tile:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); transform: translateY(-3px); }
.add-tile svg { width: 18px; height: 18px; }
.group-tools { display: inline-flex; gap: 6px; }
.group-tools .tool { position: static; animation: popIn 0.4s var(--spring) both; }
.add-group { width: 100%; min-height: 64px; }
.editing .wcard { animation: jiggle 0.36s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -113ms); cursor: grab; touch-action: none; }
.editing .wcard:hover { animation-play-state: paused; }
.wcard.placeholder { background: transparent; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); animation: none; }
.wcard.placeholder > * { opacity: 0; }
.wcard.ghost { position: fixed !important; z-index: 1000; pointer-events: none; margin: 0; animation: none !important; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--accent); }
.wcard .tile-tools { top: 12px; right: 12px; }

.editbar {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 999px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--border-hi); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7); animation: barIn 0.6s var(--spring) both; overflow-x: auto;
}
.editbar.out { animation: barOut 0.35s var(--in-out) forwards; }
.editbar-label { font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.saved { font-size: 12px; color: var(--up); opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.saved.on { opacity: 1; }

/* ---------- buttons & form controls ---------- */
.btn {
  height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px;
  border: 1px solid var(--border-hi); background: var(--surface); color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap;
  position: relative; overflow: hidden; transition: transform 0.45s var(--spring), background-color 0.2s, border-color 0.2s, box-shadow 0.4s, opacity 0.2s;
}
.btn:hover { background: var(--surface-hi); }
a.btn, label.btn { text-decoration: none; color: var(--text); cursor: pointer; }
.btn:active { transform: scale(0.95); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 30px -12px var(--accent); }
.btn.primary:hover { box-shadow: 0 14px 36px -10px var(--accent); filter: brightness(1.06); }
.btn.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.btn.danger:hover { background: var(--down); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.pill { border-radius: 999px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .flabel { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-hi); background: rgba(var(--surface-rgb), 0.05);
  color: var(--text); font-size: 14.5px; transition: border-color 0.2s, box-shadow 0.3s, background-color 0.2s; min-width: 0;
}
:root[data-dark='false'] .input { background: rgba(255, 255, 255, 0.7); }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input::placeholder { color: var(--text-3); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='3' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
select.input option { background: var(--bg-2); color: var(--text); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.switch-text small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { width: 46px; height: 28px; flex-shrink: 0; border-radius: 99px; background: rgba(var(--surface-rgb), 0.14); position: relative; transition: background-color 0.3s; border: 1px solid var(--border); }
:root[data-dark='false'] .switch .knob { background: rgba(15, 23, 42, 0.14); }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.45s var(--spring); }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 3px; }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 13px; background: rgba(var(--surface-rgb), 0.06); border: 1px solid var(--border); position: relative; flex-wrap: wrap; }
.seg button { flex: 1; min-width: max-content; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: color 0.2s, background-color 0.3s, transform 0.4s var(--spring); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px var(--accent); }
.seg button:active { transform: scale(0.94); }
.seg svg { width: 15px; height: 15px; }

.range { display: flex; align-items: center; gap: 12px; }
.range input[type='range'] { flex: 1; appearance: none; -webkit-appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), rgba(var(--surface-rgb), 0.14) var(--p, 50%)); outline: none; }
.range input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); cursor: pointer; transition: transform 0.3s var(--spring); }
.range input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.2); }
.range input[type='range']::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); cursor: pointer; }
.range output { font-family: var(--mono); font-size: 12px; color: var(--text-2); min-width: 44px; text-align: right; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: var(--c); position: relative; transition: transform 0.4s var(--spring); padding: 0; }
.sw:hover { transform: scale(1.12); }
.sw[aria-pressed='true'] { border-color: var(--text); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.sw.auto { background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); }
.sw input[type='color'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.sw.custom { background: conic-gradient(#f87171, #fbbf24, #4ade80, #22d3ee, #818cf8, #e879f9, #f87171); }

/* ---------- layers: modal, drawer, palette, menus, toasts ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: var(--overlay); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fadeIn 0.35s var(--out) both; }
.scrim.out { animation: fadeOut 0.3s var(--out) forwards; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 101; width: min(640px, calc(100vw - 24px)); max-height: min(88vh, 900px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: 24px; box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  transform: translate(-50%, -50%); animation: modalIn 0.55s var(--spring) both;
}
.modal.out { animation: modalOut 0.28s var(--in-out) forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.modal-body { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal.small { width: min(440px, calc(100vw - 24px)); }

.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 101; width: min(520px, calc(100vw - 20px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: 24px; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  animation: drawerIn 0.6s var(--spring) both;
}
.drawer.out { animation: drawerOut 0.35s var(--in-out) forwards; }
.drawer-tabs { display: flex; gap: 4px; padding: 6px 16px 0; overflow-x: auto; scrollbar-width: none; position: relative; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-tabs::-webkit-scrollbar { display: none; }
.dtab { height: 42px; padding: 0 12px; border: 0; background: none; color: var(--text-3); font-weight: 700; font-size: 13.5px; white-space: nowrap; position: relative; transition: color 0.2s; }
.dtab:hover { color: var(--text); }
.dtab[aria-selected='true'] { color: var(--text); }
.tab-ink { position: absolute; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transition: left 0.5s var(--spring), width 0.5s var(--spring); }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px 40px; overscroll-behavior: contain; }
.drawer-body > .pane { display: flex; flex-direction: column; gap: 22px; animation: paneIn 0.45s var(--out) both; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block-title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.card-box { padding: 14px 16px; border-radius: 16px; background: rgba(var(--surface-rgb), 0.04); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.card-box .switch { padding: 6px 0; }
.note { font-size: 13px; color: var(--text-2); padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); line-height: 1.5; }
.note code, .card-box code { font-family: var(--mono); font-size: 12px; background: rgba(var(--surface-rgb), 0.08); padding: 1px 5px; border-radius: 5px; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.theme-card { border: 1px solid var(--border-hi); background: none; padding: 0; border-radius: 16px; overflow: hidden; text-align: left; transition: transform 0.45s var(--spring), box-shadow 0.3s; color: var(--text); }
.theme-card:hover { transform: translateY(-3px); }
.theme-card[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--accent), 0 12px 30px -12px var(--accent); }
.theme-prev { height: 74px; position: relative; overflow: hidden; }
.theme-prev i { position: absolute; border-radius: 50%; filter: blur(14px); width: 70px; height: 70px; }
.theme-prev b { position: absolute; left: 12px; bottom: 10px; width: 46px; height: 10px; border-radius: 6px; }
.theme-prev u { position: absolute; left: 12px; bottom: 26px; width: 26px; height: 26px; border-radius: 8px; }
.theme-name { padding: 9px 12px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.font-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.font-card { height: 64px; border-radius: 14px; border: 1px solid var(--border-hi); background: rgba(var(--surface-rgb), 0.04); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform 0.4s var(--spring), border-color 0.2s; }
.font-card b { font-size: 20px; line-height: 1; }
.font-card span { font-size: 11px; color: var(--text-3); font-family: var(--font); }
.font-card[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.font-card:hover { transform: translateY(-2px); }

.wset { border-radius: 16px; border: 1px solid var(--border); background: rgba(var(--surface-rgb), 0.04); overflow: hidden; transition: border-color 0.3s; }
.wset[open] { border-color: var(--border-hi); }
.wset summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.wset summary::-webkit-details-marker { display: none; }
.wset-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); flex-shrink: 0; }
.wset-icon svg { width: 17px; height: 17px; }
.wset-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.wset-name small { display: block; color: var(--text-3); font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wset-body { padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 14px; animation: paneIn 0.35s var(--out) both; }
.test-result { font-size: 13px; font-weight: 600; }
.test-result.ok { color: var(--up); }
.test-result.bad { color: var(--down); }

.palette {
  position: fixed; left: 50%; top: min(14vh, 140px); z-index: 101; width: min(660px, calc(100vw - 24px)); transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: 22px; overflow: hidden;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
  backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  animation: paletteIn 0.45s var(--spring) both;
}
.palette.out { animation: paletteOut 0.22s var(--in-out) forwards; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.pal-input svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.pal-input input { flex: 1; height: 60px; border: 0; background: none; outline: none; font-size: 17px; color: var(--text); min-width: 0; }
.pal-list { max-height: min(52vh, 460px); overflow: auto; padding: 8px; position: relative; scrollbar-width: thin; }
.pal-sec { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 13px; cursor: pointer; position: relative; z-index: 1; color: var(--text); text-decoration: none; animation: fadeUp 0.35s var(--out) both; animation-delay: calc(var(--i, 0) * 18ms); }
.pal-item .ticon { --icon: 34px; transform: none; border-radius: 10px; }
.pal-item .pi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-item .pi-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .pi-title mark { background: none; color: var(--accent); }
.pal-item .pi-sub { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .pi-hint { font-size: 11.5px; color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.pal-item .sdot { flex-shrink: 0; }
.pal-item[data-state='up'] .sdot { background: var(--up); }
.pal-item[data-state='slow'] .sdot { background: var(--slow); }
.pal-item[data-state='down'] .sdot { background: var(--down); }
.pal-hl { position: absolute; left: 8px; right: 8px; top: 0; height: 0; border-radius: 13px; background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); transition: transform 0.35s var(--spring), height 0.3s var(--spring); pointer-events: none; z-index: 0; }
.pal-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.pal-empty { padding: 30px; text-align: center; color: var(--text-3); }
.cmd-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--surface-rgb), 0.07); color: var(--text-2); flex-shrink: 0; }
.cmd-icon svg { width: 16px; height: 16px; }

.menu {
  position: fixed; z-index: 102; min-width: 240px; padding: 8px; border-radius: 18px; background: var(--panel); border: 1px solid var(--border-hi);
  backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
  transform-origin: top right; animation: menuIn 0.4s var(--spring) both;
}
.menu.out { animation: menuOut 0.18s var(--in-out) forwards; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 14px; }
.menu-head span { font-size: 12px; color: var(--text-3); word-break: break-all; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; border-radius: 11px; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; }
.menu-item:hover { background: rgba(var(--surface-rgb), 0.08); }
.menu-item svg { width: 16px; height: 16px; color: var(--text-2); }
.menu-item.danger { color: var(--down); }
.menu-item.danger svg { color: var(--down); }

#toasts { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column-reverse; gap: 10px; align-items: center; pointer-events: none; width: min(460px, calc(100vw - 24px)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px; min-width: 260px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--border-hi); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.7); font-size: 14px; font-weight: 600; position: relative; overflow: hidden;
  animation: toastIn 0.55s var(--spring) both;
}
.toast.out { animation: toastOut 0.3s var(--in-out) forwards; }
.toast .t-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--c, var(--accent)) 18%, transparent); color: var(--c, var(--accent)); }
.toast .t-icon svg { width: 14px; height: 14px; }
.toast .t-msg { flex: 1; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--c, var(--accent)); animation: toastBar var(--d, 4s) linear forwards; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 10; }
.login-card {
  width: min(400px, 100%); padding: 34px 30px 28px; border-radius: 30px; text-align: center; display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); border: 1px solid var(--border-hi); backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 0.9); animation: loginIn 1s var(--spring) both;
}
.login-card.shake { animation: shake 0.5s var(--out); }
.login-card.leave { animation: loginOut 0.7s var(--in-out) forwards; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 6px; color: var(--accent); position: relative; }
.login-logo svg { width: 100%; height: 100%; overflow: visible; }
.login-logo .o1 { transform-origin: 48px 48px; animation: spin 6s linear infinite; }
.login-logo .o2 { transform-origin: 48px 48px; animation: spin 9s linear infinite reverse; }
.login-logo .core { transform-origin: 48px 48px; animation: corePulse 2.6s ease-in-out infinite; }
.login-card.ok .login-logo .core { animation: unlock 0.8s var(--spring) forwards; }
.login-card h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.login-card p { margin: 0; color: var(--text-2); }
.pw { position: relative; }
.pw .input { height: 52px; font-size: 16px; padding-right: 52px; border-radius: 15px; text-align: left; }
.pw .eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; }
.pw .eye svg { width: 18px; height: 18px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.login-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.login-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.login .btn.primary { height: 52px; font-size: 15px; border-radius: 15px; }
.login-error { min-height: 20px; color: var(--down); font-size: 13.5px; font-weight: 600; }

/* ---------- two-step verification ---------- */
.otp { display: flex; gap: 8px; justify-content: center; }
.otp-gap { width: 8px; }
.otp-d {
  width: 46px; height: 58px; padding: 0; text-align: center; font: 600 24px var(--mono); border-radius: 14px; border: 1px solid var(--border-hi);
  background: rgba(var(--surface-rgb), 0.05); color: var(--text); caret-color: var(--accent);
  transition: border-color 0.2s, box-shadow 0.3s, transform 0.4s var(--spring);
}
.otp-d:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); transform: translateY(-3px); }
.otp-d.filled { animation: digitPop 0.4s var(--spring); border-color: color-mix(in srgb, var(--accent) 55%, var(--border-hi)); }
.otp.ok .otp-d { border-color: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); animation: okWave 0.6s var(--spring) both; }
.otp.ok .otp-d:nth-child(2) { animation-delay: 40ms; } .otp.ok .otp-d:nth-child(3) { animation-delay: 80ms; }
.otp.ok .otp-d:nth-child(5) { animation-delay: 120ms; } .otp.ok .otp-d:nth-child(6) { animation-delay: 160ms; } .otp.ok .otp-d:nth-child(7) { animation-delay: 200ms; }
:root[data-dark='false'] .otp-d { background: rgba(255, 255, 255, 0.75); }
.step-in { animation: stepIn 0.55s var(--spring) both; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--text-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; align-self: center; }
.link-btn:hover { color: var(--text); }
.tfa { display: flex; gap: 14px; align-items: flex-start; }
.tfa-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.tfa.on .tfa-icon { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); box-shadow: 0 0 24px -6px var(--up); }
.tfa-icon svg { width: 20px; height: 20px; }
.tfa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.tfa-text b { color: var(--text); font-size: 15px; }
.qr-setup { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 20px; align-items: center; }
.qr { width: 196px; height: 196px; padding: 10px; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px -24px var(--accent), 0 0 0 1px var(--border-hi); animation: qrIn 0.8s var(--spring) both; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret-key { font: 600 14px var(--mono); letter-spacing: 0.06em; word-break: break-all; padding: 10px 12px; border-radius: 12px; background: rgba(var(--surface-rgb), 0.06); border: 1px dashed var(--border-hi); user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.codes span { font: 600 15px var(--mono); letter-spacing: 0.04em; padding: 10px; text-align: center; border-radius: 11px; background: rgba(var(--surface-rgb), 0.06); border: 1px solid var(--border); user-select: all; animation: fadeUp 0.45s var(--out) both; animation-delay: calc(var(--i) * 45ms); }
.steps { display: flex; gap: 6px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--border-hi); transition: background-color 0.4s; }
.steps i.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
@keyframes digitPop { from { transform: scale(0.75); } to { transform: none; } }
@keyframes okWave { 40% { transform: translateY(-6px); } to { transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes qrIn { from { opacity: 0; transform: scale(0.85) rotate(-4deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@media (max-width: 520px) {
  .qr-setup { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .otp-d { width: 40px; height: 52px; font-size: 21px; }
  .otp { gap: 6px; }
}

/* ---------- launch overlay ---------- */
.launch { position: fixed; inset: 0; z-index: 500; pointer-events: none; display: grid; place-items: center; }
.launch-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--tint) 55%, var(--bg)), var(--bg) 70%); }
.launch-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.launch .ticon { --icon: 96px; border-radius: 28px; transform: none; box-shadow: 0 0 80px -10px var(--tint); }
.launch-label { font-size: 15px; color: var(--text-2); text-align: center; opacity: 0; animation: fadeUp 0.4s var(--out) 0.18s forwards; }
.launch-label b { display: block; color: var(--text); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.launch-ring { position: absolute; left: 50%; top: 48px; width: 96px; height: 96px; margin-left: -48px; border-radius: 28px; border: 2px solid var(--tint); animation: shock 0.9s var(--out) forwards; }
.burst { position: fixed; z-index: 600; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; }

.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); padding-top: 18px; border-top: 1px solid var(--border); animation: fadeIn 1s var(--out) 1s both; }
.footer button { background: none; border: 0; color: inherit; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; font-size: 14px; }
.shortcuts kbd { justify-self: start; }
.empty-hint { padding: 26px; border-radius: var(--radius); border: 1px dashed var(--border-hi); color: var(--text-3); text-align: center; }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.icon-pick { height: 46px; border-radius: 12px; border: 1px solid var(--border); background: rgba(var(--surface-rgb), 0.04); display: grid; place-items: center; color: var(--text-2); transition: transform 0.3s var(--spring), border-color 0.2s, color 0.2s; }
.icon-pick:hover { transform: scale(1.08); color: var(--text); }
.icon-pick[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.icon-pick svg { width: 20px; height: 20px; }
.icon-pick img { width: 26px; height: 26px; object-fit: contain; }
.preview-wrap { padding: 18px; border-radius: 18px; background: radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), rgba(var(--surface-rgb), 0.03); border: 1px solid var(--border); }
.preview-wrap .tile { animation: none; max-width: 340px; }
.backup-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.backup-row:first-child { border-top: 0; }
.backup-row span { flex: 1; min-width: 0; }

/* ---------- keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes corePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes avatarSpin { to { --ang: 360deg; } }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pill, var(--up)) 70%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes ripplePing { 0% { opacity: 0.7; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes blinkDot { 50% { opacity: 0.25; } }
@keyframes letterIn { from { opacity: 0; transform: translateY(0.5em) rotate(8deg) scale(0.8); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes shimmerText { to { background-position: -220% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(30px) scale(0.96); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes tileIn { from { opacity: 0; transform: perspective(900px) translate3d(0, 28px, -60px) rotateX(18deg) scale(0.92); filter: blur(8px); } to { opacity: 1; filter: blur(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
@keyframes digitIn { from { transform: translateY(100%); opacity: 0; filter: blur(4px); } to { transform: none; opacity: 1; filter: blur(0); } }
@keyframes blink { 50% { opacity: 0.35; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes skel { to { background-position: -200% 0; } }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@keyframes growUp { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 0.85; } }
@keyframes drift { from { transform: translateX(-3px); } to { transform: translateX(4px); } }
@keyframes rain { from { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(14px); opacity: 0; } }
@keyframes snow { from { transform: translate(0, -6px); opacity: 0; } 30% { opacity: 1; } to { transform: translate(4px, 14px); opacity: 0; } }
@keyframes flash { 0%, 86%, 92%, 100% { opacity: 0; } 88%, 94% { opacity: 1; } }
@keyframes fogSlide { from { transform: translateX(-4px); } to { transform: translateX(5px); } }
@keyframes sway { from { transform: rotate(-8deg); } to { transform: rotate(6deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes flash2 { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tint) 80%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes rippleOut { to { transform: scale(var(--s, 30)); opacity: 0; } }
@keyframes jiggle { from { transform: rotate(-0.7deg) translateY(0); } to { transform: rotate(0.7deg) translateY(-1px); } }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 40px) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes barOut { to { opacity: 0; transform: translate(-50%, 30px) scale(0.92); } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); filter: blur(10px); } to { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); } }
@keyframes modalOut { to { opacity: 0; transform: translate(-50%, -48%) scale(0.95); filter: blur(6px); } }
@keyframes drawerIn { from { opacity: 0; transform: translateX(60px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drawerOut { to { opacity: 0; transform: translateX(80px); } }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes paletteIn { from { opacity: 0; transform: translate(-50%, -16px) scale(0.94); filter: blur(10px); } to { opacity: 1; transform: translate(-50%, 0); filter: blur(0); } }
@keyframes paletteOut { to { opacity: 0; transform: translate(-50%, -10px) scale(0.97); } }
@keyframes menuIn { from { opacity: 0; transform: scale(0.85) translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes menuOut { to { opacity: 0; transform: scale(0.92); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(30px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px) scale(0.95); } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }
@keyframes loginIn { from { opacity: 0; transform: translateY(40px) scale(0.9); filter: blur(16px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes loginOut { to { opacity: 0; transform: scale(1.12); filter: blur(20px); } }
@keyframes unlock { 0% { transform: scale(1); } 40% { transform: scale(0.6); } 100% { transform: scale(14); opacity: 0; } }
@keyframes shock { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-1.5%, -1%); } }

/* =====================================================================
   Alerts: bell, tile badges, speech bubbles, flying bubble, feed, panels
   ===================================================================== */
.bell { position: relative; }
.bell svg { transform-origin: 50% 8%; }
.bell.ringing svg { animation: bellRing 0.9s var(--out); }
.bell-n {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--down); color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 6px 16px -4px var(--down); pointer-events: none;
}
.bell-n.pop, .tbadge.pop { animation: badgePop 0.6s var(--spring); }

/* badge on a tile */
.tbadge {
  position: absolute; top: -8px; right: -8px; z-index: 4; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 0 2.5px var(--bg), 0 8px 20px -6px var(--accent); transform: translateZ(60px); pointer-events: none;
}
.tbadge[data-level='warn'] { background: var(--slow); color: #1d1404; box-shadow: 0 0 0 2.5px var(--bg), 0 8px 20px -6px var(--slow); }
.tbadge[data-level='crit'] { background: var(--down); color: #fff; box-shadow: 0 0 0 2.5px var(--bg), 0 8px 22px -4px var(--down); animation: critGlow 1.8s ease-in-out infinite; }
.tbadge[data-level='crit'].pop { animation: badgePop 0.6s var(--spring), critGlow 1.8s ease-in-out 0.6s infinite; }
.tbadge.out { animation: badgeOut 0.3s var(--in-out) forwards; }
.tile.has-alerts { border-color: color-mix(in srgb, var(--tint) 34%, var(--border)); }
.tile.has-alerts .tile-fx::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(120px circle at 100% 0%, color-mix(in srgb, var(--tint) 24%, transparent), transparent 70%); animation: breathe 3.2s ease-in-out infinite; }
:root[data-tiles='icon'] .tbadge { top: 2px; right: calc(50% - 44px); }
:root[data-tiles='list'] .tbadge { top: 50%; right: 46px; margin-top: -11px; }
.tile.peeking { z-index: 6; }
.tile.opened { opacity: 0.35; transform: perspective(900px) scale(0.96); }

/* speech bubble above a tile */
.tpeek {
  position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 7; display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: min(300px, 80vw); padding: 8px 14px 8px 8px; border-radius: 16px; cursor: pointer;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--tint) 45%, var(--border-hi));
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 30px -10px var(--tint);
  backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%);
  transform: translateX(-50%) translateZ(80px); transform-origin: 50% 100%;
  animation: peekIn 0.6s var(--spring) both; text-align: left; color: var(--text);
}
.tpeek::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: inherit; border: inherit; border-top: 0; border-left: 0; transform: rotate(45deg); border-radius: 0 0 3px 0; }
.tpeek.below { bottom: auto; top: calc(100% + 12px); transform-origin: 50% 0; }
.tpeek.below::after { bottom: auto; top: -7px; transform: rotate(225deg); }
.tpeek.out { animation: peekOut 0.35s var(--in-out) forwards; }
.tpeek[data-level='warn'] { border-color: color-mix(in srgb, var(--slow) 60%, transparent); }
.tpeek[data-level='crit'] { border-color: color-mix(in srgb, var(--down) 70%, transparent); }
.tp-img { width: 34px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.7); }
.tp-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: var(--tint); background: color-mix(in srgb, var(--tint) 18%, transparent); }
.tp-ic svg { width: 18px; height: 18px; }
.tp-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-text b { font-size: 12px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; color: color-mix(in srgb, var(--tint) 75%, var(--text)); }
.tp-text span { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* bubble flying from tile to tile */
.orb { position: fixed; left: 0; top: 0; z-index: 90; width: 52px; height: 52px; pointer-events: none; will-change: transform; }
.orb-in {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--panel); border: 2px solid var(--tint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 25%, transparent), 0 0 34px 4px color-mix(in srgb, var(--tint) 70%, transparent), 0 20px 40px -10px rgba(0, 0, 0, 0.7);
}
.orb-in img, .orb-in .poster { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; }
.orb-in svg { width: 24px; height: 24px; }
.orb.land .orb-in { animation: orbLand 0.38s var(--out) forwards; }
.orb-spark { position: fixed; z-index: 89; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; filter: blur(0.5px); box-shadow: 0 0 10px currentColor; }

/* ---------- rows (feed, card, panel) ---------- */
.nrow {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 30px 12px 12px; border-radius: 16px;
  border: 1px solid transparent; cursor: pointer; transition: background-color 0.25s, border-color 0.25s; outline-offset: 2px;
}
.nrow:hover { background: rgba(var(--surface-rgb), 0.05); border-color: var(--border); }
.nrow.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.nrow.unread:hover { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.nrow[data-level='warn']::before, .nrow[data-level='crit']::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--slow); }
.nrow[data-level='crit']::before { background: var(--down); box-shadow: 0 0 12px var(--down); }
.nrow.fresh { animation: rowIn 0.8s var(--spring); }
.nrow.fresh::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1.5px var(--accent); animation: fadeOut 2.4s ease-in 0.6s forwards; }
.nthumb { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; }
.nthumb.ticon { --icon: 40px; transform: none; }
.nthumb.kind { background: rgba(var(--surface-rgb), 0.07); color: var(--text-2); border: 1px solid var(--border); }
.nthumb.kind svg { width: 19px; height: 19px; }
.nthumb.poster-thumb { height: 58px; width: 40px; }
.nthumb.poster-thumb .poster { width: 40px; height: 58px; border-radius: 8px; }
.nmain { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ntop { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ntitle { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.3; }
.nrow.unread .ntitle { font-weight: 800; }
.ntime { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.nbody { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nrow.open .nbody { -webkit-line-clamp: unset; }
.nstep { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.nmeta .chip { padding: 1px 8px; font-size: 11px; }
.nmeta .chip svg { width: 11px; height: 11px; }
.nacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.nacts .btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.ndot { position: absolute; top: 18px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nmore { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; animation: fadeUp 0.4s var(--out) both; }
.nrow.compact { padding: 9px 26px 9px 8px; gap: 10px; }
.nrow.compact .nthumb { width: 34px; height: 34px; border-radius: 10px; }
.nrow.compact .nthumb.ticon { --icon: 34px; }
.nrow.compact .nthumb.poster-thumb { width: 34px; height: 48px; }
.nrow.compact .nthumb.poster-thumb .poster { width: 34px; height: 48px; }
.nrow.compact .ntitle { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nrow.compact .nbody { -webkit-line-clamp: 1; font-size: 12.5px; }
.nrow.compact .ndot { top: 15px; }

/* Requested → Downloading → Ready */
.track { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin: 4px 0 2px; }
.tk { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.tk:first-child { align-items: flex-start; text-align: left; }
.tk:last-child { align-items: flex-end; text-align: right; }
.tk i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1.5px solid var(--border-hi); color: var(--text-3); transition: background-color 0.4s, border-color 0.4s, color 0.4s; }
.tk i svg { width: 12px; height: 12px; }
.tk b { font-size: 11px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.tk.past i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tk.past b { color: var(--text-2); }
.tk.now i { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 18px -2px var(--accent); animation: nowPulse 2s ease-in-out infinite; }
.tk.now b { color: var(--text); }
.tk.bad i { background: var(--down); border-color: var(--down); color: #fff; }
.tk.bad b { color: var(--down); }
.track.done .tk i { background: var(--up); border-color: var(--up); color: #062312; }
.tk-line { position: absolute; left: 11px; right: 11px; top: 10px; height: 2px; border-radius: 2px; background: var(--border-hi); }
.tk-line span { position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); transition: width 1s var(--spring); }
.track.done .tk-line span { background: var(--up); box-shadow: 0 0 10px var(--up); }
.track.failed .tk-line span { background: var(--down); box-shadow: none; }

/* full timeline */
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 5px 0; font-size: 12.5px; }
.tl li:not(:last-child)::before { content: ''; position: absolute; left: 4px; top: 16px; bottom: -6px; width: 2px; background: var(--border-hi); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); align-self: center; box-shadow: 0 0 8px var(--accent); }
.tl-declined .tl-dot, .tl-failed .tl-dot { background: var(--down); box-shadow: 0 0 8px var(--down); }
.tl-ready .tl-dot { background: var(--up); box-shadow: 0 0 8px var(--up); }
.tl-main { display: flex; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.tl-main span { color: var(--text-3); }
.tl-at { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ---------- feed drawer ---------- */
.drawer.feed .modal-head h2 { display: flex; align-items: center; gap: 10px; }
.feed-count { white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--accent-ink); background: var(--accent); padding: 3px 9px; border-radius: 99px; letter-spacing: 0; }
.feed-count:empty { display: none; }
.feed-filters { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.feed-filters .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.feed-filters .seg button { height: 32px; padding: 0 11px; font-size: 12.5px; }
.drawer.feed .drawer-body { padding: 8px 10px 40px; }
.feed-list { display: flex; flex-direction: column; gap: 2px; }
.feed-day { position: sticky; top: -8px; z-index: 2; padding: 12px 12px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); background: linear-gradient(var(--panel) 70%, transparent); }
.feed-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 70px 20px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.feed-empty svg { width: 46px; height: 46px; color: var(--accent); opacity: 0.8; animation: floaty 3s ease-in-out infinite; }
.feed-empty b { color: var(--text); font-size: 16px; }
.feed-snoozed { align-self: center; margin-top: 12px; }

/* Notifications card */
.nlist { display: flex; flex-direction: column; gap: 2px; margin: -6px -8px 0; }
.nlist.two { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 2px 8px; }
.ncard-more { align-self: flex-start; margin-top: auto; }
.bell-big svg { width: 34px; height: 34px; color: var(--accent); animation: floaty 3s ease-in-out infinite; }

/* ---------- app panel ---------- */
.apanel-wrap { position: fixed; inset: 0; z-index: 101; display: grid; place-items: center; padding: 12px; pointer-events: none; }
.apanel-wrap.out { animation: fadeOut 0.3s var(--out) forwards; }
.apanel-wrap.out.morph-out { animation: none; }
.apanel {
  --tint: var(--accent);
  position: relative; pointer-events: auto; width: min(780px, 100%); max-height: min(88vh, 940px); display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--tint) 30%, var(--border-hi)); border-radius: 28px;
  box-shadow: 0 60px 140px -30px rgba(0, 0, 0, 0.85), 0 0 80px -40px var(--tint);
  backdrop-filter: blur(34px) saturate(170%); -webkit-backdrop-filter: blur(34px) saturate(170%);
}
.ap-glow { position: absolute; inset: 0 0 auto; height: 320px; z-index: -1; pointer-events: none; -webkit-mask-image: linear-gradient(#000 30%, transparent); mask-image: linear-gradient(#000 30%, transparent); background: radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--tint) 30%, transparent), transparent 62%), radial-gradient(circle at 90% -20%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 60%); transition: background 1s; }
.ap-head { display: flex; align-items: center; gap: 16px; padding: 22px 22px 16px; flex-wrap: wrap; }
.ap-icon { --icon: 60px; transform: none; border-radius: 18px; box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--tint) 80%, transparent); }
.ap-title { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.ap-title h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.ap-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.ap-state { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.ap-state[data-state='up'] .sdot, .mon-app[data-state='up'] .sdot { background: var(--up); }
.ap-state[data-state='up'] .sdot::after { animation: ripplePing 2.6s var(--out) infinite; }
.ap-state[data-state='slow'] .sdot, .mon-app[data-state='slow'] .sdot { background: var(--slow); }
.ap-state[data-state='down'] .sdot, .mon-app[data-state='down'] .sdot { background: var(--down); animation: blinkDot 1.1s steps(2) infinite; }
.ap-state[data-state='down'] { color: var(--down); }
.ap-host { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.ap-actions { display: flex; align-items: center; gap: 8px; }
.ap-body { flex: 1; overflow: auto; padding: 4px 22px 26px; display: flex; flex-direction: column; gap: 26px; overscroll-behavior: contain; }
.ap-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ap-h { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.ap-h svg { width: 16px; height: 16px; color: var(--tint); }
.ap-h .chip, .ap-h .faint { text-transform: none; letter-spacing: 0; font-weight: 700; }
.ap-count { margin-left: auto; font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--accent); }
.ap-alerts { display: flex; flex-direction: column; gap: 2px; margin: 0 -10px; }
.ap-empty { display: flex; align-items: center; gap: 12px; margin: 0; padding: 18px; border-radius: 16px; border: 1px dashed var(--border-hi); color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.ap-empty svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--tint); opacity: 0.8; }
.ap-foot { margin: 0; font-size: 12px; }
.ap-tabs button { height: 32px; font-size: 12.5px; }
.ap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.ap-stats > div { padding: 14px 16px; border-radius: 16px; background: rgba(var(--surface-rgb), 0.04); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.ap-stats > div::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ap-stats b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ap-stats b small { font-size: 13px; color: var(--text-2); font-weight: 700; }
.ap-stats span { font-size: 12px; color: var(--text-3); }
.ap-spark { width: 100%; height: 86px; display: block; overflow: visible; }
.ap-spark .l, .mon-spark .l { fill: none; stroke: var(--tint); stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--tint) 55%, transparent)); }
.ap-spark .a, .mon-spark .a { fill: color-mix(in srgb, var(--tint) 16%, transparent); }
.ap-wbody { display: flex; flex-direction: column; gap: 12px; }
.ap-np { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: rgba(var(--surface-rgb), 0.035); border: 1px solid var(--border); }

/* requests */
.reqs { display: flex; flex-direction: column; gap: 10px; }
.req { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 18px; background: rgba(var(--surface-rgb), 0.035); border: 1px solid var(--border); transition: border-color 0.3s, background-color 0.3s; }
.req[data-phase='waiting'] { border-color: color-mix(in srgb, var(--slow) 40%, var(--border)); background: color-mix(in srgb, var(--slow) 6%, transparent); }
.req .poster { width: 64px; height: 94px; }
.req-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.req-title { font-weight: 800; font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.req-sub { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; }
.req-state { margin-left: auto; font-weight: 700; color: var(--text-2); }
.req-dl { font-family: var(--mono); font-size: 11px; }
.req.approved { animation: approved 0.9s var(--spring); }
.req.declined { animation: declined 0.6s var(--in-out) forwards; }

/* downloads */
.dl-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dl-top .big-num { font-size: 44px; }
.dl-sum { flex: 1; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.dl-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.dl-list { display: flex; flex-direction: column; gap: 4px; }
.dl { display: flex; flex-direction: column; gap: 7px; padding: 11px 0; border-top: 1px solid var(--border); }
.dl:first-child { border-top: 0; }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dl-row .v { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dl-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.dl-meta .chip { padding: 1px 8px; font-size: 10.5px; }
.bar > i.paused { --bar: var(--slow); }
.bar > i.paused::after { display: none; }

/* just added */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.shelf-item { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: var(--text); text-align: left; scroll-snap-align: start; transition: transform 0.5s var(--spring); }
.shelf-item:hover { transform: translateY(-4px); }
.shelf-item .poster { width: 112px; height: 164px; border-radius: 14px; }
.shelf-item b { font-size: 12.5px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-item span { font-size: 11px; color: var(--text-3); }
.shelf-item .ndot { top: 8px; right: 8px; }

/* monitoring */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.mon-app { --icon: 36px; position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 16px; border-radius: 16px; background: rgba(var(--surface-rgb), 0.035); border: 1px solid var(--border); overflow: hidden; isolation: isolate; }
.mon-app .ticon { transform: none; }
.mon-app[data-state='down'] { border-color: color-mix(in srgb, var(--down) 50%, var(--border)); background: color-mix(in srgb, var(--down) 8%, transparent); }
.mon-n { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mon-n b { font-size: 13.5px; }
.mon-n > span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-spark { position: absolute; inset: auto 0 0 0; height: 12px; width: 100%; z-index: -1; opacity: 0.45; }

@keyframes bellRing { 0% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-7deg); } 75% { transform: rotate(4deg); } 100% { transform: rotate(0); } }
@keyframes badgePop { 0% { transform: translateZ(60px) scale(0.2); } 55% { transform: translateZ(60px) scale(1.35); } 100% { transform: translateZ(60px) scale(1); } }
@keyframes badgeOut { to { transform: translateZ(60px) scale(0); opacity: 0; } }
@keyframes critGlow { 0%, 100% { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 0 color-mix(in srgb, var(--down) 60%, transparent); } 50% { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 7px transparent; } }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes peekIn { from { opacity: 0; transform: translateX(-50%) translateZ(80px) translateY(12px) scale(0.6); filter: blur(6px); } to { opacity: 1; transform: translateX(-50%) translateZ(80px); filter: blur(0); } }
@keyframes peekOut { to { opacity: 0; transform: translateX(-50%) translateZ(80px) translateY(8px) scale(0.85); filter: blur(4px); } }
@keyframes orbLand { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.2); opacity: 0; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(-14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes nowPulse { 0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 18px -2px var(--accent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 6%, transparent), 0 0 24px 0 var(--accent); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes approved { 0% { transform: scale(1); } 35% { transform: scale(1.025); box-shadow: 0 0 0 2px var(--up), 0 0 40px -6px var(--up); } 100% { transform: none; } }
@keyframes declined { to { opacity: 0.35; transform: translateX(16px); filter: grayscale(1); } }

@media (max-width: 760px) {
  .apanel-wrap { padding: 0; place-items: end stretch; }
  .apanel { width: auto; max-height: 92vh; height: 92vh; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .ap-head { padding: 18px 16px 12px; gap: 12px; }
  .ap-icon { --icon: 50px; }
  .ap-title h2 { font-size: 21px; }
  .ap-actions { width: 100%; order: 3; }
  .ap-actions .btn.primary { flex: 1; justify-content: center; }
  .ap-head > .ap-actions .icon-btn { position: absolute; top: 14px; right: 14px; }
  .ap-body { padding: 4px 16px 26px; }
  .tpeek { max-width: 72vw; }
  .tbadge { top: -6px; right: -6px; }
  :root[data-tiles='icon'] .tbadge { right: calc(50% - 38px); }
  .dl-top .big-num { font-size: 36px; }
  .drawer.feed .ra-label { display: none; }
  .drawer.feed .modal-head h2 { font-size: 18px; }
}


/* settings → alerts */
.role-map { gap: 4px; }
.role-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); align-items: center; gap: 12px; padding: 6px 0; }
.role-row + .role-row { border-top: 1px solid var(--border); }
.role-row > span { display: flex; flex-direction: column; font-weight: 700; font-size: 14px; }
.role-row small { font-weight: 500; font-size: 12px; color: var(--text-3); }
.role-row .input { height: 38px; }
.hub-ok { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.hub-ok b { color: var(--text); }
.live-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; flex-shrink: 0; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: ping 2.4s var(--out) infinite; --pill: var(--up); }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.dev-row + .dev-row { border-top: 1px solid var(--border); padding-top: 12px; }
.dev-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.dev-ic svg { width: 18px; height: 18px; }
.dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-main b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dev-main small { font-size: 12px; color: var(--text-3); }
.dev-tools { display: flex; gap: 6px; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: #fff; background: var(--down); border-color: transparent; }

/* ---------- motion levels ---------- */
:root[data-motion='off'] *, :root[data-motion='off'] *::before, :root[data-motion='off'] *::after { animation: none !important; transition: none !important; }
:root[data-motion='subtle'] .tile, :root[data-motion='subtle'] .wcard, :root[data-motion='subtle'] .group { animation-name: fadeIn; animation-duration: 0.5s; }
:root[data-motion='subtle'] .greet .ch { animation: fadeIn 0.5s both !important; }
:root[data-motion='subtle'] .greet-name, :root[data-motion='subtle'] .greet-name .ch { animation: none !important; }
:root[data-motion='subtle'] .tile:hover { --lift: -2px; }
:root[data-motion='subtle'] .tile:hover .ticon { transform: translateZ(28px) scale(1.04); }
:root[data-motion='subtle'] .editing .tile, :root[data-motion='subtle'] .editing .wcard { animation: none; }
:root[data-motion='subtle'] .bar > i::after { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .shell { gap: 26px; padding-top: max(14px, env(safe-area-inset-top)); }
  .topbar { gap: 10px; }
  .brand { font-size: 18px; }
  .search-trigger { order: 3; flex-basis: 100%; max-width: none; }
  .search-trigger kbd { display: none; }
  .top-actions { margin-left: auto; gap: 6px; }
  .top-actions .hide-sm { display: none; }
  .status-pill { padding: 0 12px; }
  .status-pill .pill-text { display: none; }
  .hero { align-items: flex-start; flex-direction: column; gap: 10px; }
  .clock { display: none; }
  .wcard { grid-column: span 1; min-height: 0; }
  :root[data-tiles='card'] .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-tiles='card'] .tile { flex-direction: column; align-items: flex-start; gap: 12px; min-height: 0; padding: 14px 14px 24px; }
  .tspark { height: 20px; }
  :root[data-tiles='card'] .tbody { width: 100%; }
  :root[data-tiles='card'] .tstatus { position: absolute; top: 14px; right: 14px; }
  :root[data-tiles='card'] .tlat { display: none; }
  :root[data-tiles='icon'] .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  :root[data-tiles='icon'] .tile { padding: 12px 4px 10px; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
  :root[data-tiles='icon'] .ticon { width: 58px; height: 58px; background: color-mix(in srgb, var(--tint) 22%, var(--bg-2)); }
  :root[data-tiles='icon'] .tname { font-size: 12px; }
  :root[data-tiles='icon'] .tstatus { top: 6px; right: calc(50% - 36px); }
  .group-row { gap: 26px; }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: min(86vh, 860px); border-radius: 26px; animation-name: sheetIn; }
  .drawer.out { animation-name: sheetOut; }
  .modal { top: auto; bottom: 8px; transform: translateX(-50%); max-height: 90vh; animation-name: sheetModalIn; }
  .modal.out { animation-name: sheetModalOut; }
  .editbar-label .long { display: none; }
}
@media (max-width: 420px) {
  .lib b { font-size: 18px; }
  .rings { justify-content: center; }
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes sheetModalIn { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes sheetModalOut { to { transform: translate(-50%, 100%); } }
@media (hover: none) {
  #cursor-glow { display: none; }
  .tlat { opacity: 1; transform: none; }
}
@media print { #bg, #grain, #cursor-glow, .topbar, .editbar { display: none; } }

/* View-transition theme reveal */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
