/* Kasm Hub component kit (docs/ui-design.md section 4). Tokens come from app.css; the markup is the kit partials
   (templates/_kit_*.html); behaviour is kit.js. Class names are the kit's API. */

/* ---- fields (4.7): label on top, control, one-line hint; error replaces the hint ---- */
.kit .fields, .fields.kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--sp-4) var(--sp-5); }
.kfield { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; margin: 0 0 var(--sp-4); }
.kfield.wide { grid-column: 1 / -1; }
.klabel { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 500; color: var(--fg); }
.klabel .opt { color: var(--fg-muted); font-weight: 400; }
.klabel .opt.auto { font-size: .75em; padding: 0 .4em; margin-left: .3em; border: 1px solid currentColor; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.kfield .hint, .kfield .err { margin: 0; font-size: var(--fs-sm); color: var(--fg-muted); max-width: 72ch; }
.kfield .err { color: var(--bad); }
.kfield input[type=text], .kfield input[type=email], .kfield input[type=search], .kfield select, .kfield textarea { width: 100%; max-width: 32rem; }
.kfield [aria-invalid=true] { border-color: var(--bad); }
.kfield.big input[type=text] { font-size: var(--fs-md); max-width: 24rem; }
.krow { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; }
.krow > .kfield { margin: 0; }

/* ---- name plate (2) ---- */
.plate { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2) var(--sp-4); padding: var(--sp-4) var(--sp-5); margin: 0 0 var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--kasm-blue); border-radius: var(--r-lg); }
.plate-name { margin: 0; font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.plate-name.empty { color: var(--fg-faint); font-weight: 400; }
.plate-addr { margin: 0; color: var(--fg-muted); font-family: var(--mono); font-size: var(--fs-sm); }
.plate-addr:empty { display: none; }
.plate-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; margin: 0 0 0 auto; padding: 0; }

/* ---- static chip (4.4): one option, no control ---- */
.chip.static { display: inline-flex; align-items: center; min-height: var(--control-h-sm); max-width: 100%; padding: 2px var(--sp-3); border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg); font-size: var(--fs-sm); font-weight: 500; line-height: 1.3; overflow-wrap: break-word; }
.kchip-row { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h); }

/* ---- stepper (4.2) ---- */
ol.steps { display: flex; list-style: none; margin: 0 0 var(--sp-5); padding: 0; gap: 0; }
ol.steps .step { flex: 1 1 0; min-width: 0; position: relative; }
ol.steps .step + .step::before { content: ""; position: absolute; top: 12px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 1px; background: var(--line-strong); }
ol.steps .step-btn { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); width: 100%; min-height: 0; padding: 0 var(--sp-1);
  background: none; border: 0; color: var(--fg-muted); font: inherit; font-size: var(--fs-sm); text-align: center; }
ol.steps button.step-btn { cursor: pointer; }
ol.steps button.step-btn:hover:not(:disabled) { background: none; }
ol.steps button.step-btn:hover .step-title { text-decoration: underline; }
ol.steps .step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: var(--fs-xs); font-weight: 600; color: var(--fg-muted); }
ol.steps .step-text { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
ol.steps .step-title { overflow-wrap: break-word; line-height: 1.3; }
ol.steps .step-answer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* the answer (a name, a region) is data: cut, with its title */
ol.steps .step-answer { font-size: var(--fs-xs); color: var(--fg-muted); }
ol.steps .done .step-num { background: var(--ok-wash); border-color: var(--ok); color: var(--ok); }
ol.steps .done .step-title, ol.steps .reachable .step-title { color: var(--fg); }
ol.steps .current .step-num { background: var(--accent); border-color: var(--accent); color: var(--fg-on-accent); }
ol.steps .current .step-title { color: var(--fg); font-weight: 600; }
ol.steps .later .step-num { border-style: dashed; } /* not faded: a faded muted title fails contrast (axe) */
.steps-compact { display: none; margin: 0 0 var(--sp-4); }
.steps-compact summary { cursor: pointer; font-weight: 500; min-height: var(--control-h); display: flex; align-items: center; }
.steps-compact ol { margin: 0; padding-left: var(--sp-5); color: var(--fg-muted); }
@media (max-width: 720px) { ol.steps { display: none; } .steps-compact { display: block; } }

/* ---- choice tiles (4.3): the whole tile is the label; the input is visually hidden, not removed ---- */
.tiles { --tile-min: 15rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min), 100%), 1fr)); align-items: stretch; gap: var(--sp-3); }
.tiles.tiles-wide { --tile-min: 20rem; } .tiles.tiles-narrow { --tile-min: 13rem; }
.tiles > label.tile { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "head price info" "sub sub sub" "why why why";
  align-content: start; align-items: center; gap: var(--sp-1) var(--sp-2); position: relative; padding: var(--sp-3) var(--sp-4); min-height: 3.5rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-base); font-weight: 400; cursor: pointer;
  transition: border-color var(--t-select), background-color var(--t-select); }
.tiles > label.tile:hover { border-color: var(--accent); }
.tile-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-width: 0; }
.tile-title { font-weight: 500; line-height: 1.35; overflow-wrap: break-word; min-width: 0; }
.tile-price { grid-area: price; align-self: start; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-sub { grid-area: sub; color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.4; }
.tile-why { grid-area: why; color: var(--fg-muted); font-size: var(--fs-sm); }
.tile > .info { grid-area: info; align-self: start; margin-top: 2px; }
.tile .badge { flex: none; }
.tiles > label.tile:has(input:checked) { border: 2px solid var(--accent); padding: calc(var(--sp-3) - 1px) calc(var(--sp-4) - 1px); background: var(--accent-wash); }
.tiles > label.tile:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tiles > label.tile:has(input:disabled) { background: var(--off-wash); color: var(--fg-muted); cursor: not-allowed; border-color: var(--line); }
.tiles > label.tile:has(input:disabled) .tile-title { color: var(--fg-muted); }
.tiles > label.tile:has(input[type=checkbox]) { padding-left: calc(var(--sp-4) + 22px); }
.tiles > label.tile:has(input[type=checkbox])::before { content: ""; position: absolute; left: var(--sp-3); top: calc(var(--sp-3) + 3px); width: 16px; height: 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.tiles > label.tile:has(input[type=checkbox]:checked)::before { content: "✓"; display: grid; place-items: center; color: var(--fg-on-accent); font-size: 12px;
  background: var(--accent); border-color: var(--accent); left: calc(var(--sp-3) - 1px); top: calc(var(--sp-3) + 2px); }

/* ---- segmented control (4.4): 2 to 4 short options, width from content, never stretched; on a narrow screen the
options wrap onto another row (and a long label onto another line) rather than being cut ---- */
.seg { display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 2px; padding: 2px; min-height: var(--control-h); border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--line-strong); max-width: 100%; }
.seg > label { flex-direction: row; align-items: center; justify-content: center; position: relative; min-height: calc(var(--control-h) - 6px); padding: 2px var(--sp-3);
  border-radius: calc(var(--r-md) - 2px); font-size: var(--fs-sm); font-weight: 400; line-height: 1.3; text-align: center; color: var(--fg-muted); cursor: pointer; }
.seg > label:hover { color: var(--fg); }
.seg > label:has(input:checked) { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 0 0 1px var(--line-strong); }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg > label:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* ---- picker (4.5) ---- */
.picker { position: relative; display: flex; flex-direction: column; gap: var(--sp-1); min-width: min(20rem, 100%); max-width: 32rem; }
.picker select { width: 100%; text-overflow: ellipsis; }
.picker.searchable select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); width: 100%; min-height: var(--control-h); padding: 4px var(--sp-3);
  background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-weight: 400; text-align: left; }
