:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-deep: #02040c;
  --surface: rgba(10, 17, 43, .72);
  --surface-solid: #0a112b;
  --surface-raised: rgba(19, 31, 72, .86);
  --text: #edf5ff;
  --muted: #9caed1;
  --line: rgba(144, 180, 255, .16);
  --line-bright: rgba(84, 214, 255, .38);
  --cyan: #42d9ff;
  --blue: #6074ff;
  --coral: #ff715b;
  --green: #54f58a;
  --warning: #ffc268;
  --danger: #ff5d7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
  --radius: 24px;
  --header: 80px;
  --sidebar-width: 278px;
  --sidebar-collapsed-width: 86px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef6ff;
  --bg-deep: #dceafb;
  --surface: rgba(255, 255, 255, .76);
  --surface-solid: #fff;
  --surface-raised: rgba(255, 255, 255, .94);
  --text: #091735;
  --muted: #536583;
  --line: rgba(30, 69, 133, .14);
  --line-bright: rgba(18, 123, 181, .35);
  --cyan: #087eaa;
  --blue: #4058e8;
  --coral: #d74836;
  --green: #0a9b50;
  --shadow: 0 24px 80px rgba(42, 75, 128, .15);
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: var(--bg);
}
html { min-height: 100%; scroll-behavior: smooth; }
body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--text); }
img { max-width: 100%; }
code { font-family: "SFMono-Regular", Consolas, monospace; }
::selection { color: #05101f; background: var(--cyan); }

.skip-link {
  position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 16px;
  color: var(--bg); background: var(--text); border-radius: 10px; transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.ambient { position: fixed; z-index: -2; inset: 0; overflow: hidden; pointer-events: none; }
.space-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .88; }
:root[data-theme="light"] .space-canvas { opacity: .48; }
.ambient::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 10%, rgba(66,217,255,.08) 0 1px, transparent 1.5px), radial-gradient(circle at 80% 25%, rgba(255,113,91,.08) 0 1px, transparent 1.5px);
  background-size: 42px 42px, 61px 61px; mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.ambient span { position: absolute; width: 34vw; aspect-ratio: 1; border-radius: 50%; filter: blur(100px); opacity: .13; animation: drift 18s ease-in-out infinite alternate; }
.ambient span:nth-child(1) { top: -15%; left: -8%; background: var(--blue); }
.ambient span:nth-child(2) { top: 30%; right: -15%; background: var(--cyan); animation-delay: -8s; }
.ambient span:nth-child(3) { bottom: -20%; left: 36%; background: var(--coral); animation-delay: -13s; }

