/* Component kit. Loads after g.css and fasra.css; tokens only. A card fills its slot: about 360px in chat,
   wider on a dashboard panel. Nothing here sets a fixed width. */
@import url("../ui/ui.css");
.kit-card { box-sizing: border-box; min-width: 0; background: var(--surface-1); border: 1px solid var(--card-border, var(--border-subtle)); border-radius: 12px; font-size: 13px; line-height: var(--lh-2); color: var(--text-primary); container-type: inline-size; }
.kit-h { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
.kit-h .orb { width: 24px; height: 24px; --blur: 4px; }
.kit-ht { min-width: 0; }
.kit-ht span { display: block; font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.kit-ht b { display: block; font-size: 14px; line-height: var(--lh-2); font-weight: 500; overflow-wrap: anywhere; }
.kit-b { padding: var(--sp-3) var(--sp-4); }
.kit-f { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border-subtle); font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.kit-card .num { font-variant-numeric: tabular-nums; }

/* card */
.kit-facts { margin: 0; }
.kit-facts div { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; }
.kit-facts div + div { border-top: 1px solid var(--border-subtle); }
.kit-facts.compact div { padding: var(--sp-1) 0; }
.kit-facts dt { flex: none; color: var(--text-secondary); }
.kit-facts dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
.kit-links { margin-top: var(--sp-3); }
.kit-links h4 { margin: 0 0 var(--sp-2); font-size: 12px; line-height: var(--lh-1); font-weight: 500; color: var(--text-secondary); }
.kit-links > div { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.kit-links .gp-chip { max-width: 100%; min-width: 0; }
.kit-links .gp-chip > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* list and table */
.kit-list { list-style: none; margin: 0; padding: 0; counter-reset: k; }
.kit-list li { display: flex; align-items: center; gap: var(--sp-3); height: var(--h-2); counter-increment: k; }
.kit-list li + li { border-top: 1px solid var(--border-subtle); }
.kit-list li::before { content: counter(k); width: 16px; flex: none; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.kit-nm { flex: 1; min-width: 48px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kit-list [class^="kit-c-"] { flex: none; text-align: right; }
.kit-list .kit-c-value, .kit-list .kit-c-change { min-width: 40px; }
.kit-list .kit-c-kind { flex: 0 1 84px; min-width: 0; overflow: hidden; text-align: left; }
.kit-kind { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); white-space: nowrap; }
.kit-chg.up { color: var(--ok-text, var(--text-primary)); }
.kit-chg.down { color: var(--text-secondary); }
.kit-tw { margin: calc(-1 * var(--sp-3)) calc(-1 * var(--sp-4)); overflow-x: auto; }

/* chart */
.kit-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0 0 var(--sp-3); padding: 0; font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.kit-legend li { display: inline-flex; align-items: center; gap: 6px; }
.kit-legend i, .kit-tip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.kit-grid { stroke: var(--border-subtle); stroke-width: 1; }
.kit-cross { stroke: var(--border); stroke-width: 1; }
.kit-ax { font-size: 12px; fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
.kit-tip { position: absolute; top: 0; z-index: 2; width: 150px; box-sizing: border-box; margin-left: 8px; padding: var(--sp-2) var(--sp-3); border-radius: 8px; background: color-mix(in oklab, var(--surface-1) var(--glass-keep, 100%), transparent); -webkit-backdrop-filter: var(--glass-fx, none); backdrop-filter: var(--glass-fx, none); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-overlay); font-size: 12px; line-height: var(--lh-1); pointer-events: none; }
.kit-tip b { display: block; margin-bottom: var(--sp-1); font-weight: 500; }
.kit-tip div { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.kit-tip span:not(.num) { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-secondary); }

/* steps */
.kit-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.kit-steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: var(--sp-2); align-items: center; min-height: var(--h-1); }
.kit-steps li > span:nth-child(2) { color: var(--text-secondary); transition: color var(--dur-slow) var(--ease-out); }
.kit-steps li.done > span:nth-child(2), .kit-steps li.running > span:nth-child(2) { color: var(--text-primary); }
.kit-tick { width: 10px; height: 10px; margin: 3px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--border); transition: background var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out); }
.kit-steps .running .kit-tick { border-color: var(--leaf); }
.kit-steps .done .kit-tick { border-color: var(--leaf); background: var(--leaf); }
.kit-steps .failed .kit-tick { border-color: var(--chart-5); background: var(--chart-5); }
.kit-st { font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); white-space: nowrap; }

/* choice */
.kit-opts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.kit-opts.stack { flex-direction: column; align-items: stretch; }
.kit-opts .btn { gap: var(--sp-2); justify-content: space-between; max-width: 100%; height: auto; min-height: var(--h-control); padding-block: 6px; white-space: normal; text-align: left; }
.kit-opts .btn > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.kit-cr { flex: none; white-space: nowrap; }
.kit-opts .btn:disabled { opacity: .45; }
.kit-cr { font-size: 12px; opacity: .8; }
.kit-picked { margin: var(--sp-3) 0 0; font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }

/* graph */
.kit-graph { position: relative; min-width: 0; max-width: 100%; overflow: clip; }
.kit-gbox { position: relative; aspect-ratio: 4 / 3; overflow: hidden; contain: paint; border-radius: 8px; }
.kit-gbox .gl-label { text-shadow: 0 0 1px var(--surface-1), 0 0 2px var(--surface-1), 0 0 4px var(--surface-1), 0 0 6px var(--surface-1), 0 0 10px var(--surface-1); }
.kit-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.kit-graph:not(.gl) .kit-gbox { display: none; }
.kit-nodes .kit-gnote { grid-column: 1 / -1; }
.kit-gnote { margin: 0 0 var(--sp-3); font-size: 12px; line-height: var(--lh-1); color: var(--text-secondary); }
.kit-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.kit-ng h4 { margin: 0 0 var(--sp-1); font-size: 12px; line-height: var(--lh-1); font-weight: 500; color: var(--text-secondary); }
.kit-ng ul { list-style: none; margin: 0; padding: 0; }
.kit-ng button { display: flex; align-items: center; gap: 6px; width: 100%; min-height: var(--h-1); padding: 0 var(--sp-1); margin-left: calc(-1 * var(--sp-1)); border: 0; border-radius: 6px; background: none; font: inherit; color: var(--text-primary); text-align: left; cursor: pointer; transition: background var(--dur-base) var(--ease-out), opacity var(--dur-slow) var(--ease-out); }
.kit-ng button:hover { background: var(--fill-hover); }
.kit-ng button span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kit-ng li.dim button { opacity: .4; }
.kit-ng li.locked .orb { filter: grayscale(1); opacity: .6; }
.kit-ng li.focus button { background: color-mix(in oklab, var(--leaf) 14%, transparent); }

.kit-empty { margin: 0; font-size: 13px; line-height: var(--lh-2); color: var(--text-secondary); }
.kit-err { padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--border); border-radius: 12px; font-size: 13px; line-height: var(--lh-2); color: var(--text-secondary); }
@media (pointer: coarse), (max-width: 720px) { .kit-nodes li > button, .kit-card .gp-chip { min-height: 40px; } }
/* A map name is a 40px tap row on touch at any width; the negative margin keeps the label where placement put it. */
@media (pointer: coarse), (max-width: 720px) { .kit-gbox .gl-label { min-height: 40px; justify-content: center; box-sizing: border-box; margin-block: -10px; } }
