/* =====================================================
   Armada — component classes (blueprint aesthetic baked in)
   Square corners, mono uppercase badges, accent signal rule.
   These are the public class contracts the Razor components emit.
   Entire file fenced under @scope (.armada) so these deliberately
   generic class names (.btn, .card, .badge, …) stay contained to
   the app root.
   ===================================================== */

@scope (.armada) {

/* ── BUTTONS ──────────────────────────────────────────────────
   .btn  .btn.primary  .btn.ghost  .btn.danger  .btn.sm  .btn.icon */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  cursor: pointer;
  transition: background 80ms linear, border-color 80ms linear;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.danger { color: var(--err); border-color: var(--border); background: var(--surface); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn.sm { height: 26px; padding: 0 9px; font-size: var(--text-xs); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 26px; height: 26px; }

/* ── BADGES / STATUS ──────────────────────────────────────────
   Blueprint badges are mono, uppercase, outlined — no fill, no dot. */
.badge {
  display: inline-flex; align-items: center;
  height: 18px;
  padding: 1px 6px;
  border-radius: 0;
  border: 1px solid currentColor;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.badge.running, .badge.success, .badge.completed { color: var(--ok); }
.badge.creating, .badge.info    { color: var(--info); }
/* A converting backup is already usable for its own engine kind, and a failed conversion still
   leaves a usable backup — neither is an error, so both read as in-between rather than red. */
.badge.converting { color: var(--info); }
.badge.conversionfailed { color: var(--warn); }
.badge.hibernating, .badge.hibernated, .badge.waking, .badge.warn { color: var(--warn); }
.badge.failed, .badge.error, .badge.deleted, .badge.danger { color: var(--err); }
.badge.deleting { color: var(--del); }
.badge.queued, .badge.sleeping, .badge.idle, .badge.neutral { color: var(--muted); }

/* a small status dot for inline use (sidebars, lists) */
.st-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.st-dot.running { background: var(--ok); }
.st-dot.creating, .st-dot.waking { background: var(--info); }
.st-dot.hibernating, .st-dot.hibernated { background: var(--warn); }
.st-dot.failed, .st-dot.deleting, .st-dot.deleted { background: var(--err); }

/* ── CARDS / SURFACES ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* explicit so card text follows the theme token rather than inheriting
     whatever colour an ancestor happens to set — it went unreadable in dark
     mode when this was left off. */
  color: var(--fg);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: var(--pad-y) var(--pad-x);
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-size: var(--text-section);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg);
}
.card-body { padding: var(--pad-x); }

/* ── INPUTS ───────────────────────────────────────────────────
   .field (wrapper)  .label  .input  .select  .hint */
.label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.input, .select {
  display: block;
  width: 100%;
  height: var(--row-h);
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.input:disabled, .select:disabled { opacity: 0.5; cursor: not-allowed; }
.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
.hint { font-size: var(--text-xs); color: var(--muted); margin-top: 6px; }
.field + .field { margin-top: var(--space-4); }

/* ── CHECKBOX ───────────────────────────────────────────────── */
.check {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: var(--text-sm); color: var(--fg);
  cursor: pointer; user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 16px; height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background 80ms linear, border-color 80ms linear;
}
.check .box svg { width: 11px; height: 11px; stroke: var(--accent-fg); opacity: 0; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .box svg { opacity: 1; }
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── TOGGLE / SWITCH ──────────────────────────────────────────
   Square track + square knob; indigo when on. No pill rounding. */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: var(--text-sm); color: var(--fg); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 0; transition: background 90ms linear, border-color 90ms linear;
}
.toggle .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: transform 110ms cubic-bezier(0.2, 0, 0, 1), border-color 90ms linear;
}
.toggle input:checked + .track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(16px); background: var(--accent-fg); border-color: var(--accent-fg); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle input:disabled + .track { opacity: 0.5; cursor: not-allowed; }

/* ── RADIO ────────────────────────────────────────────────────
   Square (blueprint never rounds); indigo inset block when on. */
.radio { display: inline-flex; align-items: center; gap: 9px; font-size: var(--text-sm); color: var(--fg); cursor: pointer; user-select: none; }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio .dot {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1px solid var(--border-strong); border-radius: 0;
  background: var(--surface); display: grid; place-items: center;
  transition: border-color 80ms linear;
}
.radio .dot::after { content: ""; width: 8px; height: 8px; background: var(--accent); transform: scale(0); transition: transform 110ms cubic-bezier(0.2, 0, 0, 1); }
.radio input:checked + .dot { border-color: var(--accent); }
.radio input:checked + .dot::after { transform: scale(1); }
.radio input:focus-visible + .dot { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio input:disabled + .dot { opacity: 0.5; cursor: not-allowed; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-group.row { flex-direction: row; gap: 18px; }

/* ── TEXTAREA ───────────────────────────────────────────────── */
.textarea {
  display: block; width: 100%;
  min-height: 84px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); font-family: var(--font-sans); font-size: var(--text-sm);
  line-height: var(--leading-snug); resize: vertical;
}
.textarea::placeholder { color: var(--faint); }
.textarea:hover { border-color: var(--border-strong); }
.textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.textarea:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── TABS ─────────────────────────────────────────────────────
   Underlined, mono-uppercase. Active tab carries the indigo rule. */
.tabs { display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--border); }
.tab {
  position: relative; appearance: none; border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: var(--text-xs); font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted);
  padding: 11px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  transition: color 80ms linear, border-color 80ms linear;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab .tab-count { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--muted); background: var(--surface-2); padding: 1px 5px; }
