/*
 * Guided entry ("Saisir mes données", source pages and their sheets).
 * Built on the platform tokens only: same surfaces, radii, type scale and
 * motion as the rest of the app. Client colours (--c) mark each source.
 */

/* ---------- Shared pieces ---------- */
/* .src-tile: an icon tile in the source's own colour (frame.css, "Icon tiles"); --s sets its side. */
.src-tile { --s: 36px; }
.src-tile-s { --s: 28px; }
.src-tile-xl { --s: 60px; }
.src-scope { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: var(--t-cap); font-weight: 650; color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent); white-space: nowrap; }
.src-scope::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.src-h2 { font-size: var(--t-title-2); font-weight: 620; letter-spacing: -0.01em; }
.src-cap { font-size: var(--t-cap); font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--label-3); }
.src-warn { color: var(--orange); font-weight: 600; }
.src-u { color: var(--label-3); font-size: var(--t-foot); }
.src-attrs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.src-attr { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: var(--r-xs); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); font-size: var(--t-foot); font-weight: 560; }
.src-attr small { color: var(--label-3); font-weight: 450; }

/* ---------- Hub ---------- */
.src-head-hub .lead { max-width: 64ch; }
.src-finder { position: relative; max-width: 780px; }
.src-find { display: flex; align-items: center; gap: 0.75rem; height: 56px; padding: 0 1.1rem; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--window-shadow); cursor: text; transition: box-shadow var(--m-200) var(--ease); }
.src-find:focus-within { box-shadow: var(--window-shadow), 0 0 0 4px var(--accent-ring); }
.src-find > .i { width: 20px; height: 20px; color: var(--label-3); }
.src-find-input { flex: 1; min-width: 0; width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: var(--t-title-2); color: var(--label); }
.src-find-input::placeholder { color: var(--label-4); }
.src-find-input::-webkit-search-cancel-button { cursor: pointer; }
.src-res { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; display: grid; gap: 2px; max-height: min(60vh, 460px); overflow-y: auto; padding: 0.4rem; border-radius: var(--r-l); background: var(--surface-raised); box-shadow: var(--pop-shadow); animation: pop-in var(--m-200) var(--ease-out); }
.src-res[hidden] { display: none; }
.src-res-h { padding: 0.5rem 0.65rem 0.2rem; font-size: var(--t-cap); font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--label-4); }
.src-res-item { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.55rem 0.65rem; border: 0; border-radius: var(--r-s); background: none; color: inherit; text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.src-res-item > span:not(.src-tile) { display: grid; min-width: 0; flex: 1; }
.src-res-item small { color: var(--label-3); font-size: var(--t-foot); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-res-item > .i { color: var(--label-4); }
.src-res-item:hover, .src-res-item.is-active { background: var(--fill-2); }
.src-res-none { padding: 0.8rem 0.7rem; color: var(--label-2); font-size: var(--t-callout); }
.src-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0 1.5rem; }
.src-chip { display: inline-flex; align-items: center; gap: 0.45rem; height: 32px; padding: 0 0.85rem 0 0.7rem; border: 0; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); color: var(--label-2); font: inherit; font-size: var(--t-foot); font-weight: 560; cursor: pointer; transition: transform var(--m-200) var(--ease-out), box-shadow var(--m-200) var(--ease), color var(--m-150) var(--ease); }
.src-chip .i { width: 16px; height: 16px; color: var(--accent-text); }
.src-chip:hover { color: var(--label); transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--sep-2), 0 8px 18px -14px rgba(6, 33, 41, 0.5); }