.picker-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--fg-faint); }
.picker-btn span { min-width: 0; overflow-wrap: break-word; line-height: 1.3; }
.picker-btn::after { content: "▾"; color: var(--fg-muted); }
.picker-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; padding: var(--sp-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-float); }
.picker-pop[hidden] { display: none; }
.picker-pop input[type=search] { width: 100%; }
.picker-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; max-height: 16rem; overflow: auto; }
.picker-list .grp { padding: var(--sp-2) var(--sp-2) var(--sp-1); font-size: var(--fs-xs); color: var(--fg-muted); font-weight: 500; }
.picker-list [role=option] { padding: var(--sp-2); border-radius: var(--r-sm); cursor: pointer; overflow-wrap: break-word; line-height: 1.35; }
.picker-list [role=option].active { background: var(--accent-wash); }
.picker-list [role=option][aria-selected=true] { font-weight: 600; }
.picker-list [role=option][aria-disabled=true] { color: var(--fg-faint); cursor: not-allowed; }
.picker-list .none { padding: var(--sp-2); color: var(--fg-muted); }
.picker-err { margin: 0; color: var(--fg-muted); font-size: var(--fs-sm); }
.type-own { margin: .25rem 0 0; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.type-own input { flex: 1 1 14rem; min-width: 0; }

/* ---- info popover (4.6) ---- */
button.info { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg-muted); font: italic 600 12px/1 Georgia, serif; cursor: help; position: relative; }
button.info::after { content: ""; position: absolute; inset: -8px; } /* a 36px hit target */
button.info:hover:not(:disabled) { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.pop { position: fixed; inset: auto; margin: 0; max-width: min(22rem, calc(100vw - 16px)); padding: var(--sp-3) var(--sp-4); background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-float); font-size: var(--fs-sm); font-weight: 400; line-height: 1.5; text-align: left;
  opacity: 1; transition: opacity var(--t-fade); }
.pop p { margin: 0 0 var(--sp-2); } .pop p:last-child { margin: 0; }
.pop .pop-more { color: var(--fg-muted); font-size: var(--fs-xs); }
.pop ul { margin: 0 0 var(--sp-2); padding-left: var(--sp-4); }
.pop code { font-family: var(--mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.no-popover .pop { display: none; position: static; margin-top: var(--sp-2); }
.no-popover .pop.open { display: block; }

/* ---- autofill row (4.7) ---- */
.autofill-row { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h); }
.autofill-value { font-weight: 500; overflow-wrap: anywhere; }
.autofill-value:empty::before { content: "Filled in once you choose"; color: var(--fg-faint); font-weight: 400; }
.autofill.editing .autofill-row { display: none; }

/* ---- key/value chip editor (4.8) ---- */
.kv-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; }
.kv-chips:empty { display: none; }
.kv-chip { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--control-h-sm); padding: 0 var(--sp-1) 0 var(--sp-3); border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-sm); font-family: var(--mono); }
.kv-chip.locked { padding-right: var(--sp-3); background: var(--off-wash); }
.kv-chip.locked::before { content: "🔒︎"; font-size: 10px; filter: grayscale(1); }
.kv-chip.bad { border-color: var(--bad); background: var(--bad-wash); }
button.kv-x { min-height: 0; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--fg-muted); font-size: 16px; line-height: 1; }
button.kv-x:hover:not(:disabled) { background: var(--line); color: var(--fg); border: 0; }
.kv-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.kv .kv-add input[type=text] { width: 9rem; }

/* ---- CIDR choice (4.9) ---- */
.cidr-custom { display: none; margin-top: var(--sp-2); }
.cidr:has(input[value=custom]:checked) .cidr-custom { display: flex; }
.cidr-custom textarea { width: 100%; max-width: 24rem; font-size: var(--fs-sm); }

/* ---- summary list (4.10) ---- */
dl.summary { display: grid; grid-template-columns: max-content 1fr auto; margin: 0 0 var(--sp-4); border-top: 1px solid var(--line); }
dl.summary > div { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; column-gap: var(--sp-5); min-height: 44px;
  border-bottom: 1px solid var(--line); }
dl.summary dt { color: var(--fg-muted); }
dl.summary dd { margin: 0; font-weight: 500; display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* ---- level pills (4.11): wash + text + glyph ---- */
.badge .g { font-size: .95em; line-height: 1; }

/* ---- alerts and toasts (4.12) ---- */
.alert { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-4); border-left: 3px solid var(--info);
  background: var(--info-wash); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.alert.ok { border-color: var(--ok); background: var(--ok-wash); } .alert.warn { border-color: var(--warn); background: var(--warn-wash); }
.alert.bad { border-color: var(--bad); background: var(--bad-wash); }
.alert-title { margin: 0; font-weight: 500; }
.alert ul { margin: 0; padding-left: var(--sp-5); }
.alert li { display: list-item; } .alert li button { margin-left: var(--sp-2); }
.toasts { position: fixed; top: calc(52px + var(--sp-3)); right: var(--sp-4); z-index: 50; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast { padding: var(--sp-3) var(--sp-4); background: var(--kasm-ink); color: #fff; border-radius: var(--r-md); box-shadow: var(--sh-float); font-weight: 500;
  transition: opacity var(--t-fade); }
.toast.bad { background: var(--bad); } .toast.gone { opacity: 0; }

/* ---- buttons (4.13): primary is plain <button>; secondary/danger in app.css ---- */
button.ghost { background: none; border-color: transparent; color: var(--accent); }
button.ghost:hover:not(:disabled) { background: var(--accent-wash); border-color: transparent; }
button.sm { min-height: var(--control-h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); }
.why { color: var(--fg-muted); font-size: var(--fs-sm); }
.why[hidden] { display: none; }

/* ---- acknowledgement and sticky step footer (4.14, 5.7) ---- */
.ack { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); margin: var(--sp-4) 0 0; background: var(--warn-wash); border-radius: var(--r-md); }
.ack > label { flex-direction: row; align-items: center; gap: var(--sp-2); min-height: var(--control-h); font-weight: 500; }
.ack input[type=checkbox] { width: 18px; height: 18px; }
.wiz-nav.kit-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) calc(-1 * var(--sp-5)) 0;
  padding: var(--sp-3) var(--sp-5); background: var(--surface); box-shadow: var(--sh-sticky); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.kit-nav .gap { flex: 1; }