.tab.active .tab-count { color: var(--accent-ink); background: var(--accent-soft); }
.tabpanel { padding-top: var(--space-5); }

/* ── MODAL / DIALOG ───────────────────────────────────────────
   Square card on a dim scrim; no rounding, thin pop shadow. */
.modal-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: color-mix(in oklch, var(--fg), transparent 55%);
  display: grid; place-items: center; padding: 24px;
}
.modal {
  /* .modal is the dialog panel itself, not a full-screen overlay — the
     surrounding .modal-backdrop does the positioning. Stated explicitly so
     the flow layout can't be knocked over by an inherited or injected rule. */
  position: static; inset: auto; height: auto; overflow: visible;
  width: 100%; max-width: 520px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 0; box-shadow: var(--shadow-pop);
}
.modal.lg { max-width: 720px; }
.modal:focus, .modal:focus-visible { outline: none; } /* dialog is focused on open so Esc works; no ring */
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: var(--pad-y) var(--pad-x); border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  font-size: var(--text-h2); font-weight: var(--weight-bold); letter-spacing: -0.01em;
  display: flex; align-items: center;
}
.modal-head h3::before { content: ""; width: 4px; height: 16px; background: var(--accent); margin-right: 10px; flex-shrink: 0; }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.modal-close:hover { background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.modal-body { padding: var(--pad-x); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: var(--pad-y) var(--pad-x); border-top: 1px solid var(--border); }
.modal-foot .sp { flex: 1; }

/* ── TOAST ────────────────────────────────────────────────────
   Square ground note; status keyed by left accent bar. */
.toast {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 14px; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-left-width: 3px; border-left-color: var(--accent);
  border-radius: 0; box-shadow: var(--shadow-pop); font-size: var(--text-sm);
}
.toast .toast-ic { display: inline-flex; color: var(--accent); }
.toast .toast-ic svg { width: 15px; height: 15px; }
.toast.success { border-left-color: var(--ok); } .toast.success .toast-ic { color: var(--ok); }
.toast.warn    { border-left-color: var(--warn); } .toast.warn .toast-ic { color: var(--warn); }
.toast.error   { border-left-color: var(--err); } .toast.error .toast-ic { color: var(--err); }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ── VALIDATION STATES (fields) ─────────────────────────────── */
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--err); }
.input.invalid:focus, .select.invalid:focus, .textarea.invalid:focus { border-color: var(--err); box-shadow: inset 0 0 0 1px var(--err); }
.input.valid, .select.valid, .textarea.valid { border-color: var(--ok); }
.input.valid:focus, .select.valid:focus, .textarea.valid:focus { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }

.label .req { color: var(--err); margin-left: 3px; }
.label .opt { color: var(--faint); font-weight: var(--weight-regular); text-transform: none; letter-spacing: 0; margin-left: 6px; }