.src-pulse { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2rem; align-items: start; }
.src-pulse .card-head { margin-bottom: 0.9rem; }
.src-stack { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--fill-3); }
.src-stack-s { height: 10px; }
.src-seg { flex: var(--g) 1 0; min-width: 4px; background: var(--c, var(--label-4)); transition: filter var(--m-150) var(--ease); }
a.src-seg:hover { filter: brightness(1.12); }
.src-seg-rest { --c: var(--fill); }
.src-seg.is-dim { opacity: 0.35; }
.page-enter .src-stack { animation: grow-w 700ms var(--ease-out) both; }
.src-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.85rem 0 0; padding: 0; list-style: none; font-size: var(--t-foot); color: var(--label-2); }
.src-legend a, .src-legend span { display: inline-flex; align-items: center; gap: 0.4rem; color: inherit; text-decoration: none; }
.src-legend a:hover { color: var(--label); }
.src-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.src-legend .src-rest-dot { background: var(--fill); }
.src-legend b { font-weight: 620; color: var(--label); font-variant-numeric: tabular-nums; }
.src-pulse-side { display: grid; gap: 0.75rem; min-width: 0; }
.src-pulse-side > * { min-width: 0; }
.src-ring { display: flex; align-items: center; gap: 0.8rem; }
.src-ring svg { width: 52px; height: 52px; flex: none; transform: rotate(-90deg); }
.src-ring circle { fill: none; stroke-width: 5; }
.src-ring-bg { stroke: var(--fill); }
.src-ring-fg { stroke: var(--signal); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease-out); }
.src-ring b { display: block; font-size: var(--t-title); font-weight: 620; font-stretch: var(--figure-stretch); line-height: 1.1; }
.src-ring small { color: var(--label-2); font-size: var(--t-foot); }
.src-gaps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.src-gaps li { min-width: 0; }
.src-gap { min-width: 0; display: flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.6rem; border-radius: var(--r-s); background: var(--orange-soft); color: var(--orange); font-size: var(--t-foot); text-decoration: none; transition: filter var(--m-150) var(--ease); }
.src-gap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.src-gap .i { width: 14px; height: 14px; }
.src-gap:hover { filter: brightness(0.97); }
.src-allset { display: flex; align-items: center; gap: 0.4rem; color: var(--accent-text); font-size: var(--t-foot); font-weight: 560; }

.src-scopes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.src-scopes > .card + .card { margin-top: 0; }
.src-scope-card { display: grid; gap: 0.9rem; padding: 1.15rem 1rem 1rem; scroll-margin-top: 1rem; }
.src-scope-head { display: grid; gap: 0.35rem; padding: 0 0.35rem; }
.src-scope-head p { color: var(--label-2); font-size: var(--t-foot); }
.src-scope-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem; }
.src-scope-total { color: var(--label-2); font-size: var(--t-foot); white-space: nowrap; }
.src-scope-total b { color: var(--label); font-size: var(--t-title); font-weight: 600; font-stretch: var(--figure-stretch); letter-spacing: -0.02em; margin-right: 0.15rem; }
.src-list { display: grid; gap: 2px; }
.src-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.6rem; border-radius: var(--r-m); color: inherit; text-decoration: none; transition: background var(--m-150) var(--ease), transform var(--m-200) var(--ease-out); }
a.src-row:hover { background: var(--fill-3); transform: translateX(2px); }
.src-row-main { display: grid; gap: 0.15rem; min-width: 0; }
.src-row-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row-main small { color: var(--label-2); font-size: var(--t-foot); }
.src-row-val { display: grid; justify-items: end; }
.src-row-val b { font-weight: 620; font-stretch: var(--figure-stretch); font-variant-numeric: tabular-nums; }
.src-row-val small { color: var(--label-3); font-size: var(--t-cap); }
.src-ticks { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; max-width: 144px; margin-top: 0.25rem; }
.src-ticks i { height: 4px; border-radius: 2px; background: var(--c); }
.src-ticks i.no { background: none; box-shadow: inset 0 0 0 1px var(--orange); }
.src-none { padding: 0.5rem 0.35rem; color: var(--label-3); font-size: var(--t-callout); }
.src-add { display: flex; align-items: center; justify-content: center; gap: 0.45rem; height: 40px; border: 1px dashed var(--sep-2); border-radius: var(--r-m); background: none; color: var(--label-2); font: inherit; font-size: var(--t-callout); font-weight: 560; cursor: pointer; transition: color var(--m-150) var(--ease), border-color var(--m-150) var(--ease), background var(--m-150) var(--ease); }
.src-add:hover { color: var(--accent-text); border-color: var(--accent-text); background: var(--accent-soft); }

