/* Change a part with AI (shared/aipart.js): the picture big, the mark painted over it, what it should be – the Sprite
   editor's and the Image editor's */
.spa { display: flex; flex-direction: column; gap: 10px; }
.spa-stage { display: flex; justify-content: center; align-items: center; padding: 12px; border-radius: 10px; background: var(--sunk); min-height: 120px; }
.spa-canvas { display: block; image-rendering: pixelated; cursor: none; touch-action: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.spa-canvas.rect { cursor: crosshair; }
.spa-canvas:focus-visible { outline: 2px solid var(--prog); outline-offset: 2px; }
.spa-tools { flex-wrap: wrap; gap: 8px; }
.spa-tools input[type=range] { width: 140px; }
.spa-words { width: 100%; box-sizing: border-box; resize: vertical; min-height: 4.6em; font: inherit; line-height: 1.4; }
.spa-ai { flex-wrap: wrap; gap: 8px; }
.spa-ai .btn.primary { margin-left: auto; }
.spa-status { margin-right: auto; }
.spa.busy .spa-canvas { opacity: .7; cursor: progress; }
.spa-ai select.inp { width: auto; flex: none; }
/* (the pieces it shares with the Sprite editor's other AI windows – there in sprite/sprite.css too) */
.spa .sai-hint { font-size: 12px; color: var(--muted, var(--text-2)); }
.spa .sai-row { display: flex; align-items: center; gap: 6px; }
.spa .sai-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.spa .sai-segb { border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; padding: 6px 10px; cursor: pointer; }
.spa .sai-segb + .sai-segb { border-left: 1px solid var(--line); }
.spa .sai-segb.on { background: var(--prog-soft, rgba(42,120,214,.12)); color: var(--prog-strong, var(--prog)); font-weight: 600; }
.spa .sai-segb[hidden], .spa .sai-seg[hidden] { display: none; }
.spa .sai-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -1px; z-index: 2; margin: 0 -2px; padding: 10px 2px 2px; background: var(--surface); border-top: 1px solid var(--line-soft, var(--line)); }
.spa .sai-cost { margin-right: auto; font-size: 12.5px; color: var(--text-2); }

/* three columns (October 2026): Change · Your changes · The result (shared/aipart.js window) */
.spa-modal .modal-body { max-height: calc(100vh - 120px); }
.spa-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.spa.spa-cols { display: grid; grid-template-columns: minmax(300px, 1fr) min(var(--spa-c2, 260px), max(220px, calc(100% - 300px))); gap: 0; align-items: start; }
.spa.spa-cols.spa-three { grid-template-columns: var(--spa-c1, minmax(0, 1fr)) var(--spa-c2, 260px) minmax(0, 1fr); }
.spa.spa-cols.spa-three.spa-c1-min { grid-template-columns: 44px var(--spa-c2, 260px) minmax(0, 1fr); }
.spa-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0 16px; }
.spa-col.spa-c1 { padding-left: 0; }
.spa-col + .spa-col { border-left: 1px solid var(--line-soft, var(--line)); }
.spa-col[hidden] { display: none; }
.spa-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text); min-height: 28px; }
.spa-head .material-symbols-outlined { font-size: 19px; color: var(--prog); }
.spa-gap { flex: 1; }
.spa-count { margin-left: 4px; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--prog-soft, rgba(42,120,214,.12)); color: var(--prog-strong, var(--prog)); font-size: 11.5px; text-align: center; }
.spa-count:empty { display: none; }
.spa-x { margin-left: auto; border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; }
.spa-x:hover:not(:disabled) { background: var(--hover, rgba(0,0,0,.05)); color: var(--text); }
.spa-x:disabled { opacity: .35; cursor: default; }
.spa-x .material-symbols-outlined { font-size: 18px; }
/* Change folded to a strip: its title on its side, a click opens it */
.spa-c1-min .spa-c1 > :not(.spa-head) { display: none; }
.spa-c1-min .spa-c1 { padding: 0; cursor: pointer; }
.spa-c1-min .spa-c1 .spa-head { writing-mode: vertical-rl; flex-direction: row; padding: 6px 0; justify-content: flex-start; }
.spa-c1-min .spa-c1:hover .spa-head { color: var(--prog-strong, var(--prog)); }
.spa-go { flex-wrap: wrap; gap: 8px; }
.spa-go select.inp { width: auto; flex: none; }
.spa-go .btn.primary { margin-left: auto; }
/* Your changes: the shared cards under a heading for each day (shared/aiwindow.css, .aiw-try) */
.spa-jobs { display: flex; flex-direction: column; gap: 4px; max-height: min(640px, calc(100vh - 220px)); overflow: auto; }
.spa-none { margin: 0; }
/* The result */
.spa-res { cursor: default; }
.spa-res-row { flex-wrap: wrap; gap: 8px; }
/* (what was written before: the shared prompt box's history – shared/aiwindow.css, .aiw-words) */
.spa-wrap > .spa-foot:has(.spa-status:empty) { display: none; }