.field-msg { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--text-xs); }
.field-msg svg { width: 12px; height: 12px; flex-shrink: 0; }
.field-msg.error { color: var(--err); }
.field-msg.success { color: var(--ok); }
.field-msg.warn { color: var(--warn); }
.field .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field .label-row .label { margin-bottom: 6px; }
.field .counter { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.field .counter.over { color: var(--err); }

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--fg-2); }
.breadcrumb a, .breadcrumb button { color: var(--fg-2); background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.breadcrumb a:hover, .breadcrumb button:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--faint); user-select: none; }
.breadcrumb .leaf { color: var(--fg); font-weight: var(--weight-semibold); }

/* ── TOOLTIP ──────────────────────────────────────────────────
   Square ink chip on hover/focus. Sentence case, low drama. */
.tooltip { position: relative; display: inline-flex; }
.tooltip > .tooltip-tip {
  position: absolute; z-index: 45; pointer-events: none;
  background: var(--fg); color: var(--bg);
  font-size: var(--text-2xs); line-height: 1.3; white-space: nowrap;
  padding: 5px 8px; border-radius: 0; box-shadow: var(--shadow-pop);
  opacity: 0; transition: opacity 90ms linear, transform 90ms linear;
}
.tooltip:hover > .tooltip-tip, .tooltip:focus-within > .tooltip-tip { opacity: 1; }
.tooltip > .tooltip-tip.top    { bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%) translateY(3px); }
.tooltip:hover > .tooltip-tip.top, .tooltip:focus-within > .tooltip-tip.top { transform: translateX(-50%) translateY(0); }
.tooltip > .tooltip-tip.bottom { top: calc(100% + 7px); left: 50%; transform: translateX(-50%) translateY(-3px); }
.tooltip:hover > .tooltip-tip.bottom, .tooltip:focus-within > .tooltip-tip.bottom { transform: translateX(-50%) translateY(0); }
.tooltip > .tooltip-tip.left   { right: calc(100% + 7px); top: 50%; transform: translateY(-50%) translateX(3px); }
.tooltip:hover > .tooltip-tip.left, .tooltip:focus-within > .tooltip-tip.left { transform: translateY(-50%) translateX(0); }
.tooltip > .tooltip-tip.right  { left: calc(100% + 7px); top: 50%; transform: translateY(-50%) translateX(-3px); }
.tooltip:hover > .tooltip-tip.right, .tooltip:focus-within > .tooltip-tip.right { transform: translateY(-50%) translateX(0); }

/* ── CHIPS (filter pills, square) ─────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-2);
  cursor: pointer;
}
.chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }

/* ── TABLE ────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tbl th {
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  padding: 10px var(--pad-x);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.tbl td { padding: var(--pad-y) var(--pad-x); border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable:hover td { background: var(--surface-2); cursor: default; }
.tbl .name { font-weight: var(--weight-medium); color: var(--fg); }
.tbl .name a { color: var(--fg); }
.tbl .name a:hover { color: var(--accent); }
.tbl .secondary { color: var(--muted); font-size: var(--text-xs); }

/* ── PAGE HEADER (accent rule signature) ───────────────────────── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
  display: flex; align-items: center;
}
.page-head h1::before {
  content: "";
  display: inline-block;
  width: 4px; height: 22px;
  background: var(--accent);
  margin-right: 12px;
  flex-shrink: 0;
}
.page-head .sub { color: var(--muted); font-size: var(--text-sm); margin-top: 6px; }

/* ── SECTION HEAD ──────────────────────────────────────────────── */
.section-head { margin-bottom: var(--space-4); }
.section-head h2 {
  font-size: var(--text-section);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ── STAT STRIP (dashboard metrics) ────────────────────────────── */
.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  overflow: hidden;
}
.status-strip .cell { padding: 16px 20px; border-right: 1px solid var(--border); min-width: 0; }
.status-strip .cell:last-child { border-right: none; }
.status-strip .cell .label {
  font-size: var(--text-2xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: var(--weight-semibold);
  margin-bottom: 6px;
}
.status-strip .cell .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.status-strip .cell .delta { font-size: var(--text-2xs); color: var(--muted); margin-top: 6px; display: flex; gap: 4px; }
.status-strip .cell .delta.up { color: var(--ok); }
.status-strip .cell .delta.down { color: var(--err); }

/* ── CREATE WORKSPACE (two-pane) ────────────────────────────────
   Page-scoped layout + the selectable hosting card + BYO block.
   All built from existing tokens; nothing new in the token files. */
.create-workspace .panes { display: grid; grid-template-columns: 336px 1fr; }
.create-workspace .pane-left {
  border-right: 1px solid var(--border);
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.create-workspace .pane-right {
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.create-workspace .pane-right .field { margin-top: 0; }
.create-workspace .details-head { display: flex; align-items: center; gap: 10px; }
.create-workspace .details-head h2 {
  font-size: var(--text-section); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
  color: var(--fg); margin: 0;
}
.create-workspace .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.create-workspace .row2.conn { grid-template-columns: 1.4fr 1fr; }
.create-workspace .actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 18px; border-top: 1px solid var(--border);
}

.create-workspace .hosting-option {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface);
  transition: background 80ms linear, border-color 80ms linear;
}
.create-workspace .hosting-option:hover { border-color: var(--border-strong); }
.create-workspace .hosting-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.create-workspace .hosting-option.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.create-workspace .hosting-option .indicator {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center;
}
.create-workspace .hosting-option .indicator > span { width: 8px; height: 8px; background: var(--accent); }
.create-workspace .hosting-option .opt-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.create-workspace .hosting-option .opt-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--fg); }
.create-workspace .hosting-option .opt-desc { font-size: var(--text-xs); color: var(--muted); line-height: var(--leading-snug); }