/* ---------- Source page ---------- */
.src-back { display: inline-flex; align-items: center; gap: 0.3rem; margin-bottom: 0.9rem; color: var(--label-2); font-size: var(--t-foot); font-weight: 560; text-decoration: none; }
.src-back:hover { color: var(--label); }
.src-head { align-items: center; }
.src-id { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.src-id-text { min-width: 0; }
.src-id .kicker { flex-wrap: wrap; }
.src-head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.src-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.src-col { display: grid; gap: 1rem; min-width: 0; }
.src-col > .card + .card { margin-top: 0; }
.src-side { position: sticky; top: 1rem; }
.src-mgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.35rem; }
.src-month { display: grid; justify-items: center; gap: 0.35rem; padding: 0.4rem 0.1rem; border: 0; border-radius: var(--r-s); background: none; color: inherit; font: inherit; min-width: 0; }
button.src-month { cursor: pointer; transition: background var(--m-150) var(--ease); }
button.src-month:hover { background: var(--fill-3); }
.src-bar { display: flex; align-items: flex-end; justify-content: center; width: 100%; max-width: 34px; height: 104px; border-radius: var(--r-xs); background: var(--fill-3); overflow: hidden; }
.src-bar i { display: block; width: 100%; height: calc(var(--h) * 100%); min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--c); transform-origin: bottom; }
.page-enter .src-bar i { animation: src-rise 700ms var(--ease-out) calc(var(--d, 0) * 1ms) both; }
.src-month.is-just .src-bar i { animation: src-rise 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes src-rise { from { transform: scaleY(0); } }
.src-month.is-est .src-bar i { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 55%, transparent) 5px 9px); }
.src-month.is-miss .src-bar { align-items: center; background: none; outline: 1.5px dashed var(--orange); outline-offset: -1.5px; color: var(--orange); }
button.src-month.is-miss:hover .src-bar { background: var(--orange-soft); }
.src-m { font-size: var(--t-cap); color: var(--label-2); font-weight: 560; }
.src-v { font-size: var(--t-cap); font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.src-month.is-miss .src-v { color: var(--orange); }
.src-table-wrap { overflow-x: auto; margin: 0 -0.5rem; }
.src-table { width: 100%; border-collapse: collapse; font-size: var(--t-callout); }
.src-table th { padding: 0.5rem; border-bottom: 1px solid var(--sep); color: var(--label-2); font-size: var(--t-foot); font-weight: 560; text-align: left; white-space: nowrap; }
.src-table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--sep); white-space: nowrap; font-variant-numeric: tabular-nums; vertical-align: middle; }
.src-table tbody tr:last-child td { border-bottom: 0; }
.src-table .num { text-align: right; }
.src-table td b { font-weight: 600; }
.src-table tbody tr[tabindex] { cursor: pointer; transition: background var(--m-150) var(--ease); }
.src-table tbody tr[tabindex]:hover { background: var(--fill-3); }
.src-table tbody tr:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.src-table tr.is-just { animation: src-row-in 1.6s var(--ease-out); }
@keyframes src-row-in { 0%, 30% { background: var(--accent-soft); } }
.src-raw { display: block; color: var(--label-3); font-size: var(--t-cap); }
.src-empty { padding: 2.5rem 1rem 2rem; }
.src-empty .src-tile { margin-bottom: 0.5rem; }
.src-annual-fig { display: flex; align-items: baseline; gap: 0.4rem; margin: 0.2rem 0 1rem; }
.src-annual-fig b { font-size: 2rem; font-weight: 560; font-stretch: var(--figure-stretch); letter-spacing: -0.03em; }
.src-annual-fig span { color: var(--label-2); }
.src-annual-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.src-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; font-size: var(--t-callout); }
.src-dl dt { color: var(--label-2); }
.src-dl dd { margin: 0; font-weight: 520; min-width: 0; overflow-wrap: anywhere; }
.src-calc { display: grid; gap: 1rem; }
.src-calc .src-dl { border-top: 1px solid var(--sep); padding-top: 0.85rem; }
.src-quality { width: 100%; max-width: 100%; }
.src-eq { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.45rem; align-items: center; }
.src-eq-b { display: grid; min-width: 0; padding: 0.6rem 0.75rem; border-radius: var(--r-m); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); }
.src-eq-b strong { font-size: var(--t-title-2); font-weight: 620; font-stretch: var(--figure-stretch); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.src-eq-b small { color: var(--label-2); font-size: var(--t-cap); }
.src-eq-op { color: var(--label-3); font-weight: 500; }
.src-eq-r { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; }
.src-eq-res { display: grid; padding: 0.55rem 0.85rem; border-radius: var(--r-m); background: var(--signal); color: #04241a; }
.src-eq-res strong { font-size: var(--t-title); font-weight: 680; font-stretch: var(--figure-stretch); line-height: 1.1; font-variant-numeric: tabular-nums; }
.src-eq-res small { font-size: var(--t-cap); font-weight: 560; }
.src-todo { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; font-size: var(--t-callout); color: var(--orange); }
.src-todo li { display: flex; gap: 0.4rem; align-items: flex-start; }
.src-todo .i { margin-top: 0.15rem; }
.src-share { display: grid; gap: 0.85rem; }
.src-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; font-size: var(--t-callout); }
.src-bar-row span:first-child { color: var(--label-2); }
.src-bar-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.src-track { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--fill-2); overflow: hidden; }
.src-track i { display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: 999px; background: var(--c); transition: width 800ms var(--ease-out); }
.src-detail-link { display: flex; align-items: center; gap: 0.5rem; margin: 0.1rem -0.5rem -0.3rem; padding: 0.55rem 0.5rem; border-radius: var(--r-s); color: var(--label-2); font-size: var(--t-foot); font-weight: 560; text-decoration: none; }
.src-detail-link span { flex: 1; }
.src-detail-link:hover { background: var(--fill-2); color: var(--label); }

