/* Nexus License Admin — dark, glassy, animated. No external assets (CSP: 'self' only). */
:root {
  color-scheme: dark;
  --bg: #070a12; --bg2: #0b1020; --surface: rgba(18, 24, 40, .78); --surface-solid: #121828; --surface2: #182136;
  --line: rgba(120, 146, 196, .16); --line-strong: rgba(120, 146, 196, .32);
  --text: #e8eef9; --muted: #8b98b4; --faint: #5d6a86;
  --accent: #22d3ee; --accent2: #8b5cf6; --accent3: #3b82f6; --accent-soft: rgba(34, 211, 238, .12);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .13); --idle: #94a3b8; --idle-soft: rgba(148, 163, 184, .13);
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-bg: linear-gradient(180deg, rgba(14, 19, 33, .92), rgba(9, 13, 24, .92));
  --input-bg: rgba(4, 7, 14, .65); --input-bg-focus: rgba(4, 7, 14, .9); --hover: rgba(255, 255, 255, .04); --row-hover: rgba(255, 255, 255, .025);
  --toast-ok: rgba(10, 30, 26, .95); --toast-ok-fg: #d1fae5; --toast-bad: rgba(40, 12, 14, .95); --toast-bad-fg: #fecaca;
  --page-glow-a: rgba(139, 92, 246, .16); --page-glow-b: rgba(34, 211, 238, .12);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb; --bg2: #eef1f8; --surface: rgba(255, 255, 255, .86); --surface-solid: #ffffff; --surface2: #f1f4fa;
  --line: rgba(30, 41, 59, .1); --line-strong: rgba(30, 41, 59, .2);
  --text: #0f172a; --muted: #5b6478; --faint: #94a0b8;
  --accent: #0891b2; --accent2: #7c3aed; --accent-soft: rgba(8, 145, 178, .1);
  --ok: #059669; --ok-soft: rgba(5, 150, 105, .1); --warn: #b45309; --warn-soft: rgba(217, 119, 6, .12);
  --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .09); --idle: #64748b; --idle-soft: rgba(100, 116, 139, .12);
  --shadow: 0 10px 28px -16px rgba(15, 23, 42, .25), 0 1px 0 rgba(255, 255, 255, .6) inset;
  --side-bg: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(246, 248, 252, .92));
  --input-bg: #ffffff; --input-bg-focus: #ffffff; --hover: rgba(15, 23, 42, .04); --row-hover: rgba(15, 23, 42, .025);
  --toast-ok: #ecfdf5; --toast-ok-fg: #065f46; --toast-bad: #fef2f2; --toast-bad-fg: #991b1b;
  --page-glow-a: rgba(124, 58, 237, .08); --page-glow-b: rgba(8, 145, 178, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 14px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 600px at 85% -10%, var(--page-glow-a), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--page-glow-b), transparent 60%),
    var(--bg);
  background-attachment: fixed; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: #67e8f9; }
h1 { font-size: 24px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
h2 .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px;
  background: var(--side-bg); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px; }
.brand strong { letter-spacing: .14em; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #04121a; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 6px 22px -6px rgba(34, 211, 238, .6);
  animation: glow 4s ease-in-out infinite alternate;
}
@keyframes glow { to { box-shadow: 0 6px 26px -4px rgba(139, 92, 246, .7); } }
nav { display: flex; flex-direction: column; gap: 3px; }
nav .group { color: var(--faint); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 14px 12px 6px; }
nav a {
  position: relative; display: flex; align-items: center; gap: 11px; color: var(--muted); padding: 9px 12px; border-radius: 10px;
  transition: background .18s var(--ease), color .18s, transform .18s var(--ease);
}
nav a:hover { background: var(--hover); color: var(--text); transform: translateX(2px); }
nav a.on { background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .08)); color: var(--text); }
nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent2));
}
nav a.on svg.i { color: var(--accent); }
nav a .badge { margin-left: auto; }
.me { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .02); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #04121a;
  background: linear-gradient(135deg, #67e8f9, #a78bfa); text-transform: uppercase; flex: none; }
.me .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.me .who small { display: block; color: var(--muted); font-size: 11px; }
.main { padding: 30px 36px 60px; max-width: 1380px; width: 100%; animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Cards, grids ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); animation: rise .5s var(--ease) both;
}
.card.tight { padding: 0; overflow: hidden; }
.card.tight > h2 { padding: 18px 20px 0; }
.grid { display: grid; gap: 16px; margin-bottom: 18px; }
.grid > .card { margin-bottom: 0; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.995); } }
.grid > *:nth-child(2) { animation-delay: .05s; } .grid > *:nth-child(3) { animation-delay: .1s; }
.grid > *:nth-child(4) { animation-delay: .15s; } .grid > *:nth-child(5) { animation-delay: .2s; }
.grid > *:nth-child(6) { animation-delay: .25s; } .grid > *:nth-child(7) { animation-delay: .3s; } .grid > *:nth-child(8) { animation-delay: .35s; }