.site-header {
  position: sticky; z-index: 100; top: 0; min-height: var(--header); display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr); align-items: center; gap: 28px;
  padding: 12px clamp(20px, 4vw, 72px); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 76%, transparent); backdrop-filter: blur(24px) saturate(140%);
}
.control-sidebar {
  position: fixed; z-index: 130; inset: 0 auto 0 0; width: var(--sidebar-width); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 14px 12px 16px; border-right: 1px solid var(--line-bright);
  background: color-mix(in srgb, var(--surface-solid) 48%, transparent); box-shadow: 18px 0 60px rgba(0,0,0,.18);
  backdrop-filter: blur(26px) saturate(145%); -webkit-backdrop-filter: blur(26px) saturate(145%);
  transition: width .28s cubic-bezier(.2,.8,.2,1), background .25s, box-shadow .25s;
}
.control-sidebar[hidden] { display: none; }
.sidebar-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 16px; }
.sidebar-brand { min-width: 0; display: flex; align-items: center; gap: 9px; color: var(--text); }
.sidebar-brand img, .sidebar-copyright img { flex: 0 0 auto; filter: drop-shadow(0 0 16px rgba(66,217,255,.2)); }
.sidebar-brand span { min-width: 0; display: flex; align-items: baseline; letter-spacing: -.04em; white-space: nowrap; }
.sidebar-brand small { color: var(--coral); font-weight: 800; }
.sidebar-toggle { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); cursor: pointer; }
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { color: var(--cyan); border-color: var(--line-bright); outline: none; }
.sidebar-nav { min-height: 0; display: grid; align-content: start; gap: 5px; overflow-x: hidden; overflow-y: auto; padding: 8px 0; }
.sidebar-nav a { min-height: 46px; display: flex; align-items: center; gap: 13px; padding: 10px 13px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); white-space: nowrap; }
.sidebar-nav a[hidden] { display: none; }
.sidebar-nav a i { width: 22px; flex: 0 0 22px; color: var(--cyan); text-align: center; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: var(--text); border-color: var(--line); background: color-mix(in srgb, var(--surface-raised) 62%, transparent); }
.sidebar-nav a.active { border-color: color-mix(in srgb, var(--cyan) 32%, var(--line)); box-shadow: inset 3px 0 0 var(--cyan); }
.sidebar-separator { height: 1px; margin: 9px 12px; background: var(--line); }
.sidebar-foot { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar-copyright { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.sidebar-copyright p { margin: 0; }
.sidebar-copyright strong { color: var(--text); }
.sidebar-legal { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 8px; font-size: .65rem; }
.sidebar-legal a { color: var(--muted); }
.sidebar-legal p { width: 100%; margin: 2px 0 0; color: var(--warning); line-height: 1.3; }
.sidebar-telemetry.api-telemetry { display: grid; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; gap: 8px 10px; margin: 0; padding: 11px; background: color-mix(in srgb, var(--surface) 62%, transparent); font-size: .66rem; }
.sidebar-telemetry > span:not(.telemetry-pulse) { min-width: 0; }
.sidebar-telemetry > span:nth-child(n+3) { grid-column: 2; }
.sidebar-telemetry time, .sidebar-telemetry code { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; }
body.authenticated { --sidebar-current: var(--sidebar-width); }
body.authenticated.sidebar-collapsed { --sidebar-current: var(--sidebar-collapsed-width); }
body.authenticated .control-sidebar { width: var(--sidebar-current); }
body.authenticated .site-header, body.authenticated #app, body.authenticated .update-banner { margin-left: var(--sidebar-current); transition: margin-left .28s cubic-bezier(.2,.8,.2,1); }
body.authenticated .site-header { grid-template-columns: 1fr; padding-left: 18px; background: color-mix(in srgb, var(--bg) 54%, transparent); }
body.authenticated .site-header > .brand, body.authenticated .main-nav { display: none; }
body.authenticated .site-footer { display: none; }
body.sidebar-collapsed .control-sidebar { padding-inline: 9px; }
body.sidebar-collapsed .sidebar-head { display: grid; justify-items: center; }
body.sidebar-collapsed .sidebar-brand img { width: 40px; height: 40px; }
body.sidebar-collapsed .sidebar-label { display: none !important; }
body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding-inline: 8px; }
body.sidebar-collapsed .sidebar-separator { margin-inline: 7px; }
body.sidebar-collapsed .sidebar-copyright { display: grid; justify-items: center; gap: 5px; padding: 0; text-align: center; }
body.sidebar-collapsed .sidebar-telemetry.api-telemetry { display: grid; grid-template-columns: 1fr; justify-items: center; padding: 10px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; color: var(--text); }
.brand img { filter: drop-shadow(0 0 18px rgba(66,217,255,.18)); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.brand:hover img { transform: rotate(7deg) scale(1.05); }
.wordmark { display: flex; align-items: baseline; letter-spacing: -.045em; line-height: 1; }
.wordmark strong { font-size: 1.24rem; }
.wordmark small { color: var(--coral); font-weight: 750; font-size: .8rem; letter-spacing: -.02em; }
.brand-dot { color: var(--green); text-shadow: 0 0 12px var(--green); }
.main-nav { display: flex; align-items: center; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.main-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; color: var(--muted); font-size: .9rem; }
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--surface-raised); }
.header-actions { display: flex; justify-content: flex-end; gap: 10px; }
.user-menu { position: relative; }
.session-link { white-space: nowrap; }
.session-chevron { margin-left: 2px; color: var(--muted); font-size: .68rem; transition: transform .2s; }
.session-link[aria-expanded="true"] .session-chevron { transform: rotate(180deg); }
.session-menu { position: absolute; z-index: 120; top: calc(100% + 10px); right: 0; width: max-content; min-width: 210px; padding: 7px; border: 1px solid var(--line-bright); border-radius: 16px; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); box-shadow: 0 22px 60px rgba(0,0,0,.38); backdrop-filter: blur(22px) saturate(140%); }
.session-menu[hidden] { display: none; }
.session-menu a, .session-menu button { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; border-radius: 10px; color: var(--text); background: transparent; font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.session-menu a:hover, .session-menu a:focus-visible, .session-menu button:hover, .session-menu button:focus-visible { color: var(--text); background: var(--surface-raised); outline: none; }
.session-menu i { width: 18px; color: var(--cyan); text-align: center; }
.session-menu button[data-logout] { color: var(--danger); }
.session-menu button[data-logout] i { color: currentColor; }
.icon-button, .button {
  border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface);
  min-height: 44px; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; cursor: pointer; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.icon-button { width: 44px; padding: 0; }
.button:hover, .icon-button:hover { transform: translateY(-2px); border-color: var(--line-bright); color: var(--text); }
.button-primary { color: #03101b; border-color: transparent; background: linear-gradient(135deg, var(--cyan), #8cf1ff); box-shadow: 0 12px 34px rgba(66,217,255,.2); }
.button-primary:hover { color: #03101b; box-shadow: 0 16px 42px rgba(66,217,255,.3); }
.button-accent { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--blue), #8b65ff); }
.button-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.button-small { min-height: 36px; padding: 6px 12px; font-size: .82rem; }
.button[disabled], button[disabled] { opacity: .48; cursor: wait; transform: none; }

#app { min-height: calc(100vh - var(--header)); outline: none; }
.page { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: clamp(54px, 8vw, 110px) 0; animation: page-in .5s ease both; }
.page-narrow { width: min(820px, calc(100% - 40px)); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .76rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; box-shadow: 0 0 10px currentColor; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; margin: 0 0 .6em; }
h1 { max-width: 920px; font-size: clamp(2.7rem, 7vw, 6.8rem); }
h2 { font-size: clamp(2rem, 4vw, 3.7rem); }
h3 { font-size: 1.25rem; }
.lede { max-width: 720px; margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.35rem); }
.gradient-text { color: transparent; background: linear-gradient(100deg, var(--cyan), var(--blue) 48%, var(--coral)); background-clip: text; -webkit-background-clip: text; }

.hero { position: relative; isolation: isolate; min-height: calc(100vh - var(--header)); display: grid; place-items: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; z-index: -2; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 72%, transparent) 0%, color-mix(in srgb, var(--bg) 36%, transparent) 58%, color-mix(in srgb, var(--bg) 10%, transparent)), url("/assets/img/cosmic-network.png") center/cover; opacity: .62; }
:root[data-theme="light"] .hero::before { opacity: .24; mix-blend-mode: multiply; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0; height: 20%; background: linear-gradient(transparent, color-mix(in srgb, var(--bg) 82%, transparent)); }
.hero-content { width: min(1220px, calc(100% - 40px)); padding: 90px 0 130px; }
.hero h1 { margin-top: 18px; }
.hero-content h1 { max-width: 760px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.signal-line { display: flex; align-items: center; gap: 14px; margin-top: 58px; color: var(--muted); font-size: .84rem; letter-spacing: .05em; }
.signal-line::before { content: ""; width: 58px; height: 1px; background: linear-gradient(90deg, transparent, var(--green)); animation: signal 2s ease-in-out infinite; }
.orbit-system { position: absolute; right: clamp(-130px, 3vw, 30px); top: 50%; width: min(40vw, 530px); aspect-ratio: 1; transform: translateY(-52%); pointer-events: none; opacity: .88; }
.orbit-system .ring { position: absolute; inset: 10%; border: 1px solid rgba(111,205,255,.28); border-radius: 50%; transform: rotate(20deg); animation: rotate 26s linear infinite; }
.orbit-system .ring:nth-child(2) { inset: 24%; transform: rotate(-38deg); animation-direction: reverse; animation-duration: 17s; border-color: rgba(255,113,91,.3); }
.orbit-system .ring::after { content: ""; position: absolute; top: 44%; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 24px var(--cyan); }
.orbit-system .core { position: absolute; inset: 38%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--cyan) 15%, var(--blue) 42%, transparent 70%); filter: drop-shadow(0 0 44px rgba(66,217,255,.55)); animation: breathe 4s ease-in-out infinite; }
.hero-emblem { position: absolute; z-index: -1; right: clamp(-120px, 0vw, 30px); top: 50%; width: min(48vw, 700px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; animation: emblem-float 8s ease-in-out infinite; }
.hero-emblem::after { content: ""; position: absolute; inset: 15%; border-radius: 50%; box-shadow: 0 0 100px rgba(66,217,255,.13), 0 0 160px rgba(255,113,91,.08); }
.hero-emblem img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; filter: saturate(.92) contrast(1.04); mask-image: radial-gradient(circle, #000 54%, rgba(0,0,0,.94) 70%, transparent 78%); }
:root[data-theme="light"] .hero-emblem { opacity: .86; filter: drop-shadow(0 30px 60px rgba(23,52,108,.22)); }

.section { padding: clamp(70px, 10vw, 140px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.section-head p { max-width: 530px; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface-raised), var(--surface)); box-shadow: var(--shadow); overflow: hidden; }
.feature-card { min-height: 280px; padding: 30px; transition: transform .35s, border-color .35s; }
.feature-card:hover { transform: translateY(-8px); border-color: var(--line-bright); }
.feature-card .icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 55px; border-radius: 16px; font-size: 1.25rem; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 25%, transparent); }
.feature-card:nth-child(2) .icon { color: var(--coral); background: color-mix(in srgb, var(--coral) 12%, transparent); }
.feature-card:nth-child(3) .icon { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.feature-card p { color: var(--muted); }
.feature-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -50px; top: -50px; border: 1px solid var(--line); border-radius: 50%; }