/* ---------- Sheets ---------- */
.src-sheet { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.src-sheet-head { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1rem 0.9rem 1.25rem; border-bottom: 1px solid var(--sep); }
.src-sheet-head > div { flex: 1; min-width: 0; }
.src-sheet-head p { color: var(--label-2); font-size: var(--t-foot); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-sheet-head h2 { font-size: var(--t-title-2); font-weight: 640; }
.src-sheet-body { display: grid; gap: 1rem; align-content: start; overflow-y: auto; padding: 1rem 1.25rem 1.25rem; color: var(--label); }
.src-sheet-foot { display: grid; gap: 0.75rem; padding: 0.9rem 1.25rem 1.1rem; border-top: 1px solid var(--sep); background: var(--surface-2); }
.src-sheet-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.src-sheet-btns .src-sheet-del { margin-right: auto; }
.src-field { margin-top: 0; }
.src-err { color: var(--red); font-size: var(--t-foot); }
.src-field.has-error .input { box-shadow: inset 0 0 0 1px var(--red), 0 0 0 3px var(--red-soft); }
.src-fs { display: grid; gap: 0.5rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.src-fs > legend { margin-bottom: 0.45rem; padding: 0; }
.src-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.src-inp { display: flex; align-items: stretch; gap: 0; }
.src-inp .input { flex: 1; min-width: 0; width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; font-variant-numeric: tabular-nums; }
.src-inp-u, .src-unit { display: flex; align-items: center; padding: 0 0.75rem; border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep); color: var(--label-2); font: inherit; font-size: var(--t-foot); white-space: nowrap; border: 0; }
.src-unit { cursor: pointer; color: var(--label); font-weight: 560; padding-right: 0.5rem; }
.src-unit:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent-text), 0 0 0 3px var(--accent-ring); }
.src-mpick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.35rem; }
.src-mp { position: relative; height: 32px; border: 0; border-radius: var(--r-s); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep-2); color: var(--label-2); font: inherit; font-size: var(--t-foot); font-weight: 560; cursor: pointer; transition: background var(--m-150) var(--ease), color var(--m-150) var(--ease); }
.src-mp:hover { background: var(--fill-3); color: var(--label); }
.src-mp.has::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--signal); }
.src-mp.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.src-mp[disabled] { cursor: default; }
.src-sec { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.2rem; font-size: var(--t-cap); font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--label-3); }
.src-sec::after { content: ""; flex: 1; height: 1px; background: var(--sep); }
.src-drop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.8rem 0.9rem; border: 1.5px dashed var(--sep-2); border-radius: var(--r-l); background: var(--surface-2); transition: border-color var(--m-150) var(--ease), background var(--m-150) var(--ease); }
.src-drop.is-over { border-color: var(--accent-text); background: var(--accent-soft); }
.src-drop.has-file { border-style: solid; border-color: color-mix(in srgb, var(--signal) 50%, transparent); }
.src-drop-txt { display: grid; min-width: 0; font-size: var(--t-callout); }
.src-drop-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.src-drop-txt small { color: var(--label-2); font-size: var(--t-foot); }
.src-drop-acts { display: flex; align-items: center; gap: 0.6rem; }
.src-note { display: flex; gap: 0.4rem; align-items: flex-start; color: var(--label-2); font-size: var(--t-foot); }
.src-note .i { margin-top: 0.1rem; width: 14px; height: 14px; color: var(--accent-text); }
.src-live { display: flex; align-items: center; gap: 1rem; }
.src-live-eq { flex: 1; min-width: 0; display: grid; gap: 0.2rem; color: var(--label-2); font-size: var(--t-foot); font-variant-numeric: tabular-nums; }
.src-live-eq b { color: var(--label); font-weight: 600; }
.src-live-eq small { color: var(--label-3); }
.src-live-r { display: grid; justify-items: end; }
.src-live-r strong { font-size: 1.6rem; font-weight: 640; font-stretch: var(--figure-stretch); line-height: 1.05; color: var(--accent-text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.src-live-r small { color: var(--label-2); font-size: var(--t-cap); }
.src-warn-box { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0; padding: 0.55rem 0.7rem; border-radius: var(--r-s); background: var(--orange-soft); color: var(--orange); font-size: var(--t-foot); font-weight: 560; }
.src-warn-box .i { margin-top: 0.1rem; }

/* Document sheet: a window sliding in from the right edge. */
dialog.src-drawer { width: min(500px, calc(100vw - 1.25rem)); height: calc(100% - 1.25rem); max-height: none; margin: 0.625rem 0.625rem 0.625rem auto; padding: 0; overflow: hidden; background: var(--surface-raised); box-shadow: var(--window-shadow); }
dialog.src-drawer[open]:not(.is-closing):not(.closing) { animation: src-slide 420ms var(--ease-out); }
dialog.src-drawer.is-closing { animation: src-slide-out 170ms var(--ease-in, ease-in) forwards; }
@keyframes src-slide { from { transform: translateX(calc(100% + 1rem)); } }
@keyframes src-slide-out { to { transform: translateX(calc(100% + 1rem)); opacity: 0.6; } }

/* Source sheet: new source in three steps, or personalise. */
dialog.src-wizard { width: min(980px, calc(100vw - 2rem)); height: min(740px, calc(100% - 2rem)); max-height: none; overflow: hidden; }
.src-wz-head { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 0.9rem 0.85rem 1.25rem; border-bottom: 1px solid var(--sep); }
.src-wz-head .src-cap { flex: 1; }
.src-steps { display: flex; flex: 1; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.src-steps li { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem 0.25rem 0.3rem; border-radius: 999px; color: var(--label-3); font-size: var(--t-foot); font-weight: 560; }
.src-steps li b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fill-2); font-size: var(--t-cap); }
.src-steps li b .i { width: 12px; height: 12px; stroke-width: 1.5px; }
.src-steps li.is-on { background: var(--fill-2); color: var(--label); }
.src-steps li.is-on b { background: var(--accent); color: var(--accent-ink); }
.src-steps li.is-done { color: var(--accent-text); }
.src-steps li.is-done b { background: var(--accent-soft); }
.src-wz-body { overflow-y: auto; padding: 1.4rem 1.5rem 1.6rem; color: var(--label); }
.src-wz-title { font-size: var(--t-title); font-weight: 640; letter-spacing: -0.015em; outline: none; }
.src-wz-lead { margin-top: 0.35rem; max-width: 66ch; color: var(--label-2); font-size: var(--t-callout); }
.src-wz-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1rem 0.9rem 1.25rem; border-top: 1px solid var(--sep); }
.src-wz-hint { flex: 1; color: var(--label-2); font-size: var(--t-foot); }
.src-spacer { flex: 1; }
.src-tgroup { display: grid; gap: 0.6rem; margin-top: 1.4rem; }
.src-tgroup h3 { display: flex; align-items: center; gap: 0.6rem; font-size: var(--t-callout); font-weight: 620; }
.src-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr)); gap: 0.5rem; }
.src-ttile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.75rem; align-items: center; padding: 0.75rem; border: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform var(--m-200) var(--ease-out), box-shadow var(--m-200) var(--ease); }
.src-ttile > span:last-child { display: grid; gap: 0.1rem; min-width: 0; }
.src-ttile b { font-weight: 600; font-size: var(--t-callout); }
.src-ttile small { color: var(--label-2); font-size: var(--t-foot); }
.src-ttile em { justify-self: start; margin-top: 0.2rem; }
.src-ttile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--sep-2), 0 12px 24px -18px rgba(6, 33, 41, 0.5); }
.src-wz-more { margin-top: 1.2rem; }
.src-wz2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.75rem; margin-top: 1.3rem; align-items: start; }
.src-wz-form { display: grid; gap: 1.2rem; min-width: 0; }
.src-swatches, .src-icons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.src-sw { position: relative; width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--c); cursor: pointer; transition: transform var(--m-200) var(--ease-out); }
.src-sw:hover { transform: scale(1.08); }
.src-sw.is-on { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px var(--c); }
.src-sw.is-on::after { content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.src-cf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 0.45rem; align-items: center; }
.src-sugg { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.src-sugg button { display: inline-flex; align-items: center; gap: 0.3rem; height: 28px; padding: 0 0.7rem 0 0.5rem; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--accent-ring); color: var(--accent-text); font: inherit; font-size: var(--t-foot); font-weight: 560; cursor: pointer; }
.src-sugg button .i { width: 14px; height: 14px; }
.src-sugg button:hover { background: var(--accent-soft); }
.src-addl { display: inline-flex; align-items: center; gap: 0.3rem; justify-self: start; }
.src-addl .i { width: 14px; height: 14px; }
.src-wz-preview { position: sticky; top: 0; display: grid; gap: 0.6rem; }
.src-pv { display: grid; gap: 0.9rem; padding: 1rem; border-radius: var(--r-l); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); }
.src-pv .src-row { background: var(--surface); box-shadow: var(--card-shadow); }
.src-pv .src-attrs { margin-top: 0; }
.src-pv-label { margin-bottom: 0.4rem; color: var(--label-2); font-size: var(--t-foot); }
.src-wz3 { display: grid; gap: 1.3rem; max-width: 720px; margin-top: 1.3rem; }
.src-opts { display: grid; gap: 0.45rem; }
.src-opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.src-opts-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.src-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.7rem; align-items: start; padding: 0.75rem 0.85rem; border: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: box-shadow var(--m-150) var(--ease), background var(--m-150) var(--ease); }
.src-opt b { font-weight: 600; font-size: var(--t-callout); }
.src-opt small { display: block; margin-top: 0.1rem; color: var(--label-2); font-size: var(--t-foot); }
.src-opt em { margin-left: 0.4rem; vertical-align: 1px; }
.src-opt:hover { box-shadow: inset 0 0 0 1px var(--sep-2); }
.src-opt.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-text); }
.src-radio { width: 18px; height: 18px; margin-top: 0.1rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--sep-3); transition: box-shadow var(--m-150) var(--ease); }
.src-opt.is-on .src-radio { box-shadow: inset 0 0 0 5.5px var(--accent-text); }
.src-factor { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.85rem; border-radius: var(--r-l); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); }
.src-factor > span { display: grid; flex: 1; min-width: 0; }
.src-factor b { font-weight: 600; font-size: var(--t-callout); }
.src-factor small { color: var(--label-2); font-size: var(--t-foot); }
.src-summary { display: grid; gap: 0.45rem; padding: 0.85rem 1rem; border-radius: var(--r-l); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--sep); font-size: var(--t-callout); }
.src-summary p { display: flex; gap: 0.5rem; align-items: flex-start; }
.src-summary .i { margin-top: 0.15rem; color: var(--accent-text); }

