:root {
  color-scheme: dark;
  --ink: #f0f6ff;
  --muted: #97adc2;
  --cyan: #51e4ff;
  --blue: #2186f3;
  --mint: #65f5ce;
  --line: #26435b;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #080d16; color: var(--ink); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3, .wordmark { line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 3.8vw, 3rem); letter-spacing: -.052em; }
h2 { font-size: 1.24rem; letter-spacing: -.022em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; min-height: 44px; padding: .61rem .95rem; background: #101e2c; border: 1px solid var(--line); border-radius: 8px; transition: background-color .2s, border-color .2s, box-shadow .2s, transform .2s; }
button:hover:not(:disabled) { border-color: var(--cyan); background-color: #152c3e; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button.primary { background: linear-gradient(108deg,#1165ae,#067789); border-color: #399ab7; color: #fff; font-weight: 650; box-shadow: inset 0 1px #ffffff1f, 0 7px 26px #027abd18; }
button.primary:hover:not(:disabled) { border-color: #b1f4ff; box-shadow: inset 0 1px #ffffff35, 0 0 26px #1acbfc39; }
input { width: 100%; min-height: 50px; padding: .7rem .85rem; border: 1px solid var(--line); background: #081320; border-radius: 9px; }
input::placeholder { color: #7490a8; opacity: 1; }
label { font-size: .89rem; font-weight: 550; }
.muted, .field-hint { color: var(--muted); }
.wordmark { display: flex; align-items: baseline; gap: .62rem; font-weight: 780; font-size: 1.35rem; letter-spacing: .2em; white-space: nowrap; }
.wordmark span { color: var(--cyan); font: 600 .62rem/1.1 var(--mono); letter-spacing: .14em; }
.location { display: inline-flex; align-items: center; white-space: nowrap; gap: .4rem; color: #bdd0e1; font: .77rem var(--mono); }
.location i { width: 8px; height: 8px; display:inline-block; border: 1px solid var(--cyan); border-radius: 2px; transform: rotate(45deg); }

.access, .overview {
  background-color: #080f1b;
  background-image: radial-gradient(ellipse at 27% 45%, #103355 0%, transparent 54%),
    linear-gradient(#41678917 1px, transparent 1px), linear-gradient(90deg,#41678917 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}
.access { min-height: 100dvh; display: grid; place-items: center; padding: clamp(.8rem, 4vw, 3.7rem); }
.access-inner { width: min(100%, 1280px); min-height: min(765px, 89dvh); display: flex; flex-direction: column; border: 1px solid #2a4660; border-radius: 22px; overflow: hidden; background: linear-gradient(115deg,#090f1990,#080e18ed 75%); box-shadow: 0 24px 90px #01040ab0; position: relative; isolation: isolate; }
.access-inner::before { content: ""; position: absolute; left: 4%; right: 4%; top: 0; height: 1px; background: linear-gradient(90deg,transparent,#47c6ff 26%,#9aefff 46%,transparent 78%); }
.access-header, .access-footer { display: flex; justify-content: space-between; align-items: center; padding: 1.15rem clamp(1rem, 4vw, 2.7rem); gap: 1rem; }
.access-header { border-bottom: 1px solid #21354d; }
.access-footer { border-top: 1px solid #21354d; color: var(--muted); font: .74rem var(--mono); }
.access-grid { display: grid; grid-template-columns: 1.17fr 1fr; align-items: stretch; flex:1; min-width: 0; }
.access-art, .overview-art { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; }
.access-art {
  min-height: 39rem;
  background: radial-gradient(closest-side,#173e67 10%,#0a2541 48%,transparent 100%),
    repeating-linear-gradient(135deg,transparent 0 41px,#3c82c024 42px,transparent 43px 64px);
}
.access-art::before { content:""; position:absolute; inset:0; background: linear-gradient(90deg,#070e1870,transparent 23% 77%,#070e1850),linear-gradient(0deg,#070e18,transparent 28% 75%,#070e18); pointer-events:none; z-index:-1; }
.sentinel { width: 68%; max-width: 370px; aspect-ratio: 330/317; background: url("/static/centinela.png") no-repeat 9.12% 5.37% / 465.45% 323%; mask-image: radial-gradient(ellipse 68% 67% at 50% 49%,#000 56%,transparent 98%); mix-blend-mode: screen; }
.access-art .sentinel { transform: translateY(-2%); z-index:1; animation: emerge .85s ease-out both; }
.orbit, .orbit-radar, .visor, .reticle { position: absolute; width: 82%; max-width: 550px; aspect-ratio: 1; pointer-events: none; border-radius: 50%; }
.orbit-outer { border: 1px solid #284967; border-top-color: #61dfff; border-bottom-color: #2071a9; box-shadow: 0 0 20px #119cee25, inset 0 0 20px #119cee20; animation: orbit 28s linear infinite; }
.orbit-outer::before, .orbit-outer::after { content:""; position:absolute; width:8px; height:8px; top:8%; left:22%; background:#c4f7ff; border-radius:50%; box-shadow:0 0 17px 4px #3ce0ff8e; }
.orbit-outer::after { top:auto; left:auto; bottom:8%; right:22%; width:5px; height:5px; }
.orbit-inner { width: 70%; max-width: 465px; border: 1px dashed #4899bf82; border-left-color: #7df0ff; animation: orbit 40s linear infinite reverse; }
.orbit-radar { background: conic-gradient(from 0deg,transparent 0deg 302deg,#39bbf112 341deg,#42d7ff36 359deg,transparent 360deg); mask-image: radial-gradient(circle,transparent 47%,#000 60%,#000 68%,transparent 70%); animation: orbit 9s linear infinite; }
.visor { width: 52%; background: radial-gradient(closest-side,#25bcff56,transparent 84%); animation: breathe 5s ease-in-out infinite; }
.reticle { width: 80%; border-radius: 0; }
.reticle b { position: absolute; width: 22px; height: 22px; border: 1px solid #4c96ba86; }
.reticle b:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.reticle b:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.reticle b:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.reticle b:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.access-form { align-self: center; min-width: 0; padding: clamp(1rem,4vw,3rem); padding-right: clamp(1.1rem,5vw,4.15rem); }
.access-heading h1 { margin: .8rem 0 .55rem; font-size: clamp(2.1rem,4.15vw,3.75rem); }
.access-heading > p:last-child, .field-hint { color:var(--muted); }
.eyebrow { display:flex; align-items:center; gap:.55rem; font: 650 .77rem var(--mono); letter-spacing:.1em; text-transform:uppercase; color:var(--cyan); }
.fields { margin: 1.8rem 0 1.25rem; display: grid; gap: .4rem; }
.fields label:not(:first-child) { margin-top: .65rem; }
.field-hint { font-size: .78rem; }
.password-field { position: relative; }
.password-field input { padding-right: 3.6rem; }
.password-field button { position:absolute; right: 4px; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:45px; padding:0; border-color:transparent; background:transparent; }
.eye { width:15px; height:10px; display:block; border:1px solid var(--muted); border-radius:75% 75%; position:relative; }
.eye::before { content:""; position:absolute; width:4px; height:4px; border-radius:50%; top:2px; left:4px; background:var(--cyan); }
.password-field button[aria-pressed="true"] .eye::after { content:""; position:absolute; width:18px; height:1px; top:4px; left:-2px; background:var(--cyan); transform:rotate(-42deg); }
#access-code { font: 600 1.04rem var(--mono); letter-spacing:.25em; }
.access-submit { width:100%; min-height:52px; display:flex; justify-content:space-between; align-items:center; }
#login-status { border-left:2px solid #ff969b; padding:.45rem .65rem; color:#ffd1d2; font-size:.88rem; margin-top:.75rem; background:#35192180; }
#login-status:empty { display:none; }
.icon { width:1rem; height:1rem; flex:none; display:inline-block; position:relative; color:inherit; }
.icon-monitor { height:.75rem; border:1px solid currentColor; border-radius:2px; margin-bottom:.18rem; }
.icon-monitor::after { content:""; position:absolute; left:20%; right:20%; bottom:-.23rem; height:1px; background:currentColor; }
.icon-lock { border:1px solid currentColor; width:.82rem; height:.63rem; border-radius:2px; margin-top:.23rem; }
.icon-lock::after { content:""; position:absolute; inset:-.37rem .13rem auto; height:.32rem; border:1px solid currentColor; border-bottom:0; border-radius:.3rem .3rem 0 0; }
.icon-clock { border:1px solid currentColor; border-radius:50%; }
.icon-clock::after { content:""; position:absolute; top:18%; left:47%; width:27%; height:36%; border-left:1px solid currentColor; border-bottom:1px solid currentColor; }
.icon-settings { border:1px solid currentColor; border-radius:3px; width:.8rem; height:.8rem; margin:.1rem; transform:rotate(45deg); }
.icon-settings::after { content:""; position:absolute; inset:28%; border:1px solid currentColor; border-radius:50%; }
.shell { min-height:100dvh; display:grid; grid-template-columns: 15rem minmax(0,1fr); }
.sidebar { min-width:0; display:flex; flex-direction:column; border-right:1px solid #1c344b; background:linear-gradient(170deg,#0c1a2a,#090f1a 68%); }
.sidebar-brand { display:flex; align-items:center; gap:.55rem; padding:1.35rem 1rem; border-bottom:1px solid #1c344b; }
.sidebar-brand .sentinel { width:46px; flex:none; }
.sidebar-brand .wordmark { flex-direction:column; gap:.26rem; font-size:1.03rem; }
.sidebar.ready .sentinel { filter:drop-shadow(0 0 7px #2eb8f488); animation:emerge .65s ease-out; }
nav { display:grid; gap:.25rem; padding:.95rem .65rem; }
nav button { display:flex; align-items:center; gap:.7rem; background:none; border-color:transparent; color:#a9bed2; text-align:left; }
nav button[aria-current="page"] { color:#f0fbff; border-color:#215474; box-shadow:inset 2px 0 var(--cyan); background:linear-gradient(90deg,#143e57,#101e2f); }
nav button[aria-current="page"] .icon { color:var(--cyan); }
.sidebar-bottom { display:flex; gap:.45rem; justify-content:space-between; align-items:center; margin-top:auto; padding:.8rem .95rem; border-top:1px solid #1c344b; }
.sidebar-bottom button { padding:.4rem .65rem; font-size:.82rem; }
.content { width:min(100%, 1600px); padding:clamp(1.15rem,3.7vw,3.1rem); min-width:0; }
.console-header, .above, .toolbar, .actions { display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; justify-content:space-between; }
.console-header { margin-bottom:1.5rem; min-height:2.6rem; }
.overview { position:relative; isolation:isolate; overflow:hidden; border:1px solid #254868; border-radius:15px; min-height:13.5rem; display:flex; align-items:center; background-image:radial-gradient(ellipse at 84% 43%,#164978 0%,transparent 60%),linear-gradient(#41678919 1px,transparent 1px),linear-gradient(90deg,#41678919 1px,transparent 1px); }
.overview::before { content:""; position:absolute; inset:0; background:linear-gradient(90deg,#101d2d,#101d2d60 60%,transparent); z-index:-1; }
.overview::after { content:""; position:absolute; inset:0 12% auto; height:1px; background:linear-gradient(90deg,transparent,#51d7f29c,transparent); pointer-events:none; }
.overview-art { position:absolute; inset:0 0 0 auto; width:37%; z-index:-1; }
.overview-art .sentinel { max-width:156px; width:56%; }
.overview-art .orbit { max-width:226px; }
.overview-art .orbit-inner { max-width:183px; }
.metrics { display:flex; flex-wrap:wrap; align-items:stretch; padding:1.4rem clamp(.8rem,3vw,2.4rem); }
.metrics div { display:flex; flex-direction:column-reverse; justify-content:start; min-width: 7.5rem; padding:0 clamp(.6rem,2.25vw,1.7rem); border-left:1px solid #2e4d66; }
.metrics div:first-child { padding-left:0; border:0; }
.metrics dd { color:#e9f5ff; font:500 clamp(1.8rem,4.5vw,3.45rem)/1.1 var(--mono); letter-spacing:-.09em; }
.metrics div:last-child dd { color:var(--cyan); }
.metrics dt { font-size:.82rem; color:#a8c1d7; margin-top:.4rem; }
.above { margin:1.65rem 0 .9rem; }
.above button span { margin-right:.3rem; }
.devices { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:.8rem; }
.panel { border:1px solid #28435b; border-radius:12px; background:linear-gradient(148deg,#111e30,#0b1522 70%); }
.machine { min-width:0; padding:1rem; display:grid; gap:.95rem; transition: border-color .24s, box-shadow .24s, transform .24s; }
.machine:hover { transform:translateY(-2px); border-color:#4fa4cf; box-shadow:0 9px 30px #01050b80; }
.machine[data-state="ready"] { border-top-color:#438eab; }
.machine-head, .viewer-device { display:flex; align-items:center; gap:.65rem; min-width:0; }
.machine-head h3, #remote-name { overflow-wrap:anywhere; }
.machine-head h3 { font-size:1rem; }
.machine-icon { display:grid; place-items:center; height:39px; width:39px; flex:none; border:1px solid #2c4e65; border-radius:9px; color:var(--cyan); background:#142b40; }
.machine-foot { display:flex; flex-wrap:wrap; gap:.5rem; justify-content:space-between; align-items:center; }
.status { --signal:var(--mint); display:inline-flex; gap:.46rem; align-items:center; width:fit-content; padding:.32rem .58rem; border:1px solid #315464; border-radius:20px; font: .72rem/1.2 var(--mono); background:#0c1a26; color:#c5dfec; }
.status::before { content:""; width:.45rem; height:.45rem; flex:none; border-radius:50%; background:var(--signal); box-shadow:0 0 10px var(--signal); }
[data-state="online"] .status, #session-badge[data-state="connecting"] { --signal:var(--cyan); }
[data-state="offline"] .status { --signal:#7890a6; box-shadow:none; }
#session-badge[data-state="connecting"]::before { animation:breathe 1.6s ease-in-out infinite; }
.machine-foot button { min-height:40px; padding:.45rem .7rem; font-size:.86rem; }
.empty { text-align:center; padding:2rem 1rem; display:grid; justify-items:center; gap:.5rem; }
.empty .icon { width:1.45rem; height:1.03rem; color:var(--cyan); margin-bottom:.5rem; }
.empty p { color:var(--muted); }
#feedback { border-left:2px solid var(--cyan); padding:.6rem .85rem; border-radius:4px; background:#102337; margin:0 0 1rem; }
.list-panel { padding:1.1rem; }
.list-panel > p { margin-top:.6rem; }
.history, .list-panel ul { list-style:none; margin:.75rem 0 0; padding:0; }
.history li, .list-panel li { display:flex; flex-wrap:wrap; column-gap:.9rem; row-gap:.3rem; padding:.7rem .2rem; align-items:center; border-bottom:1px solid #20374b; overflow-wrap:anywhere; }
.list-panel li:last-child { border-bottom:0; }
.history time { color:var(--muted); font:.8rem var(--mono); }
#settings-devices li { justify-content:space-between; }
.viewer { overflow:hidden; background:#08111d; }
.viewer.connecting { border-color:#378aa9; }
.viewer-toolbar, .keyboard { padding:.75rem; border-bottom:1px solid #28435b; background:#0e1c2a; }
.viewer-device .icon { color:var(--cyan); }
.disconnect { color:#ffd3d5; border-color:#62404b; background:#2a1b27; }
.viewer-stage { position:relative; min-height:0; }
#remote { height:min(55vw,72dvh); min-height:12rem; background:#050910; overflow:hidden; }
.session-loader { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:1rem; color:#b2d9ed; background:radial-gradient(circle,#0d2947,#050910 60%); pointer-events:none; }
.spinner { width:43px; height:43px; border:1px solid #365675; border-top:2px solid var(--cyan); border-radius:50%; box-shadow:0 0 22px #2e9eff2f; animation:orbit 1s linear infinite; }
.viewer:fullscreen, .viewer.expanded { border-radius:0; display:flex; flex-direction:column; background:#050910; }
.viewer.expanded { position:fixed; inset:0; z-index:10; }
.viewer:fullscreen .viewer-stage, .viewer.expanded .viewer-stage { flex:1; }
.viewer:fullscreen #remote, .viewer.expanded #remote { height:100%; min-height:0; }
.keyboard, .vnc-login { display:flex; gap:.65rem; align-items:end; }
.vnc-login { padding:.7rem .8rem; border-bottom:1px solid #274359; }
.keyboard label, .vnc-login label { flex:1; min-width:min(100%,13rem); display:grid; gap:.3rem; }
@keyframes orbit { to { transform:rotate(360deg); } }
@keyframes breathe { 50% { opacity:.5; } }
@keyframes emerge { from { opacity:.35; } to { opacity:1; } }
@media (max-width: 880px) {
  .shell { grid-template-columns: 12rem minmax(0,1fr); }
  .access-art { min-height:32rem; }
  .metrics div { min-width:0; }
}
@media (max-width: 680px) {
  .access { padding:.65rem; }
  .access-inner { border-radius:15px; min-height:0; }
  .access-header, .access-footer { padding:.78rem .85rem; }
  .access-header .wordmark { font-size:.95rem; gap:.35rem; }
  .access-grid { grid-template-columns:1fr; }
  .access-art { min-height:0; height:clamp(142px,26dvh,215px); }
  .access-art .sentinel { max-width: clamp(95px,22dvh,170px); }
  .access-art .orbit, .access-art .orbit-radar { width:min(52vw,24dvh); }
  .access-art .orbit-inner { width:min(46vw,21dvh); }
  .reticle { display:none; }
  .access-form { padding:1rem .95rem 1.3rem; }
  .access-heading h1 { margin:.44rem 0 .3rem; }
  .fields { margin:1.1rem 0 .9rem; }
  .shell { grid-template-columns:minmax(0,1fr); }
  .sidebar { border-right:0; border-bottom:1px solid #26435b; display:grid; grid-template-columns:1fr auto; }
  .sidebar-brand { border:0; padding:.5rem .75rem; }
  .sidebar-brand .sentinel { width:32px; }
  .sidebar-bottom { grid-row:1; grid-column:2; margin:0; padding:.4rem .65rem; border:0; }
  .sidebar-bottom .location { display:none; }
  nav { grid-column:1/-1; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.2rem; padding:.32rem .45rem .45rem; }
  nav button { font-size:.76rem; justify-content:center; gap:.3rem; padding:.36rem .15rem; }
  nav .icon { display:none; }
  .console-header { margin-bottom:1rem; }
  .overview { min-height:7.75rem; }
  .overview-art { width:34%; opacity:.32; }
  .metrics { padding:.7rem; }
  .metrics div { padding:0 .55rem; }
  .metrics dt { font-size:.68rem; }
  .actions { gap:.35rem; justify-content:start; }
  .actions button { font-size:.76rem; min-height:40px; padding:.35rem .42rem; }
  #remote { height:65vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation:none !important; transition:none !important; }
}

.totp-fields { display: contents; }
.totp-fields label { margin-top: .65rem; }
