body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-wash); }
html { scrollbar-color: var(--line-strong) var(--canvas); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- typographic roles ---- */
.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3);
}
.page-title {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-weight: 700; font-size: 1.7rem; line-height: 1.12;
  letter-spacing: -.021em; color: var(--ink); text-wrap: balance;
}
.lede { color: var(--ink-2); font-size: .9rem; margin-top: .35rem; }
.num  { font-family: "Hanken Grotesk", sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---- card ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.card-pad { padding: 1.2rem; }
.card-ok { border-color: color-mix(in srgb, var(--ok) 22%, var(--line)); background: color-mix(in srgb, var(--ok-wash) 55%, var(--surface)); }
.card-accent { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.card-danger { border-color: color-mix(in srgb, var(--down) 30%, var(--line)); }
.card-tile { padding: .75rem 1rem; text-align: left; transition: border-color .12s; }
.card-tile:hover { border-color: var(--accent); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.2rem; border-bottom: 1px solid var(--line);
}
.card-head h2 {
  font-family: "Hanken Grotesk", "Inter", sans-serif;
  font-weight: 600; font-size: .95rem; color: var(--ink); letter-spacing: -.01em;
}
.card-link { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.card-link:hover { color: var(--ink); }
.divide-hair > * + * { border-top: 1px solid var(--line); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 3rem 1.5rem; gap: .6rem; }
.empty-state-icon { width: 30px; height: 30px; color: var(--ink-3); opacity: .55; }
.empty-state-title { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.empty-state-desc { font-size: 12.5px; color: var(--ink-3); max-width: 360px; line-height: 1.5; }
.empty-state-desc a, .empty-state-desc .link-accent { color: var(--accent); font-weight: 500; }

/* ---- table ---- */
.rtable { width: 100%; font-size: .875rem; border-collapse: collapse; }
.rtable .text-right { text-align: right; }
.rtable thead th {
  text-align: left; font-family: "Inter", sans-serif; white-space: nowrap;
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
  padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.rtable tbody td { padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable td.nowrap, .rtable th.nowrap { white-space: nowrap; }
.rtable .ta-right { text-align: right; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover { background: var(--surface-2); }
.rtable-apps { table-layout: auto; }
.rtable-apps th:first-child, .rtable-apps td:first-child { width: 100%; }
.rtable-apps th:not(:first-child), .rtable-apps td:not(:first-child) { white-space: nowrap; }
.row-accent-ok td:first-child, .row-accent-warn td:first-child,
.row-accent-down td:first-child, .row-accent-live td:first-child { box-shadow: inset 3px 0 0 var(--row-accent); }
.row-accent-ok { --row-accent: var(--ok); }
.row-accent-warn { --row-accent: var(--warn); }
.row-accent-down { --row-accent: var(--down); }
.row-accent-live { --row-accent: var(--live); }

.step-tracker { display: flex; align-items: center; }
.step-tracker-item { display: flex; align-items: center; gap: .5rem; }
.step-tracker-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; border: 2px solid var(--line-strong);
  color: var(--ink-3); background: var(--surface);
}
.step-tracker-item.is-done .step-tracker-dot { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.step-tracker-item.is-current .step-tracker-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.step-tracker-item.is-error .step-tracker-dot { background: var(--down); border-color: var(--down); color: var(--on-accent); }
.step-tracker-label { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.step-tracker-item.is-done .step-tracker-label,
.step-tracker-item.is-current .step-tracker-label,
.step-tracker-item.is-error .step-tracker-label { color: var(--ink); font-weight: 500; }
.step-tracker-line { flex: 1; height: 2px; background: var(--line-strong); margin: 0 .6rem; min-width: 16px; }
.step-tracker-line.is-done { background: var(--ok); }

.step-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; counter-reset: step; }
.step-list li { display: flex; align-items: flex-start; gap: .65rem; font-size: 13px; color: var(--ink-2); }
.step-list li::before {
  counter-increment: step; content: counter(step); flex: none;
  width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  background: var(--accent-wash); color: var(--accent-hover);
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: 13px; font-weight: 600; line-height: 1; height: 34px; padding: 0 .9rem;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface);
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary, .btn-primary:hover { border-color: transparent; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, transparent); background: var(--surface); }
.btn-danger:hover { background: var(--down-wash); }
.app-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.app-dialog::backdrop { background: rgba(8,10,14,.55); backdrop-filter: blur(2px); }
.app-dialog form { padding: 1.25rem; display: grid; gap: 1rem; }
.app-dialog p { font-size: 14px; line-height: 1.5; margin: 0; white-space: pre-line; }
.app-dialog .app-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.btn-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: var(--surface); }
.btn-warn:hover { background: var(--warn-wash); }
.btn-sm { height: 28px; padding: 0 .65rem; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 1.2rem; font-size: 14px; }
form.button_to { display: inline-flex; }
.link-accent { color: var(--accent); font-weight: 500; }
.link-accent:hover { color: var(--accent-hover); }

/* ---- status pills ---- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: 3px 10px 3px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; line-height: 1; border: 1px solid transparent;
}
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; flex: none; }
.pill .dot { background: currentColor; }
.pill-ok   { color: var(--ok);   background: var(--ok-wash);   border-color: color-mix(in srgb, var(--ok) 18%, transparent); }
.pill-warn { color: var(--warn); background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.pill-down { color: var(--down); background: var(--down-wash); border-color: color-mix(in srgb, var(--down) 18%, transparent); }
.pill-live { color: var(--live); background: var(--live-wash); border-color: color-mix(in srgb, var(--live) 20%, transparent); }
.pill-neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line-strong); }
.pill-lg { font-size: 12px; padding: 4px 12px 4px 9px; }
.pill-live .dot { animation: railyard-pulse 1.4s ease-in-out infinite; }
@keyframes railyard-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pill-live .dot { animation: none; } }

/* ---- load meters ---- */
.meter-row { display: grid; grid-template-columns: 30px 1fr 40px; align-items: center; gap: .5rem; }
.meter-key { font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .06em; color: var(--ink-3); }
.meter-val { font-family: "IBM Plex Mono", monospace; font-size: 11px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter-track { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-fill  { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }
.meter-fill.hot  { background: var(--warn); }
.meter-fill.crit { background: var(--down); }

/* ---- forms ---- */
.fieldset { border-top: 1px solid var(--line); padding-top: 1.4rem; margin-top: 1.4rem; }
.fieldset.is-first { border-top: 0; padding-top: 0; margin-top: 0; }
.fieldset-title { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: .9rem;
  display: flex; align-items: center; gap: .45rem; text-transform: uppercase; letter-spacing: .06em; }
.fieldset-title svg { width: 14px; height: 14px; color: var(--ink-3); flex: none; }

.field-icon-wrap { position: relative; }
.field-icon-wrap .input { padding-left: 2.15rem; }
.field-icon-wrap svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.field { display: block; }
.field + .field { margin-top: 1rem; }
.field-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: .3rem; }
.field-hint  { font-size: 12px; color: var(--ink-3); margin-top: .35rem; line-height: 1.45; }
.field-hint code { font-family: "IBM Plex Mono", monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 4px; border-radius: 4px; font-size: 11px; }
.input {
  width: 100%; display: block; font-size: 13px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .55rem .7rem;
  transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.input.mono, textarea.input { font-family: "IBM Plex Mono", monospace; }
textarea.input { line-height: 1.5; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.form-error { background: var(--down-wash); border: 1px solid color-mix(in srgb, var(--down) 25%, transparent); border-radius: var(--radius-sm); padding: .8rem 1rem; }
/* inline read-only value / connection-string display */
.codeblock { display: block; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: .4rem .55rem; word-break: break-all; }
/* destructive-action enclosure (reset, delete) */
.danger-zone { border: 1px solid color-mix(in srgb, var(--down) 30%, var(--line));
  background: color-mix(in srgb, var(--down-wash) 40%, transparent);
  border-radius: var(--radius-sm); padding: .75rem; }
.danger-zone > summary { color: var(--down); font-weight: 600; cursor: pointer; }

/* progressive-disclosure enclosure for optional/advanced form fields —
   same shape as danger-zone, neutral instead of alarming, so a form
   can default to just what's needed and tuck the rest away. */
.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.disclosure + .disclosure { margin-top: .6rem; }
.disclosure > summary {
  list-style: none; cursor: pointer; padding: .65rem .9rem;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  display: flex; align-items: center; gap: .5rem;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform .12s;
}
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { color: var(--ink); }
.disclosure-body { padding: .2rem 1rem 1rem; border-top: 1px solid var(--line); }
.disclosure-body > .field:first-child,
.disclosure-body > .grid:first-child { margin-top: 1rem; }
.form-error h3 { font-size: 13px; font-weight: 600; color: var(--down); }
.form-success { background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.form-success h3 { color: var(--ok); }
.form-error ul { font-size: 13px; color: var(--down); margin-top: .3rem; padding-left: 1.1rem; list-style: disc; }
.check { width: 15px; height: 15px; border-radius: 4px; accent-color: var(--accent); }

/* ---- repo command bar + detect reveal (New application) ----
   The one bold moment on the page: paste a repo, watch it get
   understood. Everything else in the form stays quiet around it. */
.repobar {
  display: flex; gap: .5rem; align-items: stretch;
  background: var(--surface-inverse); padding: 6px; border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 2px rgba(23,26,33,.06), 0 12px 28px -14px rgba(23,26,33,.35);
}
.repobar-input {
  flex: 1; min-width: 0; font-family: "IBM Plex Mono", monospace; font-size: 14px;
  color: #fff; background: transparent; border: 0; padding: .75rem .9rem;
}
.repobar-input::placeholder { color: rgba(255,255,255,.4); }
.repobar-input:focus { outline: none; }
.repobar:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.repobar-go {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: var(--radius-sm); padding: 0 1.05rem; cursor: pointer;
  transition: background-color .12s, transform .12s;
}
.repobar-go:hover { background: var(--accent-hover); }
.repobar-go:active { transform: scale(.97); }
.repobar-go svg { width: 14px; height: 14px; flex: none; }
.repobar-go.is-busy svg { animation: railyard-spin 0.7s linear infinite; }
@keyframes railyard-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .repobar-go.is-busy svg { animation: none; } }
.repobar-hint { font-size: 12px; color: var(--ink-3); margin-top: .55rem; }
@media (max-width: 480px) {
  .repobar { flex-wrap: wrap; }
  .repobar-input { flex-basis: 100%; }
  .repobar-go { flex: 1; justify-content: center; padding: .65rem; }
}

.detect-reveal {
  margin-top: .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: .9rem 1rem;
  opacity: 0; transform: translateY(-4px) scale(.98);
  animation: railyard-reveal .32s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes railyard-reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .detect-reveal { animation: none; opacity: 1; transform: none; } }
.detect-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.fw-badge {
  display: inline-flex; align-items: center; gap: .4rem; font-family: "Hanken Grotesk", sans-serif;
  font-weight: 700; font-size: 13px; padding: 3px 10px 3px 8px; border-radius: var(--radius-pill);
  color: var(--fw-color, var(--accent)); background: var(--fw-wash, var(--accent-wash));
}
.fw-badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.detect-note { font-size: 12.5px; color: var(--ink-2); }
.detect-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; align-items: center; }
.chip {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 3px 8px;
}
.fw-avatar { width: 20px; height: 20px; border-radius: 5px; flex: none; }

/* ---- template gallery cards ---- */
.template-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-card);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.template-card:hover {
  border-color: var(--line-strong); box-shadow: var(--shadow-pop); transform: translateY(-1px);
}
.template-card-name {
  font-family: "Hanken Grotesk", sans-serif; font-weight: 700; font-size: 1rem;
  color: var(--ink); margin-top: .7rem; letter-spacing: -.01em;
}
.template-card-desc { font-size: 12.5px; color: var(--ink-2); margin-top: .35rem; line-height: 1.5; }
.template-card-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: 1rem;
  padding-top: .75rem; border-top: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--ink-3);
}

/* category tabs + search — the "browse a broad catalog" toolbar */
.template-tabs {
  display: flex; flex-wrap: wrap; gap: 1.4rem; border-bottom: 1px solid var(--line);
}
.template-tab {
  font-family: "Hanken Grotesk", sans-serif; font-weight: 600; font-size: 13.5px;
  color: var(--ink-3); background: none; border: none; cursor: pointer;
  padding: 0 0 .7rem; margin-bottom: -1px; border-bottom: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
.template-tab:hover { color: var(--ink); }
.template-tab[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.template-search-row { display: flex; gap: .6rem; margin-top: 1rem; }
.template-search {
  flex: 1; font-size: 13.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .6rem .85rem; transition: border-color .12s, box-shadow .12s;
}
.template-search::placeholder { color: var(--ink-3); }
.template-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.template-count { font-size: 12px; color: var(--ink-3); margin-top: .6rem; }
.template-empty {
  grid-column: 1 / -1; padding: 3rem 1rem; text-align: center;
  font-size: 13px; color: var(--ink-3);
}
.template-verified-toggle {
  display: flex; align-items: center; gap: .4rem; font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.template-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.verified-badge {
  display: inline-flex; align-items: center; font-family: "Inter", sans-serif;
  font-weight: 600; font-size: 11px; color: var(--ok); background: var(--ok-wash);
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.verified-badge-inline { margin: 0 .1rem; }

/* live "this is the URL it'll answer on" feedback under Name */
.url-preview {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink-3);
  margin-top: .35rem; line-height: 1.5;
}
.url-preview[hidden] { display: none; }
.url-preview b { font-weight: 500; color: var(--accent); overflow-wrap: anywhere; }

/* selectable addon chips (Managed datastores) — real checkboxes underneath,
   :has() drives the active state so no JS is needed. */
.addon-chip {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); padding: .4rem .8rem .4rem .6rem;
  transition: background-color .12s, border-color .12s, color .12s;
}
.addon-chip:hover { border-color: var(--ink-3); }
.addon-chip:has(input:checked) {
  background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-hover);
}
.addon-chip input { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }

/* provider picker (Attach a server) — visual card-per-provider radio
   group instead of a plain <select>, same :has()-driven active state
   as the addon chips above. */
.provider-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.provider-card {
  position: relative; display: flex; flex-direction: column; gap: .25rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .7rem .85rem; transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.provider-card:hover { border-color: var(--ink-3); }
.provider-card input { position: absolute; opacity: 0; pointer-events: none; }
.provider-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-wash);
  box-shadow: 0 0 0 1px var(--accent);
}
.provider-card-name { font-family: "Hanken Grotesk", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.provider-card:has(input:checked) .provider-card-name { color: var(--accent-hover); }
.provider-card-hint { font-size: 11.5px; color: var(--ink-3); }

/* region/size picker (Attach a server, provisioning path) — same
   :has()-driven card pattern as .provider-card above, denser since
   there are more options and no subtitle line. */
.option-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.option-card {
  position: relative; display: flex; align-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .5rem .7rem; transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.option-card:hover { border-color: var(--ink-3); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-wash);
  box-shadow: 0 0 0 1px var(--accent);
}
.option-card:has(input:disabled) { cursor: default; opacity: .5; }
.option-card-name { font-size: 12.5px; color: var(--ink); }
.option-card:has(input:checked) .option-card-name { color: var(--accent-hover); font-weight: 600; }

.health-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.health-banner b { color: var(--ink); }
.health-banner.is-ok { background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.health-banner.is-warn { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.health-banner.is-down { background: var(--down-wash); border-color: color-mix(in srgb, var(--down) 25%, transparent); }
.kpi-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: block; padding: 1rem 1.1rem; transition: border-color .12s; } .kpi:hover { border-color: var(--accent); }
.kpi-of { font-size: 14px; color: var(--ink-3); margin-left: .25rem; font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--ink-3); margin-top: .15rem; }
.app-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.app-tile { display: block; padding: .95rem 1.05rem; transition: border-color .12s, transform .12s; } .app-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.provider-mark-own { background: var(--surface-inverse); }
.server-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.server-card { display: flex; flex-direction: column; gap: .85rem; padding: 1rem 1.1rem; transition: border-color .12s, transform .12s; }
.server-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.server-card-head { display: flex; align-items: center; gap: .7rem; }
.server-card-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; font-size: 12px; }
.server-card-facts div span { display: block; color: var(--ink-3); font-size: 11px; }
.server-card-facts div b { font-weight: 600; color: var(--ink); }
.server-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: .7rem; }
.form-with-nav { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .form-with-nav { grid-template-columns: 170px minmax(0, 44rem); } }
.section-nav { display: none; }
@media (min-width: 1024px) { .section-nav { display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 1.25rem; align-self: start; } }
.section-nav a { font-size: 13px; color: var(--ink-2); padding: .4rem .6rem; border-radius: var(--radius-sm); }
.section-nav a:hover { color: var(--ink); background: var(--surface-2); }
.check-ok { color: var(--ok); font-weight: 700; } .check-warn { color: var(--warn); font-weight: 700; } .check-fail { color: var(--down); font-weight: 700; }
.repo-list { display: grid; margin-top: .5rem; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.repo-list:empty { display: none; }
.repo-row { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem .8rem; font-size: 13px; color: var(--ink); text-align: left; border-bottom: 1px solid var(--line); background: var(--surface); }
.repo-row:last-child { border-bottom: 0; } .repo-row:hover { background: var(--accent-wash); }
.repo-row-meta { font-size: 11.5px; color: var(--ink-3); font-family: ui-monospace, "JetBrains Mono", monospace; }
.diagnosis { border-left: 3px solid var(--down); }
.diagnosis-evidence { margin-top: .85rem; padding: .6rem .8rem; font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border-radius: var(--radius-sm); color: var(--ink-2); }
.add-server { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .add-server { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.mode-picker { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mode-card {
  position: relative; display: flex; gap: .85rem; cursor: pointer; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.mode-card:hover { border-color: var(--ink-3); }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 0 0 1px var(--accent); }
.mode-card-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); font-size: 18px; }
.mode-card:has(input:checked) .mode-card-icon { background: var(--surface); }
.mode-card b { display: block; font-family: "Hanken Grotesk", sans-serif; font-size: 15px; color: var(--ink); }
.mode-card span.hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: .15rem; }
.step { display: flex; align-items: center; gap: .6rem; margin: 1.6rem 0 .75rem; font-family: "Hanken Grotesk", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); }
.step-num { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-size: 11.5px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }
.provider-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; flex: none; }
.provider-card .provider-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.connected { font-size: 10.5px; font-weight: 600; color: var(--ok); background: var(--ok-wash); border-radius: 999px; padding: .1rem .45rem; }
.size-card { flex-direction: column; align-items: stretch; gap: .2rem; padding: .7rem .8rem; }
.size-card .size-price { font-family: "Hanken Grotesk", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.size-card .size-meta { font-size: 11px; color: var(--ink-3); font-family: ui-monospace, "JetBrains Mono", monospace; }
.size-card .badge-rec { align-self: flex-start; font-size: 10px; font-weight: 600; color: var(--accent-hover); background: var(--accent-wash); border-radius: 999px; padding: .05rem .45rem; }
.token-saved { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--ok-wash); color: var(--ink); font-size: 13px; }
.checklist { display: grid; gap: .4rem; font-size: 13px; color: var(--ink-2); }
.checklist li { display: flex; gap: .5rem; } .checklist li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.summary-card { position: sticky; top: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.summary-row span:first-child { color: var(--ink-3); } .summary-row span:last-child { color: var(--ink); text-align: right; }
.summary-total { display: flex; align-items: baseline; justify-content: space-between; padding: .8rem 0 .2rem; }
.summary-total b { font-family: "Hanken Grotesk", sans-serif; font-size: 22px; color: var(--ink); }
.timeline { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .6rem; }
.timeline li { display: flex; gap: .6rem; font-size: 12.5px; color: var(--ink-2); }
.timeline li i { font-style: normal; width: 20px; height: 20px; flex: none; border-radius: 999px; display: grid; place-items: center; font-size: 10.5px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }

/* ---- flash ---- */
.flash { border-radius: 10px; padding: .7rem 1rem; font-size: 13px; font-weight: 500; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok   { background: var(--ok-wash);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.flash-warn { background: var(--warn-wash); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.flash-down { background: var(--down-wash); color: var(--down); border-color: color-mix(in srgb, var(--down) 22%, transparent); }

.toast-stack {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: .5rem; width: 100%; max-width: 360px;
}
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
  padding: .8rem .9rem .9rem 1rem; border-radius: var(--radius); font-size: 13px; line-height: 1.45;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
  border-left: 3px solid currentColor; box-shadow: 0 12px 32px rgba(0,0,0,.28);
  animation: railyard-toast-in .22s cubic-bezier(.2,.8,.3,1);
}
.toast.flash-ok { background: var(--surface); color: var(--ok); }
.toast.flash-down { background: var(--surface); color: var(--down); }
.toast > span { color: var(--ink); }
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: currentColor; opacity: .5; transform-origin: left;
  animation: railyard-toast-timer 5s linear forwards;
}
@keyframes railyard-toast-timer { to { transform: scaleX(0); } }
.toast button {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font-size: 15px; line-height: 1; color: inherit; opacity: .6; flex: none;
}
.toast button:hover { opacity: 1; }
.toast.is-leaving { animation: railyard-toast-out .18s ease forwards; }
@keyframes railyard-toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes railyard-toast-out { to { opacity: 0; transform: translateX(12px); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation: none; } }
@media (max-width: 480px) { .toast-stack { left: 1rem; right: 1rem; max-width: none; } }

/* ============================================================
   Shell — left icon rail + centered content column.
   ============================================================ */
.app-shell { display: flex; align-items: flex-start; min-height: 100vh; }

.rail {
  width: var(--rail-w); flex: none;
  position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
  padding: 1.1rem .75rem 1rem;
}
.rail-top { padding: .3rem .55rem 1rem; }
.railbrand { display: inline-flex; align-items: center; gap: .6rem; }
.signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.signal i { width: 3px; border-radius: 2px; background: var(--line-strong); display: block; }
.signal i:nth-child(1) { height: 7px; }
.signal i:nth-child(2) { height: 11px; }
.signal i:nth-child(3) { height: 16px; background: var(--accent); }
.wordmark { font-family: "Hanken Grotesk", sans-serif; font-weight: 700; letter-spacing: -.015em; color: var(--ink); font-size: 1.02rem; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .9rem .6rem .3rem; }
.navlink {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: background-color .12s, color .12s; width: 100%; text-align: left;
}
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.is-active { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.rail-ic { width: 16px; height: 16px; flex: none; opacity: .9; }
.navlink.is-active .rail-ic { opacity: 1; }
.theme-switching, .theme-switching * { transition: none !important; }
.theme-picker { position: relative; }
.theme-picker .navlink-label { flex: 1; }
.theme-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 40;
  max-height: min(70vh, 34rem); overflow-y: auto; padding: .35rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.theme-menu-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: .6rem .5rem .3rem; }
.theme-menu-group:first-child { padding-top: .3rem; }
.theme-option {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  padding: .38rem .5rem; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-2);
}
.theme-option:hover, .theme-option:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }
.theme-option[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.theme-option[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); font-size: 12px; }
.theme-swatch {
  display: inline-flex; align-items: center; gap: 3px; flex: none; padding: 4px 5px; border-radius: 6px;
  background: var(--o-bg); box-shadow: inset 0 0 0 1px var(--o-sel);
}
.theme-swatch i { width: 6px; height: 6px; border-radius: 999px; }
.theme-swatch i:nth-child(1) { background: var(--o-fg); }
.theme-swatch i:nth-child(2) { background: var(--o-accent); }
.theme-swatch i:nth-child(3) { background: var(--o-green); }
.theme-swatch i:nth-child(4) { background: var(--o-red); }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: .3rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.rail-foot form { display: block; margin: 0; }
.railchip {
  display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start;
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; margin: 0 .1rem .25rem;
}
.railchip .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.railchip.is-ok   { color: var(--ok);   background: var(--ok-wash); }
.railchip.is-down { color: var(--down); background: var(--down-wash); }
.rail-team { font-size: 12px; padding: .3rem .4rem; }
.rail-team-name { font-size: 12px; color: var(--ink-3); padding: .35rem .6rem; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-content { flex: 1; width: 100%; max-width: var(--shell-max); margin: 0 auto; padding: 2rem 2.5rem 3rem; }
.app-foot { width: 100%; max-width: var(--shell-max); margin: 0 auto; padding: 1.25rem 2.5rem 2rem; }

/* rail-less (signed-out) state — brand mark stands in for the rail */
.app-content--auth { max-width: 460px; padding-top: 3.25rem; }
.app-content--auth .mt-16 { margin-top: .25rem; }
.app-content--auth .mt-10 { margin-top: .25rem; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: .55rem; margin-bottom: 1.6rem; }
.auth-brand .eyebrow { margin-left: .1rem; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; align-items: stretch; }
  .rail {
    width: auto; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; gap: .1rem;
    overflow-x: auto; padding: .55rem .75rem;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .rail-top { padding: .25rem .8rem .25rem .3rem; }
  .rail-nav { flex-direction: row; }
  .navlink { padding: .45rem .55rem; }
  .navlink-label { display: none; }
  .rail-group { display: none; }
  .theme-menu { position: fixed; top: 3.6rem; right: .75rem; left: auto; bottom: auto; width: 15rem; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: .15rem; padding-top: 0; border-top: 0; }
  .railchip { margin: 0 .35rem; }
  .rail-team-name { display: none; }
  .app-content { padding: 1.5rem 1.25rem 2.5rem; }
  .app-foot { padding: 1rem 1.25rem 1.75rem; }
}

/* ---- in-page tab bar (application detail, etc.) ---- */
.tabbar { display: flex; align-items: center; gap: .15rem; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
a.tab-btn { display: inline-block; }
.tab-btn { font-size: 13px; color: var(--ink-2); font-weight: 500; padding: .55rem .8rem; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.ls-results { max-height: 520px; overflow-y: auto; border-top: 1px solid var(--line); font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ls-row { display: grid; grid-template-columns: 12.5em 3.6em 6em 1fr; gap: 10px; padding: 1px 14px; }
.ls-row:hover { background: var(--surface-2); }
.ls-row .ls-t { color: var(--ink-3); white-space: nowrap; }
.ls-row .ls-p { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-row .ls-l { white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.ls-row.lv-warn .ls-v { color: var(--warn); } .ls-row.lv-error .ls-v, .ls-row.lv-fatal .ls-v { color: var(--down); font-weight: 600; }
.ls-row .ls-v { color: var(--ink-3); text-transform: uppercase; font-size: 10.5px; }
.ls-results mark { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 2px; }
.ls-empty { padding: 1.5rem; text-align: center; color: var(--ink-3); font-family: inherit; }
.canvas-page { display: flex; flex-direction: column; height: calc(100vh - 64px); gap: 12px; }
.canvas-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.canvas-viewport { position: relative; flex: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; cursor: grab;
  background-color: var(--surface-2); background-image: radial-gradient(circle, color-mix(in srgb, var(--ink-3) 35%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.canvas-viewport.is-panning { cursor: grabbing; }
.canvas-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.canvas-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.canvas-edges path { fill: none; stroke: color-mix(in srgb, var(--ink-3) 70%, transparent); stroke-width: 1.5; }
.canvas-edges path.environment { stroke-dasharray: 5 5; stroke: var(--accent); }
.canvas-edges path.route { stroke: color-mix(in srgb, var(--ok) 70%, transparent); }
.canvas-edges path.shared { stroke-dasharray: 2 4; }
.canvas-edges path.private { stroke: var(--link-private); stroke-dasharray: 6 4; stroke-width: 1.75; }
.canvas-edges path.public { stroke: var(--link-public); stroke-dasharray: 6 4; }
.canvas-edges path.linking { stroke: var(--accent); stroke-dasharray: 4 4; }
.canvas-edges text { font-size: 11px; fill: var(--ink-2); paint-order: stroke; stroke: var(--canvas); stroke-width: 4px; font-family: ui-monospace, monospace; }
.cn-port { position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--link-private); cursor: crosshair; }
.cn-port:hover { background: var(--link-private); }
.canvas-node.is-link-target { border-color: var(--link-private); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-private) 25%, transparent); }
.canvas-group { position: absolute; border: 1.5px dashed color-mix(in srgb, var(--ink-3) 45%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.canvas-group-head { position: absolute; top: -12px; left: 16px; display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.canvas-node { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px -8px rgba(0,0,0,.15);
  cursor: pointer; user-select: none; }
.canvas-node:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.canvas-node.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.canvas-node.app { width: 250px; padding: 12px 14px; }
.canvas-node.small { width: 220px; padding: 9px 12px; font-size: 12px; }
.canvas-node .cn-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.canvas-node .cn-sub { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-node .cn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.canvas-node .cn-stats b { display: block; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.canvas-node .cn-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; flex-shrink: 0; }
.cn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.cn-dot.pill-ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); } .cn-dot.pill-down { background: var(--down); box-shadow: 0 0 0 3px var(--down-wash); }
.cn-dot.pill-warn { background: var(--warn); } .cn-dot.pill-live { background: var(--live); animation: railyard-pulse 1.4s infinite; }
.canvas-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.25); padding: 16px; overflow-y: auto; cursor: default; }
.canvas-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.canvas-kinds .canvas-kind { padding: 6px 8px; } .canvas-kinds .canvas-kind b { font-size: 12px; }
.canvas-kind { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; cursor: pointer; background: var(--surface); }
.canvas-kind:hover, .canvas-kind.is-active { border-color: var(--accent); background: var(--accent-wash); }
.canvas-kind b { display: block; font-size: 13px; } .canvas-kind span { font-size: 11px; color: var(--ink-3); }
.canvas-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -16px 12px; padding: 0 12px; }
.canvas-tabs :is(button, a) { font-size: 12px; padding: 6px 8px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.canvas-tabs :is(button, a).is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.canvas-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 8px; }
.canvas-bar .canvas-pick { width: auto; min-width: 160px; }
.canvas-env-tabs { margin: 0; padding: 0; border-bottom: 0; }
.canvas-ask { display: flex; gap: 6px; align-items: center; }
.canvas-ask .input { width: 220px; }
.canvas-logs { max-height: 360px; overflow: auto; font: 11px/1.5 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.canvas-code { min-height: 260px; font-size: 12px; line-height: 1.5; white-space: pre; tab-size: 2; }
.range-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.range-btn { font-size: 12px; color: var(--ink-2); padding: .3rem .6rem; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.range-btn + .range-btn { border-left: 1px solid var(--line); }
.range-btn:hover { color: var(--ink); background: var(--surface-2); }
.range-btn.is-active { color: var(--accent); background: var(--live-wash); font-weight: 600; }
.range-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.range-btn.is-active .dot { animation: railyard-pulse 1.6s ease-in-out infinite; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1.25rem 1.5rem; padding: 1.15rem; }
.metric-chart { min-width: 0; }
.metric-chart .uplot { font-family: inherit; width: 100% !important; }
.metric-chart .u-legend { font-size: 11px; color: var(--ink-2); text-align: left; margin-top: .25rem; }
.metric-chart .u-legend .u-marker { width: .7em; height: .7em; border-radius: 2px; }
.metric-chart .u-legend th { font-weight: 500; }
.metric-chart .u-legend td { font-variant-numeric: tabular-nums; }
.metric-chart .u-select { background: var(--live-wash); }

/* ---- log consoles (deploy pipeline + live application logs) ---- */
#deploy-logs-scroll::-webkit-scrollbar,
.log-console-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
#deploy-logs-scroll::-webkit-scrollbar-thumb,
.log-console-scroll::-webkit-scrollbar-thumb { background: var(--l-mute); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
#deploy-logs-scroll::-webkit-scrollbar-track,
.log-console-scroll::-webkit-scrollbar-track { background: transparent; }

.log-src-section { color: var(--l-ink); font-weight: 600; font-size: 11px; margin: .6rem 0 .3rem; }
.log-src-section:first-child { margin-top: 0; }
.log-src-group { margin-bottom: .7rem; padding-left: .35rem; }
.log-src-head  { color: var(--l-dim); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; margin-bottom: .25rem; }
.log-src-item  { display: flex; align-items: center; gap: .4rem; color: var(--l-ink); padding: .12rem 0; cursor: pointer; }
.log-src-item:hover { color: var(--l-acc); }
.log-src-item input { accent-color: var(--accent); width: 12px; height: 12px; }

.log-ts   { color: var(--l-dim); }
.log-tag  { text-transform: uppercase; font-size: 10px; letter-spacing: .08em; white-space: pre; }
.log-line { color: var(--l-ink); white-space: pre-wrap; }
.log-stdout { color: var(--l-ink); }
.log-stderr { color: var(--l-err); }
.log-system { color: var(--l-warn); }
.log-tag.log-stdout { color: var(--l-dim); }

/* ---- overflow action menu (<details> disclosure, no JS) ---- */
.actions-menu { position: relative; display: inline-block; }
.actions-menu > summary { list-style: none; cursor: pointer; }
.actions-menu > summary::-webkit-details-marker { display: none; }
.actions-menu[open] > summary { background: var(--surface-2); }
.actions-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 200px; padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}
.actions-menu-pop form { display: block; }
.actions-menu-pop > a,
.actions-menu-pop button {
  width: 100%; text-align: left; justify-content: flex-start;
  font-size: 13px; padding: .48rem .6rem; border-radius: 6px;
  color: var(--ink); background: transparent; border: 0; cursor: pointer;
  display: block; line-height: 1.3;
}
.actions-menu-pop > a:hover,
.actions-menu-pop button:hover { background: var(--surface-2); }
.actions-menu-pop button.is-danger { color: var(--down); }
.actions-menu-pop button.is-danger:hover { background: var(--down-wash); }
.actions-menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }

.palette-trigger {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  padding: .5rem .6rem; margin-top: .6rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3);
  font-size: 12.5px; cursor: pointer; transition: border-color .12s, color .12s;
}
.palette-trigger:hover { border-color: var(--line-strong); color: var(--ink-2); }
.palette-trigger svg { width: 14px; height: 14px; flex: none; }
.palette-trigger-label { flex: 1; text-align: left; }
.palette-kbd {
  font-family: "IBM Plex Mono", monospace; font-size: 10.5px; padding: 1px 5px;
  border-radius: 4px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-3);
}
@media (max-width: 900px) { .palette-trigger { display: none; } }

.palette-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(23,26,33,.4);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem;
}
.palette-panel {
  width: 100%; max-width: 560px; max-height: 65vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line); overflow: hidden;
}
.palette-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: .9rem 1.1rem;
  font-size: 14px; color: var(--ink); background: transparent; font-family: "Inter", sans-serif;
}
.palette-input:focus { outline: none; }
.palette-input::placeholder { color: var(--ink-3); }
.palette-results { overflow-y: auto; padding: .4rem; }
.palette-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem .75rem; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink);
  text-decoration: none;
}
.palette-item.is-active { background: var(--accent-wash); color: var(--accent-hover); }
.palette-item-sub { font-size: 11px; color: var(--ink-3); flex: none; }
.palette-item.is-active .palette-item-sub { color: var(--accent); }
.palette-empty { padding: 2.5rem 1rem; text-align: center; font-size: 13px; color: var(--ink-3); }
.palette-hint {
  display: flex; align-items: center; gap: 1rem; padding: .5rem 1.1rem;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3);
}
.palette-hint kbd {
  font-family: "IBM Plex Mono", monospace; font-size: 10px; padding: 1px 5px;
  border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-strong);
}
.xcon { background: var(--l-bg); border: 1px solid var(--l-line); border-radius: 10px; overflow: hidden; }
.xcon-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; border-bottom: 1px solid var(--l-line); font-size: 11px; color: var(--l-dim); }
.xcon-btn:hover { color: var(--l-ink); }
.dlog { position: relative; background: var(--l-bg); border: 1px solid var(--l-line); border-radius: 10px; overflow: hidden; color: var(--l-ink); }
.dlog.is-full { position: fixed; inset: 0; z-index: 60; border-radius: 0; border: 0; display: flex; flex-direction: column; }
body.dlog-lock { overflow: hidden; }
.dlog-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px;
            background: var(--l-bar); border-bottom: 1px solid var(--l-line); font: 12px/1 'IBM Plex Mono', ui-monospace, monospace; }
