/* components.css: the pieces shared by the app (prototype.html), the case study
   (index.html) and the system page. One definition each; tokens from tokens.css. */

/* ---------- surfaces ---------- */
/* inside stone surfaces, slate text steps darker to keep 4.5:1, and secondary buttons sit on canvas */
.panel, .rows { --ink-2: var(--ink-2-on-surface); --ink-3: var(--ink-2-on-surface); --secondary-bg: var(--canvas); }
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.rows { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--rule); min-height: 56px; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; }
.row .amt { font-variant-numeric: tabular-nums; font-weight: 500; }
button.row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; cursor: pointer; transition: background-color var(--dur-hover) var(--ease-standard); }
button.row:first-child { border-top: 0; }
button.row:hover { background: var(--tertiary-hover); }
.section-label { font-size: 15px; font-weight: 600; margin: 28px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-label span { font-weight: 400; color: var(--ink-3); font-size: 13.5px; text-align: right; }
.card { padding: 16px 18px; }
.card + .card { margin-top: 14px; }


/* ---------- chips (buttons and radio labels) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--control); background: var(--surface); cursor: pointer; font-weight: 500; font-variant-numeric: tabular-nums; transition: background-color var(--dur-press) var(--ease-standard), color var(--dur-press) var(--ease-standard); }
.chip[aria-pressed="true"], .radio-chip input:checked + .chip { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.radio-chip { position: relative; }
.radio-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chip input:focus-visible + .chip { outline: 2px solid var(--focus); outline-offset: 2px; }

/* upcoming timeline */
.timeline { display: block; width: 100%; height: auto; margin: 4px 0 12px; overflow: visible; }
.timeline .tl-line { stroke-dasharray: 400; stroke-dashoffset: 400; }
.timeline.run .tl-line { transition: stroke-dashoffset var(--dur-chart) var(--ease-settle); stroke-dashoffset: 0; }
.timeline .tl-mark { opacity: 0; transform: translateY(-4px); transform-box: fill-box; transition: opacity var(--dur-card) var(--ease-settle), transform var(--dur-card) var(--ease-settle); }
.timeline.run .tl-mark { opacity: 1; transform: none; }
.timeline text { font-family: var(--sans); font-size: 11.5px; }


.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 12px 16px; }
.cat-row .bar { grid-column: 1 / -1; position: relative; height: 10px; border-radius: 3px; background: var(--data-muted); overflow: visible; }
.cat-row .bar i { position: absolute; inset: 0; border-radius: 3px; transform-origin: left center; transform: scaleX(var(--w, 0)); transition: transform var(--dur-chart) var(--ease-standard), background-color var(--dur-card) var(--ease-standard); }
.cat-row .bar s { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); left: calc(var(--last, 0) * 100%); transition: left var(--dur-chart) var(--ease-standard); text-decoration: none; }
.cat-row .name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.cat-row .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.cat-row .cmp { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); }
.cat-row[aria-pressed="true"] { background: var(--tertiary-hover); }
.cat-row[aria-pressed="true"] .name { font-weight: 700; }
.cat-dot { width: 10px; height: 10px; border-radius: 2px; flex: none; border: 1px solid var(--control); }

.legend-key { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.legend-key i { width: 2px; height: 14px; background: var(--ink); display: inline-block; }

.week { display: block; width: 100%; height: auto; }
.week .wk-bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform var(--dur-chart) var(--ease-settle); }
.week.run .wk-bar { transform: scaleY(1); }
.week text { font-family: var(--sans); font-size: 11.5px; }


.confirm { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; font-weight: 600; min-height: 0;
  opacity: 0; transform: translateY(6px); transition: opacity var(--dur-card) var(--ease-settle), transform var(--dur-card) var(--ease-settle); }
.confirm.on { opacity: 1; transform: none; }
.confirm keel-lottie { width: 44px; height: 44px; flex: none; }

.scenario { display: block; width: calc(100% + 8px); margin: 10px -4px 0; height: auto; overflow: visible; }
.scenario text { font-family: var(--sans); font-size: 11.5px; }
.scenario .area { transition: opacity var(--dur-card) var(--ease-standard); }