.metric {
  position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow); animation: rise .5s var(--ease) both;
  transition: transform .2s var(--ease), border-color .2s;
}
.metric:hover { transform: translateY(-3px); border-color: var(--line-strong); }
a.metric { display: block; color: var(--text); }
a.metric:hover { color: var(--text); }
.metric::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--tone, rgba(34, 211, 238, .18)), transparent 70%); pointer-events: none; }
.metric .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.metric .top svg.i { color: var(--tone-fg, var(--accent)); width: 20px; height: 20px; }
.metric b { display: block; font-size: 30px; font-weight: 650; margin-top: 8px; letter-spacing: -.02em; }
.metric small { color: var(--muted); }
.t-ok { --tone: rgba(52, 211, 153, .2); --tone-fg: var(--ok); }
.t-warn { --tone: rgba(251, 191, 36, .2); --tone-fg: var(--warn); }
.t-bad { --tone: rgba(248, 113, 113, .2); --tone-fg: var(--bad); }
.t-violet { --tone: rgba(139, 92, 246, .24); --tone-fg: #a78bfa; }

/* ---------- Chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar i {
  width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; min-height: 3px; display: block;
  background: linear-gradient(180deg, var(--accent), var(--accent2)); transform-origin: bottom;
  animation: grow .8s var(--ease) both; box-shadow: 0 6px 18px -8px rgba(34, 211, 238, .7);
}
.chart .bar.zero i { background: var(--line); box-shadow: none; }
.chart .bar small { color: var(--faint); font-size: 10.5px; }
.chart .bar b { font-size: 11px; color: var(--muted); font-weight: 500; }
@keyframes grow { from { transform: scaleY(0); } }
/* Bar heights as classes: the CSP forbids inline style attributes. */
.h0{height:0%} .h5{height:5%} .h10{height:10%} .h15{height:15%} .h20{height:20%} .h25{height:25%} .h30{height:30%} .h35{height:35%} .h40{height:40%} .h45{height:45%} .h50{height:50%} .h55{height:55%} .h60{height:60%} .h65{height:65%} .h70{height:70%} .h75{height:75%} .h80{height:80%} .h85{height:85%} .h90{height:90%} .h95{height:95%} .h100{height:100%}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .15s; animation: fadeRow .4s var(--ease) both; }
tbody tr:nth-child(2) { animation-delay: .02s; } tbody tr:nth-child(3) { animation-delay: .04s; } tbody tr:nth-child(4) { animation-delay: .06s; }
tbody tr:nth-child(5) { animation-delay: .08s; } tbody tr:nth-child(6) { animation-delay: .1s; } tbody tr:nth-child(n+7) { animation-delay: .12s; }
@keyframes fadeRow { from { opacity: 0; transform: translateX(-4px); } }
tbody tr:hover td { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
td .sub2 { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.empty svg.i { width: 34px; height: 34px; color: var(--faint); display: block; margin: 0 auto 8px; }

/* ---------- Pills, dots, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 7px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.pill.ok, .pill.Active { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.Suspended, .pill.Paused { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.Revoked, .pill.Expired, .pill.Blocked { background: var(--bad-soft); color: var(--bad); }
.pill.idle, .pill.Released, .pill.Offline, .pill.Disconnected { background: var(--idle-soft); color: var(--idle); }
.pill.info, .pill.Online { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--idle); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
.dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--ok-soft); color: var(--ok); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 6px 13px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; transition: all .18s var(--ease); }
.chips a:hover { border-color: var(--line-strong); color: var(--text); }
.chips a.on { border-color: rgba(34, 211, 238, .55); color: var(--accent); background: var(--accent-soft); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 12px; margin: 2px 4px 2px 0; }

/* ---------- Forms ---------- */
label, .lbl { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: span 2; } .form-grid .full { grid-column: 1 / -1; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 22px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
input, select, textarea {
  width: 100%; background: var(--input-bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .16); background: var(--input-bg-focus); }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer; 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='%238b98b4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
select option, select optgroup { background: var(--surface-solid); color: var(--text); padding: 8px; }
select option:checked { background: var(--accent-soft); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; cursor: pointer; }
input[type=datetime-local] { color-scheme: dark; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-size: 13px; margin: 0; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: all .15s; background: rgba(255, 255, 255, .02);
}
.checks label:hover { border-color: var(--line-strong); }
.checks label:has(input:checked) { border-color: rgba(34, 211, 238, .45); background: var(--accent-soft); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(4, 7, 14, .65); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg label { margin: 0; padding: 7px 14px; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px; transition: all .15s; }
.seg input { display: none; }
.seg label:has(input:checked) { background: linear-gradient(135deg, rgba(34, 211, 238, .22), rgba(139, 92, 246, .18)); color: var(--text); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > .grow { flex: 1; min-width: 180px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.toolbar .search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.toolbar .search input { padding-left: 36px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #22d3ee, #3b82f6 60%, #8b5cf6); background-size: 160% 160%; color: #fff;
  box-shadow: 0 8px 22px -10px rgba(59, 130, 246, .8); transition: transform .15s var(--ease), box-shadow .2s, background-position .4s, filter .2s;
}
.btn:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 12px 26px -10px rgba(139, 92, 246, .85); color: #fff; }
.btn:active { transform: translateY(0) scale(.98); }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .25) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .6s var(--ease); }
.btn:hover::after { transform: translateX(120%); }
.btn.ghost { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }
.btn.danger { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(248, 113, 113, .35); box-shadow: none; }
.btn.danger:hover { background: rgba(248, 113, 113, .22); color: #fecaca; }
.btn.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251, 191, 36, .35); box-shadow: none; }
.btn.warn:hover { background: rgba(251, 191, 36, .22); color: #fde68a; }
.btn.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(52, 211, 153, .35); box-shadow: none; }
.btn.ok:hover { background: rgba(52, 211, 153, .22); color: #a7f3d0; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn svg.i { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Misc ---------- */
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 440px; display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: 12px; background: var(--toast-ok); border: 1px solid rgba(52, 211, 153, .4); color: var(--toast-ok-fg);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .7); animation: toastIn .45s var(--ease) both;
}
.toast.err { background: var(--toast-bad); border-color: rgba(248, 113, 113, .45); color: var(--toast-bad-fg); }
.toast.hide { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.key {
  font: 600 22px/1.4 "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; color: var(--accent); background: rgba(4, 7, 14, .7);
  padding: 18px; border-radius: 12px; border: 1px dashed rgba(34, 211, 238, .55); word-break: break-all; text-align: center;
  animation: keyIn .6s var(--ease) both;
}
@keyframes keyIn { from { opacity: 0; letter-spacing: .3em; filter: blur(4px); } }
.callout { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); color: var(--muted); font-size: 13px; }
.callout.warn { border-color: rgba(251, 191, 36, .35); background: var(--warn-soft); color: #fde68a; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; }
.hero-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-status h1 { display: flex; align-items: center; gap: 12px; }
.device { display: flex; gap: 12px; align-items: center; }
.device .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); flex: none; }
.device .ico svg.i { color: var(--muted); }
.device.online .ico { border-color: rgba(52, 211, 153, .4); background: var(--ok-soft); }
.device.online .ico svg.i { color: var(--ok); }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > .pop { animation: popIn .18s var(--ease) both; }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 14px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8);
}
.pop .lbl { margin-top: 2px; }
.pop .btn-row { margin-top: 10px; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop.floating { position: fixed; right: auto; z-index: 100; animation: popIn .18s var(--ease) both; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.timeline .when { color: var(--faint); font-size: 12px; }
.timeline .what { font-weight: 550; }
.login { width: 100%; max-width: 410px; padding: 32px; animation: rise .6s var(--ease) both; }
.login .brand { justify-content: center; margin-bottom: 18px; }
.login h1 { text-align: center; font-size: 22px; }
.login .sub { text-align: center; margin-bottom: 22px; }
.login .field { margin-bottom: 14px; }
.orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; animation: float 14s ease-in-out infinite alternate; }
.orb.a { width: 340px; height: 340px; background: #0e7490; top: -80px; left: -60px; }
.orb.b { width: 300px; height: 300px; background: #6d28d9; bottom: -90px; right: -40px; animation-delay: -6s; }
@keyframes float { to { transform: translate(40px, 30px) scale(1.08); } }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.theme-fab { position: fixed; top: 16px; right: 16px; z-index: 5; }
:root[data-theme="light"] .key { background: #f0fbff; }
:root[data-theme="light"] .btn.ghost { background: #fff; }
:root[data-theme="light"] .btn.danger:hover { color: #7f1d1d; } :root[data-theme="light"] .btn.warn:hover { color: #78350f; }
:root[data-theme="light"] .btn.ok:hover { color: #064e3b; } :root[data-theme="light"] .callout.warn { color: #92400e; }
:root[data-theme="light"] .orb { opacity: .18; }
:root[data-theme="light"] .tag, :root[data-theme="light"] .checks label { background: #fff; }
:root[data-theme="light"] input[type=datetime-local] { color-scheme: light; }

@media (max-width: 1100px) { .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 14px; }
  nav { flex-direction: row; flex-wrap: wrap; } nav .group { display: none; } nav a.on::before { display: none; }
  .me { margin-top: 0; }
  .main { padding: 18px 14px 40px; }
  dl.kv { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Account & sign-in ---------- */
.center-text { text-align: center; justify-content: center; }
.small { font-size: 12.5px; }
.avatar.xl { width: 64px; height: 64px; font-size: 26px; margin: 4px auto 12px; display: grid; }
.profile-card h2 { margin-bottom: 16px; }
.profile-card dl.kv { grid-template-columns: 110px 1fr; margin-bottom: 14px; }
.steps { margin: 0 0 10px; padding-left: 20px; color: var(--muted); font-size: 13px; }
.steps li { margin-bottom: 6px; }
.secret-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 14px;
  border-radius: 12px; border: 1px dashed rgba(34, 211, 238, .5); background: var(--accent-soft); }
.secret-box .mono { font-size: 15px; letter-spacing: .12em; color: var(--accent); font-weight: 600; word-break: break-all; }
.code-input { font: 600 20px/1.2 "Cascadia Mono", Consolas, monospace; letter-spacing: .5em; text-align: center; }
.mfa-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px;
  background: var(--accent-soft); color: var(--accent); }
.mfa-icon svg.i { width: 28px; height: 28px; }
.callout.ok-callout { border-color: rgba(52, 211, 153, .35); background: var(--ok-soft); color: var(--ok); display: flex; gap: 8px; align-items: center; }

/* File drop zone (app updates) */
.dropzone { position: relative; display: flex; align-items: center; min-height: 92px; padding: 16px 18px; margin: 0; cursor: pointer; font-size: 14px; font-weight: 400;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--input-bg);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.dropzone:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dropzone.drag { border-color: var(--accent); border-style: solid; transform: scale(1.01); box-shadow: 0 0 0 6px var(--accent-soft), 0 10px 30px -12px var(--accent); }
.dropzone.bad { border-color: var(--bad, #f87171); animation: dz-shake .35s; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone > span { display: flex; align-items: center; gap: 14px; width: 100%; pointer-events: none; }
.dropzone .dz-picked { display: none; }
.dropzone.has-file .dz-empty { display: none; }
.dropzone.has-file .dz-picked { display: flex; animation: rise .35s var(--ease) both; }
.dropzone.has-file { border-style: solid; border-color: var(--line-strong); }
.dz-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.dz-icon svg.i { width: 22px; height: 22px; }
.dropzone:hover .dz-empty .dz-icon, .dropzone.drag .dz-icon { animation: dz-bob 1s var(--ease) infinite alternate; }
.dz-icon.ok { background: rgba(52, 211, 153, .15); color: #34d399; box-shadow: none; }
.dz-text { flex: 1; color: var(--muted); }
.dz-text b { color: var(--text); font-weight: 600; }
.dz-text u { color: var(--accent); text-decoration: none; border-bottom: 1px dashed currentColor; }
.dz-hint { color: var(--faint, var(--muted)); font-size: 12px; letter-spacing: .02em; }
.dz-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dz-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone .btn.sm { pointer-events: none; padding: 6px 12px; font-size: 12.5px; }
@keyframes dz-bob { to { transform: translateY(-4px); } }
@keyframes dz-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