.dlog-bar-left, .dlog-bar-right { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dlog-live { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; color: var(--l-acc);
             background: rgba(122,167,255,.1); text-transform: capitalize; }
.dlog-live[hidden] { display: none; }
.dlog-live.is-ok { color: var(--l-ok); background: color-mix(in srgb, var(--l-ok) 10%, transparent); }
.dlog-live.is-failed { color: var(--l-err); background: var(--l-err-bg); }
.dlog-live.is-done { color: var(--l-dim); background: var(--l-line); }
.dlog-live:not(.is-live) .dlog-dot { display: none; }
.dlog-body { display: flex; min-height: 0; }
.dlog.is-full .dlog-body { flex: 1; }
.dlog-body > .dlog-scroll { flex: 1; min-width: 0; }
.dlog-sources { width: 11rem; flex-shrink: 0; border-right: 1px solid var(--l-line); padding: 10px; overflow-y: auto; max-height: 70vh;
                font: 11px/1.5 'IBM Plex Mono', ui-monospace, monospace; color: var(--l-dim); }
.dlog-sources:empty { display: none; }
.dlog-sources .log-src-head { color: var(--l-ink); margin-top: 6px; }
.dlog-sources .log-src-item { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.dlog-tag { display: inline-block; min-width: 7ch; margin-right: 10px; color: var(--l-acc); opacity: .8; }
.dlog-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.dlog-scroll::-webkit-scrollbar-thumb { background: var(--l-mute); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
.dlog-scroll::-webkit-scrollbar-track { background: transparent; }
.dlog-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dlog-pulse 1.4s ease-in-out infinite; }
@keyframes dlog-pulse { 50% { opacity: .3; } }
.dlog-chip, .dlog-btn { padding: 5px 9px; border-radius: 6px; color: var(--l-dim); background: transparent; border: 1px solid var(--l-line);
                        font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.dlog-chip:hover, .dlog-btn:hover { color: var(--l-ink); border-color: var(--l-mute); }
.dlog-chip.is-on, .dlog-btn.is-on { color: var(--l-ink); background: var(--l-line); }
.dlog-chip.is-error span { color: var(--l-err); }
.dlog-chip.is-warn span { color: var(--l-warn); }
.dlog-btn[hidden] { display: none; }
.dlog-jump-error { color: var(--l-err); border-color: rgba(255,123,130,.4); }
.dlog-search { display: flex; align-items: center; gap: 6px; background: var(--l-bg); border: 1px solid var(--l-line); border-radius: 6px; padding: 0 8px; }
.dlog-search:focus-within { border-color: var(--l-acc); }
.dlog-search input { background: transparent; border: 0; outline: 0; color: var(--l-ink); font: inherit; padding: 5px 0; width: 11rem; }
.dlog-matches { color: var(--l-dim); min-width: 2.5rem; text-align: right; }
.dlog-scroll { max-height: 70vh; min-height: 12rem; overflow: auto; padding: 6px 0; outline: 0; overscroll-behavior: contain;
               font: 12.5px/1.6 'IBM Plex Mono', ui-monospace, monospace; }
.dlog.is-full .dlog-scroll, .dlog.is-full .dlog-sources { max-height: none; }
.dlog-empty { padding: 3rem 1rem; text-align: center; color: var(--l-dim); }
.dlog-empty[hidden] { display: none; }
.dlog-lines { min-width: max-content; }
.dlog.is-wrap .dlog-lines { min-width: 0; }
.dlog-line { display: grid; grid-template-columns: 4.2em 5.2em 1fr auto; column-gap: 12px; padding: 0 14px 0 0;
             content-visibility: auto; contain-intrinsic-size: auto 20px; }
.dlog-line[hidden] { display: none; }
.dlog-line:hover { background: rgba(255,255,255,.03); }
.dlog-n { color: var(--l-mute); text-align: right; user-select: none; text-decoration: none; }
.dlog-n:hover { color: var(--l-ink); }
.dlog-t { color: var(--l-mute); user-select: none; font-variant-numeric: tabular-nums; }
.dlog-x { white-space: pre; }
.dlog.is-wrap .dlog-x { white-space: pre-wrap; overflow-wrap: anywhere; }
.dlog-line.is-step .dlog-x { color: var(--l-dim); }
.dlog-line.is-error { background: var(--l-err-bg); box-shadow: inset 2px 0 var(--l-err); }
.dlog-line.is-error .dlog-x { color: var(--l-err); }
.dlog-line.is-warn .dlog-x { color: var(--l-warn); }
.dlog-line.is-phase { margin-top: 6px; padding-top: 3px; padding-bottom: 3px; background: rgba(122,167,255,.07); box-shadow: inset 2px 0 var(--l-acc); }
.dlog-line.is-phase .dlog-x { color: var(--l-ink); font-weight: 600; }
.dlog-dur { color: var(--l-dim); font-variant-numeric: tabular-nums; }
.dlog-line.is-match { background: var(--l-hit); }
.dlog-line.is-current, .dlog-line.is-target { background: rgba(122,167,255,.28); }
.dlog-pill { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px;
             background: var(--l-acc); color: var(--l-bg); font: 600 12px/1 'Hanken Grotesk', sans-serif; border: 0; cursor: pointer;
             box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.dlog-pill[hidden] { display: none; }
.ansi-k { color: var(--ansi-k); } .ansi-r { color: var(--ansi-r); } .ansi-g { color: var(--ansi-g); } .ansi-y { color: var(--ansi-y); }
.ansi-bl { color: var(--ansi-b); } .ansi-m { color: var(--ansi-m); } .ansi-c { color: var(--ansi-c); } .ansi-w { color: var(--ansi-w); }
.ansi-bold { font-weight: 700; }
.dlog-static { border-radius: 8px; }
.dlog-static .dlog-scroll { max-height: 40vh; min-height: 0; padding: 4px 0; font-size: 12px; }
.dlog-static .dlog-line { grid-template-columns: 3.2em 1fr; }
@media (max-width: 640px) { .dlog-line { grid-template-columns: 3em 1fr; } .dlog-t, .dlog-dur, .dlog-sources { display: none; } .dlog-search input { width: 7rem; } }
.manifest-code { margin: 0; padding: 14px 18px; max-height: 62vh; overflow: auto; font: 12.5px/1.65 'IBM Plex Mono', ui-monospace, monospace;
                 color: var(--ink); background: var(--surface-2, transparent); tab-size: 2; }
.manifest-code[hidden], .manifest-form[hidden] { display: none; }
.y-k { color: var(--accent); } .y-s { color: var(--ok); } .y-n, .y-b { color: var(--warn); } .y-c { color: var(--ink-3); font-style: italic; }
.y-secret { color: var(--ink-3); background: var(--line); border-radius: 4px; padding: 0 4px; }
.manifest-form { padding: 12px; }
.manifest-input { width: 100%; min-height: 18rem; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
                  background: var(--surface); color: var(--ink); font: 12.5px/1.65 'IBM Plex Mono', ui-monospace, monospace; tab-size: 2; }
.manifest-input:focus { outline: 0; border-color: var(--accent); }
.manifest-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.mplan { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mplan-head { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--line); }
.mplan-row { display: grid; grid-template-columns: minmax(10rem, max-content) 1fr auto 1fr; gap: 10px; align-items: baseline;
             padding: 7px 12px; border-top: 1px solid var(--line); font: 12px/1.5 'IBM Plex Mono', ui-monospace, monospace; }
.mplan-path { color: var(--ink); }
.mplan-from { color: var(--ink-3); text-decoration: line-through; overflow-wrap: anywhere; }
.mplan-arrow { color: var(--ink-3); }
.mplan-to { color: var(--ok); overflow-wrap: anywhere; }
.mplan-to.is-removed { color: var(--down); }
@media (max-width: 640px) { .mplan-row { grid-template-columns: 1fr; } .mplan-arrow { display: none; } }
.dlog-preset { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
               font: 11.5px/1.4 'IBM Plex Mono', ui-monospace, monospace; cursor: pointer; }
.dlog-preset:hover { color: var(--ink); border-color: var(--accent); }
.dlog-compact .dlog-scroll { max-height: 40vh; min-height: 6rem; }
.dlog-compact .dlog-chip, .dlog-compact .dlog-search { display: none; }
.activity-list > li + li { border-top: 1px solid var(--line); }
.activity-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; font-size: 13px; }
.activity-row[hidden], .activity-day[hidden] { display: none; }
.dlog-preset.is-on { color: var(--ink); border-color: var(--accent); background: var(--accent-wash, transparent); }
.trigger-chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; line-height: 1.6; white-space: nowrap;
                color: var(--ink-2); background: var(--line); }
.trigger-push { color: var(--ok); background: var(--ok-wash); }
.trigger-rollback { color: var(--warn); background: var(--warn-wash); }
.trigger-api, .trigger-manifest { color: var(--accent); background: var(--accent-wash, rgba(47,111,235,.12)); }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-radius: 10px;
           border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-wash); }