.create-workspace .connection-block {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--accent-soft); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.create-workspace .connection-block .conn-head {
  display: flex; align-items: center; gap: 8px; color: var(--accent-ink);
  font-size: var(--text-2xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
}

/* ── EMPTY STATE ───────────────────────────────────────────────
   Centered "nothing here yet" block: square hairline icon frame,
   optional uppercase eyebrow, title, one-line message + actions.
   Borders over shadows — `.bordered` wraps it in a dashed panel.
   The DataGrid renders this internally when it has no rows. */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 56px 32px;
  color: var(--muted);
}
.empty-state-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  margin-bottom: 18px;
}
.empty-state-ic svg { width: 22px; height: 22px; }
.empty-state-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--faint);
}
.empty-state-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  color: var(--fg);
  line-height: var(--leading-snug);
}
.empty-state-msg {
  margin-top: 7px;
  max-width: 360px;
  color: var(--fg-2);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  text-wrap: pretty;
}
.empty-state-msg p { margin: 0; }
.empty-state-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

/* bordered placeholder panel */
.empty-state.bordered { border: 1px dashed var(--border-strong); background: var(--surface); }

/* compact — for cards, panels, narrow regions */
.empty-state.compact { padding: 34px 22px; }
.empty-state.compact .empty-state-ic { width: 38px; height: 38px; margin-bottom: 13px; }
.empty-state.compact .empty-state-ic svg { width: 18px; height: 18px; }
.empty-state.compact .empty-state-title { font-size: var(--text-body); }
.empty-state.compact .empty-state-msg { font-size: var(--text-xs); margin-top: 5px; }
.empty-state.compact .empty-state-actions { margin-top: 16px; }

/* ── CREATE WIZARDS ─────────────────────────────────────────────
   Shared chrome + inputs for the create dialogs (tentacle / node /
   database). Reusable design-system classes; tokens only. */

/* wizard modal shell */
.modal.wizard { max-width: none; }              /* width is set inline per dialog */
.modal-foot.split { justify-content: space-between; }
.wiz-chip {
  font-family: var(--font-mono); font-size: var(--text-mono);
  text-transform: uppercase; letter-spacing: var(--tracking-mono);
  color: var(--muted); border: 1px solid var(--border); padding: 2px 6px;
}

