:root {
  color-scheme: dark;
  --bg: #080c18;
  --bg-soft: #0b1120;
  --surface: rgba(17, 24, 43, 0.82);
  --surface-solid: #11182b;
  --surface-raised: #172038;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #edf3ff;
  --text-muted: #8f9bb2;
  --text-soft: #b9c2d3;
  --primary: #7c6df2;
  --primary-bright: #9b8cff;
  --primary-soft: rgba(124, 109, 242, 0.14);
  --cyan: #28c9d8;
  --green: #32d583;
  --amber: #fdb022;
  --red: #f97066;
  --shadow: 0 24px 65px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-small: 10px;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 16% -5%, rgba(88, 79, 180, 0.16), transparent 31rem),
    radial-gradient(circle at 90% 20%, rgba(27, 141, 159, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

code, pre, kbd { font-family: var(--font-mono); }
code { color: #c9c2ff; font-size: 0.88em; }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 24, 0.82);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -0.02em; }

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(155, 140, 255, 0.34);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(124, 109, 242, 0.28), rgba(40, 201, 216, 0.1));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 8px 30px rgba(82, 66, 190, 0.2);
  color: #b9aeff;
}

.brand-mark svg { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 10px; color: var(--text-soft); }
.nav-links > a:not(.button) { padding: 8px 10px; transition: color 150ms ease; }
.nav-links > a:not(.button):hover { color: var(--text); }
.nav-terminal { display: inline-flex; align-items: center; gap: 7px; }
.nav-terminal-icon { color: #9285fb; font-family: var(--font-mono); font-size: 0.73rem; font-weight: 700; }

.page-wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 80px; }

.page-heading,
.detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.page-heading h1,
.detail-heading h1 {
  margin: 1px 0 6px;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.eyebrow {
  margin: 0 0 8px;
  color: #9285fb;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-subtitle { margin: 0; color: var(--text-muted); font-size: 1rem; }

.heading-meta { display: flex; align-items: center; gap: 18px; color: var(--text-muted); font-size: 0.87rem; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 0.78rem; font-weight: 600; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(50, 213, 131, 0.12); }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-small { min-height: 34px; padding: 7px 12px; font-size: 0.84rem; }
.button-full { width: 100%; }

.button-primary {
  border-color: rgba(181, 170, 255, 0.32);
  background: linear-gradient(135deg, #7767e9, #6154d6);
  box-shadow: 0 8px 24px rgba(78, 65, 190, 0.24), inset 0 1px rgba(255,255,255,0.18);
  color: #fff;
}

.button-primary:hover { background: linear-gradient(135deg, #8979f2, #6d60dc); box-shadow: 0 10px 28px rgba(78, 65, 190, 0.34); }
.button-secondary { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.035); color: var(--text-soft); }
.button-secondary:hover, .button-ghost:hover { border-color: rgba(155, 140, 255, 0.35); background: var(--primary-soft); color: var(--text); }
.button-redeploy { padding: 0; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.button-redeploy:hover { background: transparent; color: #bdb4ff; }
.button-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.button-danger { border-color: rgba(249, 112, 102, 0.3); background: rgba(249, 112, 102, 0.08); color: #ffaca5; }
.button-danger:hover { background: rgba(249, 112, 102, 0.15); }
.inline-form { display: inline-flex; margin: 0; }

.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.service-card,
.panel,
.stat-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(20, 28, 49, 0.86), rgba(13, 20, 36, 0.86));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 18px 55px rgba(0, 0, 0, 0.12);
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 16px;
  border-radius: 12px;
  font-family: var(--font-mono);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.service-card::before {
  position: absolute;
  width: 160px;
  height: 160px;
  top: -110px;
  right: -80px;
  border-radius: 50%;
  background: rgba(124, 109, 242, 0.09);
  content: "";
  filter: blur(1px);
}

.service-card:hover { transform: translateY(-3px); border-color: rgba(155, 140, 255, 0.26); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24); }
.service-card-top { position: relative; display: flex; min-height: 36px; align-items: flex-start; justify-content: space-between; gap: 10px; }
.service-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }

.service-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(155, 140, 255, 0.2);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(124, 109, 242, 0.2), rgba(40, 201, 216, 0.08));
  color: #bcb2ff;
  font-weight: 700;
}

.service-avatar-large { width: 58px; height: 58px; border-radius: 15px; font-size: 1.2rem; }
.service-name { display: block; overflow: hidden; max-width: 190px; font-size: 0.91rem; font-weight: 700; letter-spacing: -0.035em; text-overflow: ellipsis; white-space: nowrap; }
.service-name:hover { color: #bdb4ff; }
.service-state { display: flex; align-items: center; gap: 6px; margin-top: 1px; color: var(--text-muted); font-size: 0.68rem; text-transform: capitalize; }

.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #667085; }
.status-running { background: var(--green); box-shadow: 0 0 0 3px rgba(50, 213, 131, 0.1); }
.status-stopped, .status-exited, .status-failed { background: var(--red); box-shadow: 0 0 0 3px rgba(249, 112, 102, 0.09); }
.status-partial, .status-unknown { background: var(--amber); box-shadow: 0 0 0 3px rgba(253, 176, 34, 0.09); }
.status-none { background: #667085; }

.service-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 8px; }
.service-metrics > div { padding: 7px 9px; border: 1px solid rgba(148, 163, 184, 0.1); border-radius: 7px; background: rgba(7, 11, 22, 0.35); }
.service-metrics strong { color: var(--text-soft); font-size: 0.73rem; font-weight: 600; }
.metric-label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.service-card .metric-label { margin-bottom: 3px; font-size: 0.6rem; }
.version-summary, .detail-version-summary { display: flex; align-items: center; gap: 6px; color: #778399; font-size: 0.68rem; }
.version-summary { margin: 0 1px 11px; font-size: 0.61rem; }
.version-summary code, .detail-version-summary code { color: #8992a8; font-size: 1em; }
.dashboard-log-preview { margin-bottom: 11px; overflow: hidden; border: 1px solid rgba(148, 163, 184, 0.1); border-radius: 7px; background: #070b14; }
.log-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 9px 5px; border-bottom: 1px solid rgba(148, 163, 184, 0.08); background: #0a0f1c; }
.log-preview-heading .metric-label { margin: 0; }
.log-preview-heading a { color: #a99eff; font-size: 0.61rem; font-weight: 600; }
.log-preview-heading a:hover { color: #c4bdff; }
.dashboard-log-preview pre { height: 76px; margin: 0; overflow: hidden; padding: 7px 9px 8px; color: #b7c0d3; font-family: var(--font-mono); font-size: 0.61rem; line-height: 1.45; white-space: pre-wrap; }
.service-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--border); }
.service-card-actions .button-small { min-height: 29px; padding: 6px 9px; font-size: 0.68rem; }
.service-card-actions .button-redeploy { min-height: auto; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 7px; width: fit-content; border: 1px solid var(--border); border-radius: 999px; font-size: 0.7rem; font-weight: 600; line-height: 1; white-space: nowrap; }
.badge-update { padding: 7px 9px; border-color: rgba(253, 176, 34, 0.23); background: rgba(253, 176, 34, 0.1); color: #fbcf75; }
.badge-state { padding: 7px 10px; background: rgba(255,255,255,0.03); color: var(--text-soft); text-transform: capitalize; }
.badge-deploy { padding: 7px 10px; text-transform: capitalize; }
.badge-deploy-success { border-color: rgba(50, 213, 131, 0.24); background: rgba(50, 213, 131, 0.09); color: #72e5a7; }
.badge-deploy-running, .badge-deploy-pending { border-color: rgba(40, 201, 216, 0.25); background: rgba(40, 201, 216, 0.09); color: #78dce5; }
.badge-deploy-failed { border-color: rgba(249, 112, 102, 0.24); background: rgba(249, 112, 102, 0.09); color: #ff9c94; }

.empty-state { grid-column: 1 / -1; padding: 70px 24px; border-radius: var(--radius); text-align: center; }
.empty-state h2 { margin: 15px 0 5px; }
.empty-state p { max-width: 460px; margin: 0 auto 23px; color: var(--text-muted); }
.empty-icon { display: grid; width: 52px; height: 52px; margin: auto; place-items: center; border: 1px solid rgba(155, 140, 255, 0.25); border-radius: 15px; background: var(--primary-soft); color: #b9aeff; font-size: 1.5rem; }

.breadcrumb { margin-bottom: 20px; color: var(--text-muted); font-size: 0.85rem; }
.breadcrumb a:hover { color: var(--text); }
.detail-heading { align-items: center; }
.detail-title, .detail-title-row, .action-row { display: flex; align-items: center; }
.detail-title { gap: 16px; min-width: 0; }
.detail-title-row { gap: 12px; }
.detail-title h1 { margin: 0; }
.detail-title .page-subtitle { overflow: hidden; max-width: 520px; text-overflow: ellipsis; white-space: nowrap; }
.action-row { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(253, 176, 34, 0.2);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(253, 176, 34, 0.1), rgba(253, 176, 34, 0.025));
}

.update-banner > div { display: flex; align-items: center; gap: 10px; }
.update-banner > div > span:not(.update-icon) { color: var(--text-muted); }
.update-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: rgba(253, 176, 34, 0.13); color: #ffd27a; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 20px; border-radius: 13px; }
.stat-card strong { display: flex; min-height: 28px; align-items: center; gap: 9px; margin: 2px 0 4px; font-size: 1.05rem; text-transform: capitalize; }
.stat-card strong code { font-size: 0.88rem; text-transform: none; }
.stat-caption { color: var(--text-muted); font-size: 0.77rem; }
.detail-version-summary { justify-content: flex-end; margin: -8px 4px 18px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 18px; margin-bottom: 18px; }
.panel { border-radius: var(--radius); }
.detail-panel { min-width: 0; overflow: hidden; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 24px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0 0 3px; font-size: 1rem; letter-spacing: -0.01em; }
.panel-heading p { margin: 0; color: var(--text-muted); font-size: 0.83rem; }
.compact-heading { align-items: center; padding: 18px 20px; }
.count-pill { min-width: 27px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 0.7rem; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 20px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--text-muted); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
td { color: var(--text-soft); font-size: 0.8rem; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: rgba(255,255,255,0.018); }
tbody tr:last-child td { border-bottom: 0; }
.table-primary { color: var(--text); font-weight: 600; }
.table-primary a { color: #b8aeff; }
.empty-cell { height: 98px; color: var(--text-muted); text-align: center; }

.log-box {
  display: block;
  height: 330px;
  margin: 0;
  overflow: auto;
  padding: 18px 20px;
  background: #070b14;
  color: #b7c0d3;
  font-size: 0.75rem;
  line-height: 1.75;
  white-space: pre-wrap;
  scrollbar-color: #2a3550 transparent;
}
.full-width-log-panel, .history-panel { margin-bottom: 18px; }
.full-width-log-panel .log-box { height: min(58vh, 560px); min-height: 360px; }

.log-box-large { min-height: 520px; }
.deployment-log-panel { max-width: 1000px; }

.terminal-page { min-width: 0; }
.terminal-heading { align-items: center; }
.terminal-session-meta { display: flex; align-items: center; gap: 12px; }
.terminal-connection { display: inline-flex; min-width: 112px; align-items: center; justify-content: flex-end; gap: 8px; color: var(--text-muted); font-size: 0.78rem; font-weight: 600; }
.terminal-connection[data-state="connecting"] .status-dot { background: var(--amber); animation: blink 1s ease-in-out infinite; }
.terminal-connection[data-state="connected"] { color: #72e5a7; }
.terminal-connection[data-state="connected"] .status-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(50, 213, 131, 0.1); }
.terminal-connection[data-state="disconnected"] { color: #ff9c94; }
.terminal-connection[data-state="disconnected"] .status-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(249, 112, 102, 0.09); }

.terminal-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(253, 176, 34, 0.2);
  border-radius: 11px;
  background: linear-gradient(90deg, rgba(253, 176, 34, 0.085), rgba(253, 176, 34, 0.025));
}
.terminal-warning-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: rgba(253, 176, 34, 0.14); color: #ffd27a; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 800; }
.terminal-warning div { display: grid; gap: 2px; }
.terminal-warning strong { color: #f6d78e; font-size: 0.78rem; }
.terminal-warning div > span { color: var(--text-muted); font-size: 0.75rem; }

.terminal-panel { overflow: hidden; background: #070b14; }
.terminal-chrome { display: grid; grid-template-columns: 1fr auto 1fr; height: 43px; align-items: center; padding: 0 15px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(24, 32, 53, 0.96), rgba(15, 22, 38, 0.96)); }
.terminal-dots { display: flex; gap: 7px; }
.terminal-dots span { width: 9px; height: 9px; border-radius: 50%; background: #f97066; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.terminal-dots span:nth-child(2) { background: #fdb022; }
.terminal-dots span:nth-child(3) { background: #32d583; }
.terminal-title { color: #778399; font-family: var(--font-mono); font-size: 0.69rem; }
.terminal-clear { justify-self: end; padding: 4px 0 4px 12px; border: 0; cursor: pointer; background: transparent; color: #778399; font-size: 0.68rem; }
.terminal-clear:hover { color: var(--text-soft); }
.terminal-host { height: min(68vh, 720px); min-height: 440px; padding: 13px 9px 10px 15px; outline: 0; background: #070b14; }
.terminal-host .xterm { height: 100%; }
.terminal-host .xterm-viewport { scrollbar-color: #2a3550 transparent; }
.terminal-unavailable { display: grid; min-height: 440px; place-content: center; gap: 7px; padding: 30px; color: var(--text-muted); text-align: center; }
.terminal-unavailable strong { color: #ffaaa3; font-size: 1rem; }
.terminal-unavailable span { font-family: var(--font-mono); font-size: 0.76rem; }
.terminal-footnote { margin: 10px 2px 0; color: var(--text-muted); font-size: 0.72rem; }

.form-heading { margin-bottom: 24px; }
.service-form { display: grid; gap: 18px; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.form-panel, .editor-panel { overflow: hidden; }
.step-number { color: rgba(155, 140, 255, 0.48); font-family: var(--font-mono); font-size: 0.74rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; padding: 24px; }
.form-notes { display: grid; grid-column: 1 / -1; min-width: 0; gap: 12px; }
.form-notes .field-help { margin: 0; }
.field { min-width: 0; transition: opacity 180ms ease; }
.field.is-muted { opacity: 0.42; }
.field label, .login-form label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 0.8rem; font-weight: 600; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: 0;
  background: rgba(7, 11, 22, 0.58);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input, select { height: 42px; padding: 0 12px; }
input::placeholder, textarea::placeholder { color: #566178; }
input:focus, select:focus, textarea:focus { border-color: rgba(155, 140, 255, 0.65); background: rgba(10, 14, 28, 0.82); box-shadow: 0 0 0 3px rgba(124, 109, 242, 0.12); }
input[readonly] { cursor: not-allowed; color: var(--text-muted); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #768198 50%), linear-gradient(135deg, #768198 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 12px) 17px; background-repeat: no-repeat; background-size: 4px 4px; }
.field-help { display: block; margin-top: 7px; color: var(--text-muted); font-size: 0.73rem; }

.panel-heading-actions { display: flex; align-items: center; gap: 16px; }
.editor-health { display: flex; max-width: 400px; align-items: center; gap: 7px; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; }
.editor-health [data-validation-message] { overflow: hidden; text-overflow: ellipsis; }
.validation-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #667085; }
.editor-health.is-checking .validation-dot { background: var(--amber); animation: blink 1s ease-in-out infinite; }
.editor-health.is-valid { color: #72e5a7; }
.editor-health.is-valid .validation-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(50, 213, 131, 0.09); }
.editor-health.is-invalid { color: #ff9c94; }
.editor-health.is-invalid .validation-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(249, 112, 102, 0.09); }

@keyframes blink { 50% { opacity: 0.4; } }

.editor-host { background: #090d18; }
.editor-host .cm-editor { border: 0; background: #090d18; font-size: 0.78rem; }
.editor-host .cm-editor.cm-focused { outline: 0; box-shadow: inset 0 0 0 1px rgba(155, 140, 255, 0.32); }
.editor-host .cm-gutters { border-right-color: rgba(148, 163, 184, 0.1); background: #090d18; color: #4e5970; }
.editor-host .cm-activeLine, .editor-host .cm-activeLineGutter { background: rgba(124, 109, 242, 0.055); }
.editor-host .cm-content { padding: 14px 0 36px; }
.editor-host .cm-line { padding-left: 8px; }
.editor-host .cm-tooltip { border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text-soft); }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); background: rgba(7, 11, 22, 0.38); color: var(--text-muted); font-size: 0.68rem; }
kbd { display: inline-grid; min-width: 19px; height: 19px; margin-left: 3px; place-items: center; border: 1px solid var(--border-strong); border-bottom-color: rgba(148,163,184,0.35); border-radius: 4px; background: rgba(255,255,255,0.04); color: var(--text-soft); font-size: 0.62rem; }
.secure-note { color: #72d7df; }
.form-actions { position: sticky; z-index: 10; bottom: 14px; display: flex; justify-content: flex-end; gap: 10px; width: fit-content; margin-left: auto; padding: 10px; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(12, 18, 33, 0.92); box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3); backdrop-filter: blur(14px); }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 38px; padding: 20px 22px; border: 1px solid rgba(249, 112, 102, 0.18); border-radius: 12px; background: rgba(249, 112, 102, 0.035); }
.danger-zone h2 { margin: 0 0 3px; color: #ffaaa3; font-size: 0.9rem; }
.danger-zone p { margin: 0; color: var(--text-muted); font-size: 0.78rem; }

.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 0.82rem; }
.alert strong { white-space: nowrap; }
.alert-error { border-color: rgba(249, 112, 102, 0.24); background: rgba(249, 112, 102, 0.08); color: #ffaaa3; }
.alert-error span { color: #d9a09c; }
.alert-success { border-color: rgba(52, 211, 153, 0.24); background: rgba(52, 211, 153, 0.08); color: #86efac; }
.alert-success span { color: #a7f3d0; }

.login-body { display: grid; overflow: hidden; place-items: center; padding: 24px; background: #080c18; }
.login-glow { position: fixed; border-radius: 50%; filter: blur(5px); pointer-events: none; }
.login-glow-one { width: 520px; height: 520px; top: -300px; left: -180px; background: radial-gradient(circle, rgba(124, 109, 242, 0.21), transparent 68%); }
.login-glow-two { width: 450px; height: 450px; right: -240px; bottom: -230px; background: radial-gradient(circle, rgba(40, 201, 216, 0.12), transparent 68%); }
.login-card { position: relative; width: min(420px, 100%); padding: 39px; border: 1px solid var(--border); border-radius: 20px; background: rgba(16, 23, 41, 0.82); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-brand { width: 48px; height: 48px; margin-bottom: 25px; border-radius: 13px; }
.login-brand svg { width: 28px; height: 28px; }
.login-card h1 { margin: 0 0 7px; font-size: 2rem; letter-spacing: -0.045em; }
.login-copy { margin: 0 0 26px; color: var(--text-muted); }
.login-form { display: grid; gap: 9px; }
.login-form input { height: 46px; margin-bottom: 8px; }
.login-remember { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: -2px 0 8px; color: var(--text-muted); font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.login-remember input[type="checkbox"] { width: 1em; height: 1em; margin: 0; accent-color: var(--primary); cursor: pointer; }
.login-footnote { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 0; color: var(--text-muted); font-size: 0.72rem; }

@media (max-width: 1000px) {
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand > span:last-child, .nav-links > a:not(.button) { display: none; }
	.nav-links > a.nav-terminal { display: inline-flex; padding-inline: 8px; }
	.nav-terminal > span:last-child { display: none; }
  .nav-links { gap: 4px; }
  .page-wrap { width: min(100% - 28px, 1240px); padding-top: 34px; }
  .page-heading, .detail-heading { align-items: flex-start; flex-direction: column; }
  .service-grid, .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .detail-title { align-items: flex-start; }
  .detail-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .action-row { justify-content: flex-start; }
  .update-banner, .update-banner > div { align-items: flex-start; }
  .update-banner > div { flex-wrap: wrap; }
  .update-banner { flex-direction: column; }
  .panel-heading { padding: 18px; }
  .panel-heading-actions { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .editor-health { max-width: 190px; }
  .form-grid { padding: 18px; }
  .detail-version-summary { justify-content: flex-start; margin-left: 1px; }
  .editor-footer { align-items: flex-start; flex-direction: column; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
	.terminal-heading { flex-direction: column; }
	.terminal-session-meta { width: 100%; justify-content: space-between; }
	.terminal-connection { justify-content: flex-start; }
	.terminal-host { height: 65vh; min-height: 360px; padding-left: 10px; }
	.terminal-warning div > span { line-height: 1.5; }
}

@media (max-width: 520px) {
  .service-grid { grid-template-columns: 1fr; }
  .nav-links .button-ghost { padding-inline: 8px; }
  .service-card-actions { justify-content: space-between; }
  .form-actions .button { flex: 1; }
  .form-actions { width: 100%; margin-left: 0; }
  .login-card { padding: 29px 24px; }
}

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

/* Consent includes untrusted client names and potentially long callback URLs. */
.oauth-body { overflow: auto; align-items: start; }
.oauth-card { width: min(640px, 100%); overflow-wrap: anywhere; }
