/* studio-frame.css: the CoS shared kit for the try-it pages (2026-10-03 night).
   Load AFTER theme.css. Tokens (colours, fonts, radii) come from theme.css; nothing here changes theme.css for others.
   Every class is prefixed sf- so it never collides with maker.css / stills2.css / join pages.
   See kit-demo.html for every component in use. */

/* ---------- page shell ---------- */
html.sf-root, html.sf-root body { width: 100%; height: 100%; overflow: hidden; }
html.sf-root body { height: 100vh; height: 100dvh; }
.sf [hidden] { display: none !important; }
.sf button { font-family: var(--ui); cursor: pointer; }
.sf button.btn { color: var(--text); background: transparent; }
.sf button.btn.primary { color: var(--on-accent); background: var(--accent); }
.sf .btn:focus-visible, .sf a:focus-visible, .sf button:focus-visible, .sf textarea:focus-visible, .sf input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sf a { color: inherit; text-decoration: none; }

/* mode: Basic hides hands-on things and vice versa (html[data-sf-mode]) */
html[data-sf-mode="basic"] [data-mode="handson"]:not(.sf-fix-open) { display: none !important; }
html[data-sf-mode="handson"] [data-mode="basic"] { display: none !important; }
/* while one item is opened with Fix it myself: only that item's groups show in the panel */
html[data-sf-fixing] .sf-panel-body > .sf-group:not(.sf-fix-open) { display: none !important; }

:root { --sf-top-h: 52px; --sf-panel-w: clamp(300px, 23vw, 340px); --sf-peek-h: 0px; --sf-gap: 12px; }

.sf-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sf-panel-w);
  grid-template-rows: var(--sf-top-h) minmax(0, 1fr);
  height: 100vh; height: 100dvh;
  background: var(--bg);
}
.sf-app > * { min-width: 0; min-height: 0; }

/* ---------- top bar: Home · door · stages · badge · theme ---------- */
.sf-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--bg-2); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 30; }
.sf-home { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 10px; border-radius: 9px; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; flex: none; }
.sf-home:hover { background: var(--hover); }
.sf-home svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sf-home[aria-current="page"] { background: var(--raised); border-color: var(--accent-line); }
.sf-door { font: 600 15px var(--cond); color: var(--muted); white-space: nowrap; flex: none; padding: 0 4px; }
.sf-door b { color: var(--text); font-weight: 600; }
.sf-stages { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sf-stages::-webkit-scrollbar { display: none; }
.sf-stg { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 9px; color: var(--text-2); white-space: nowrap; font-size: 14px; position: relative; flex: none; }
.sf-stg .sf-stg-n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
a.sf-stg:hover { background: var(--hover); color: var(--text); }
.sf-stg[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 600; }
.sf-stg[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -8px; height: 2px; border-radius: 2px; background: var(--accent); }
.sf-stg[aria-current="page"] .sf-stg-n { color: var(--accent-ink); }
.sf-stg.sf-coming { color: var(--faint); cursor: help; }
.sf-stg.sf-coming small { font-size: 11px; color: var(--faint); border: 1px dashed var(--faint); border-radius: 8px; padding: 0 6px; line-height: 16px; }
.sf-stg-sep { width: 8px; height: 1px; background: var(--line); flex: none; }
.sf-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px dashed var(--faint); color: var(--text-2); font-size: 12.5px; white-space: nowrap; flex: none; }
.sf-theme { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--text-2); display: grid; place-items: center; flex: none; }
.sf-theme svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.sf-theme:hover { background: var(--hover); color: var(--text); }