/* with JavaScript a change re-renders the step by itself (kit.js refreshStep): the no-JS Refresh button is noise */
.js form[data-refreshable] .kit-nav button[value=refresh] { display: none; }

/* ---- live filters (5.1) ---- */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); }
.fbar fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin: 0; padding: 0; border: 0; }
.fbar legend { float: left; margin-right: var(--sp-2); font-size: var(--fs-sm); color: var(--fg-muted); }
.fbar label.ftoggle { position: relative; flex-direction: row; align-items: center; min-height: var(--control-h-sm); padding: 0 var(--sp-3); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-sm); font-weight: 400; cursor: pointer; }
.fbar label.ftoggle:has(input:checked) { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-hover); font-weight: 500; }
.fbar label.ftoggle:has(input:checked)::before { content: "✓"; margin-right: var(--sp-1); }
.fbar label.ftoggle:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.fcount { color: var(--fg-muted); font-size: var(--fs-sm); }
[data-filtered-out] { display: none !important; }

/* ---- lightbox (5.1): the diagram Expand dialog's frame, for drawings served as images ---- */
.kd-dialog.lightbox .kdx-view img { display: block; margin: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
.preview-btn { display: block; width: 100%; aspect-ratio: 16 / 10; min-height: 0; padding: var(--sp-2); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); cursor: zoom-in; }
.preview-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--accent); }
.preview-btn img { width: 100%; height: 100%; object-fit: contain; }

/* ---- the kit sample page ---- */
.kit-sec { margin: 0 0 var(--sp-6); }
.kit-sec > h2 { padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line); }
.kit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr)); gap: var(--sp-3); }
.kit-swatches { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; }
.kit-swatches li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1); border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-family: var(--mono); background: var(--surface); }
.kit-swatches i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); }
.sw-blue { background: var(--kasm-blue); } .sw-navy { background: var(--kasm-navy); } .sw-ink { background: var(--kasm-ink); } .sw-slate { background: var(--kasm-slate); }
.sw-accent { background: var(--accent); } .sw-ok { background: var(--ok); } .sw-warn { background: var(--warn); } .sw-bad { background: var(--bad); } .sw-info { background: var(--info); }
.kit-type p { margin: 0 0 var(--sp-2); }
.fs-xs { font-size: var(--fs-xs); } .fs-sm { font-size: var(--fs-sm); } .fs-md { font-size: var(--fs-md); } .fs-lg { font-size: var(--fs-lg); } .fs-xl { font-size: var(--fs-xl); }
.kit-form { display: block; margin: 0; }
.pop:popover-open:not(.placed) { visibility: hidden; }

/* ---- the New platform wizard (docs/ui-design.md 5): page frame, step panel, architecture cards ---- */
.wizk { max-width: 1120px; }
.wizk-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); margin: 0 0 var(--sp-3); }
.wizk-form { display: block; margin: 0; }
.wizk-form[aria-busy=true] .wizk-panel { opacity: .7; transition: opacity var(--t-fade); }
.wizk-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-5) 0; margin: 0 0 var(--sp-3); }
.wizk-title { display: flex; align-items: center; gap: var(--sp-3); }
.wizk-title h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; }
.wizk-lowered { display: inline-flex; align-items: center; gap: var(--sp-2); }
.wizk-note { margin: var(--sp-1) 0 var(--sp-5); color: var(--fg-muted); max-width: 72ch; }
.wizk-sub { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-md); font-weight: 600; }
.wizk-name .kfield.big { margin-bottom: var(--sp-3); }
.wizk-row { gap: var(--sp-4) var(--sp-5); }
.wizk-row > .kfield { flex: 0 1 auto; min-width: 0; }
.wizk-row .picker { min-width: 12rem; }
.wizk-quota { margin: 0 0 var(--sp-3); color: var(--fg-muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--sp-2); }
.wizk-about { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); color: var(--fg-muted); font-size: var(--fs-sm); margin: 0 0 var(--sp-5); }
.wizk-more { margin: var(--sp-4) 0; border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.wizk-more > summary { cursor: pointer; font-weight: 500; color: var(--accent); min-height: var(--control-h); display: flex; align-items: center; }
.wizk-more[open] > summary { margin-bottom: var(--sp-3); }
.wizk-export { margin: var(--sp-4) 0; border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.wizk-export-title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.wizk-export-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-2) var(--sp-4); }
.wizk-export-row .kfield { margin: 0; }
.wizk-export [data-export-result] { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--fg-muted); overflow-wrap: anywhere; }
.wizk-export [data-export-result].bad { color: var(--bad); }
.wizk-cost { display: flex; align-items: center; gap: var(--sp-2); font-weight: 500; margin: 0 0 var(--sp-3); }
.wizk-facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin: 0 0 var(--sp-4); }
.wizk-fact > summary { cursor: pointer; color: var(--accent); }
.wizk-fact ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-sm); max-width: 72ch; }
.wizk-diagram { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); margin: 0 0 var(--sp-4); }
.wizk-diagram .kd-tabs { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.wizk-diagram .kd-expand { margin-left: auto; }
.wizk-doc pre { max-height: 24rem; overflow: auto; padding: var(--sp-3); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); font: var(--fs-xs)/1.5 var(--mono); }
.wizk-doc p { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-2); }
.wizk-panel .wiz-nav.kit-nav { margin-top: var(--sp-5); }
.wizk-panel .ack { margin-top: var(--sp-5); }