.auth-page { min-height: calc(100vh - var(--header)); width: 100%; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(410px, .88fr); }
.auth-visual { position: relative; overflow: hidden; min-height: 720px; background: linear-gradient(140deg, rgba(4,8,24,.28), var(--bg)), url("/assets/img/cosmic-network.png") center/cover; }
.auth-visual-content { position: absolute; z-index: 2; left: clamp(30px, 6vw, 90px); right: 30px; bottom: 11%; }
.auth-visual h1 { font-size: clamp(3rem, 6vw, 6.4rem); }
.auth-visual .orbit-system { right: 8%; top: 39%; width: 48%; }
.auth-panel { display: grid; place-items: center; padding: 54px clamp(24px, 6vw, 90px); background: color-mix(in srgb, var(--surface-solid) 84%, transparent); backdrop-filter: blur(22px); }
.auth-box { width: min(460px, 100%); }
.auth-box h2 { font-size: clamp(2.2rem, 4vw, 3.3rem); }
.auth-box > p { color: var(--muted); margin-bottom: 30px; }
.auth-switch { margin-top: 22px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: grid; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 720; font-size: .88rem; }
.field small { color: var(--muted); font-size: .76rem; }
.input-wrap { position: relative; }
.input-wrap i { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input, .field textarea, .field select {
  width: 100%; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 15px; outline: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input { padding-left: 43px; }
.field textarea { min-height: 170px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 12%, transparent); background: var(--surface-raised); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 12px; color: var(--muted); border: 1px solid var(--line); border-right: 0; border-radius: 14px 0 0 14px; background: var(--surface-solid); font-family: monospace; font-size: .82rem; }
.input-prefix input { min-width: 0; border-radius: 0 14px 14px 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.form-actions .button-primary { flex: 1; }
.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.provider-list { display: grid; gap: 10px; }
.provider-list .button { width: 100%; }
.passkey-button { border-color: color-mix(in srgb, var(--green) 38%, var(--line)); }
.passkey-button i { color: var(--green); }

.prose { color: var(--muted); font-size: 1rem; }
.prose h2 { margin-top: 2em; color: var(--text); font-size: 1.7rem; }
.prose h3 { margin-top: 1.8em; color: var(--text); letter-spacing: -.02em; }
.prose strong { color: var(--text); }
.prose .notice { padding: 20px 24px; color: var(--text); border-left: 3px solid var(--warning); background: color-mix(in srgb, var(--warning) 8%, transparent); border-radius: 0 14px 14px 0; }
.legal-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 45px; }
.legal-index a { padding: 7px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; }

.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.dashboard-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.dashboard-nav a { padding: 9px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 11px; }
.dashboard-nav a:hover { color: var(--text); border-color: var(--line-bright); }
.profile-tabs { display: inline-flex; gap: 6px; margin: 28px 0; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.profile-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--muted); border-radius: 11px; }
.profile-tabs a:hover, .profile-tabs a.active { color: var(--text); background: color-mix(in srgb, var(--cyan) 10%, var(--surface-solid)); }
.profile-tabs a.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 30%, var(--line)); }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.security-heading-icon { color: var(--cyan); font-size: 1.5rem; }
.totp-secret { display: grid; gap: 10px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--line-bright); border-radius: 15px; background: var(--bg-deep); }
.totp-secret small { color: var(--muted); }
.totp-secret code { color: var(--green); font-size: clamp(.8rem, 2vw, 1rem); overflow-wrap: anywhere; letter-spacing: .08em; }
.totp-secret .button { justify-self: start; }
.recovery-codes { padding: 18px; color: var(--green); background: var(--bg-deep); border: 1px solid var(--line); border-radius: 15px; font-size: 1rem; line-height: 1.8; letter-spacing: .08em; text-align: center; }
.integration-form { align-items: end; margin-bottom: 26px; }
.integration-list { display: grid; gap: 10px; margin-top: 24px; }
.integration-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.integration-item > i { width: 42px; height: 42px; display: grid; place-items: center; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); border-radius: 13px; }
.integration-item p { margin: 2px 0; color: var(--muted); }
.integration-item small { color: var(--muted); }
.integration-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field-stack { grid-template-columns: 1fr; }
.copy-field textarea { min-height: 130px; resize: vertical; font-family: "SFMono-Regular", Consolas, monospace; font-size: .78rem; }
.stats { grid-template-columns: repeat(3, 1fr); margin: 28px 0; }
.stat { padding: 24px; }
.stat strong { display: block; font-size: 2.2rem; line-height: 1; }
.stat span { color: var(--muted); font-size: .84rem; }
.panel { padding: clamp(20px, 4vw, 34px); }
.panel + .panel { margin-top: 20px; }
.grid > .panel + .panel { margin-top: 0; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.panel-header h2 { margin: 0; font-size: 1.55rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: .88rem; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-solid); }
tr:last-child td { border-bottom: 0; }
td.actions, th.actions { position: sticky; right: 0; z-index: 1; background: var(--surface-solid); }
.truncate { display: inline-block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.truncate:focus, .truncate:hover { white-space: normal; overflow: visible; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); font-size: .72rem; }
.badge-ok { color: var(--green); }
.badge-warn { color: var(--warning); }
.passkey-list { display: grid; gap: 10px; }
.passkey { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.passkey > i { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); border-radius: 13px; }
.passkey p { margin: 0; }
.passkey small { color: var(--muted); }
.passkey-actions { display: flex; gap: 7px; }