/* ---------- work area (the thing worked on) ---------- */
.sf-work { position: relative; padding: var(--sf-gap); display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.sf-well { position: relative; flex: 1; min-height: 0; background: var(--well); border-radius: var(--r-screen); overflow: hidden; display: grid; place-items: center; }
.sf-well > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sf-well .sf-tags { position: absolute; left: 12px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }

/* the dock: ONE strip floating over the bottom of the work area. data-state = show | auto | hide */
.sf-dock { position: absolute; left: calc(var(--sf-gap) + 10px); right: calc(var(--sf-gap) + 10px); bottom: calc(var(--sf-gap) + 8px); z-index: 12;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow-pop);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .22s ease, opacity .22s ease; }
.sf-dock[data-state="hide"] { display: none; }
.sf-dock[data-state="auto"]:not(.sf-up) { transform: translateY(calc(100% + var(--sf-gap) + 2px)); opacity: 0; pointer-events: none; }
.sf-dock-lip { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); width: 120px; height: 14px; border: 0; padding: 0; background: transparent; z-index: 11; display: none; }
.sf-dock-lip::before { content: ""; position: absolute; left: 30px; right: 30px; top: 5px; height: 4px; border-radius: 2px; background: var(--faint); }
.sf-work.sf-dock-auto-down .sf-dock-lip { display: block; }
@media (prefers-reduced-motion: reduce) { .sf-dock, .sf-panel { transition: none !important; } }

/* ---------- the right panel ---------- */
.sf-panel { position: relative; margin: var(--sf-gap) var(--sf-gap) var(--sf-gap) 0; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-panel); display: flex; flex-direction: column; overflow: hidden; z-index: 20; }
.sf-handle { display: none; }
.sf-panel-head { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: none; }
.sf-panel-head h1 { font: 600 20px/1.1 var(--cond); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-panel-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; overscroll-behavior: contain; }
.sf-panel-body::-webkit-scrollbar { width: 10px; }
.sf-panel-body::-webkit-scrollbar-track { background: var(--bg-2); }
.sf-panel-body::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 5px; border: 2px solid var(--bg-2); }
.sf-panel-body { scrollbar-color: var(--faint) var(--bg-2); }
.sf-panel-foot { flex: none; padding: 10px 14px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; background: var(--panel); }
.sf-panel-foot .btn.primary { flex: 1; height: 42px; font-size: 15px; }
.sf-panel-foot .sf-note { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* numbered groups: <section class="sf-group" data-title="Describe her"> → "1 Describe her" */
.sf-group { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.sf-group:last-child { border-bottom: 0; }
.sf-gh { display: flex; align-items: center; gap: 8px; font: 600 14px var(--ui); color: var(--text); margin-bottom: 8px; }
.sf-gh .sf-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 700 12.5px var(--ui); font-variant-numeric: tabular-nums; flex: none; }
.sf-gh .sf-gt { flex: 1; min-width: 0; }
.sf-gh .sf-gx { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.sf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-lab { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: block; }
.sf-field { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: var(--bg-2); color: var(--text); font: 14px/1.45 var(--ui); display: block; resize: vertical; }
.sf-field::placeholder { color: var(--faint); }
.sf-big { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* segmented switch (real buttons) */
.sf-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); flex: none; }
.sf-seg > button { height: 28px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 500 13px var(--ui); white-space: nowrap; }
.sf-seg > button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.sf-seg > button:hover { color: var(--text); }
.sf-seglab { font-size: 12.5px; color: var(--muted); }

/* Fix it myself bar (in the panel head) */
.sf-fixbar { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 10px; border-radius: 9px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 13px; }
.sf-fixbar b { font-weight: 600; }
.sf-fixbar .sf-grow { flex: 1; }

/* ---------- shelf ---------- */
.sf-shelf + .sf-shelf { margin-top: 8px; }
.sf-shelf-h { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); font: 600 13.5px var(--ui); padding: 3px 0; }
.sf-shelf-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--raised); color: var(--text); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.sf-shelf-car { color: var(--text-2); transition: transform .15s; display: inline-grid; place-items: center; width: 16px; height: 16px; }
.sf-shelf-car svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sf-shelf.sf-open .sf-shelf-car { transform: rotate(90deg); }
.sf-shelf-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sf-shelf:not(.sf-open) .sf-shelf-row { display: none; }
.sf-thumb { position: relative; width: 60px; height: 44px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #000; outline: 1px solid var(--line); outline-offset: 0; flex: none; }
.sf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.sf-thumb .sf-thumb-b { position: absolute; left: 2px; bottom: 2px; font: 600 10.5px var(--cond); color: #fff; background: rgba(0,0,0,.72); border-radius: 3px; padding: 0 4px; pointer-events: none; }
.sf-thumb:hover { outline: 2px solid var(--text-2); }
.sf-thumb.sf-pinned { outline: 2px solid var(--accent); outline-offset: 1px; }
.sf-thumb.sf-cur::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--accent); border-radius: 6px; pointer-events: none; }
.sf-shelf-empty { font-size: 12.5px; color: var(--faint); }
/* the preview: fixed overlay, never moves the layout; clamped inside the viewport */
.sf-pv { position: fixed; z-index: 300; width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow-pop); pointer-events: none; }
.sf-pv img { width: 100%; height: 176px; object-fit: contain; background: #000; border-radius: 7px; display: block; }
.sf-pv-cap { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.35; display: flex; gap: 6px; align-items: baseline; }
.sf-pv-cap b { color: var(--text); }
.sf-pv-hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.sf-pv.sf-pinned { pointer-events: auto; outline: 2px solid var(--accent); }
.sf-pv-x { position: absolute; right: 12px; top: 12px; width: 26px; height: 26px; border-radius: 13px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 15px; line-height: 1; display: none; }
.sf-pv.sf-pinned .sf-pv-x { display: grid; place-items: center; }

/* ---------- references: drop zone + pick a file ---------- */
.sf-drop { border: 1.5px dashed var(--faint); border-radius: 10px; padding: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; transition: background .12s; }
.sf-drop.sf-over { border-color: var(--accent); background: var(--accent-soft); }
.sf-drop .sf-drop-t { flex: 1; min-width: 120px; }
.sf-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sf-refs .sf-shelf { margin-top: 8px; }

/* ---------- words box (stand-in for the assistant) ---------- */
.sf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sf-words-top { justify-content: space-between; display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.sf-words-l { font: 600 13.5px var(--ui); color: var(--text); }
.sf-standin { font-size: 11.5px; color: var(--muted); border: 1px dashed var(--faint); border-radius: 9px; padding: 0 7px; white-space: nowrap; }
.sf-words-row { display: flex; gap: 6px; align-items: flex-end; }
.sf-words-row textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; }
.sf-words-row .btn { flex: none; height: 42px; }
.sf-reply { margin-top: 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 7px 10px; }
.sf-reply:empty { display: none; }
.sf-reply .sf-who { font-weight: 600; color: var(--accent-ink); flex: none; }
.sf-reply .sf-said { flex: 1; min-width: 140px; }

/* ---------- toast (top of the work area: never over the primary action or the sheet) ---------- */
.sf-toast { position: fixed; z-index: 400; top: calc(var(--sf-top-h) + 14px); left: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(520px, calc(100vw - 24px));
  background: var(--text); color: var(--bg); padding: 9px 10px 9px 14px; border-radius: 10px; box-shadow: var(--shadow-pop); font-size: 14px; }
.sf .sf-toast .btn, .sf-toast .btn { height: 30px; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); background: transparent; font-weight: 600; }
.sf .sf-toast .sf-toast-x, .sf-toast .sf-toast-x { border: 0; background: transparent; color: var(--bg); opacity: .7; font-size: 16px; width: 24px; }

