@font-face {
  font-family: Satoshi;
  src: url("/assets/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0088ce;
  --blue-dark: #005f7c;
  --navy: #001129;
  --bg: #f5f5fa;
  --card: #fff;
  --text: #191919;
  --muted: #5d6b7c;
  --border: #d4d5d4;
  --ok: #23664c;
  --warn: #005f7c;
  --danger: #ef0f0f;
  --radius: 8px;
  font-family: Satoshi, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }
code, pre, textarea.json { font-family: Consolas, "Cascadia Mono", monospace; }
h2, h3 { margin: 0 0 .4rem; }

.topbar {
  display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap; padding: 1.5rem; background: var(--navy); color: #fff;
}
.topbar a { color: #fff; }
.topbar a:focus-visible, .topbar button:focus-visible { outline-color: #fff; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.brand-logo { display: block; width: 160px; height: auto; flex-shrink: 0; }
.tag { font-size: .7rem; background: rgba(255, 255, 255, .2); padding: .1rem .4rem; border-radius: 4px; vertical-align: middle; }
.user { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: .9rem; max-width: 100%; }
.user-name { overflow-wrap: anywhere; min-width: 0; }
.user-identity { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; }
.tabs { display: flex; gap: .3rem; }
.tabs a { text-decoration: none; padding: .35rem .8rem; border-radius: 6px; }
.tabs a.active, .tabs a:hover { background: rgba(255, 255, 255, .2); }
.tabs a.active { text-decoration: underline; text-underline-offset: .3rem; }
.nav-menu { position: relative; }
.nav-menu summary { cursor: pointer; list-style: none; padding: .35rem .8rem; border-radius: 6px; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary, .nav-menu summary:hover { background: rgba(255, 255, 255, .2); }
.nav-menu summary.active { background: rgba(255, 255, 255, .2); text-decoration: underline; text-underline-offset: .3rem; }
.nav-menu-items {
  position: absolute; top: 100%; left: 0; z-index: 2; display: grid; min-width: 11rem;
  padding: .35rem; background: var(--navy); border: 1px solid rgba(255, 255, 255, .3); border-radius: 6px;
}
.nav-menu-items a { padding: .45rem .65rem; border-radius: 4px; }
.nav-menu-items a:hover, .nav-menu-items a.active { background: rgba(255, 255, 255, .2); }

.banner { background: var(--bg); color: var(--blue-dark); padding: .7rem 1.5rem; border-bottom: 1px solid var(--border); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.2rem; flex: 1; }
.container.wide { max-width: 1500px; }
.footer { flex: 0; display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; padding-top: 0; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.session-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0 1rem; color: var(--muted); font-size: 1.1rem;
}
.session-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.muted { color: var(--muted); }
.error { color: var(--text); border-left: 3px solid var(--danger); padding-left: .6rem; min-height: 1.2em; }

.login { max-width: 460px; margin: 3rem auto; display: flex; flex-direction: column; gap: .5rem; }
.login input { font-size: 1.05rem; padding: .6rem; font-family: Consolas, monospace; }
.login .login-action { display: block; padding: .85rem 1rem; font-size: 1rem; font-weight: 600; text-align: center; }
.login-action:focus-visible, .sign-in-help summary:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }
.sign-in-help { margin-top: 1rem; font-size: .9rem; }
.sign-in-help summary { color: var(--blue); cursor: pointer; padding: .5rem 0; }

.class-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; justify-content: space-between; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.pods { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.pod { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.pod-busy { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.pod-head { display: flex; justify-content: space-between; align-items: center; }
.busy { margin: 0; color: var(--warn); font-weight: 500; }
.connect, .pod-actions, .vm-actions, .row-actions, .dialog-actions, .toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.vm-actions select { margin-left: .3rem; }
.toolbar { margin-bottom: .8rem; }
.toolbar h2 { margin: 0 1rem 0 0; }
.toolbar input { min-width: 16rem; }

.btn {
  display: inline-block; font: inherit; font-size: .9rem; padding: .45rem .9rem; cursor: pointer;
  border: 1px solid var(--muted); background: #fff; color: var(--text); border-radius: 6px; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--blue); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-small { font-size: .8rem; padding: .25rem .6rem; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--navy); font-weight: 700; text-transform: uppercase; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); color: #fff; }
.btn-warn { border-color: var(--warn); color: var(--warn); }
.btn-danger { border-color: var(--danger); color: var(--text); }
.btn-danger:hover:not(:disabled) { background: var(--text); color: #fff; }
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }

input, select, textarea { font: inherit; padding: .4rem .5rem; border: 1px solid var(--muted); border-radius: 6px; background: #fff; }

.badge {
  display: inline-block; font-size: .78rem; padding: .12rem .5rem; border-radius: 999px;
  background: #e9ecef; color: var(--muted); white-space: nowrap;
}
.power-running, .badge-success { background: #d1f2dc; color: var(--ok); }
.badge-failure, .badge-timed_out, .power-failed { background: #fbe0e0; color: var(--text); border-left: 3px solid var(--danger); }
.power-starting, .power-stopping, .power-deploying, .power-mixed, .badge-dispatched, .badge-in_progress,
.badge-queued, .badge-dispatch_unconfirmed, .power-scheduled { background: var(--bg); color: var(--blue-dark); }
.power-stopped, .power-deallocated, .power-deleted { background: #e9ecef; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table-scroll { overflow-x: auto; }
.table th, .table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.table td.detail { font-family: Consolas, monospace; font-size: .78rem; word-break: break-all; max-width: 40rem; }
code.code { font-size: .8rem; word-break: break-all; }

.dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; max-width: min(900px, 95vw); }
.dialog::backdrop { background: rgba(20, 30, 45, .45); }
.dialog .dialog-actions { justify-content: flex-end; margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; align-items: center; }
.form-grid .span, .form-grid button { grid-column: 1 / -1; }
.form-grid button { justify-self: end; }
.integration-metadata { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .4rem 1rem; }
.integration-metadata dt { font-weight: 600; }
.integration-metadata dd { margin: 0; overflow-wrap: anywhere; }
.integration-security { margin: 1rem 0; }
.integration-security summary { cursor: pointer; }
.integration-troubleshooting { margin-top: 1rem; }
.integration-troubleshooting > summary { cursor: pointer; }
.integration-test { margin-top: 1rem; }
.integration-test:not([hidden]) { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.integration-test h3, .integration-test p { margin: 0; }
.integration-test select { max-width: 100%; }
.integration-test label { max-width: 48rem; }
.integration-test [role="status"] { align-self: stretch; min-width: 0; }
.integration-test [role="status"] p { margin: .75rem 0; }
@media (max-width: 480px) {
  .integration-metadata { grid-template-columns: 1fr; gap: .2rem; }
  .integration-metadata dd { margin-bottom: .5rem; }
}
pre.snippet { white-space: pre-wrap; background: var(--bg); padding: .8rem; border-radius: 6px; font-size: .85rem; }
textarea.json { width: 100%; font-size: .85rem; }

.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 150%); transition: transform .25s;
  background: var(--text); color: #fff; padding: .7rem 1.2rem; border-radius: 6px; max-width: 90vw; z-index: 10;
}
.toast.show { transform: translate(-50%, 0); }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--text); border-left: 3px solid var(--danger); }

@media (max-width: 640px) {
  .topbar { gap: 1.5rem; }
  .toolbar input { min-width: 0; max-width: 100%; }
  .pods { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