/* step rail */
.wiz-rail { display: flex; align-items: center; gap: 8px; padding: 13px var(--pad-x); border-bottom: 1px solid var(--border); }
.wiz-rail-step { display: flex; align-items: center; gap: 8px; background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.wiz-rail-step:disabled { cursor: default; }
.wiz-rail-num {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
}
.wiz-rail-num.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.wiz-rail-num.done { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.wiz-rail-lbl { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted); }
.wiz-rail-lbl.active { color: var(--accent-ink); }
.wiz-rail-line { flex: 1; height: 1px; background: var(--border); }
.wiz-rail-line.done { background: var(--accent); }

/* body + group headers (tentacle families) */
.wiz-body { display: flex; flex-direction: column; gap: 18px; }
.wiz-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wiz-group-head .t { font-family: var(--font-mono); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); font-weight: var(--weight-semibold); color: var(--accent-ink); }
.wiz-group-head .t.muted { color: var(--muted); }
.wiz-group-head .rule { flex: 1; height: 1px; background: var(--border); }
.wiz-blurb { font-size: var(--text-xs); color: var(--fg-2); line-height: var(--leading-body); margin: 0 0 10px; }
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }

/* selectable card (generalises hosting-option) */
.select-card {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  padding: 13px; text-align: left; cursor: pointer; border-radius: 0; font: inherit;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  transition: background 80ms linear, border-color 80ms linear;
}
.select-card:hover { border-color: var(--border-strong); }
.select-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.select-card.selected { border-color: var(--accent-line); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-ink); }
.select-card .select-card-ind {
  position: absolute; top: 9px; right: 9px; width: 16px; height: 16px;
  border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center;
}
.select-card.selected .select-card-ind { border-color: var(--accent); }
.select-card .select-card-ind > span { width: 8px; height: 8px; background: var(--accent); transform: scale(0); transition: transform 110ms cubic-bezier(0.2, 0, 0, 1); }
.select-card.selected .select-card-ind > span { transform: scale(1); }
.select-card .sc-title { font-size: var(--text-body); font-weight: var(--weight-semibold); }
.select-card .sc-meta { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--muted); }
.select-card .sc-desc { font-size: var(--text-xs); color: var(--fg-2); line-height: var(--leading-snug); }

/* segmented control */
.seg { display: inline-flex; align-items: stretch; border: 1px solid var(--border); height: 32px; }
.seg-opt {
  display: inline-flex; align-items: center; padding: 0 14px; cursor: pointer;
  font-family: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--fg-2); background: transparent; border: none; border-left: 1px solid var(--border);
}
.seg-opt:first-child { border-left: none; }
.seg-opt:hover { color: var(--fg); }
.seg-opt.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: var(--weight-semibold); }
.seg-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* stepper (labelled −/＋ counter) */
.count-field { display: flex; flex-direction: column; gap: 6px; }
.count-field .count-label { font-size: var(--text-xs); color: var(--fg-2); }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); height: 36px; width: fit-content; }
.stepper-btn { width: 34px; display: grid; place-items: center; background: var(--surface); border: none; color: var(--fg-2); cursor: pointer; font-size: 17px; }
.stepper-btn:first-child { border-right: 1px solid var(--border-strong); }
.stepper-btn:last-child { border-left: 1px solid var(--border-strong); }
.stepper-btn:hover { background: var(--surface-2); }
.stepper-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper-val { width: 72px; padding: 0 8px; text-align: center; background: transparent; border: none; color: var(--fg); font-family: var(--font-mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper-val:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.provision-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.provision-row .op { font-size: 18px; color: var(--muted); padding-bottom: 7px; }
.provision-total { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--accent-line); background: var(--accent-soft); font-family: var(--font-mono); font-size: 16px; font-weight: var(--weight-bold); color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* size slider with clickable ticks */
.slider-field { display: flex; flex-direction: column; }
.slider-field .slider-head { display: flex; justify-content: space-between; align-items: baseline; }
.slider-field .slider-label { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--muted); }
.slider-field .slider-readout { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--accent-ink); }
.wiz-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--border-strong); cursor: pointer; margin: 13px 0; }
.wiz-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; background: var(--accent); border: none; border-radius: 0; cursor: pointer; }
.wiz-slider::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent); border: none; border-radius: 0; cursor: pointer; }
.wiz-ticks { display: flex; justify-content: space-between; }
.wiz-tick { font-family: var(--font-mono); font-size: var(--text-mono); letter-spacing: var(--tracking-mono); color: var(--muted); cursor: pointer; background: none; border: none; padding: 0; }
.wiz-tick:hover { color: var(--fg); }
.wiz-tick.on { color: var(--accent-ink); font-weight: 600; }