/* ---------- greyed control says why ---------- */
.sf [aria-disabled="true"].btn, .sf button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.sf-tip { position: fixed; z-index: 500; max-width: 260px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow-pop); pointer-events: none; }

/* ---------- Making… ---------- */
.sf-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(127,127,127,.35); border-top-color: currentColor; animation: sfspin .8s linear infinite; flex: none; display: inline-block; }
@keyframes sfspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sf-spin { animation: none; } }
.sf-making-over { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 10px; color: #ecebe7; font-size: 16px; background: rgba(0,0,0,.55); border-radius: inherit; }
.sf-making-over .sf-spin { border-top-color: var(--accent); width: 20px; height: 20px; }

/* ---------- 390: the work area on top; the panel is a draggable bottom sheet ---------- */
@media (max-width: 760px) {
  :root { --sf-top-h: 70px; --sf-gap: 8px; }
  .sf-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--sf-top-h) minmax(0, 1fr); padding-bottom: var(--sf-peek-h); }
  .sf-top { flex-wrap: wrap; align-content: center; gap: 4px 6px; padding: 4px 8px; }
  .sf-home { height: 34px; padding: 0 9px; }
  .sf-home .sf-home-t { display: none; }
  .sf-door { font-size: 14px; }
  .sf-stages { order: 2; }
  .sf-stg { height: 34px; padding: 0 9px; font-size: 13.5px; }
  .sf-stg[aria-current="page"]::after { bottom: -3px; }
  .sf-badge { order: 4; flex-basis: 100%; justify-content: center; height: 20px; border: 0; padding: 0; font-size: 11.5px; color: var(--muted); }
  .sf-theme { order: 3; width: 34px; height: 34px; }
  .sf-panel { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; height: var(--sf-sheet-h, var(--sf-peek-h)); max-height: calc(100dvh - var(--sf-top-h) - 6px);
    border-radius: 16px 16px 0 0; border-bottom: 0; box-shadow: 0 -10px 30px rgba(0,0,0,.35); z-index: 60; transition: height .22s ease; }
  .sf-panel.sf-dragging { transition: none; }
  .sf-handle { display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; height: 24px; width: 100%; border: 0; background: transparent; color: var(--muted); font-size: 12px; touch-action: none; padding: 0; }
  .sf-handle::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--faint); }
  .sf-panel-head { padding: 2px 12px 8px; touch-action: none; }
  .sf-panel-head h1 { font-size: 18px; }
  .sf-panel-foot { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .sf-dock { left: calc(var(--sf-gap) + 4px); right: calc(var(--sf-gap) + 4px); }
  .sf-pv { width: 220px; }
  .sf-pv img { height: 150px; }
}

