/* steps/result.css: the Result, option 1 "Workspace" (the thread on the left, one pane on the right with Preview, Why
   map and Code) with option 3 "Why map" inside the pane (numbered pins on the built screen, the rest dims around the one
   you point at). Every class is rs- so no other step's styles reach it; the shell's tokens, .btn and .from are used. */
/* the full width, its edges on the top bar's (2026-11-06) */
main[data-step="result"] { padding: 12px 24px 16px; }
.view.rs { max-width: none; height: calc(100vh - 60px - 28px); height: calc(100dvh - 60px - 28px); display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; font-size: 12.5px; --ink-30: rgba(255,255,255,.3); --pop: #111; --ease-tab: cubic-bezier(.22,1,.36,1); }
.rs .grow { flex: 1; min-width: 0; }
.rs svg { display: block; }
.rs .btn { height: 32px; padding: 0 14px; white-space: nowrap; }
.rs .btn.main { background: var(--ink-100); box-shadow: none; }
.rs .btn.main:hover { background: rgba(255,255,255,.88); }
.rs .btn.rs-sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 6px; }
.rs .btn.rs-ico { width: 32px; padding: 0; justify-content: center; }
.rs .btn.rs-ghost { background: none; box-shadow: none; color: var(--ink-62); }
.rs .btn.rs-ghost:hover { background: var(--fill); color: var(--ink-100); }
.rs-pick { display: inline-flex; align-items: center; gap: 4px; color: var(--up); font-size: 11px; white-space: nowrap; }
.rs-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; color: var(--ink-62); background: var(--fill); white-space: nowrap; flex: none; }
.rs ::-webkit-scrollbar { width: 0; height: 0; }
.rs * { scrollbar-width: none; }

/* tooltips: one only, never a native title */
.rs [data-tip] { position: relative; }
.rs [data-tip]:hover::after, .rs [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: var(--pop); color: var(--ink-100); font: 400 11.5px/1 var(--font); padding: 6px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 0 0 1px var(--hair), 0 8px 24px rgba(0,0,0,.5); pointer-events: none; z-index: 50; }
.rs :focus-visible { outline: 1.5px solid rgba(90,170,255,.9); outline-offset: 1px; }