.relay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 42px 0; }
.relay-card { padding: clamp(24px, 4vw, 38px); }
.relay-card-head { display: flex; align-items: center; gap: 18px; }
.relay-card-head h2 { margin: 4px 0 0; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.relay-icon, .confirm-icon { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; color: var(--green); font-size: 1.4rem; background: color-mix(in srgb, var(--green) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line)); box-shadow: 0 0 30px color-mix(in srgb, var(--green) 10%, transparent); }
.relay-card > p { min-height: 48px; color: var(--muted); }
.relay-activate { width: 100%; min-height: 168px; margin: 22px 0 18px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--line)); border-radius: 24px; color: #03101b; background: radial-gradient(circle at 50% 0, rgba(255,255,255,.72), transparent 42%), linear-gradient(135deg, var(--cyan), var(--green)); box-shadow: 0 20px 45px color-mix(in srgb, var(--cyan) 18%, transparent); cursor: pointer; transition: transform .2s, box-shadow .2s, filter .2s; }
.relay-activate:hover { transform: translateY(-3px); box-shadow: 0 25px 58px color-mix(in srgb, var(--cyan) 28%, transparent); filter: saturate(1.08); }
.relay-activate:focus-visible { outline: 4px solid color-mix(in srgb, var(--cyan) 34%, transparent); outline-offset: 4px; }
.relay-activate i { font-size: 2.3rem; }
.relay-activate span { font-size: 1.55rem; font-weight: 850; letter-spacing: -.02em; }
.relay-activate small { font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.relay-direct-link { width: 100%; margin-bottom: 18px; }
.relay-last { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
.relay-admin { margin-top: clamp(70px, 10vw, 130px); }
.relay-share-list { display: grid; gap: 12px; }
.relay-share { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(280px, 2fr) auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.relay-share small { color: var(--muted); }
.relay-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.share-users { display: flex; flex-wrap: wrap; gap: 7px; }
.share-users .badge { cursor: pointer; }

body.relay-focus-mode { overflow: hidden; }
body.relay-focus-mode .site-header, body.relay-focus-mode .site-footer, body.relay-focus-mode .api-telemetry, body.relay-focus-mode .update-banner, body.relay-focus-mode .control-sidebar { display: none; }
body.relay-focus-mode #app { min-height: 100svh; margin-left: 0; }
.relay-focus-page { position: relative; min-height: 100svh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); animation: page-in .4s ease both; }
.focus-back { position: absolute; z-index: 2; top: max(22px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; }
.relay-focus-control { width: min(620px, 100%); text-align: center; }
.relay-focus-control .eyebrow { justify-content: center; }
.relay-focus-control h1 { margin: 14px auto 26px; font-size: clamp(2.4rem, 9vw, 5.4rem); }
.relay-focus-button { min-height: clamp(260px, 48svh, 480px); margin: 0; border-radius: clamp(28px, 6vw, 52px); }
.relay-focus-button i { font-size: clamp(3.4rem, 13vw, 6.2rem); }
.relay-focus-button span { font-size: clamp(2rem, 8vw, 4rem); }
.focus-hint { display: block; margin-top: 22px; color: var(--muted); }
.focus-hint i { margin-right: 6px; }

.confirm-dialog { width: min(520px, calc(100% - 32px)); padding: clamp(26px, 5vw, 42px); color: var(--text); background: var(--surface-solid); border: 1px solid var(--line-bright); border-radius: 26px; box-shadow: 0 35px 100px rgba(0,0,0,.52); }
.confirm-dialog::backdrop { background: rgba(1,4,14,.72); backdrop-filter: blur(12px); }
.confirm-dialog .confirm-icon { margin-bottom: 24px; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 30%, var(--line)); }
.confirm-dialog h2 { margin-top: 10px; font-size: clamp(2rem, 6vw, 3.2rem); }
.confirm-dialog p { color: var(--muted); }
.confirm-dialog .form-actions { justify-content: flex-end; }
.confirm-dialog.form-dialog { width: min(780px, calc(100% - 32px)); }
.passkey-modal-icon { color: var(--green) !important; background: color-mix(in srgb, var(--green) 12%, var(--surface)) !important; border-color: color-mix(in srgb, var(--green) 30%, var(--line)) !important; }
.form-status { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line-bright); border-radius: 13px; color: var(--text) !important; background: var(--surface); font-size: .86rem; }
.form-status.progress { border-color: color-mix(in srgb, var(--cyan) 42%, var(--line)); }
.form-status.progress::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 9px; vertical-align: -1px; border: 2px solid color-mix(in srgb, var(--cyan) 28%, transparent); border-top-color: var(--cyan); border-radius: 50%; animation: rotate .8s linear infinite; }
.form-status.error { border-color: color-mix(in srgb, var(--coral) 50%, var(--line)); color: var(--coral) !important; background: color-mix(in srgb, var(--coral) 8%, var(--surface)); }
.toggle-field { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.toggle-field input { width: auto; }

.audit-dialog { width: min(960px, calc(100% - 32px)) !important; max-height: min(900px, calc(100svh - 32px)); overflow: auto; }
.audit-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.audit-meta div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.audit-meta dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }
.audit-meta dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.audit-meta .audit-meta-wide { grid-column: 1 / -1; }
.audit-payloads { display: grid; gap: 12px; }
.audit-payloads section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-deep); }
.audit-payloads h3 { margin: 0 0 9px; font-size: .82rem; color: var(--muted); }
.audit-payloads pre { max-height: 260px; margin: 0; overflow: auto; color: var(--green); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .76rem; }
.contact-dialog { width: min(760px, calc(100% - 32px)) !important; max-height: calc(100svh - 32px); overflow: auto; }
.contact-message-body { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-deep); }
.contact-message-body h3 { margin: 0 0 10px; color: var(--muted); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.contact-message-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.commit-list { display: grid; gap: 10px; }
.commit { display: grid; grid-template-columns: 86px 1fr auto; gap: 16px; align-items: start; padding: 17px 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.commit code { color: var(--cyan); }
.commit p { margin: 0; font-weight: 700; }
.commit small { color: var(--muted); }
.commit-stats { display: flex; gap: 10px; font-family: monospace; font-size: .76rem; }
.add { color: var(--green); } .del { color: var(--coral); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.loading { min-height: 45vh; display: grid; place-items: center; color: var(--muted); }
.loader { width: 42px; height: 42px; border: 2px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: rotate 1s linear infinite; }

.api-telemetry { grid-column: 1 / -1; justify-self: stretch; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 4px; padding: 13px 16px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; font-size: .72rem; }
.api-telemetry span:not(.telemetry-pulse) { display: grid; }
.api-telemetry small { opacity: .7; }
.api-telemetry time, .api-telemetry code { color: var(--text); font-size: .72rem; }
.telemetry-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning) 45%, transparent); animation: pulse 2s infinite; }
.api-telemetry.online .telemetry-pulse { background: var(--green); }