/* ======================= v2 components (brief v2 §§ B–F) ======================= */
.sf-work { grid-column: 1; grid-row: 2; }
.sf-panel, .sf-assist { grid-column: 2; grid-row: 2; }
.sf-grow { flex: 1; }
.sf-back { flex: none; }
.sf-assist-btn { flex: none; }
.sf-assist-btn[aria-pressed="true"] { background: var(--accent-soft); }

/* the Assistant pane: same place and size as the right panel */
.sf-assist { position: relative; margin: var(--sf-gap) var(--sf-gap) var(--sf-gap) 0; background: var(--panel); border: 1px solid var(--accent-line); border-radius: var(--r-panel);
  display: flex; flex-direction: column; overflow: hidden; z-index: 21; min-height: 0; }
.sf-as-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px 6px; flex-wrap: wrap; }
.sf-as-head h2 { font: 600 20px/1.1 var(--cond); color: var(--accent-ink); }
.sf-as-intro { margin: 0 14px 8px; font: 600 15px/1.35 var(--ui); color: var(--text); }
.sf-as-rule .sf-standin { display: inline-block; margin-bottom: 4px; }
.sf-as-rule { margin: 0 14px 8px; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.sf-as-tools { padding: 0 14px 8px; gap: 6px; }
.sf-as-tools .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.sf-as-explain { margin: 0 14px 8px; font-size: 13.5px; line-height: 1.4; color: var(--text); background: var(--bg-2); border-radius: 9px; padding: 8px 10px; }
.sf-as-explain:empty { display: none; }
.sf-as-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); scrollbar-gutter: stable; }
.sf-as-log::-webkit-scrollbar { width: 10px; }
.sf-as-log::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 5px; border: 2px solid var(--panel); }
.sf-msg { max-width: 92%; font-size: 14px; line-height: 1.42; }
.sf-msg.sf-me { align-self: flex-end; background: var(--raised); border-radius: 12px 12px 4px 12px; padding: 7px 11px; }
.sf-msg.sf-it { align-self: flex-start; color: var(--text); }
.sf-act { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); font-size: 13.5px; }
.sf-act-l { flex: 1; }
.sf-act-l b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sf-act-done { color: var(--done); font-weight: 600; font-size: 13px; padding: 0 8px; }
.sf-as-sugg { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 14px 4px; border-top: 1px solid var(--line-soft); align-items: center; }
.sf-as-sugg .sf-lab { margin: 0 2px 0 0; }
.sf-sugg { height: auto; min-height: 26px; padding: 3px 10px; white-space: normal; text-align: left; line-height: 1.3; }
.sf-sugg:hover { background: var(--hover); color: var(--text); }
.sf-as-in { padding: 6px 14px 12px; }
/* "What does this do?": the pane shrinks to its top; the controls come back underneath so they can be clicked */
.sf-assist.sf-as-compact { align-self: start; }
.sf-assist.sf-as-compact .sf-as-log, .sf-assist.sf-as-compact .sf-as-sugg, .sf-assist.sf-as-compact .sf-as-in { display: none; }
html.sf-explaining [data-explain] { cursor: help; outline: 1px dashed var(--accent-line); outline-offset: 2px; }
html.sf-explaining .sf-assist [data-explain] { outline: 0; cursor: pointer; }