/* architecture cards: equal height in a row; the preview and More sit outside the radio's label */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: var(--sp-3); align-items: stretch; }
.acard { position: relative; display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); transition: border-color var(--t-select), background-color var(--t-select); }
.acard:hover { border-color: var(--accent); }
.acard:has(input:checked) { border: 2px solid var(--accent); padding: calc(var(--sp-3) - 1px); background: var(--accent-wash); }
.acard:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.acard.off { background: var(--off-wash); color: var(--fg-muted); }
.acard.off:hover { border-color: var(--line-strong); }
.acard .preview-btn { aspect-ratio: 16 / 10; background: var(--surface); }
.acard .preview-btn.none { border-style: dashed; }
.acard-pick { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-2); cursor: pointer; font-weight: 400; min-height: 0; }
.acard.off .acard-pick { cursor: not-allowed; }
.acard-title { font-weight: 500; overflow-wrap: break-word; }
.acard-title b { font-weight: 600; margin-right: var(--sp-1); }
.acard-sum { color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.4; min-height: 2.8em; }
.acard-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.acard-chips .chip.static { min-height: 24px; font-size: var(--fs-xs); font-weight: 400; }
.acard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.acard-pills { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.acard-price { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acard-more { position: absolute; top: calc(var(--sp-3) + 6px); right: calc(var(--sp-3) + 6px); }

/* the network range and the existing database: their inputs show while the matching tile is chosen */
.netc .netc-custom, .dbc .dbc-existing { display: none; margin-top: var(--sp-3); }
.netc-custom { flex-direction: column; gap: var(--sp-1); max-width: 20rem; }
.netc:has(input[name=cidr-mode][value=custom]:checked) .netc-custom { display: flex; }
.dbc:has(input[name=database][value=existing]:checked) .dbc-existing { display: grid; }

/* ======== hub-wide pass (docs/ui-design.md 6): the kit's look on the pages that are not the wizard ======== */

/* tabs: an underlined row, the current one in the accent */
nav.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0 0 var(--sp-4); border-bottom: 1px solid var(--line); }
nav.tabs a { padding: var(--sp-2) var(--sp-1); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--fg-muted); text-decoration: none; font-weight: 500; }
nav.tabs a:hover { color: var(--fg); }
nav.tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* page title row: the primary action sits on the title's baseline at control size, not at heading size */
h1 > a.button { font-size: var(--fs-base); margin-left: var(--sp-3); vertical-align: middle; }
h1 .badge { font-size: var(--fs-xs); }
h2 > button.info { margin-left: var(--sp-2); vertical-align: middle; }

/* tables and the panels that follow them */
table.list { margin: 0 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); }
.card table.list { border: 0; border-radius: 0; margin-bottom: var(--sp-3); }
table.list th { font-size: var(--fs-sm); white-space: nowrap; background: var(--surface); }
table.list td small { color: var(--fg-muted); }
/* long values (URLs, endpoints) wrap instead of pushing the table past a narrow window */
table.list td a[href^="http"], table.list td code { overflow-wrap: anywhere; }
section.card > form, .card > form { margin-bottom: 0; }

/* filter bars: aligned controls, labels over inputs, the live find at the right */
form.filters { align-items: flex-end; gap: var(--sp-3) var(--sp-4); }
form.filters input[type=search], form.filters input:not([type]) { min-width: 11rem; }
.tfind { display: none; margin-left: auto; }
.js .tfind { display: flex; }
.tfind .fcount { color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 400; }

/* a field's label keeps its required star beside the text; a long label wraps inside its own box */
.field .lbl, .field > .lbl label { display: inline-flex; align-items: center; gap: var(--sp-1); font-weight: 500; font-size: var(--fs-sm); }
.newp .field input[type=checkbox] { width: 16px; height: 16px; height: 16px; padding: 0; align-self: auto; }
.as-wizard .field.check { flex-direction: row; flex-wrap: wrap; align-items: center; }

/* hub and user registration forms inside cards */
.card form .field, .card form > label { min-width: 12rem; }

/* wizard-style pages (autoscale pool and profile): two columns, numbered sections as plain circles */
.as-wizard .fields { grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); column-gap: var(--sp-5); }
.as-wizard .fields .field { max-width: 34rem; }
.as-wizard .fields .field.wide, .as-wizard .fields .field:has(.tiles), .as-wizard .fields .field:has(.seg.sizes), .as-wizard .fields .field:has(.seg.choices) { grid-column: 1 / -1; max-width: none; }
.as-wizard .num { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 600; }
.as-wizard .num::before { content: none; }
.as-wizard small.under, .as-wizard small.dflt { font-size: var(--fs-xs); }
.as-wizard .lookup-scope { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }

/* rows of option buttons that used to wrap as one segmented bar become a grid of tiles; short enums stay one compact bar */
.newp .seg.sizes, .newp .seg.choices { display: grid; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
  gap: var(--sp-2); border: 0; border-radius: 0; overflow: visible; background: none; height: auto; padding: 0; }
.newp .seg.sizes label, .newp .seg.choices label { align-items: flex-start; justify-content: flex-start; text-align: left; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); }
.newp .seg.sizes label:hover:not(:has(input:disabled)), .newp .seg.choices label:hover:not(:has(input:disabled)) { border-color: var(--accent); }
.newp .seg.sizes label:has(input:checked), .newp .seg.choices label:has(input:checked) { border-color: var(--accent); }
.newp .seg.sizes label:has(input:focus-visible), .newp .seg.choices label:has(input:focus-visible) { outline-offset: 2px; }
.newp .seg.compact { display: inline-flex; flex-wrap: wrap; width: fit-content; max-width: 100%; height: auto; }
.newp .seg.compact label { flex: 0 0 auto; border-left: 0; padding: var(--sp-1) var(--sp-3); }

/* configuration tab: the kinds checklist in columns, dense paragraphs live in popovers */
form > fieldset.cfg-kinds { flex: 1 1 100%; min-width: 0; }
.cfg-kinds .checks.grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.cfg-objs td select { max-width: 14rem; }
dl.facts dd .info { margin-left: var(--sp-2); vertical-align: middle; }
dl.facts dd form.inline-form { margin: var(--sp-2) 0 0; }
#plat-list td:not(:last-child), #audit-list td:not(:last-child) { white-space: nowrap; }
#plat-list td:nth-child(6) { white-space: normal; }

/* ---- modal (C0, providers-design 23.7): a native <dialog> opened with showModal(); floats, so it has a shadow ---- */
dialog.modal { width: min(44rem, calc(100vw - 2 * var(--sp-4))); max-height: calc(100vh - 2 * var(--sp-6)); padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--fg); box-shadow: var(--sh-float); overflow: auto; }
dialog.modal::backdrop { background: rgb(0 28 50 / .45); }
dialog.modal[aria-busy=true] .modal-body::before { content: "Loading…"; color: var(--fg-muted); }
.modal-x { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 32px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--fg-muted); font-size: 22px; line-height: 1; }
.modal-x:hover:not(:disabled) { background: var(--surface-2); color: var(--fg); border: 0; }
.modal-body h2 { margin: 0 var(--sp-6) var(--sp-4) 0; font-size: var(--fs-md); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
/* app.css makes every form a wrapping flex row; the connection forms stack (as .kit-form does). */
.conn-form { display: block; margin: 0; }
.conn-form > .krow-check { margin-top: var(--sp-3); }
.conn-form .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 var(--sp-4); }
.conn-form .kfield input[type=text], .conn-form .kfield input[type=password], .conn-form .kfield textarea, .conn-form .kfield select { max-width: none; }
.krow-check { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); min-height: var(--control-h); }
.krow-check input[type=checkbox] { width: 18px; height: 18px; margin: 0; }

/* ---- secret field: write-only, a file drop zone, a status line (what was chosen, never what it holds) ---- */
.secret-field .drop { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--line-strong);
  border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; max-width: 32rem; }