/* each column on its own (November 2026 – as Generate with Tripo): the window's body doesn't scroll, each column does,
   its heading staying at the top and its buttons – Make, Keep – in a row of their own at the bottom, never scrolled away */
.spa-modal.modal-window > .modal-body:has(> .spa-wrap) { max-height: none; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 0; }
.spa-modal .spa-wrap { flex: 1 1 auto; min-height: 0; gap: 0; }
.spa-modal .spa.spa-cols { flex: 1 1 auto; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.spa-modal .spa-col { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.spa-modal .spa-col > .spa-head { position: sticky; top: 0; z-index: 3; background: var(--surface); padding-bottom: 4px; }
.spa-modal .spa-col > .spa-go, .spa-modal .spa-col > .spa-res-row { position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 10px 0 12px; background: var(--surface); border-top: 1px solid var(--line-soft, var(--line)); }
.spa-modal .spa-jobs { max-height: none; overflow: visible; padding-bottom: 12px; }
.spa-modal .spa-c1-min .spa-c1 { overflow: hidden; }
.spa-modal .spa-wrap > .spa-foot { position: static; margin: 0; padding: 8px 0; }
.spa-modal .spa-col > * { flex-shrink: 0; }

/* The result as Generate with Tripo's (November 2026): its own shade on its heading and edge – it closes on its own –,
   the picture and its settings in what scrolls, and one quiet line at the bottom: what it cost, and + Add */
.spa-modal .spa-col.spa-c3 { border-left: 2px solid var(--prog); padding-right: 16px; }
.spa-modal .spa-c3 > .spa-head { background: var(--prog-soft); color: var(--prog-strong, var(--prog)); margin: 0 -16px; padding: 10px 12px 10px 16px; }
.spa-modal .spa-c3 > .spa-head .spa-x { color: inherit; }
.spa-res-scroll { display: flex; flex-direction: column; gap: 10px; flex: 1 0 auto; padding-top: 4px; }
.spa-res-set { display: flex; flex-direction: column; gap: 8px; }
.spa-res-line { flex-wrap: wrap; gap: 8px; }
.spa-res-line[hidden] { display: none; }
.spa-res-k { min-width: 44px; }
.spa-join { margin-top: 6px; padding: 6px 8px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--warn); font-style: normal; }
.spa-modal .spa-col > .spa-res-row { flex-wrap: nowrap; gap: 10px; }
.spa-res-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.spa-keep { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.spa-keep .material-symbols-outlined { font-size: 18px; }
/* (a line whose choice is hidden – a sheet whose rows are directions goes only into the frame – isn't shown) */
.spa-res-line:not(:has(> :not(.spa-res-k):not([hidden]))) { display: none; }
/* (the headings at the top of their columns, in line; The result's shade reaching the window's edges, as Tripo's) */
.spa-modal.modal-window > .modal-body:has(> .spa-wrap) { padding-top: 0; padding-right: 0; }
.spa-modal .spa-col > .spa-head { padding-top: 12px; }
.spa-modal .spa-c3 > .spa-head { margin: 0 -16px; padding: 12px 12px 8px 16px; }