/* filled by the Studio */
.sf-filled { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 6px; border-radius: 9px; background: var(--run-soft); color: var(--run); font-size: 11px; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.sf-fld + .sf-fld { margin-top: 10px; }

/* inputs line + receipt */
.sf-uses { font-size: 13.5px; line-height: 1.4; color: var(--text); padding: 7px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.sf-uses-l { color: var(--muted); }
.sf-uses-v { font-weight: 600; }
.sf-receipt { margin-top: 6px; font-size: 13px; }
.sf-receipt summary { cursor: pointer; color: var(--text-2); }
.sf-receipt summary:hover { color: var(--text); }
.sf-receipt-b { margin-top: 6px; font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; background: var(--bg-2); border-radius: 8px; padding: 8px 10px; color: var(--text-2); max-height: 180px; overflow: auto; }

/* references: thumb + Use directly */
.sf-titem { display: flex; flex-direction: column; gap: 3px; align-items: stretch; width: 72px; }
.sf-titem .sf-thumb { width: 72px; height: 50px; }
.sf-use { height: 22px; padding: 0 2px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 10.5px var(--ui); white-space: nowrap; }
.sf-use[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); font-weight: 600; }

/* engines */
.sf-englist { display: grid; gap: 5px; }
.sf-eng { display: grid; grid-template-columns: 16px 1fr; gap: 3px 8px; align-items: center; padding: 7px 9px; border: 1px solid var(--line-soft); border-radius: 9px; background: transparent; color: var(--text); text-align: left; font: 500 13.5px var(--ui); width: 100%; }
.sf-eng[aria-checked="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.sf-eng-r { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--faint); }
.sf-eng[aria-checked="true"] .sf-eng-r { border: 4px solid var(--accent); }
.sf-eng-caps { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.sf-eng-caps .chip { height: 20px; font-size: 11.5px; padding: 0 7px; }
.sf-eng-said { margin-top: 6px; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.sf-eng-said:empty { display: none; }
.sf-slot { height: 30px; }
.sf-slot[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
input[type=range].sf-range { width: 100%; accent-color: var(--accent); }
select.sf-field { height: 34px; padding: 0 8px; }

@media (max-width: 760px) {
  .sf-assist { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; height: 58dvh; border-radius: 16px 16px 0 0; border-bottom: 0; z-index: 61; box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
  .sf-assist.sf-as-compact { top: var(--sf-top-h); bottom: auto; height: auto; max-height: 34dvh; border-radius: 0 0 14px 14px; border: 1px solid var(--accent-line); }
  .sf-back { order: 1; }
  .sf-assist-btn { order: 3; height: 34px; }
  .sf-assist-btn span { display: none; }
}

/* additive (20:25): "This will use" that opens before Make (SF.inputsLine o.preview) */
.sf-uses-x { padding: 0; }
.sf-uses-x > summary { padding: 7px 10px; cursor: pointer; list-style: none; }
.sf-uses-x > summary::-webkit-details-marker { display: none; }
.sf-uses-x > summary::before { content: "▸ "; color: var(--muted); }
.sf-uses-x[open] > summary::before { content: "▾ "; }
.sf-uses-more { color: var(--accent-ink); font-weight: 500; font-size: 12.5px; }
.sf-uses-x .sf-uses-b { margin: 0 8px 8px; }

/* additive (21:25): the small preview for pick-to-view shelves (pin:false + preview:"work"): keeps the picture visible */
.sf-pv.sf-pv-small { width: 168px; padding: 6px; }
.sf-pv.sf-pv-small img { height: 96px; }
.sf-pv.sf-pv-small .sf-pv-cap { font-size: 12px; }