.env-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.env-summary::-webkit-details-marker { display: none; }
.backup-policy { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.backup-policy .backup-toggle { max-width: 17rem; }
.backup-policy > div { white-space: nowrap; }
.backup-toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink); cursor: pointer; }
.backup-toggle input { margin-top: 3px; }
.backup-toggle small { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 400; }
.backup-toggle b { font-weight: 500; }
.replica-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-2); }
.replica-row .dot { width: 7px; height: 7px; border-radius: 50%; }
.dns-record { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 3px 8px; border-radius: 6px;
              background: var(--surface-2); font-size: 11.5px; }
.dns-type { font-weight: 600; color: var(--accent); font-size: 10.5px; letter-spacing: .04em; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 14px 24px; padding: 1rem 1.15rem 1.2rem; }
.danger-zone { border-color: rgba(220,38,38,.35); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 1.15rem; font-size: 13px; }
.danger-row b { font-weight: 600; color: var(--ink); }
.danger-row p { margin: 2px 0 0; color: var(--ink-3); font-size: 12px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 16px; padding: 1rem 1.15rem .5rem; }
.health-ticks { display: flex; gap: 2px; padding: 0 1.15rem 1rem; }
.health-ticks span { flex: 1; height: 18px; border-radius: 2px; background: var(--ok); opacity: .85; }
.health-ticks span.is-down { background: var(--down); }
.env-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 12px; margin-top: 8px; }
.cost-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 1.15rem; }
.bill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 16px; padding: 1rem 1.15rem .75rem; }
.bill-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 20px; padding: .5rem 1.15rem 1.1rem; }
.bill-bar { position: relative; display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 0; }
.bill-bar i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); opacity: .55; border-radius: 2px; }
.cost-group + .cost-group { border-top: 1px solid var(--line); }
.cost-group-head { display: flex; justify-content: space-between; padding: 10px 1.15rem 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.cost-group .cost-row + .cost-row { border-top: 1px dashed var(--line); }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.page-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; min-width: 0; }
.page-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.subtabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: -.5rem; }
.subtab { font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: .35rem .7rem; border-radius: 999px; border: 1px solid transparent; }
.subtab:hover { color: var(--ink); background: var(--surface-2); }
.subtab.is-active { color: var(--accent-hover); background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 600; }
.canvas-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding-top: 4px; }
.canvas-spark { width: 100%; height: 40px; color: var(--accent); margin-top: 4px; }
.canvas-live-logs .dlog-body { max-height: 420px; }
.canvas-live-logs .dlog-bar-right { display: none; }
.canvas-node.is-picked { outline: 2px dashed var(--accent); outline-offset: 2px; }
.canvas-palette { position: absolute; inset: 0; background: color-mix(in srgb, var(--canvas) 55%, transparent); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 30; }
.canvas-palette-box { width: min(520px, 92%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .18); padding: 10px; }
.canvas-palette-list { margin-top: 6px; max-height: 50vh; overflow-y: auto; }
.canvas-palette-item { display: flex; width: 100%; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; text-align: left; }
.canvas-palette-item.is-active, .canvas-palette-item:hover { background: var(--accent-wash); color: var(--accent); }
.canvas-palette-hint { font-size: 11px; color: var(--ink-3); }
.canvas-diff { font-size: 11px; margin: 2px 0 4px; border-radius: 6px; overflow: hidden; }
.canvas-diff > div { padding: 1px 6px; white-space: pre-wrap; word-break: break-all; }
.canvas-diff .is-del { background: color-mix(in srgb, var(--down) 12%, transparent); color: var(--down); }
.canvas-diff .is-add { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.canvas-menu { position: absolute; z-index: 25; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .2); padding: 4px; display: flex; flex-direction: column; }
.canvas-menu button { text-align: left; font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.canvas-menu button:hover { background: var(--accent-wash); color: var(--accent); }
.canvas-menu button.is-danger { color: var(--down); }
.canvas-cgroup { position: absolute; border: 1.5px solid var(--cg, var(--accent)); border-radius: 14px; background: color-mix(in srgb, var(--cg, var(--accent)) 5%, transparent); pointer-events: none; }
.canvas-cgroup-head { position: absolute; top: 6px; left: 12px; display: flex; gap: 10px; align-items: center; font-size: 12px; pointer-events: auto; }
.canvas-cgroup-name { font-weight: 600; color: var(--cg, var(--accent)); }
[data-color="violet"] { --cg: var(--accent); } [data-color="blue"] { --cg: var(--live); } [data-color="green"] { --cg: var(--ok); }
[data-color="amber"] { --cg: var(--warn); } [data-color="red"] { --cg: var(--down); } [data-color="slate"] { --cg: var(--ink-3); }
.canvas-node[data-color]:not([data-color=""]) { border-color: var(--cg); }
.canvas-minimap { position: absolute; left: 12px; bottom: 12px; width: 172px; height: 112px; padding: 6px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 10px; z-index: 4; cursor: pointer; backdrop-filter: blur(6px); overflow: hidden; }
.canvas-minimap:empty { display: none; }
.canvas-minimap > div { position: absolute; margin: 6px; }
.canvas-minimap-node { background: var(--ink-3); opacity: .5; border-radius: 2px; }
.canvas-minimap-view { border: 1.5px solid var(--accent); border-radius: 3px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.canvas-avatars { display: inline-flex; margin-right: 6px; }
.canvas-avatar { width: 26px; height: 26px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--on-accent); background: var(--accent); border: 2px solid var(--surface); margin-left: -6px; }
.canvas-viewer { position: absolute; top: -9px; right: 10px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; color: var(--on-accent); background: var(--accent); }