/* cost readout (footer, left) */
.cost-readout-eyebrow { font-family: var(--font-mono); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--muted); }
.cost-readout-main { font-family: var(--font-mono); font-size: 18px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cost-readout-main .cost-sub { font-size: var(--text-xs); font-weight: 400; color: var(--muted); }
.cost-readout-hint { font-size: var(--text-sm); color: var(--muted); }

/* prefix-affix input group (locked prefix + mono text input) */
.affix { display: flex; align-items: stretch; }
.affix > span {
  display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--border); border-right: 0; background: var(--surface-2);
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted);
}
.affix > .input { flex: 1; min-width: 0; border-left: 0; font-family: var(--font-mono); }
.affix.bad > span { border-color: var(--err); }

/* env-var editor */
.envvar-list { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.envvar-row { display: flex; gap: 8px; align-items: center; }
.envvar-row .input { flex: 1; font-family: var(--font-mono); font-size: var(--text-xs); }
.envvar-row .eq { color: var(--muted); }
.envvar-row .rm { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.envvar-row .rm:hover { border-color: var(--border-strong); color: var(--fg); }
.envvar-secure { display: flex; align-items: center; gap: 5px; flex: none; font-size: var(--text-xs); color: var(--muted); cursor: pointer; user-select: none; }
.envvar-secure input { accent-color: var(--accent); cursor: pointer; }

/* env-chip toggles (tentacle environments) */
.env-chips { display: flex; gap: 9px; flex-wrap: wrap; }

/* autocomplete + chip input */
.ac { position: relative; }
.ac-panel {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 55;
  max-height: 190px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 0; box-shadow: var(--shadow-pop);
}
.ac-option { padding: 7px 12px; font-size: var(--text-sm); color: var(--fg); cursor: pointer; }
.ac-option:hover { background: var(--accent-soft); color: var(--accent-ink); }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: var(--row-h); padding: 5px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: text;
}
.chip-input:hover { border-color: var(--border-strong); }
.chip-input:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip-input .chip-input-field {
  flex: 1; min-width: 90px; height: 24px;
  border: none; outline: none; background: transparent;
  color: var(--fg); font-family: var(--font-sans); font-size: var(--text-sm);
}
.chip-input .chip-input-field::placeholder { color: var(--faint); }
.token {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 3px 0 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid var(--accent-line); font-size: var(--text-xs);
}
.token-x {
  display: grid; place-items: center; width: 16px; height: 16px;
  border: none; background: transparent; color: var(--accent-ink);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.token-x:hover { color: var(--err); }

/* ── LOADING SPINNER ─────────────────────────────────────────────
   Two animations on purpose. armada-spin does the rotation;
   armada-spin-in holds opacity at 0 through a 150ms delay using
   backwards fill, so a load that lands fast shows nothing at all
   rather than flashing a spinner. Delaying the rotation on its own
   wouldn't help — the static glyph still paints immediately. */
.armada-spin {
  animation: armada-spin .9s linear infinite,
             armada-spin-in 120ms linear 150ms both;
}

}

/* ── 404 SONAR SWEEP ─────────────────────────────────────────────
   Rotation for the NotFound page's scope beam. Keyframes are global
   by nature, so this lives outside the @scope block. */
@keyframes armada-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── AUTH / SIGNING-IN ───────────────────────────────────────────
   Keyframes for the SigningInView card (bobbing fleet mark, wave
   drift, progress sweep, active-line ellipsis). Global by nature,
   so they live outside the @scope block; "armada-sweep" was taken
   by the 404 sonar, hence the armada-auth-* prefix. */
@keyframes armada-auth-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3.5px); }
}
@keyframes armada-auth-drift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(2.5px); }
}
@keyframes armada-auth-scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(420%); }
}
@keyframes armada-auth-blink {
  0%, 20%   { opacity: 1; }
  60%, 100% { opacity: 0.15; }
}

/* ── LOADING SPINNER ─────────────────────────────────────────────
   Keyframes are global by nature, so they live out here alongside
   armada-sweep and the armada-auth-* set. See .armada-spin above. */
@keyframes armada-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes armada-spin-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