.secret-field .drop.over, .secret-field .drop:focus-within { border-color: var(--accent); background: var(--accent-wash); }
.secret-field .drop-text { font-size: var(--fs-sm); color: var(--fg-muted); }
.secret-field input[type=password] { width: 100%; max-width: 32rem; font-family: var(--mono); }
.secret-field textarea { width: 100%; max-width: 32rem; font-family: var(--mono); font-size: var(--fs-xs); }
.secret-field .paste summary { cursor: pointer; color: var(--accent); font-size: var(--fs-sm); width: max-content; }
.secret-field .gen { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.secret-status { margin: 0; font-size: var(--fs-sm); color: var(--fg-muted); }
.secret-status:empty { display: none; }
.secret-status.bad { color: var(--bad); }

/* ---- Connections page ---- */
.conn-group { margin: var(--sp-6) 0; }
.conn-group .title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.conn-group .title-row .krow { gap: var(--sp-2); }
.conn-group .title-row a.button { margin-left: 0; }
.conn-group .conn-new { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.conn-group .conn-new a.button, .conn-group .conn-new button { margin: 0; }
.conn-list td.actions { white-space: nowrap; }
.conn-list td.actions a.button, .conn-list td.actions button { margin: 0; min-height: var(--control-h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); }
a.button.ghost { background: none; color: var(--accent); border: 1px solid transparent; }
a.button.ghost:hover { background: var(--accent-wash); }
a.button.danger-text, button.danger-text { color: var(--bad); }
.conn-list code.fp { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.conn-ack { border-left: 3px solid var(--warn); }
.muted { color: var(--fg-muted); }
/* Proxmox connection (providers-design 23.2, C2): the form beside the rendered pveum commands. */
dialog.modal:has(.conn-split) { width: min(66rem, calc(100vw - 2 * var(--sp-4))); }
.conn-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 52rem) { .conn-split { grid-template-columns: 1fr; } }
.conn-form .conn-split .fields { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.conn-form .krow-check.wide { grid-column: 1 / -1; margin-bottom: var(--sp-3); }
.pveum { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.pveum h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.pve-side { display: grid; gap: var(--sp-3); align-content: start; }
.pve-guide { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.pve-guide h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); }
.pve-steps { list-style: none; counter-reset: pvestep; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.pve-steps > li { counter-increment: pvestep; position: relative; padding-left: 1.9rem; }
.pve-steps > li::before { content: counter(pvestep); position: absolute; left: 0; top: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--accent); color: var(--surface); font-weight: 600; font-size: var(--fs-xs); display: grid; place-items: center; }
.pve-steps > li > .hint { display: block; margin: 0; }
.pve-steps > li > button.sm { margin: 0 0 0 var(--sp-1); min-height: 0; padding: 0 var(--sp-2); }
.pve-steps pre.cmd { margin: var(--sp-1) 0 0; }
.pve-steps textarea { width: 100%; margin-top: var(--sp-1); font-family: var(--mono); font-size: var(--fs-xs); }
.pve-steps .pve-disc-status:empty { display: none; }
.pve-steps .pve-disc-status.bad { color: var(--bad); }
.conn-setup .pve-steps { margin: var(--sp-2) 0; }
pre.cmd { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: var(--fs-xs); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0; }
.pve-stored { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.pve-stored dt { color: var(--fg-muted); }
.pve-stored dd { margin: 0; }
ul.checks { list-style: none; padding: 0; margin: var(--sp-2) 0; }
ul.checks li.ok::before { content: "\2713  "; color: var(--ok); }
ul.checks li.bad::before { content: "\2717  "; color: var(--bad); }
/* Kubernetes targets (C3): a sub-group of Targets. */
.conn-sub { margin-top: var(--sp-5); }
.conn-sub .title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.cmd-block .hint { margin-top: 0; }

/* ---- Connections page, list (compact): a card per group with a dense table; empty groups as small tiles; Add is
   a type picker (pick the kind, its form opens in the modal) ---- */
main:has(.conn-page-list) { max-width: none; }
.conn-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.conn-head h1 { margin: 0; }
.conn-page-list .conn-tabs { margin-bottom: var(--sp-4); }
.conn-page-list .conn-ack { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.conn-ack h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-base); }
.conn-ack .conn-ack-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: var(--sp-2) 0 0; }
.conn-more > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-sm); width: max-content; }
.conn-page-list .conn-group { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); }
.conn-ghead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.conn-ghead h2, .conn-ghead h3 { margin: 0; font-size: var(--fs-md); }
.conn-ghead h3 { font-size: var(--fs-base); width: auto; }
.conn-ghead .title-acts { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.conn-ghead .title-acts a.button, .conn-ghead .title-acts button { margin: 0; }
.conn-page-list .conn-sub { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.conn-page-list section.conn-sub.card { border-top: 1px solid var(--line); padding: var(--sp-3) var(--sp-4); margin-top: 0; }
.conn-page-list .empty { margin: var(--sp-1) 0; }
.conn-page-list table.conn-list { width: 100%; margin: 0; }
.conn-list th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); font-weight: 600; }
.conn-list td { vertical-align: top; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.conn-list tr.retired td { opacity: .7; }
.conn-list td.actions { text-align: right; }
.conn-list td.actions > * { vertical-align: middle; }
.conn-list td.actions details.kebab { text-align: left; }
.conn-name { display: flex; gap: var(--sp-2); align-items: flex-start; min-width: 12rem; }
.conn-sub-line { font-size: var(--fs-xs); color: var(--fg-muted); line-height: 1.5; overflow-wrap: anywhere; }
.conn-sub-line code { font-size: var(--fs-xs); }
.conn-sub-line.err { color: var(--bad); }
.conn-mark { display: inline-grid; place-items: center; flex: none; min-width: 2.1rem; height: 1.6rem; padding: 0 .25rem; border-radius: var(--r-sm);
  font: 700 .65rem/1 var(--mono); letter-spacing: .02em; color: #fff; background: var(--fg-faint); }
.conn-mark[data-mark=oci] { background: #c74634; } .conn-mark[data-mark=aws] { background: #232f3e; } .conn-mark[data-mark=cloudflare] { background: #f38020; }
.conn-mark[data-mark=proxmox] { background: #e57000; } .conn-mark[data-mark=registry] { background: #1d63ed; } .conn-mark[data-mark=sigstore] { background: #5d3fd3; }
.conn-mark[data-mark=ssh] { background: #2f4858; } .conn-mark[data-mark=idp] { background: #0b6fa3; } .conn-mark[data-mark=azure] { background: #0078d4; }
.conn-mark[data-mark=gcp] { background: #1a73e8; } .conn-mark[data-mark=digitalocean] { background: #0069ff; } .conn-mark[data-mark=rfc2136] { background: #4b5d8a; } .conn-mark[data-mark=vsphere] { background: #607078; }
.conn-mark[data-mark=nutanix] { background: #4a6b1f; } .conn-mark[data-mark=openstack] { background: #da1a32; } .conn-mark[data-mark=kubevirt] { background: #00797f; }
.conn-mark[data-mark=harvester] { background: #00a170; } .conn-mark[data-mark=anthropic] { background: #c15f3c; } .conn-mark[data-mark=bedrock] { background: #7b3fbf; }
.conn-mark[data-mark=vertex] { background: #34a853; } .conn-mark[data-mark=gateway] { background: #555f6d; } .conn-mark[data-mark=k8s] { background: #326ce5; }
.conn-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-s { display: inline-block; padding: 1px .5em; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.5; }
.chip-s.muted { color: var(--fg-muted); border-style: dashed; }
.chip-n { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: var(--r-pill); background: var(--accent-wash); color: var(--accent); font-weight: 600; font-size: var(--fs-xs); }
.conn-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-xs); }
.conn-status details.checks summary { cursor: pointer; }
.pc-state { font-weight: 600; } .pc-state[data-pc-state=Ready] { color: var(--ok); } .pc-state[data-pc-state=None] { color: var(--fg-muted); font-weight: 400; }
.pc-state[data-pc-state=Missing], .pc-state[data-pc-state=Conflict] { color: var(--bad); } .pc-state[data-pc-state="Provider not installed"] { color: var(--warn); }
/* the empty groups: small tiles in a grid */
.conn-empties { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--sp-3); margin: var(--sp-2) 0 var(--sp-4); }
.conn-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); }
.conn-empty .conn-ghead { margin: 0; }
.conn-empty .conn-ghead h2 { font-size: var(--fs-base); }
.conn-empty p { margin: 0; }
.conn-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto !important; padding-top: var(--sp-1); }
.conn-marks .conn-mark { min-width: 1.8rem; height: 1.3rem; font-size: .6rem; opacity: .85; }
/* Add: the type picker */
details.conn-add { position: relative; display: inline-block; }
details.conn-add > summary { list-style: none; cursor: pointer; margin: 0; }
details.conn-add > summary::-webkit-details-marker { display: none; }
details.conn-add > summary.button { display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 .9rem; font-weight: 500; border: 1px solid var(--accent);
  border-radius: var(--r-md); background: var(--accent); color: var(--fg-on-accent); user-select: none; }
details.conn-add > summary.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
details.conn-add > summary.button.sm { min-height: var(--control-h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); }
details.conn-add > summary.button.secondary { background: var(--surface); color: var(--fg); border-color: var(--line-strong); }
details.conn-add > summary.button.secondary:hover, details.conn-add[open] > summary.button.secondary { background: var(--surface-2); border-color: var(--fg-faint); }
.conn-add-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: max-content; max-width: min(46rem, calc(100vw - 2rem)); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-float); padding: var(--sp-3); }
.conn-add-group + .conn-add-group { margin-top: var(--sp-3); }
.conn-add-title { margin: 0 0 var(--sp-1); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); }
.conn-add-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 4px; min-width: min(28rem, calc(100vw - 3rem)); }
.conn-add-kind { display: flex; align-items: center; gap: var(--sp-2); padding: 4px var(--sp-2); margin: 0; border: 1px solid transparent; border-radius: var(--r-md);
  background: none; color: var(--fg); text-decoration: none; font: inherit; font-size: var(--fs-sm); text-align: left; min-height: 0; }
