:root {
  --midnight: #141414;
  --cream: #fdf9f0;
  --paper: #ffffff;
  --lime: #c7ff69;
  --blue: #478bff;
  --orange: #ff6d38;
  --green: #00a652;
  --yellow: #ffc412;
  --violet: #7a78ff;
  --lavender: #ccccff;
  --text: var(--midnight);
  --muted: rgba(20, 20, 20, 0.62);
  --faint: rgba(20, 20, 20, 0.64);
  --border: rgba(20, 20, 20, 0.14);
  --border-strong: rgba(20, 20, 20, 0.72);
  --display: "Arial Black", "Arial Narrow", Arial, sans-serif;
  --body: Inter, Arial, Helvetica, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-card: 32px;
  --radius-control: 14px;
  --radius-pill: 999px;
  --shadow: 0 22px 60px -46px rgba(20, 20, 20, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
  background: var(--cream);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font: 14px/1.5 var(--body);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(1480px, calc(100% - 64px));
  margin-inline: auto;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.wordmark__mark {
  display: block;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  background-image: url("/static/lacuna-icon.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.wordmark__name {
  font-size: 21px;
}

.wordmark__product {
  color: var(--faint);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wordmark--inverse {
  color: var(--cream);
}

.wordmark--inverse .wordmark__product {
  color: rgba(253, 249, 240, 0.72);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-state,
.user-chip,
.text-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--paper);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.system-state__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(0, 166, 82, 0.12);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.text-button {
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.text-button:hover {
  border-color: var(--midnight);
  background: var(--midnight);
  color: var(--cream);
}

.intro {
  padding-top: clamp(72px, 9vw, 130px);
  padding-bottom: 38px;
}

.eyebrow,
.section-index,
.auth-card__index {
  color: var(--muted);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow--inverse {
  color: rgba(253, 249, 240, 0.52);
}

.intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  align-items: end;
  gap: 48px;
  margin-top: 20px;
}

.intro h1 {
  margin: 0;
  color: var(--blue);
  font: 900 clamp(88px, 12vw, 178px) / 0.76 var(--display);
  letter-spacing: -0.09em;
  text-transform: lowercase;
}

.intro__grid > p {
  max-width: 420px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 21px);
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(48px, 7vw, 84px);
}

.overview__item {
  min-height: 120px;
  padding: 18px 20px;
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overview__item span {
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.overview__item strong {
  overflow: hidden;
  font: 900 clamp(28px, 3.2vw, 48px) / 0.9 var(--display);
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview__item--blue {
  background: var(--blue);
  color: var(--midnight);
}

.overview__item--green {
  background: var(--lime);
}

.overview__item--orange {
  background: var(--orange);
}

.overview__item--violet {
  background: var(--lavender);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1.72fr);
  gap: 24px;
  align-items: start;
  padding-top: 34px;
  padding-bottom: 90px;
  border-top: 1px solid var(--border);
}

.tool-card {
  position: sticky;
  top: 100px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.section-index {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.section-heading h2,
.auth-card h2 {
  margin: 0;
  font: 900 clamp(26px, 2.6vw, 38px) / 0.95 var(--display);
  letter-spacing: -0.055em;
  text-transform: lowercase;
}

.section-heading p {
  max-width: 430px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tool-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 26px 0 20px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.06);
}

.tool-tab {
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-tab.is-active {
  background: var(--midnight);
  color: var(--cream);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.mode-switch label {
  min-width: 0;
  cursor: pointer;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  display: flex;
  min-height: 72px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  flex-direction: column;
  justify-content: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.mode-switch b {
  font-size: 13px;
  text-transform: lowercase;
}

.mode-switch small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.25;
}

.mode-switch input:checked + span {
  border-color: var(--blue);
  background: rgba(71, 139, 255, 0.08);
}

.mode-switch input:focus-visible + span {
  outline: 3px solid rgba(71, 139, 255, 0.22);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 10px;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field > span:first-child {
  color: var(--muted);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.field-help {
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
}

.field input,
.field select,
.search-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--cream);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field select {
  cursor: pointer;
}

.field input::placeholder,
.search-field input::placeholder {
  color: var(--faint);
}

.field input:focus,
.field select:focus,
.search-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(71, 139, 255, 0.12);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 82px;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.password-field button:hover {
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.context-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  background: rgba(71, 139, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 0 18px 0 20px;
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--midnight);
  cursor: pointer;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 150ms ease, background 150ms ease;
}

.primary-button:hover {
  background: #d7ff93;
  transform: translateY(-1px);
}

.primary-button--dark {
  background: var(--midnight);
  color: var(--cream);
}

.primary-button--dark:hover {
  background: var(--blue);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.file-picker {
  position: relative;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-picker label {
  display: flex;
  min-height: 84px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  cursor: pointer;
  text-align: center;
}

.file-picker b {
  font-size: 12px;
}

.file-picker small {
  max-width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker input:focus-visible + label {
  outline: 3px solid rgba(71, 139, 255, 0.18);
  outline-offset: 2px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.security-note > span {
  color: var(--green);
}

.security-note p {
  margin: 0;
}

.security-note b {
  color: var(--text);
  font-weight: 600;
}

.fleet {
  min-width: 0;
  padding: 28px;
  border-radius: var(--radius-card);
  background: rgba(20, 20, 20, 0.035);
}

.fleet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--paper);
  cursor: pointer;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.refresh-button:hover {
  border-color: var(--midnight);
}

.refresh-button.is-loading span {
  animation: rotate 700ms linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.fleet-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 18px;
}

.search-field {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  min-width: 180px;
  height: 44px;
  padding-left: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--muted);
}

.search-field input {
  height: 42px;
  padding-left: 9px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.status-filters {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.06);
}

.status-filter {
  min-height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-filter span {
  margin-left: 4px;
  color: inherit;
}

.status-filter.is-active {
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 2px 9px rgba(20, 20, 20, 0.08);
}

.nodes {
  display: grid;
  gap: 14px;
}

.node-card {
  --node-accent: var(--faint);
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.node-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--node-accent);
  content: "";
}

.node-card--online,
.node-card--installed {
  --node-accent: var(--green);
}

.node-card--installing {
  --node-accent: var(--yellow);
}

.node-card--offline,
.node-card--error {
  --node-accent: var(--orange);
}

.node-card--new {
  --node-accent: var(--violet);
}

.node-card__main {
  padding: 22px 22px 20px 26px;
}

.node-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.node-identity {
  min-width: 0;
}

.node-identity__label {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.node-identity__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.node-identity h3 {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  font: 900 clamp(23px, 2vw, 32px) / 1 var(--display);
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--node-accent), transparent 58%);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--node-accent), transparent 90%);
  color: var(--text);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--node-accent);
  content: "";
}

.node-actions {
  display: flex;
  gap: 8px;
}

.node-delete {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 109, 56, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(255, 109, 56, 0.07);
  color: #be3d10;
  cursor: pointer;
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.node-delete:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--midnight);
}

.node-delete:disabled {
  cursor: wait;
  opacity: 0.55;
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.node-meta span {
  min-height: 27px;
  padding: 7px 9px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.02em;
}

.node-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.node-stat {
  min-width: 0;
  min-height: 76px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--cream);
}

.node-stat span {
  display: block;
  color: var(--faint);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.node-stat strong {
  display: block;
  overflow: hidden;
  margin-top: 13px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.resource__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resource__track {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 20, 0.08);
}

.resource__fill {
  width: var(--value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 350ms ease;
}

.resource--ram .resource__fill {
  background: var(--violet);
}

.node-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--faint);
  font: 500 8px/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.node-log {
  border-top: 1px solid var(--border);
  background: var(--midnight);
  color: rgba(253, 249, 240, 0.74);
}

.node-log summary {
  min-height: 44px;
  padding: 14px 26px;
  cursor: pointer;
  color: var(--lime);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}

.node-log summary::-webkit-details-marker {
  display: none;
}

.node-log summary::before {
  content: "+ ";
}

.node-log[open] summary::before {
  content: "− ";
}

.node-log pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  padding: 0 26px 22px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 11px/1.55 var(--mono);
}

.empty-state {
  display: grid;
  min-height: 360px;
  padding: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: 26px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--lime);
  font: 700 11px/1 var(--mono);
}

.empty-state h3 {
  margin: 18px 0 0;
  font: 900 28px/1 var(--display);
  letter-spacing: -0.05em;
}

.empty-state p {
  max-width: 330px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 110px;
  padding-top: 28px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.signal-bars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
}

.signal-bars i {
  display: block;
  width: 5px;
  height: 16px;
  border-radius: var(--radius-pill);
}

.signal-bars i:nth-child(1) { background: var(--green); height: 9px; }
.signal-bars i:nth-child(2) { background: var(--yellow); height: 15px; }
.signal-bars i:nth-child(3) { background: var(--blue); height: 20px; }
.signal-bars i:nth-child(4) { background: var(--orange); height: 13px; }
.signal-bars i:nth-child(5) { background: var(--violet); height: 18px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--midnight);
  color: var(--cream);
  box-shadow: 0 18px 44px rgba(20, 20, 20, 0.24);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: var(--orange);
  color: var(--midnight);
}

/* Login */
.login-page {
  background: var(--midnight);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  min-height: 100vh;
}

.login-brand {
  display: flex;
  min-height: 100vh;
  padding: 34px 40px;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background: var(--midnight);
  color: var(--cream);
}

.login-brand__content {
  display: grid;
  flex: 1;
  width: 100%;
  padding: 24px 0 0;
  place-items: center;
  text-align: center;
}

.login-brand h1 {
  margin: 0;
  font: 900 clamp(112px, 15vw, 230px) / 0.72 var(--display);
  letter-spacing: -0.095em;
  text-transform: lowercase;
}

.login-brand h1 span {
  color: var(--blue);
}

.login-brand__content p {
  max-width: 480px;
  margin: clamp(46px, 7vw, 90px) 0 0;
  color: rgba(253, 249, 240, 0.58);
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.login-brand__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  color: rgba(253, 249, 240, 0.38);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-form-area {
  display: grid;
  min-height: 100vh;
  padding: 40px;
  place-items: center;
  background: var(--blue);
}

.auth-card {
  width: min(100%, 500px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(20, 20, 20, 0.14);
  border-radius: 38px;
  background: var(--cream);
  box-shadow: 0 34px 90px -48px rgba(20, 20, 20, 0.7);
}

.auth-card__index {
  margin-bottom: 34px;
}

.auth-card h2 {
  font-size: clamp(34px, 4.2vw, 58px);
}

.auth-card__lead {
  max-width: 360px;
  margin: 16px 0 30px;
  color: var(--muted);
  font-size: 13px;
}

.auth-card form {
  display: grid;
  gap: 16px;
}

.auth-card .primary-button {
  margin-top: 4px;
}

.form-error {
  display: none;
  padding: 11px 13px;
  border-left: 3px solid var(--orange);
  background: rgba(255, 109, 56, 0.08);
  color: #9f3008;
  font-size: 11px;
}

.form-error.is-visible {
  display: block;
}

.auth-card__secure {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  color: var(--faint);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.auth-card__secure span {
  margin-right: 6px;
  color: var(--green);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  }

  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .node-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    flex: 0 0 44px;
    width: 100%;
    min-width: 0;
  }

  .status-filters {
    align-self: flex-start;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.85fr);
  }
}

@media (max-width: 920px) {
  .container {
    width: min(100% - 40px, 760px);
  }

  .topbar {
    padding-inline: 20px;
  }

  .system-state {
    display: none;
  }

  .intro__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .tool-card {
    position: static;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 62vh;
  }

  .login-form-area {
    min-height: auto;
    padding-block: 64px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }

  .topbar {
    min-height: 66px;
    padding: 10px 14px;
  }

  .wordmark__mark {
    width: 38px;
    height: 38px;
  }

  .wordmark__name {
    font-size: 18px;
  }

  .wordmark__product,
  .user-chip {
    display: none;
  }

  .text-button {
    min-height: 44px;
  }

  .intro {
    padding-top: 42px;
    padding-bottom: 28px;
  }

  .intro h1 {
    font-size: clamp(78px, 28vw, 126px);
  }

  .overview {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 32px;
  }

  .overview__item {
    min-height: 88px;
    padding: 14px;
    border-radius: 20px;
  }

  .overview__item span {
    font-size: 8px;
  }

  .workspace {
    gap: 14px;
    padding-bottom: 56px;
  }

  .tool-card,
  .fleet {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .section-heading {
    gap: 11px;
  }

  .section-index {
    width: 30px;
    height: 30px;
    font-size: 8px;
  }

  .section-heading h2 {
    font-size: 27px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .mode-switch span {
    min-height: 68px;
    padding-inline: 11px;
  }

  .fleet__head {
    align-items: flex-start;
    gap: 10px;
  }

  .refresh-button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .refresh-button span {
    font-size: 18px;
  }

  .status-filters {
    width: 100%;
    overflow-x: auto;
  }

  .status-filter {
    flex: 1 0 auto;
  }

  .empty-state {
    min-height: 240px;
    padding: 28px 20px;
    border-radius: 22px;
  }

  .empty-state > span {
    width: 48px;
    height: 48px;
  }

  .empty-state h3 {
    margin-top: 14px;
    font-size: 24px;
  }

  .node-card__main {
    padding: 19px 16px 17px 21px;
  }

  .node-card__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .node-identity {
    width: 100%;
  }

  .node-actions {
    align-self: stretch;
  }

  .node-delete {
    width: 100%;
  }

  .node-stats,
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }

  .node-card__foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-brand {
    min-height: 46svh;
    padding: 24px 20px;
  }

  .login-brand h1 {
    font-size: clamp(92px, 34vw, 156px);
  }

  .login-brand__content {
    padding: 28px 0 0;
  }

  .login-brand__content p {
    margin-top: 44px;
  }

  .login-brand__foot span {
    display: none;
  }

  .login-form-area {
    padding: 18px 14px 48px;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 28px;
  }

  .auth-card__index {
    margin-bottom: 26px;
  }

  .auth-card h2 {
    font-size: 37px;
  }

  .site-footer {
    min-height: 92px;
  }

  .site-footer > span {
    max-width: 190px;
    text-align: right;
  }
}

@media (max-width: 420px) {
  .intro .eyebrow,
  .intro__grid > p,
  .fleet .section-heading p {
    display: none;
  }

  .intro__grid {
    gap: 0;
    margin-top: 12px;
  }

  .intro h1 {
    font-size: clamp(72px, 26vw, 104px);
  }

  .overview {
    grid-template-columns: 1fr 1fr;
    margin-top: 26px;
  }

  .overview__item {
    min-height: 80px;
    padding: 12px;
    border-radius: 18px;
  }

  .overview__item strong {
    font-size: 28px;
  }

  .section-index {
    display: none;
  }

  .section-heading {
    min-width: 0;
    gap: 0;
  }

  .section-heading > div {
    min-width: 0;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .fleet__head .section-heading {
    flex: 1 1 auto;
  }

  .fleet-controls {
    margin-top: 18px;
  }

  .empty-state {
    min-height: 210px;
  }

  .node-identity__title {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .node-identity h3 {
    width: 100%;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