/* segmented control: one thumb slides between the options (ssych segmented control / View Switch) */
.rs-seg { position: relative; display: inline-flex; background: var(--fill); border-radius: 999px; padding: 2px; flex: none; }
.rs-seg button { position: relative; z-index: 1; height: 28px; min-width: 32px; padding: 0 9px; border-radius: 999px; border: 0; background: none; color: var(--ink-62); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; font-size: 12px; transition: color .15s; }
.rs-seg button:hover { color: var(--ink-100); }
.rs-seg button.on { color: #000; }
.rs-th { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: 0; border-radius: 999px; background: var(--ink-100); transition: transform .25s var(--ease-tab), width .25s var(--ease-tab); }
.rs-seg.soft button.on { color: var(--ink-100); }
.rs-seg.soft .rs-th { background: var(--fill-3); }

/* the thread */
.rs-thread { display: flex; flex-direction: column; min-height: 0; }
.rs-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 16px 0;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent); mask-image: linear-gradient(#000 calc(100% - 24px), transparent); }
.rs-me { align-self: flex-end; max-width: 300px; background: var(--fill-2); border-radius: 14px 14px 4px 14px; padding: 10px 12px; color: var(--ink-100); display: flex; flex-direction: column; gap: 8px; }
.rs-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--fill-2); color: var(--ink-85); font-size: 12px; max-width: 100%; }
.rs-chip > span:not(.label) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-chip .label, .rs-shot .label { font-size: 11px; white-space: nowrap; }
.rs-shot { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 10px; background: var(--fill-2); }
.rs-shot img { width: 100%; max-height: 140px; object-fit: cover; object-position: top left; border-radius: 6px; display: block; background: var(--fill); }
.rs-sn { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 12px; color: var(--ink-85); } .rs-sn .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-shot .label { padding: 0 4px 2px; }
.rs-read { margin: 0; padding: 0 0 0 14px; color: var(--ink-62); font-size: 11.5px; }
.rs-ai { display: flex; flex-direction: column; gap: 10px; }
.rs-who { display: flex; align-items: center; gap: 8px; color: var(--ink-100); font-weight: 500; }
.rs-who i { width: 22px; height: 22px; border-radius: 999px; background: var(--fill-2); display: grid; place-items: center; flex: none; }
.rs-ai > p { margin: 0; color: var(--ink-70); }
.rs-ai code, .rs-md code { font: 400 11px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-85); background: var(--fill-2); padding: 1px 4px; border-radius: 4px; }
.rs-ver { display: flex; gap: 10px; align-items: center; border: 0; background: var(--fill); border-radius: 10px; padding: 6px; text-align: left; cursor: pointer; color: var(--ink-85); transition: background .15s; }
.rs-ver:hover, .rs-ver.on { background: var(--fill-2); }
.rs-ver img, .rs-noimg { width: 96px; height: 60px; object-fit: cover; object-position: top left; border-radius: 6px; display: block; background: #fff; flex: none; }
.rs-noimg { background: var(--fill-2); }
.rs-ver b { display: block; font-weight: 500; color: var(--ink-100); }
.rs-ver .label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-sec { display: flex; flex-direction: column; }
.rs-sec h3 { margin: 6px 0 2px; font: 500 12.5px var(--font); color: var(--ink-100); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rs-sec h3 svg { color: var(--ink-45); transition: transform .2s var(--ease); }
.rs-sec h3 .label { font-weight: 400; }
.rs-sec.shut h3 svg { transform: rotate(-90deg); }
.rs-sec.shut > :not(h3) { display: none; }
.rs-it { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; color: var(--ink-85); font: inherit; width: 100%; transition: background .15s, opacity .2s, padding .2s var(--ease), margin .2s var(--ease); }
button.rs-it { cursor: pointer; }
.rs-it:last-child { border-bottom: 0; }
.rs-t { flex: 1; min-width: 0; color: var(--ink-85); }
.rs-t > span { display: block; color: var(--ink-45); font-size: 11.5px; }
.rs-t > .from { display: inline-flex; margin-top: 4px; color: var(--ink-85); }
.rs-cols { margin-top: 2px; }
.rs-k { width: 18px; color: var(--ink-45); font-size: 11.5px; padding-top: 1px; flex: none; display: flex; }
.rs-k svg { margin-top: 2px; }
.rs-foot { display: flex; gap: 6px; padding-top: 6px; }
/* asking for a change once it is built (2026-11-06): the requests in the thread, then the chat bar. The bar's corners
   are 22 = 16 (the 32px round send button) + 6 (its padding); the focus line sits on the bar's own edge */
.rs-fixes { display: flex; flex-direction: column; gap: 14px; }
.rs-fixes:empty { display: none; }
.rs-fxk { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-62); font-size: 11px; }
.rs-now { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink-85); }
.rs-now .ring { width: 12px; height: 12px; }
.rs-now .label { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-fxerr { margin: 0; color: #f0a0a0; }
.rs-ask { margin-top: 8px; display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 22px; background: var(--fill-2); transition: box-shadow .15s; }
.rs-ask:focus-within { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.rs-ask textarea { flex: 1; min-width: 0; min-height: 32px; max-height: 132px; padding: 6px 0; border: 0; background: none; outline: none; resize: none; color: var(--ink-100); font: inherit; font-size: 13px; line-height: 1.5; }
.rs-ask textarea::placeholder { color: var(--ink-45); }
.rs-send { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; padding: 0; border-radius: 999px; background: var(--ink-100); color: #000; cursor: pointer; transition: background-color .15s, opacity .15s; }
.rs-send:hover { background: rgba(255,255,255,.88); }
.rs-send:disabled { opacity: .35; cursor: default; }
.rs-askerr { margin: 6px 6px 0; color: #f0a0a0; font-size: 12px; }
.rs-askerr[hidden] { display: none; }
/* the priority map beside the pane (2026-11-06): the map step's board, lanes one under another and without their own
   fill, so its 6px cards sit 6px in from the panel's 12px corners */
.view.rs.mapon { grid-template-columns: 340px minmax(0, 1fr) 300px; }
.rs-side { background: var(--fill); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rs-side[hidden] { display: none; }
.rs-sh { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0 14px; }
.rs-sh b { font-weight: 500; color: var(--ink-100); font-size: 13px; }
.rs-snote { margin: 0 14px 10px; color: var(--ink-45); font-size: 11.5px; }
.rs-sb { flex: 1; min-height: 0; overflow: auto; padding: 0 6px 6px; }
.rs-side .mp-board { gap: 12px; }
.rs-side .mp-lane { background: none; padding: 0; border-radius: 6px; gap: 6px; }
.rs-side .mp-lane.mp-over { background: var(--fill-2); }
.rs-side .mp-lh { padding: 0 2px 0 8px; }
.rs-side .mp-addlane { border-radius: 6px; }
.rs-sf { display: flex; justify-content: flex-end; gap: 6px; padding: 8px; box-shadow: 0 -1px 0 var(--hair); }
.rs .mp-board [data-tip]:hover::after, .rs .mp-board [data-tip]:focus-visible::after { content: none; }
#rsMapBtn[aria-pressed="true"] { background: var(--fill-3); color: var(--ink-100); }
/* the rest of the decisions, read from DECISIONS.md */
.rs-md { color: var(--ink-70); font-size: 12px; padding-bottom: 6px; }
.rs-md h4 { margin: 12px 0 4px; font: 500 12px var(--font); color: var(--ink-100); }
.rs-md p { margin: 0 0 6px; }
.rs-md ul, .rs-md ol { margin: 0 0 6px; padding-left: 16px; } .rs-md li { margin: 0 0 3px; }
.rs-md b { font-weight: 500; color: var(--ink-85); }
.rs-tr { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.rs-tr b { font-weight: 400; color: var(--ink-85); } .rs-tr span { color: var(--ink-45); font-size: 11.5px; }

/* the pane: Preview, Why map, Code */
.rs-pane { scroll-margin-top: 72px; background: var(--fill); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rs-ph { display: flex; align-items: center; gap: 6px; padding: 8px; flex-wrap: wrap; row-gap: 8px; }
.rs-url { flex: 1; min-width: 120px; height: 32px; border-radius: 999px; background: var(--fill); display: flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; color: var(--ink-45); font-size: 11.5px; overflow: hidden; white-space: nowrap; }
.rs-url .grow { overflow: hidden; text-overflow: ellipsis; text-align: center; }
.rs-url button { width: 26px; height: 26px; border-radius: 999px; border: 0; background: none; color: var(--ink-62); display: grid; place-items: center; cursor: pointer; flex: none; }
.rs-url button:hover { background: var(--fill-2); color: var(--ink-100); }
.rs-dd { position: relative; }
.rs-menu { position: absolute; top: calc(100% + 6px); left: 0; width: 280px; background: var(--pop); border-radius: 12px; padding: 4px; box-shadow: 0 0 0 1px var(--hair), 0 16px 40px rgba(0,0,0,.6); z-index: 30; display: none; }
.rs-menu.on { display: block; }
.rs-menu button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; border-radius: 8px; padding: 8px; text-align: left; cursor: pointer; color: var(--ink-85); }
.rs-menu button:hover:not(:disabled) { background: var(--fill-2); }
.rs-menu button:disabled { cursor: default; color: var(--ink-45); }
.rs-mk { width: 22px; height: 22px; border-radius: 4px; background: var(--fill-2); display: grid; place-items: center; font-size: 11px; flex: none; }
.rs-menu button.on .rs-mk { background: var(--ink-100); color: #000; }
.rs-menu .rs-t span { font-size: 11px; }
.rs-pb { flex: 1; min-height: 0; position: relative; padding: 0 8px 8px; }

/* the built screen: an iframe drawn at its real width and scaled to fit, never cut off */
.rs-vp { position: relative; overflow: hidden; height: 100%; }
.rs-sc { position: absolute; left: 0; top: 0; transform-origin: 0 0; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--hair); transition: width .3s var(--ease), height .3s var(--ease), transform .3s var(--ease); }
.rs-vp.phone .rs-sc { border-radius: 22px; }
.rs-sc iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fff; transition: opacity .25s; }
.rs-sc .dark { opacity: 0; pointer-events: none; background: #000; }
.rs.isdark .rs-sc .dark { opacity: 1; pointer-events: auto; }
.rs.isdark .rs-sc .light { pointer-events: none; }

/* the Why map: numbered pins on the blocks, letters on what opens one step away; point at one and the rest dims */
.rs-pins { position: absolute; left: 0; top: 0; pointer-events: none; display: none; }
.rs.why .rs-pins { display: block; }
.rs-pin { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 999px; display: grid; place-items: center; font: 600 11.5px var(--font); pointer-events: auto; cursor: pointer; border: 0; padding: 0; transition: transform .15s var(--ease), opacity .2s; background: #0e0e0e; color: #fff; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,.25); z-index: 2; }
.rs-pin[hidden] { display: none; }
.rs-pin.away { width: 20px; height: 20px; margin: -10px 0 0 -10px; font-size: 11px; font-weight: 500; background: #fff; color: #0e0e0e; box-shadow: 0 0 0 1.5px #0e0e0e, 0 2px 6px rgba(0,0,0,.2); }
.rs-pin.on { transform: scale(1.2); }
.rs.dim .rs-pin:not(.on) { opacity: .35; }
.rs-hole { position: absolute; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.9); pointer-events: none; opacity: 0; z-index: 1; transition: opacity .2s, left .2s var(--ease), top .2s var(--ease), width .2s var(--ease), height .2s var(--ease); }
.rs.dim .rs-hole { opacity: 1; }
.rs-none { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; display: none; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--pop); color: var(--ink-85); box-shadow: 0 0 0 1px var(--hair), 0 8px 24px rgba(0,0,0,.5); white-space: nowrap; z-index: 3; }
.rs.why .rs-none:not([hidden]) { display: flex; }
/* the thread's rows become the map's notes: the key turns into the pin it matches */
.rs.why button.rs-it { margin: 0 -8px; padding: 8px; width: calc(100% + 16px); border-radius: 8px; border-bottom-color: transparent; }
.rs.why button.rs-it:hover, .rs.why button.rs-it.on { background: var(--fill-2); }
.rs.dim .rs-sec button.rs-it:not(.on) { opacity: .35; }
.rs.why .rs-it .rs-k { width: 22px; height: 22px; padding: 0; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--ink-100); color: #000; }
.rs.why .rs-it.away .rs-k { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-62); color: var(--ink-85); font-weight: 500; }
.rs.why .rs-it .rs-k svg { margin: 0; }
.rs.why .rs-it.miss .rs-k { background: none; box-shadow: inset 0 0 0 1.5px var(--ink-30); color: var(--ink-45); }
.rs.why .rs-it.miss .rs-k[data-tip]:hover::after { left: 0; transform: none; }

/* the code: the run's real files */
.rs-code { position: absolute; inset: 0 8px 8px; display: none; grid-template-columns: 220px minmax(0, 1fr); gap: 8px; }
.mode-code .rs-code { display: grid; } .mode-code .rs-vp { visibility: hidden; }
.rs-tree { background: var(--fill); border-radius: 8px; padding: 6px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.rs-dir { color: var(--ink-45); font-size: 11.5px; padding: 8px 8px 4px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.rs-tree button { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--ink-70); cursor: pointer; text-align: left; font-size: 12px; white-space: nowrap; flex: none; }
.rs-tree button.in { padding-left: 22px; }
.rs-tree button:hover { background: var(--fill); color: var(--ink-100); }
.rs-tree button.on { background: var(--fill-2); color: var(--ink-100); }
.rs-viewer { background: rgba(255,255,255,.02); border-radius: 8px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rs-vh { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--hair); color: var(--ink-62); font-size: 12px; }
.rs-vh .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs pre { margin: 0; flex: 1; overflow: auto; padding: 10px 0; font: 400 11.5px/1.65 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-70); counter-reset: ln; }
.rs pre .l { display: block; padding: 0 16px 0 0; white-space: pre; }
.rs pre .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 44px; padding-right: 14px; text-align: right; color: var(--ink-30); }
.rs pre .rs-wait::before { content: ''; }
.rs pre .c { color: var(--ink-45); } .rs pre .k { color: var(--ink-100); } .rs pre .s { color: var(--ink-85); }

@media (max-width: 1100px) { .view.rs { grid-template-columns: 300px minmax(0, 1fr); } .view.rs.mapon { grid-template-columns: 280px minmax(0, 1fr) 280px; } }
@media (max-width: 900px) {
  main[data-step="result"] { padding: 12px 16px 16px; }
  .view.rs { height: auto; grid-template-columns: minmax(0, 1fr); }
  .rs-pane { order: -1; height: 720px; }
  .rs-scroll { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .rs-url { order: 5; flex-basis: 100%; }
  .rs-code { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rs-tree { flex-direction: row; overflow-x: auto; } .rs-dir { display: none; } .rs-tree button.in { padding-left: 8px; }
  .rs-hide-s { display: none !important; }
  .rs-none { white-space: normal; width: calc(100% - 24px); border-radius: 12px; }
  .view.rs.mapon { grid-template-columns: minmax(0, 1fr); }
  .rs-side { position: fixed; top: 60px; right: 0; bottom: 0; width: min(360px, 100vw); z-index: 40; background: #0b0b0c; border-radius: 0; box-shadow: -1px 0 0 var(--hair), -24px 0 60px rgba(0,0,0,.5); }
}
@media (max-width: 600px) { #rsMode svg { display: none; } }
@media (prefers-reduced-motion: reduce) { .rs *, .rs *::before, .rs *::after { transition-duration: 0s !important; } }