a.conn-add-kind:hover, a.conn-add-kind:focus-visible { background: var(--accent-wash); border-color: var(--accent); }
button.conn-add-kind:disabled { opacity: .55; cursor: not-allowed; }
.conn-add-menu p.warn { margin: 0 0 var(--sp-2); color: var(--warn); }
.conn-add-kinds:has(.conn-add-badge) { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.conn-add-badge { margin-left: auto; flex: none; }
.conn-add-badge .badge { font-size: var(--fs-xs); }
.conn-target-note .badge { margin-right: var(--sp-1); }
@media (max-width: 40rem) {
  .conn-page-list table.conn-list thead { display: none; }
  .conn-page-list table.conn-list, .conn-page-list table.conn-list tbody, .conn-page-list table.conn-list tr, .conn-page-list table.conn-list td { display: block; width: auto; }
  .conn-page-list table.conn-list tr { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
  .conn-page-list table.conn-list td { padding: 2px 0; border: 0; height: auto; }
  .conn-page-list .conn-list td.actions { text-align: left; }
  .conn-add-menu { position: fixed; left: var(--sp-4); right: var(--sp-4); top: 4rem; width: auto; }
}

/* ---- Connection forms: label left, control right (stacks on narrow screens); long text folds into details ---- */
.conn-form .fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
.conn-form .kfield { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--sp-4); row-gap: 2px; align-items: center; margin: 0 0 var(--sp-2); }
.conn-form .kfield > .klabel, .conn-form .kfield > legend.klabel { grid-column: 1; grid-row: 1 / span 6; align-self: start; padding-top: .45rem; float: none; }
.conn-form .kfield > :not(.klabel) { grid-column: 2; }
.conn-form .kfield .hint, .conn-form .kfield .err { max-width: none; }
.conn-form .kfield > .klabel { display: block; line-height: 1.35; }
.conn-form .kfield > .klabel .opt { display: inline; }
.conn-form fieldset.kfield { border: 0; padding: 0; min-width: 0; }
.conn-form > .krow-check, .conn-form .fields > .krow-check, .conn-form .fields > p.hint.wide, .conn-form > .hint,
.conn-form [data-ssh-pane] > p.hint, .conn-form .conn-who > .krow-check, .conn-form .edit-scope > .krow-check { margin-left: calc(11rem + var(--sp-4)); }
.conn-form .conn-split .fields { grid-template-columns: minmax(0, 1fr); }
.conn-form .conn-split .kfield { grid-template-columns: 8.5rem minmax(0, 1fr); }
.conn-form .conn-split .fields > .krow-check, .conn-form .conn-split .fields > p.hint.wide { margin-left: calc(8.5rem + var(--sp-4)); }
.conn-form .pve-stored { margin-left: 0; }
.conn-form .tiles { grid-column: 2; }
.conn-form h2 { display: flex; align-items: center; gap: var(--sp-2); }
.conn-form .conn-intro { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); }
.conn-form .conn-intro > summary { cursor: pointer; color: var(--accent); width: max-content; }
.conn-form .conn-intro > :not(summary) { margin: var(--sp-1) 0 0; color: var(--fg-muted); }
.conn-form .conn-who, .conn-form .edit-scope { margin: var(--sp-3) 0 0; padding: var(--sp-3) 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.conn-form .conn-who legend { float: left; width: 100%; padding: 0; margin: 0 0 var(--sp-1); font-weight: 600; font-size: var(--fs-sm); }
.conn-form .conn-who > p, .conn-form .edit-scope > p { clear: both; margin: 0 0 var(--sp-2); color: var(--fg-muted); }
.conn-form .edit-scope > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
@media (max-width: 40rem) {
  .conn-form .kfield, .conn-form .conn-split .kfield { grid-template-columns: minmax(0, 1fr); }
  .conn-form .kfield > .klabel { grid-row: auto; padding-top: 0; }
  .conn-form .kfield > :not(.klabel) { grid-column: 1; }
  .conn-form > .krow-check, .conn-form .fields > .krow-check, .conn-form .fields > p.hint.wide, .conn-form > .hint,
  .conn-form [data-ssh-pane] > p.hint, .conn-form .conn-who > .krow-check, .conn-form .edit-scope > .krow-check, .conn-form .conn-split .fields > .krow-check, .conn-form .conn-split .fields > p.hint.wide { margin-left: 0; }
}

/* ---- "Create new…" openers in a wizard step (an <a class="button secondary sm">): the kit button, not a link ---- */
.wizk .wiz-account-new a.button, .wizk .aswiz-new a.button, .wizk .aswiz-in a.button { margin: 0; }
.wizk .wiz-account-new, .wizk .aswiz-new { flex-direction: row; align-items: center; }

/* ---- the autoscale wizard (autoscale-multicloud-design 4.3) ---- */
.aswiz .aswiz-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.aswiz .aswiz-in input[type=text] { width: 100%; max-width: 32rem; flex: 1 1 16rem; }
.aswiz .aswiz-in input.num { max-width: 9rem; flex: 0 0 9rem; }
.aswiz .hint .dflt { color: var(--fg-faint); }
.aswiz .aswiz-note { margin: 0 0 var(--sp-4); color: var(--fg-muted); font-size: var(--fs-sm); max-width: 72ch; }
.aswiz .aswiz-adv { margin-top: 0; }
.aswiz .aswiz-adv-body { padding-top: var(--sp-2); }
.aswiz .wizk-sub:first-child { margin-top: 0; }
.aswiz table.review { margin: 0 0 var(--sp-4); }
.aswiz ul.estimate { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-sm); }
.aswiz details.wizk-fact[open] { margin-bottom: var(--sp-4); }
.kfield.kcheck { gap: 2px; }
.kcheck-label { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-base); font-weight: 500; cursor: pointer; width: fit-content; }
.kcheck-label input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.kfield.kcheck .hint { padding-left: calc(16px + var(--sp-2)); }