/* ---------- Narrow windows ---------- */
@media screen and (max-width: 1180px) {
  .src-scopes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .src-grid { grid-template-columns: minmax(0, 1fr); }
  .src-side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
}
@media screen and (max-width: 860px) {
  .src-pulse { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .src-scopes { grid-template-columns: minmax(0, 1fr); }
  .src-wz2 { grid-template-columns: minmax(0, 1fr); }
  .src-wz-preview { position: static; }
  .src-head { flex-direction: column; align-items: stretch; }
  .src-head-actions { justify-content: flex-start; }
}
@media screen and (max-width: 620px) {
  .src-mgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 0.75rem; }
  .src-bar { height: 72px; }
  .src-grid2, .src-opts-2 { grid-template-columns: minmax(0, 1fr); }
  .src-tile-xl { --s: 48px; }
  .src-find-input { font-size: var(--t-body); }
  .src-drop { grid-template-columns: auto minmax(0, 1fr); }
  .src-drop-acts { grid-column: 1 / -1; }
  .src-cf-row { grid-template-columns: minmax(0, 1fr) auto; }
  .src-cf-row > :nth-child(2) { grid-column: 1; }
  .src-wz-body { padding: 1.1rem 1rem 1.3rem; }
  .src-steps li { padding-right: 0.4rem; font-size: 0; gap: 0; }
  .src-steps li b { font-size: var(--t-cap); }
}
@media (prefers-reduced-motion: reduce) {
  .page-enter .src-stack, .page-enter .src-bar i, .src-month.is-just .src-bar i, dialog.src-drawer[open], .src-table tr.is-just { animation: none !important; }
}
html.reduce-motion .page-enter .src-stack, html.reduce-motion .page-enter .src-bar i, html.reduce-motion .src-month.is-just .src-bar i, html.reduce-motion dialog.src-drawer[open] { animation: none !important; }