.update-banner { position: sticky; z-index: 95; top: var(--header); display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 20px; color: var(--text); background: color-mix(in srgb, var(--blue) 22%, var(--surface-solid)); border-bottom: 1px solid color-mix(in srgb, var(--cyan) 34%, var(--line)); box-shadow: var(--shadow); }
.update-banner[hidden] { display: none; }
.update-banner > i { color: var(--cyan); font-size: 1.25rem; }
.update-banner span { display: grid; gap: 2px; }
.update-banner small { color: var(--muted); }
.update-banner code { color: var(--cyan); }

.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 35px; padding: 60px clamp(20px, 4vw, 72px) 100px; border-top: 1px solid var(--line); background: var(--bg-deep); }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand p, .footer-legal p { margin: 0; }
.footer-brand span, .footer-legal { color: var(--muted); font-size: .78rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.site-footer nav a { color: var(--muted); font-size: .84rem; }
.footer-legal { text-align: right; }
.confidential { color: var(--warning); }

.toast-region { position: fixed; z-index: 300; top: 92px; right: 18px; display: grid; gap: 8px; }
.toast { max-width: min(390px, calc(100vw - 36px)); padding: 13px 16px; border: 1px solid var(--line-bright); border-radius: 14px; color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow); animation: toast-in .3s ease both; }
.toast.error { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }

@keyframes drift { to { transform: translate(12%, 10%) scale(1.12); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); filter: drop-shadow(0 0 60px rgba(66,217,255,.7)); } }
@keyframes signal { 50% { width: 80px; opacity: .45; } }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes emblem-float { 0%, 100% { transform: translateY(-50%) rotate(-1deg); } 50% { transform: translateY(calc(-50% - 12px)) rotate(1deg); } }

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

@media (max-width: 980px) {
  body.authenticated { --sidebar-current: 250px; }
  body.authenticated.sidebar-collapsed { --sidebar-current: 78px; }
  .site-header { grid-template-columns: 1fr auto; }
  .main-nav { position: fixed; z-index: 90; left: 50%; bottom: 16px; transform: translateX(-50%); box-shadow: var(--shadow); }
  .feature-grid, .stats { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: 460px; }
  .auth-panel { padding-top: 70px; padding-bottom: 100px; }
  .site-footer { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { justify-content: center; }
  .footer-legal { text-align: center; }
  .relay-grid { grid-template-columns: 1fr; }
  .relay-share { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --header: 70px; }
  body.authenticated, body.authenticated.sidebar-collapsed { --sidebar-current: 72px; }
  body.authenticated:not(.sidebar-collapsed) .control-sidebar { width: min(278px, calc(100vw - 32px)); box-shadow: 22px 0 80px rgba(0,0,0,.44); }
  body.authenticated .site-header { padding-inline: 10px; }
  body.authenticated .page { width: min(1220px, calc(100% - 24px)); }
  .site-header { grid-template-columns: auto 1fr auto; gap: 8px; padding: 8px 16px; }
  .wordmark { display: none; }
  .brand img { width: 44px; height: 44px; }
  .main-nav { position: static; justify-self: center; transform: none; box-shadow: none; }
  .session-link .session-label { display: none; }
  .session-link .session-chevron { margin-left: 0; }
  .main-nav span { display: none; }
  .main-nav a { padding: 10px 13px; }
  .header-actions { gap: 6px; }
  .orbit-system { opacity: .45; right: -190px; width: 480px; }
  .hero-emblem { right: -210px; width: 520px; opacity: .48; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .section-head, .dashboard-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .security-grid { grid-template-columns: 1fr; }
  .integration-item { grid-template-columns: auto minmax(0, 1fr); }
  .integration-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .copy-field { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .auth-visual { min-height: 390px; }
  .auth-visual .orbit-system { right: -10%; width: 70%; }
  .auth-visual-content { left: 24px; bottom: 7%; }
  .auth-visual h1 { font-size: 3rem; }
  .commit { grid-template-columns: 1fr; }
  .commit-stats { justify-content: flex-start; }
  .passkey { grid-template-columns: auto 1fr; }
  .passkey-actions { grid-column: 1 / -1; }
  .audit-meta { grid-template-columns: 1fr; }
  .audit-meta .audit-meta-wide { grid-column: auto; }
  .update-banner { top: var(--header); align-items: flex-start; flex-wrap: wrap; }
  .relay-last { align-items: flex-start; flex-direction: column; }
  .relay-activate { min-height: 150px; }
  .input-prefix { display: grid; }
  .input-prefix span { min-height: 40px; border-right: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; }
  .input-prefix input { border-radius: 0 0 14px 14px; }
  .relay-focus-page { align-items: center; }
  .relay-focus-control h1 { margin-top: 10px; }
  .relay-focus-button { min-height: min(52svh, 420px); }
}