/* ---- row actions: a kebab menu (Edit, Drain, Delete…) and the delete dialog ---- */
.as-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.as-head h2 { margin: 0; }
.as-list td.actions { width: 1%; white-space: nowrap; text-align: right; }
details.kebab { position: relative; display: inline-block; }
details.kebab > summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); font-size: 18px; line-height: 1; color: var(--fg); }
details.kebab > summary::-webkit-details-marker { display: none; }
details.kebab > summary:hover, details.kebab[open] > summary { background: var(--surface-2); border-color: var(--line-strong); }
details.kebab .kebab-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 12rem; display: flex; flex-direction: column;
  padding: var(--sp-1); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-float); text-align: left; }
details.kebab .kebab-menu > a, details.kebab .kebab-menu button { display: flex; align-items: center; width: 100%; min-height: var(--control-h-sm); margin: 0;
  padding: 0 var(--sp-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--fg); font: inherit; font-size: var(--fs-sm); text-decoration: none; justify-content: flex-start; }
details.kebab .kebab-menu > a:hover, details.kebab .kebab-menu button:hover:not(:disabled) { background: var(--surface-2); }
details.kebab .kebab-menu form { margin: 0; }
details.kebab .kebab-menu .danger-text { color: var(--bad); }
.pop.as-del { max-width: 26rem; padding: var(--sp-4); white-space: normal; text-align: left; }
.pop.as-del p { margin: 0 0 var(--sp-3); }
.pop.as-del form { display: block; }
.pop.as-del label.kfield { display: flex; margin: 0 0 var(--sp-3); }
.pop.as-del .kit-nav { display: flex; width: 100%; gap: var(--sp-2); margin-top: var(--sp-3); }
.pop.as-del .kit-nav .gap { flex: 1; }
.pop.as-del input[name=force] { max-width: 12rem; }
.as-list td:first-child a { white-space: nowrap; }
/* Admin SSH key (providers-design 23.13): the picker's Generate… and Import from GitHub… side by side; fingerprints
   and public keys wrap instead of widening tiles, modals and the Connections table. */
.wizk .wiz-sshkey-new { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.wizk .wiz-sshkey-new a.button { margin: 0; width: auto; }
.wiz-sshkey .tile-sub, .ssh-keys code, .ssh-keys small { overflow-wrap: anywhere; }
.ssh-keys .krow-check { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.conn-list details.pubkey pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 48rem; }

/* Proxmox VM id (_wiz_placement.html wiz-vmid): Auto / Choose on one row, the check below. */
.wiz-vmid .vmid-row { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; align-items: center; }
.wiz-vmid .vmid-opt { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.wiz-vmid .vmid-opt input[type="text"] { width: 8.5rem; }
.wiz-vmid .vmid-auto { font-variant-numeric: tabular-nums; }
.wiz-vmid .vmid-status::before { content: "\25CF"; margin-right: .35rem; font-size: .7em; vertical-align: middle; }
.wiz-vmid .vmid-free::before { color: var(--ok, #1a7f37); }
.wiz-vmid .vmid-used::before, .wiz-vmid .vmid-refused::before { color: var(--bad, #cf222e); }
.wiz-vmid .vmid-unchecked::before { color: var(--warn, #9a6700); }
.wiz-vmid .vmid-used, .wiz-vmid .vmid-refused { color: var(--bad, #cf222e); }

/* Connections model (connections-model-design 6.1): security dots, use chips, the filter bar and the grouping by
system and account. Labels wrap; nothing is cut with an ellipsis. */
.sdot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; flex: none; vertical-align: baseline; border: 1px solid transparent; }
.sdot-red { background: var(--bad); } .sdot-amber { background: var(--warn); } .sdot-green { background: var(--ok); }
.sdot-neutral { background: var(--info); } .sdot-grey { background: transparent; border-color: var(--fg-faint); }
.conn-dot-line { display: flex; gap: var(--sp-1); align-items: baseline; margin-top: 2px; }
.conn-dot-line .conn-sub-line { overflow-wrap: anywhere; }
.conn-uses { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-u { display: inline-flex; align-items: center; gap: 4px; padding: 1px .5em; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-xs); line-height: 1.5; white-space: normal; background: var(--card); color: var(--fg); }
.chip-u small { color: var(--fg-muted); }
a.chip-u.can { border-style: dashed; color: var(--accent); text-decoration: none; }
a.chip-u.can:hover { background: var(--accent-wash); }
.conn-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-3); }
.conn-filters select, .conn-filters input[type=search] { min-height: var(--control-h-sm); font-size: var(--fs-sm); margin: 0; }
.conn-filters input[type=search] { flex: 1 1 16rem; min-width: 12rem; }
.conn-use-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-f { display: inline-flex; align-items: center; gap: 4px; padding: 2px .65em; border-radius: var(--r-pill); border: 1px solid var(--line); font-size: var(--fs-sm); text-decoration: none; color: var(--fg); background: var(--card); }
.chip-f.on { background: var(--accent); color: var(--fg-on-accent); border-color: var(--accent); }
.chip-f.on .tab-count { color: inherit; }
.conn-security { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: baseline; padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.conn-sec-counts { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.sec-count { display: inline-flex; gap: 6px; align-items: center; }
.conn-nudges { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); flex: 1 1 32rem; }
.conn-nudges li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.conn-nudges a.button { margin: 0 0 0 auto; }
.conn-account + .conn-account { margin-top: var(--sp-2); border-top: 1px dashed var(--line); padding-top: var(--sp-2); }
.conn-acct-title { margin: 0 0 4px; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.conn-list tr.conn-child td { padding-top: 2px; background: var(--tint); }
.conn-child-mark { color: var(--fg-faint); padding-left: var(--sp-2); }
/* "What is this for?" (6.2 step 3) and the uses drawer. */
.conn-usesform fieldset.use { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-2); }
.conn-usesform fieldset.use legend { display: flex; gap: 6px; align-items: center; font-weight: 600; padding: 0 4px; }
.conn-usesform .use-how { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: 4px 0; }
.conn-usesform .use-nudge { border-left: 3px solid var(--warn); background: var(--warn-wash); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); margin: 4px 0; }
.conn-usesform .use-nudge.red { border-left-color: var(--bad); background: var(--bad-wash); }
.conn-usesform .use-sep[hidden] { display: none; }
.conn-usesform pre.setup { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-xs); }
.kit-pick-search { margin: 0 0 var(--sp-2); min-height: var(--control-h-sm); font-size: var(--fs-sm); width: min(100%, 24rem); }
.conn-extra-uses label.krow-check { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.conn-extra-uses label.krow-check .opt { flex: 1 1 18rem; }

/* Certificate renewal (templates/_renewal.html): two compact options side by side, the cluster's credential row. */
.renew { border: 1px solid var(--line, #ddd); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); margin: var(--sp-2) 0; min-width: 0; }
.renew legend { font-weight: 600; padding: 0 4px; }
.renew-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-2); }
.renew-opt { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: start; border: 1px solid var(--line, #ddd); border-radius: var(--r-sm); padding: 6px 8px; cursor: pointer; }
.renew-opt:has(input:checked) { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 1px var(--accent, #2563eb) inset; }
.renew-opt:has(input:disabled) { opacity: .7; cursor: not-allowed; }
.renew-t { font-weight: 600; overflow-wrap: anywhere; }
.renew-s { grid-column: 2; font-size: .85em; color: var(--muted, #666); overflow-wrap: anywhere; }
.renew-cluster { margin-top: var(--sp-2); }
.renew-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0; }
.renew-row select { min-width: 12rem; max-width: 100%; }
.renew .use-nudge { border-left: 3px solid var(--warn); background: var(--warn-wash); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); margin: 4px 0; }

/* A Proxmox platform's Upgrade card: the phases of the last upgrade in one compact row. */
.upgrade-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 6px 0; padding: 0; }
.upgrade-step { font-size: var(--fs-sm); border: 1px solid currentColor; border-radius: var(--r-pill); padding: 0 8px; opacity: .6; }
.upgrade-step.done { color: var(--ok); opacity: 1; }
.upgrade-step.current { color: var(--info); opacity: 1; font-weight: 600; }
.upgrade-step.failed { color: var(--bad); opacity: 1; font-weight: 600; }
.upgrade-step.skipped { text-decoration: line-through; }
/* Charts page and chart-version picker (charts.go) */
.conn-mark[data-mark=helm] { background: #0f1689; }
.ch-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-2) 0; }
.ch-repos { display: grid; gap: var(--sp-3); }
.ch-repo { border: 1px solid var(--line); border-radius: var(--r-md, 8px); background: var(--card); padding: var(--sp-2) var(--sp-3); }
.ch-head { display: flex; gap: var(--sp-2); align-items: flex-start; }
.ch-id { flex: 1; min-width: 0; }
.ch-acts { display: flex; gap: var(--sp-1, 4px); flex-wrap: wrap; justify-content: flex-end; }
.ch-fams { width: 100%; border-collapse: collapse; margin-top: var(--sp-2); }
.ch-fams th { text-align: left; vertical-align: top; width: 13rem; padding: 4px var(--sp-2) 4px 0; font-weight: 600; }
.ch-fams td { padding: 4px 0; border-top: 1px solid var(--line); }
.ch-fams tr:first-child td { border-top: 0; }
.ch-fam { display: block; }
.ch-charts { display: block; font-weight: 400; overflow-wrap: anywhere; }
.ch-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0; }
.ch-kasm { font: 600 var(--fs-xs)/1.5 var(--mono); color: var(--fg-muted); min-width: 5.5rem; }
.ch-v { display: inline-block; padding: 0 .45em; border-radius: var(--r-pill); border: 1px solid var(--line); font: var(--fs-xs)/1.6 var(--mono); background: var(--surface-2); white-space: nowrap; }
.ch-v.pin { background: var(--ok-wash); color: var(--ok); border-color: currentColor; font-weight: 600; }
.ch-v.part { border-style: dashed; color: var(--fg-muted); background: transparent; text-decoration: line-through; }
.ch-other summary { cursor: pointer; color: var(--fg-muted); }
.ch-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-2); align-items: start; }
.ch-pick-wrap { border: 1px solid var(--line); border-radius: var(--r-sm, 6px); padding: var(--sp-1, 4px) var(--sp-2) var(--sp-2); margin: var(--sp-2) 0; min-width: 0; max-width: 56rem; }
.ch-pick-wrap legend { padding: 0 4px; font-weight: 600; }
.ch-pick label { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); min-width: 0; margin: 0; }
.ch-pick select { font-family: var(--mono); font-size: var(--fs-sm); width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.ch-form { display: block; }
.ch-pick .ch-note { font-size: var(--fs-xs); color: var(--fg-muted); overflow-wrap: anywhere; }
.ch-pick .ch-note.warn { color: var(--warn); }
.ch-pick .ch-note.bad { color: var(--bad); }
.ch-src { font-size: var(--fs-xs); color: var(--fg-muted); overflow-wrap: anywhere; grid-column: 1 / -1; }
@media (max-width: 640px) { .ch-head { flex-wrap: wrap; } .ch-fams th { width: auto; display: block; } .ch-fams td { display: block; } }
