/* studio/studio.css: Listing Studio's look inside the dashboard (Tasks 20 to 23).
   The dashboard loads this file on every view, so every rule starts at #section-studio, the studio's container, and
   none can reach the rest of the page; the animation is st-spin, a name the dashboard doesn't use. It follows the
   live dashboard: shared.css's tokens (--black, --off, --border, --accent, --acc-lt) and buttons (.btn, .btn-sm,
   .btn-md, .btn-solid, .btn-blue, .btn-ghost), white cards with a 1px border on the --off page, Inter (the body's),
   and #6B6B66 for secondary text (4.5:1 or better on white and on --off). The page fills the space beside the
   sidebar (.dash-wrap, up to 1600px); at 600px and below it is laid out for a phone. */

#section-studio { --st-quiet: #6B6B66; --st-error: #B91C1C; color: var(--black); }
#section-studio [hidden] { display: none !important; }   /* hidden wins over every display below */
#section-studio .st-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#section-studio .btn[aria-disabled="true"] { opacity: .55; cursor: default; box-shadow: none; }

/* ── Headings ──────────────────────────────────────────────────────────────── */
#section-studio .st-title { font-size: 24px; font-weight: 600; letter-spacing: -.6px; line-height: 1.2; color: var(--black); overflow-wrap: anywhere; }
#section-studio .st-title:focus { outline: none; }   /* focused only when it replaces what had focus */
#section-studio .st-sub { font-size: 14px; line-height: 1.5; color: var(--st-quiet); margin-top: 4px; }
#section-studio .st-loading { font-size: 13.5px; color: var(--st-quiet); }
#section-studio .st-note { font-size: 13.5px; line-height: 1.55; color: var(--st-quiet); background: white; border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; }

/* ── The home ──────────────────────────────────────────────────────────────── */
#section-studio .st-home-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 22px; }
#section-studio .st-home-intro { min-width: 0; }
#section-studio .st-new { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 380px; }
#section-studio .st-limit { font-size: 12.5px; line-height: 1.45; color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 9px; padding: 8px 12px; }
#section-studio .st-closed { font-size: 13px; line-height: 1.45; color: var(--st-quiet); background: white; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; }

#section-studio .st-tabs-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
#section-studio .st-tabs { display: flex; gap: 4px; align-self: flex-end; }
#section-studio .st-tab { display: inline-flex; align-items: center; gap: 7px; margin-bottom: -1px; padding: 10px 14px; border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--st-quiet); cursor: pointer; transition: color .12s, border-color .12s; }
#section-studio .st-tab:hover { color: var(--black); }
#section-studio .st-tab[aria-selected="true"] { color: var(--black); border-bottom-color: var(--black); }
#section-studio .st-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px 8px 0 0; }
#section-studio .st-count { min-width: 22px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 100px; background: var(--off); font-size: 12px; font-weight: 600; line-height: 1.5; color: var(--st-quiet); text-align: center; }
#section-studio .st-tab[aria-selected="true"] .st-count { background: white; color: var(--black); }
/* A refresh that failed: a quiet line beside the tabs, with Try again */
#section-studio .st-stale { padding: 6px 0; font-size: 12.5px; line-height: 1.45; color: var(--st-quiet); }
#section-studio .st-stale-retry { margin-left: 4px; padding: 2px 4px; border: none; border-radius: 6px; background: none; font-family: inherit; font-size: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
#section-studio .st-stale-retry:hover { text-decoration: underline; }
#section-studio .st-stale-retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-stale-retry[aria-disabled="true"] { opacity: .55; cursor: default; text-decoration: none; }
#section-studio .st-panel:focus { outline: none; }
#section-studio .st-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 16px; }

#section-studio .st-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
#section-studio .st-card { min-width: 0; }
#section-studio .st-card-link { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: white; border: 1px solid var(--border); border-radius: 16px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
#section-studio .st-card-link:hover { border-color: #d4d4d0; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
#section-studio .st-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .st-card-media { position: relative; display: block; padding-top: 66.6667%; background: var(--off); border-bottom: 1px solid var(--border); }   /* 3:2, as portals show photos */
#section-studio .st-card-img, #section-studio .st-card-none { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
#section-studio .st-card-img { display: block; object-fit: cover; }
#section-studio .st-card-none { display: flex; align-items: center; justify-content: center; color: var(--light); }
#section-studio .st-card-none svg { width: 30px; height: 30px; }
#section-studio .st-card-body { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 14px 16px 16px; }
#section-studio .st-card-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--black); overflow-wrap: anywhere; }
#section-studio .st-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
#section-studio .st-card-count { font-size: 12.5px; color: var(--st-quiet); }

/* A listing's status: every pair 4.5:1 or better */
#section-studio .st-status { display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid transparent; border-radius: 100px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; line-height: 1.35; white-space: nowrap; }
#section-studio .st-status-draft { background: var(--off); border-color: var(--border); color: var(--st-quiet); }
#section-studio .st-status-processing { background: #DBEAFE; color: #1D4ED8; }
#section-studio .st-status-ready { background: #DCFCE7; color: #166534; }
#section-studio .st-status-failed { background: #FEE2E2; color: #B91C1C; }

#section-studio .st-empty { padding: 44px 24px; background: white; border: 1px dashed #D9D9D5; border-radius: 16px; text-align: center; }
#section-studio .st-empty-title { font-size: 15px; font-weight: 600; color: var(--black); }
#section-studio .st-empty-text { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--st-quiet); }

/* ── The New listing dialog ────────────────────────────────────────────────── */
#section-studio .st-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; background: rgba(0,0,0,0.38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }   /* the dashboard's own modal layer */
#section-studio .st-modal-box { width: 100%; max-width: 520px; max-height: calc(100vh - 48px); margin: auto; overflow-y: auto; padding: 26px 28px 24px; background: white; border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,0.15); }
#section-studio .st-modal-box:focus { outline: none; }   /* focused by a click on its own text, so keys stay with it */
#section-studio .st-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
#section-studio .st-modal-title { font-size: 20px; font-weight: 700; letter-spacing: -.4px; color: var(--black); }
#section-studio .st-modal-x { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; margin: -5px -8px 0 0; padding: 0; border: none; border-radius: 9px; background: none; color: var(--st-quiet); cursor: pointer; }
#section-studio .st-modal-x:hover { background: var(--off); color: var(--black); }
#section-studio .st-modal-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-modal-x svg { width: 18px; height: 18px; }

#section-studio .st-form { display: flex; flex-direction: column; gap: 18px; }
#section-studio .st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: none; }
#section-studio .st-label { padding: 0; font-size: 12.5px; font-weight: 500; color: var(--st-quiet); }
#section-studio .st-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: white; font-family: inherit; font-size: 16px; color: var(--black); outline: none; transition: border-color .15s, box-shadow .15s; }   /* 16px: phones don't zoom into it */
#section-studio .st-input:hover { border-color: #D9D9D5; }
#section-studio .st-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#section-studio .st-input[aria-invalid="true"] { border-color: #FCA5A5; }
#section-studio .st-hint { font-size: 12px; color: var(--st-quiet); }
#section-studio .st-field-msg { font-size: 12.5px; line-height: 1.45; color: var(--st-error); }
#section-studio .st-field-msg:empty { display: none; }

#section-studio .st-types { gap: 8px; }
#section-studio .st-types .st-label { margin-bottom: 0; }
#section-studio .st-type { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: white; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
#section-studio .st-type:hover { border-color: #c4c4bf; }
#section-studio .st-type:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#section-studio .st-types[aria-invalid="true"] .st-type { border-color: #FCA5A5; }
#section-studio .st-type input { flex-shrink: 0; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
#section-studio .st-type-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#section-studio .st-type-name { font-size: 14px; font-weight: 600; color: var(--black); }
#section-studio .st-type input:checked + .st-type-text .st-type-name { color: var(--accent); }
#section-studio .st-type-sub { font-size: 12.5px; line-height: 1.45; color: var(--st-quiet); }
#section-studio .st-type-price { margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--black); }

#section-studio .st-form-msg { padding: 10px 14px; border: 1px solid #FECACA; border-radius: 9px; background: #FEF2F2; font-size: 13px; line-height: 1.45; color: var(--st-error); }
#section-studio .st-form-msg:empty { display: none; }
#section-studio .st-form-limit { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }
#section-studio .st-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }

/* ── A listing's page ──────────────────────────────────────────────────────── */
#section-studio .st-listing { display: flex; flex-direction: column; gap: 16px; }
#section-studio .st-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: -2px 0 -4px -8px; padding: 6px 12px 6px 6px; border: none; border-radius: 9px; background: none; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--st-quiet); cursor: pointer; transition: background-color .12s, color .12s; }
#section-studio .st-back:hover { background: white; color: var(--black); }
#section-studio .st-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-back svg { width: 16px; height: 16px; }
#section-studio .st-listing-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
#section-studio .st-listing-head .st-title { min-width: 0; }
/* R140: the pencil beside the heading, and, in the heading's place while the name is changed, an address field with Save
   and Cancel. The pencil is a 36px target; the field takes the room it can and the buttons wrap under it. */
#section-studio .st-rename-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; margin: -4px 0; padding: 0; border: none; border-radius: 9px; background: none; color: var(--st-quiet); cursor: pointer; transition: background-color .12s, color .12s; }
#section-studio .st-rename-btn:hover { background: white; color: var(--black); }
#section-studio .st-rename-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-rename-btn svg { width: 17px; height: 17px; }
#section-studio .st-rename { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 580px; }
#section-studio .st-rename-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#section-studio .st-rename-row .st-input { flex: 1 1 260px; min-width: 0; }
#section-studio .st-rename-row .st-input[readonly] { background: var(--off); }
#section-studio .st-rename-acts { display: flex; gap: 8px; }
#section-studio .st-notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #FDE68A; border-radius: 12px; background: #FFFBEB; font-size: 13.5px; line-height: 1.5; color: #92400E; }
#section-studio .st-notice-wait { border-color: #BFDBFE; background: var(--acc-lt); color: #1E40AF; }
#section-studio .st-notice-wait::before { content: ''; flex-shrink: 0; width: 14px; height: 14px; border: 2px solid #BFDBFE; border-top-color: var(--accent); border-radius: 50%; animation: st-spin .8s linear infinite; }
#section-studio .st-listing-msg { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 16px; background: white; font-size: 13.5px; line-height: 1.5; color: var(--black); }
#section-studio .st-problem { flex: 1 1 240px; min-width: 0; }
#section-studio .st-problem.st-loading { color: var(--st-quiet); }
#section-studio .st-parts { display: flex; flex-direction: column; gap: 16px; }
#section-studio .st-part { min-width: 0; }
#section-studio .st-part:empty { display: none; }

@keyframes st-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-notice-wait::before { animation: none; }
  #section-studio .st-card-link, #section-studio .st-tab, #section-studio .st-type, #section-studio .st-rename-btn { transition: none; }
}

/* Windows' high-contrast themes drop box shadows: focus and the chosen tab get outlines and borders instead */
@media (forced-colors: active) {
  #section-studio .st-input:focus, #section-studio .st-type:focus-within { outline: 2px solid Highlight; outline-offset: 1px; }
  #section-studio .st-tab[aria-selected="true"] { border-bottom-color: Highlight; }
}

/* Dropdowns look like the dashboard's own (the Listing copy tab's): no native chrome, a quiet chevron (R136). The
   select.<class> selectors outrank .st-input's and .st-rv-room's background, wherever those rules sit. */
#section-studio select,
#section-studio select.st-input,
#section-studio select.st-rv-room {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 11px center / 14px 14px;
}
#section-studio select.st-rv-room { padding-right: 30px; background-position: right 9px center; background-size: 13px 13px; }
@media (forced-colors: active) {
  #section-studio select, #section-studio select.st-input, #section-studio select.st-rv-room { -webkit-appearance: auto; -moz-appearance: auto; appearance: auto; background-image: none; }
}

/* ── Phones ────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #section-studio .st-title { font-size: 21px; letter-spacing: -.4px; }
  #section-studio .st-home-head { flex-direction: column; align-items: stretch; margin-bottom: 16px; }
  #section-studio .st-new { align-items: stretch; max-width: none; }
  #section-studio .st-new-btn { width: 100%; }
  /* The divider is under the tabs themselves, so the refresh line wraps below it */
  #section-studio .st-tabs-row { border-bottom: none; }
  #section-studio .st-tabs { flex: 1 1 100%; border-bottom: 1px solid var(--border); }
  #section-studio .st-tab { flex: 1 1 0; justify-content: center; }
  #section-studio .st-stale { padding-top: 0; }
  #section-studio .st-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  /* A card is a row: the lead photo at the side, the name and status beside it */
  #section-studio .st-card-link { flex-direction: row; border-radius: 14px; }
  #section-studio .st-card-media { flex: 0 0 108px; min-height: 80px; padding-top: 0; border-bottom: none; border-right: 1px solid var(--border); }
  #section-studio .st-card-body { justify-content: center; gap: 7px; padding: 12px 14px; }
  #section-studio .st-modal { padding: 16px; }
  #section-studio .st-modal-box { max-height: calc(100vh - 32px); padding: 22px 18px 18px; border-radius: 18px; }
  #section-studio .st-type { padding: 12px 14px; }
  /* One order for the eye, the DOM and focus: Cancel, then Create, nearest the thumb (M6) */
  #section-studio .st-actions { flex-direction: column; }
  #section-studio .st-actions .btn { width: 100%; padding-top: 12px; padding-bottom: 12px; }
  #section-studio .st-listing-msg { padding: 16px 18px; }
  /* The rename field: the address across the page, then Save and Cancel sharing the next line */
  #section-studio .st-rename { max-width: none; }
  #section-studio .st-rename-row .st-input { flex: 1 1 100%; }
  #section-studio .st-rename-acts { width: 100%; }
  #section-studio .st-rename-acts .btn { flex: 1 1 0; padding-top: 12px; padding-bottom: 12px; }
}

/* The narrowest phones (320px): a narrower lead photo, and a status that may wrap rather than run out of its card (M7) */
@media (max-width: 380px) {
  #section-studio .st-card-media { flex-basis: 84px; }
  #section-studio .st-status { white-space: normal; }
}

/* ── Task 21: workspace (studio/workspace.js) ────────────────────────────────── */
/* Task 21's rules go here, under this line. */
/* The drop zones and the progress are white cards; each file is a tile in a grid; the Start bar stays in view at the
   bottom of the screen (above the phone bar at 900px and below). Secondary text is --st-quiet, errors --st-error. */
#section-studio .ws { display: flex; flex-direction: column; gap: 16px; }
#section-studio .ws-zone, #section-studio .ws-progress { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px 22px 22px; background: white; border: 1px solid var(--border); border-radius: 16px; }
#section-studio .ws-zone-head { display: flex; flex-direction: column; gap: 4px; }
#section-studio .ws-title { font-size: 16px; font-weight: 600; letter-spacing: -.2px; line-height: 1.3; color: var(--black); }
#section-studio .ws-sub { font-size: 13px; line-height: 1.5; color: var(--st-quiet); }
#section-studio .ws-drop { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 18px 20px; border: 1.5px dashed #D9D9D5; border-radius: 12px; background: var(--off); transition: border-color .12s, background-color .12s; }
#section-studio .ws-drop.ws-over { border-color: var(--accent); background: var(--acc-lt); }
#section-studio .ws-drop-icon { display: inline-flex; flex-shrink: 0; color: var(--st-quiet); }
#section-studio .ws-drop-icon svg { width: 22px; height: 22px; }
#section-studio .ws-drop-text { flex: 1 1 220px; min-width: 0; font-size: 13.5px; line-height: 1.5; color: var(--st-quiet); }
#section-studio .ws-pick { flex-shrink: 0; background: white; }
#section-studio .ws-pick:focus-visible, #section-studio .ws-start-btn:focus-visible, #section-studio .ws-buy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .ws-shut { padding: 9px 12px; border: 1px solid #FDE68A; border-radius: 9px; background: #FFFBEB; font-size: 13px; line-height: 1.45; color: #92400E; }
#section-studio .ws-slot:empty { display: none; }

/* The files the latest drop refused, each with its reason */
#section-studio .ws-refused { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; border: 1px solid #FECACA; border-radius: 10px; background: #FEF2F2; font-size: 13px; line-height: 1.5; color: var(--st-error); }
#section-studio .ws-refused-head { font-weight: 600; }
#section-studio .ws-refused-list { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; }
#section-studio .ws-refused-name { font-weight: 600; overflow-wrap: anywhere; }

/* Tiles: a 3:2 picture, then the room (or what is happening), the name, flags, messages and actions */
#section-studio .ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
#section-studio .ws-grid:empty { display: none; }
#section-studio .ws-tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: white; border: 1px solid var(--border); border-radius: 12px; }
#section-studio .ws-tile-failed { border-color: #FECACA; }
#section-studio .ws-media { position: relative; padding-top: 66.6667%; background: var(--off); border-bottom: 1px solid var(--border); }
#section-studio .ws-img, #section-studio .ws-none { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
#section-studio .ws-img { display: block; object-fit: cover; }
#section-studio .ws-tile-doc .ws-img { object-fit: contain; background: white; }   /* a floorplan is shown whole */
#section-studio .ws-none { display: flex; align-items: center; justify-content: center; color: var(--light); }
#section-studio .ws-none svg { width: 26px; height: 26px; }
#section-studio .ws-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 5px; min-width: 0; padding: 10px 12px 12px; }
#section-studio .ws-top { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--black); overflow-wrap: anywhere; }
#section-studio .ws-top:empty { display: none; }
#section-studio .ws-top-wait { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--st-quiet); }
#section-studio .ws-top-wait::before { content: ''; flex-shrink: 0; width: 10px; height: 10px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: st-spin .8s linear infinite; }
#section-studio .ws-top-failed { color: var(--st-error); }
#section-studio .ws-name { overflow: hidden; font-size: 12px; line-height: 1.4; color: var(--st-quiet); white-space: nowrap; text-overflow: ellipsis; }
#section-studio .ws-reason, #section-studio .ws-msg { font-size: 12.5px; line-height: 1.45; color: var(--st-error); overflow-wrap: anywhere; }
#section-studio .ws-flags { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; }
#section-studio .ws-flag { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 12.5px; line-height: 1.4; color: #92400E; }
#section-studio .ws-flag-text { min-width: 0; overflow-wrap: anywhere; }
#section-studio .ws-note { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#section-studio .ws-acts { display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: auto; padding-top: 2px; }
#section-studio .ws-act { padding: 4px 0; border: none; border-radius: 4px; background: none; font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--accent); text-align: left; cursor: pointer; }
#section-studio .ws-act:hover { text-decoration: underline; }
#section-studio .ws-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .ws-act-remove, #section-studio .ws-act-cancel { color: var(--st-quiet); }
#section-studio .ws-act[aria-disabled="true"] { opacity: .55; cursor: default; text-decoration: none; }

/* Upload progress: a bar that fills, or runs while the size of what's sent isn't known */
#section-studio .ws-bar { position: relative; height: 4px; overflow: hidden; border-radius: 100px; background: var(--border); }
#section-studio .ws-bar-big { height: 6px; }
#section-studio .ws-bar-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s; }
#section-studio .ws-bar-run .ws-bar-fill { width: 40%; animation: st-ws-run 1.1s ease-in-out infinite; }

/* The buy prompt: beside Start, Add photos, a card, or another part's control (rsStudio.buyPrompt) */
#section-studio .ws-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border: 1px solid #BFDBFE; border-radius: 10px; background: var(--acc-lt); }
#section-studio .ws-buy-prompt { margin-top: 8px; }
#section-studio .ws-buy-text { flex: 1 1 200px; min-width: 0; font-size: 13px; line-height: 1.5; color: #1E40AF; }
#section-studio .ws-buy-btn { flex-shrink: 0; }

/* After Start */
#section-studio .ws-progress { gap: 10px; }
#section-studio .ws-progress:focus { outline: none; }   /* focused only when it takes over from Start */
#section-studio .ws-progress-head { font-size: 16px; font-weight: 600; letter-spacing: -.2px; color: var(--black); }
#section-studio .ws-progress-sub { font-size: 13.5px; line-height: 1.5; color: var(--st-quiet); }

/* Start, kept in view while the grid scrolls */
#section-studio .ws-start { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; padding: 14px 16px 14px 20px; background: white; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,0.08); }
#section-studio .ws-start-note { flex: 1 1 260px; min-width: 0; font-size: 13.5px; line-height: 1.5; color: var(--st-quiet); }
#section-studio .ws-start-btn { flex-shrink: 0; max-width: 100%; text-align: center; }

@keyframes st-ws-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
  #section-studio .ws-top-wait::before { animation: none; }
  #section-studio .ws-bar-run .ws-bar-fill { width: 100%; opacity: .45; animation: none; }
  #section-studio .ws-bar-fill, #section-studio .ws-drop { transition: none; }
}

@media (forced-colors: active) {
  #section-studio .ws-bar-fill { background: Highlight; }
  #section-studio .ws-drop.ws-over { outline: 2px solid Highlight; }
}

/* The phone bar (900px and below) is fixed at the bottom: Start sits above it */
@media (max-width: 900px) {
  #section-studio .ws-start { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 600px) {
  #section-studio .ws-zone, #section-studio .ws-progress { padding: 16px; }
  #section-studio .ws-drop { padding: 14px; }
  #section-studio .ws-pick { width: 100%; }
  #section-studio .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #section-studio .ws-start { flex-direction: column; align-items: stretch; padding: 12px; }
  #section-studio .ws-start-note { flex-basis: auto; }
  #section-studio .ws-start-btn { width: 100%; padding-top: 12px; padding-bottom: 12px; }
}


/* ── Task 22: review (studio/review.js) ──────────────────────────────────────── */
/* Task 22's rules go here, under this line. */
/* A started listing's photos: white cards in the pack's order, the Lead two columns wide. Over each picture sit its
   place and mark (Lead, Featured or Out of pack), its state, and its menu button; below it, the room control, why its
   last edit failed, and its open flags with their buttons. */
#section-studio .st-rv { display: flex; flex-direction: column; gap: 10px; }
#section-studio .st-rv-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; }
#section-studio .st-rv-title { font-size: 17px; font-weight: 600; letter-spacing: -.3px; color: var(--black); }
#section-studio .st-rv-title:focus { outline: none; }   /* focused only when the photo that had focus has gone */
#section-studio .st-rv-count { font-size: 13px; color: var(--st-quiet); }
#section-studio .st-rv-sub { margin-bottom: 4px; font-size: 13px; line-height: 1.5; color: var(--st-quiet); }
#section-studio .st-rv-empty { padding: 20px 24px; border: 1px solid var(--border); border-radius: 16px; background: white; font-size: 13.5px; color: var(--st-quiet); }

#section-studio .st-rv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-items: start; }
#section-studio .st-rv-tile { position: relative; min-width: 0; background: white; border: 1px solid var(--border); border-radius: 16px; transition: border-color .15s, box-shadow .15s, opacity .15s; }
#section-studio .st-rv-tile:hover { border-color: #d4d4d0; }
#section-studio .st-rv-lead { grid-column: span 2; grid-row: span 2; }   /* the Featured photos fill the space beside it */
#section-studio .st-rv-media { position: relative; display: block; padding-top: 66.6667%; overflow: hidden; border-bottom: 1px solid var(--border); border-radius: 15px 15px 0 0; background: var(--off); cursor: grab; }   /* 3:2, as portals show photos */
#section-studio .st-rv-media:active { cursor: grabbing; }
#section-studio .st-rv-img, #section-studio .st-rv-none { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
#section-studio .st-rv-img { display: block; object-fit: cover; }
#section-studio .st-rv-none { display: flex; align-items: center; justify-content: center; color: var(--light); }
#section-studio .st-rv-none svg { width: 28px; height: 28px; }
#section-studio .st-rv-outside .st-rv-img { opacity: .5; }
#section-studio .st-rv-tile[aria-busy="true"] .st-rv-media { opacity: .7; }
#section-studio .st-rv-tags { position: absolute; top: 8px; left: 8px; right: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; pointer-events: none; }
#section-studio .st-rv-place, #section-studio .st-rv-badge, #section-studio .st-rv-out { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 9px; border-radius: 100px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
#section-studio .st-rv-place { min-width: 24px; padding: 0 7px; background: rgba(17,17,16,.74); color: white; }
#section-studio .st-rv-badge-lead { background: var(--black); color: white; }
#section-studio .st-rv-badge-featured, #section-studio .st-rv-out { background: white; color: var(--black); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
#section-studio .st-rv-state { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 7px; max-width: calc(100% - 16px); padding: 5px 10px; border-radius: 100px; background: rgba(17,17,16,.8); color: white; font-size: 12px; font-weight: 500; line-height: 1.3; }
#section-studio .st-rv-state::before { content: ''; flex-shrink: 0; width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: st-spin .8s linear infinite; }
#section-studio .st-rv-more { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: none; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--black); box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; }
#section-studio .st-rv-more:hover { background: white; }
#section-studio .st-rv-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-rv-more[aria-disabled="true"] { opacity: .55; cursor: default; }
#section-studio .st-rv-more svg { width: 18px; height: 18px; }

/* The photo menu, under its button */
#section-studio .st-rv-menu { position: absolute; top: 42px; right: 6px; z-index: 30; display: flex; flex-direction: column; min-width: 196px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: white; box-shadow: 0 12px 36px rgba(0,0,0,.14); }
#section-studio .st-rv-menu-item { display: block; width: 100%; padding: 8px 10px; border: none; border-radius: 8px; background: none; font-family: inherit; font-size: 13.5px; line-height: 1.35; color: var(--black); text-align: left; cursor: pointer; }
#section-studio .st-rv-menu-item:hover, #section-studio .st-rv-menu-item:focus { outline: none; background: var(--off); }
#section-studio .st-rv-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

#section-studio .st-rv-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px 12px; }
#section-studio .st-rv-room { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: white; font-family: inherit; font-size: 13.5px; color: var(--black); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
#section-studio .st-rv-room:hover { border-color: #D9D9D5; }
#section-studio .st-rv-room:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#section-studio .st-rv-room[aria-disabled="true"] { opacity: .55; cursor: default; }
#section-studio .st-rv-typed { display: flex; flex-wrap: wrap; gap: 6px; }
#section-studio .st-rv-typed-input { flex: 1 1 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: white; font-family: inherit; font-size: 16px; color: var(--black); outline: none; }   /* 16px: phones don't zoom into it */
#section-studio .st-rv-typed-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#section-studio .st-rv-typed-input[aria-invalid="true"] { border-color: #FCA5A5; }
#section-studio .st-rv-typed-acts { display: flex; gap: 6px; }
#section-studio .st-rv-typed .btn { padding: 6px 12px; }
#section-studio .st-rv-msg, #section-studio .st-rv-error { font-size: 12.5px; line-height: 1.45; color: var(--st-error); overflow-wrap: anywhere; }
#section-studio .st-rv-msg:empty { display: none; }
#section-studio .st-rv-error { padding: 7px 10px; border: 1px solid #FECACA; border-radius: 10px; background: #FEF2F2; }
#section-studio .st-rv-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#section-studio .st-rv-flag { padding: 8px 10px; border: 1px solid #FDE68A; border-radius: 10px; background: #FFFBEB; }
#section-studio .st-rv-flag-reason { font-size: 12.5px; line-height: 1.45; color: #92400E; overflow-wrap: anywhere; }
#section-studio .st-rv-flag-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
#section-studio .st-rv-flag-btn { padding: 4px 9px; border: 1px solid #FCD34D; border-radius: 7px; background: white; font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1.35; color: #92400E; cursor: pointer; }
#section-studio .st-rv-flag-btn:hover { background: #FEF3C7; }
#section-studio .st-rv-flag-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-rv-flag-btn[aria-disabled="true"] { opacity: .55; cursor: default; }
#section-studio .st-rv-flag .st-rv-msg { margin-top: 5px; }

/* Desktop drag: the photo being moved, and where it would land */
#section-studio .st-rv-dragging { opacity: .45; }
#section-studio .st-rv-drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

/* The Relight, Redo, Stage and Switch version dialogs (on the shared .st-modal) */
#section-studio .st-rv-dlg-head { min-width: 0; }
#section-studio .st-rv-dlg-sub { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--st-quiet); overflow-wrap: anywhere; }
#section-studio .st-rv-select { cursor: pointer; }
#section-studio .st-rv-versions { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
#section-studio .st-rv-ver { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: white; font-family: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
#section-studio .st-rv-ver:hover { border-color: #c4c4bf; }
#section-studio .st-rv-ver:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .st-rv-ver[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); cursor: default; }
#section-studio .st-rv-ver[aria-disabled="true"]:not([aria-current]) { opacity: .55; cursor: default; }
#section-studio .st-rv-ver-media { position: relative; display: block; padding-top: 66.6667%; background: var(--off); }
#section-studio .st-rv-ver-media img, #section-studio .st-rv-ver-media svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#section-studio .st-rv-ver-media img { object-fit: cover; }
#section-studio .st-rv-ver-media svg { padding: 28%; color: var(--light); }
#section-studio .st-rv-ver-desc { padding: 8px 10px 9px; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--black); overflow-wrap: anywhere; }
#section-studio .st-rv-ver-now { margin-top: -5px; padding: 0 10px 9px; font-size: 11.5px; font-weight: 600; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-rv-state::before { animation: none; }
  #section-studio .st-rv-tile, #section-studio .st-rv-room, #section-studio .st-rv-ver { transition: none; }
}

@media (forced-colors: active) {
  #section-studio .st-rv-drop, #section-studio .st-rv-ver[aria-current="true"] { outline: 2px solid Highlight; outline-offset: 1px; }
  #section-studio .st-rv-room:focus, #section-studio .st-rv-typed-input:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* Phones: two photos a row, the Lead across both; the menu as wide as its card */
@media (max-width: 600px) {
  #section-studio .st-rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #section-studio .st-rv-body { padding: 8px 9px 10px; }
  #section-studio .st-rv-room { padding: 7px 8px; font-size: 16px; }   /* phones don't zoom into it */
  #section-studio .st-rv-more { top: 4px; right: 4px; width: 36px; height: 36px; }
  #section-studio .st-rv-tags { right: 46px; }
  #section-studio .st-rv-menu { top: 44px; left: 4px; right: 4px; min-width: 0; }
  #section-studio .st-rv-lead .st-rv-menu { left: auto; min-width: 210px; }
  #section-studio .st-rv-menu-item { padding: 10px; }
  #section-studio .st-rv-versions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The narrowest phones: one photo a row */
@media (max-width: 340px) {
  #section-studio .st-rv-grid { grid-template-columns: minmax(0, 1fr); }
  #section-studio .st-rv-lead { grid-column: auto; grid-row: auto; }
}


/* ── Task 23: panels (studio/panels.js) ──────────────────────────────────────── */
/* Task 23's rules go here, under this line. */

/* The panels under a listing's photos: Listing copy wide, with the seller link, the pack and the listing's own actions
   beside it (below it on a narrower page, stacked on a phone). Every class here starts st-pn-, so none can meet the
   other tasks' parts. */
#section-studio .st-pn-line { margin-bottom: 16px; }
#section-studio .st-pn-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr); gap: 16px; align-items: start; }
#section-studio .st-pn-grid.st-pn-solo { grid-template-columns: minmax(0, 520px); }   /* only the listing's own card, or the seller link alone */
#section-studio .st-pn-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#section-studio .st-pn { min-width: 0; padding: 22px 24px; background: white; border: 1px solid var(--border); border-radius: 16px; }
#section-studio .st-pn-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--black); }
#section-studio .st-pn-h3 { font-size: 13.5px; font-weight: 600; color: var(--black); }
#section-studio .st-pn-sub { margin: 4px 0 16px; font-size: 13px; line-height: 1.5; color: var(--st-quiet); }

/* Listing copy: the tab's fields, a tone and a length to choose, the rooms to tick, and Write beside its count */
#section-studio .st-pn-form { gap: 16px; }
#section-studio .st-pn-row3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
#section-studio .st-pn-select { cursor: pointer; text-overflow: ellipsis; }
#section-studio .st-pn-features, #section-studio .st-pn-box { resize: vertical; line-height: 1.5; font-family: inherit; }
#section-studio .st-pn-features { min-height: 84px; }
#section-studio .st-pn-box { min-height: 200px; }
#section-studio .st-pn-set { gap: 6px; }
#section-studio .st-pn-seg { display: flex; gap: 3px; padding: 3px; background: var(--off); border: 1px solid var(--border); border-radius: 10px; }
#section-studio .st-pn-opt { position: relative; display: block; flex: 1 1 0; min-width: 0; cursor: pointer; }
#section-studio .st-pn-opt input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#section-studio .st-pn-opt span { display: block; padding: 7px 10px; overflow: hidden; border-radius: 7px; font-size: 13px; font-weight: 500; text-align: center; text-overflow: ellipsis; white-space: nowrap; color: var(--st-quiet); transition: background-color .12s, color .12s; }
#section-studio .st-pn-opt:hover span { color: var(--black); }
#section-studio .st-pn-opt input:checked + span { background: white; color: var(--accent); font-weight: 600; box-shadow: 0 0 0 1px var(--accent), 0 1px 2px rgba(0,0,0,0.06); }
#section-studio .st-pn-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .st-pn-rooms { display: flex; flex-wrap: wrap; gap: 6px; }
#section-studio .st-pn-room { display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--border); border-radius: 100px; background: white; font-size: 13px; line-height: 1.4; color: var(--black); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
#section-studio .st-pn-room:hover { border-color: #c4c4bf; }
#section-studio .st-pn-room:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
#section-studio .st-pn-room input { flex-shrink: 0; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
#section-studio .st-pn-room span { min-width: 0; overflow-wrap: anywhere; }
#section-studio .st-pn-writebar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
#section-studio .st-pn-write { flex: 0 0 auto; }
#section-studio .st-pn-writeinfo { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }

/* The three versions, one at a time as the tab shows them, then the box the agent edits and saves */
#section-studio .st-pn-versions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
#section-studio .st-pn-versions.st-pn-dim .st-pn-vtext { opacity: .6; }   /* a new write is running: the last versions stay, dimmed (still 4.5:1) */
#section-studio .st-pn-vhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
#section-studio .st-pn-vtabs { display: flex; gap: 3px; padding: 3px; background: var(--off); border: 1px solid var(--border); border-radius: 10px; }
#section-studio .st-pn-vtab { padding: 7px 12px; border: none; border-radius: 7px; background: none; font-family: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--st-quiet); cursor: pointer; transition: background-color .12s, color .12s; }
#section-studio .st-pn-vtab:hover { color: var(--black); }
#section-studio .st-pn-vtab[aria-pressed="true"] { background: white; color: var(--accent); font-weight: 600; box-shadow: 0 0 0 1px var(--accent), 0 1px 2px rgba(0,0,0,0.06); }
#section-studio .st-pn-vtab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .st-pn-vtext { max-width: 72ch; font-size: 14.5px; line-height: 1.75; color: var(--black); white-space: pre-wrap; overflow-wrap: anywhere; }   /* a version's own line breaks */
#section-studio .st-pn-vfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
#section-studio .st-pn-boxfield { margin-top: 20px; }
/* R138: how the copy stands, under the boxes: Saving…, Saved, or Couldn't save with Try again */
#section-studio .st-pn-save { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-height: 30px; margin-top: 10px; }
#section-studio .st-pn-savestate { min-width: 0; font-size: 12.5px; line-height: 1.45; color: var(--st-quiet); }
#section-studio .st-pn-savestate.st-pn-failed { color: var(--st-error); }
/* R134: Rightmove's summary and key features, between the copy box and the status line, each with its Copy button under it */
#section-studio .st-pn-extra { margin-top: 14px; }
#section-studio .st-pn-summary, #section-studio .st-pn-keyfeatures { resize: vertical; line-height: 1.5; font-family: inherit; }
#section-studio .st-pn-summary { min-height: 76px; }
#section-studio .st-pn-keyfeatures { min-height: 150px; }
#section-studio .st-pn-extrafoot { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
#section-studio .st-pn-extrafoot .st-hint { min-width: 0; padding-top: 5px; }
#section-studio .st-pn-extrafoot .btn { flex-shrink: 0; }

/* The seller link: a switch, and the link it makes */
#section-studio .st-pn-switch { display: inline-flex; align-items: center; gap: 12px; padding: 4px 2px; border: none; background: none; font-family: inherit; font-size: 14px; font-weight: 500; text-align: left; color: var(--black); cursor: pointer; }
#section-studio .st-pn-switch[aria-disabled="true"] { opacity: .55; cursor: default; }
#section-studio .st-pn-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 100px; }
#section-studio .st-pn-track { position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: 100px; background: #8F8F8A; transition: background-color .15s; }   /* 3:1 against the card */
#section-studio .st-pn-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform .15s; }
#section-studio .st-pn-switch[aria-checked="true"] .st-pn-track { background: var(--accent); }
#section-studio .st-pn-switch[aria-checked="true"] .st-pn-knob { transform: translateX(16px); }
#section-studio .st-pn-link { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 10px; }
#section-studio .st-pn-linkrow { display: flex; align-items: center; gap: 8px; }
#section-studio .st-pn-linkfield { flex: 1 1 auto; min-width: 0; text-overflow: ellipsis; }
#section-studio .st-pn-fine { margin-top: 8px; }
#section-studio .st-pn-sees { margin-top: 8px; line-height: 1.5; }   /* R139: what the homeowner sees, beside the switch */

/* The pack: Download pack, its link, and the earlier packs */
#section-studio .st-pn-download { margin-top: 2px; }
#section-studio .st-pn-packlink { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
#section-studio .st-pn-packlink:empty { display: none; }
#section-studio .st-pn-earlier { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
#section-studio .st-pn-packs { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 0; padding: 0; list-style: none; }
#section-studio .st-pn-pack { min-width: 0; }
#section-studio .st-pn-packhead { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
#section-studio .st-pn-packwhen { font-size: 13px; font-weight: 500; color: var(--black); }
#section-studio .st-pn-packphotos { flex: 1 1 auto; font-size: 12.5px; color: var(--st-quiet); }
#section-studio .st-pn-packgot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }

/* The listing's own actions */
#section-studio .st-pn-acts { display: flex; flex-direction: column; gap: 14px; }
#section-studio .st-pn-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#section-studio .st-pn-danger { color: #B91C1C; border-color: #FECACA; }
#section-studio .st-pn-danger:hover { background: #FEF2F2; border-color: #FCA5A5; }
#section-studio .st-pn > .st-field-msg { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-pn-opt span, #section-studio .st-pn-room, #section-studio .st-pn-vtab, #section-studio .st-pn-track, #section-studio .st-pn-knob { transition: none; }
}

/* Windows' high-contrast themes drop the colours that mark the chosen option and the switch: outlines and system colours instead */
@media (forced-colors: active) {
  #section-studio .st-pn-opt input:checked + span, #section-studio .st-pn-vtab[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  #section-studio .st-pn-track { border: 1px solid CanvasText; }
  #section-studio .st-pn-switch[aria-checked="true"] .st-pn-track { background: Highlight; }
}

/* Below a wide page the cards stack, Listing copy first */
@media (max-width: 960px) {
  #section-studio .st-pn-grid, #section-studio .st-pn-grid.st-pn-solo { grid-template-columns: minmax(0, 1fr); }
}

/* Phones */
@media (max-width: 600px) {
  #section-studio .st-pn { padding: 18px 16px; border-radius: 14px; }
  #section-studio .st-pn-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #section-studio .st-pn-row3 > :first-child { grid-column: 1 / -1; }
  #section-studio .st-pn-write, #section-studio .st-pn-download { width: 100%; padding-top: 12px; padding-bottom: 12px; }
  #section-studio .st-pn-writeinfo { flex-basis: 100%; }
  #section-studio .st-pn-vhead { flex-direction: column; align-items: stretch; }
  #section-studio .st-pn-vtabs { width: 100%; }
  #section-studio .st-pn-vtab { flex: 1 1 0; padding: 9px 6px; }
  #section-studio .st-pn-vfoot { flex-direction: column; align-items: stretch; }
  #section-studio .st-pn-vfoot .btn { width: 100%; padding-top: 12px; padding-bottom: 12px; }
  #section-studio .st-pn-act .btn, #section-studio .st-pn-packgot .btn, #section-studio .st-pn-packlink .btn { width: 100%; }
  #section-studio .st-pn-act { align-items: stretch; }
  #section-studio .st-pn-packhead .btn { margin-left: auto; }
}

/* The narrowest phones (320px): a tone or length still fits its third of the row */
@media (max-width: 380px) {
  #section-studio .st-pn-opt span { padding-left: 4px; padding-right: 4px; font-size: 12.5px; }
}

/* ── R143: copy buttons (studio/panels.js) ─────────────────────────────────── */
/* R143's rules go here, under this line. */

/* The copy, the summary and the key features each hold their copy button in their top right corner, the two squares. The
   box keeps a strip on its right for it, so its text never runs under the button; after a copy the button shows a tick
   with Copied under it, in the same strip. */
#section-studio .st-pn-copywrap { position: relative; }
#section-studio .st-pn-copywrap > .st-input { display: block; padding-right: 56px; }
#section-studio .st-pn-copybtn { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 44px; min-height: 34px; padding: 6px 2px; border: none; border-radius: 8px; background: white; font-family: inherit; color: var(--st-quiet); cursor: pointer; transition: background-color .12s, color .12s; }
#section-studio .st-pn-copybtn:hover { background: var(--off); color: var(--black); }
#section-studio .st-pn-copybtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-pn-copyicon, #section-studio .st-pn-copydone { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#section-studio .st-pn-copybtn svg { width: 17px; height: 17px; flex-shrink: 0; }
#section-studio .st-pn-copydone { color: var(--accent); font-size: 11px; font-weight: 600; line-height: 1.1; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-pn-copybtn { transition: none; }
}
/* (Kept apart from the sections below so that parallel work merges cleanly.) */
/* . */
/* . */

/* ── R144: clear clutter (studio/review.js) ───────────────────────────────── */
/* R144's rules go here, under this line. */
/* (Kept apart from the sections around it so that parallel work merges cleanly.) */
/* . */
/* . */

/* ── R145: the left-out group (studio/review.js) ───────────────────────────── */
/* R145's rules go here, under this line. */
/* The photos left out of the pack: a group of their own under the grid, after a rule, with its heading and line. Its
   tiles are a little smaller and dimmed, with no number: Put back sits where the number was (the tags take no clicks,
   so it takes its own), and the picture can't be dragged. */
#section-studio .st-rv-outs { display: flex; flex-direction: column; margin-top: 14px; padding-top: 20px; border-top: 1px solid var(--border); }
#section-studio .st-rv-outs-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--black); }
#section-studio .st-rv-outs-line { margin: 2px 0 12px; font-size: 13px; line-height: 1.5; color: var(--st-quiet); }
#section-studio .st-rv-outs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
#section-studio .st-rv-outside { background: rgba(255,255,255,.6); }
#section-studio .st-rv-outside .st-rv-media, #section-studio .st-rv-outside .st-rv-media:active { cursor: default; }
#section-studio .st-rv-outside .st-rv-none { opacity: .5; }
#section-studio .st-rv-putback { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 12px; border: none; border-radius: 100px; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: .01em; line-height: 1; color: var(--black); white-space: nowrap; cursor: pointer; }
#section-studio .st-rv-putback:hover { background: var(--off); }
#section-studio .st-rv-putback:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#section-studio .st-rv-putback[aria-disabled="true"] { opacity: .55; cursor: default; }

@media (forced-colors: active) {
  #section-studio .st-rv-putback { border: 1px solid ButtonText; }
}

/* Phones: two a row, as in the grid, and a larger Put back to tap */
@media (max-width: 600px) {
  #section-studio .st-rv-outs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #section-studio .st-rv-putback { height: 32px; padding: 0 13px; }
}

/* The narrowest phones: one a row */
@media (max-width: 340px) {
  #section-studio .st-rv-outs-grid { grid-template-columns: minmax(0, 1fr); }
}
/* (Kept apart from the sections around it so that parallel work merges cleanly.) */
/* . */
/* . */

/* ── R146: floorplan and EPC cards (studio/workspace.js) ──────────────────── */
/* R146's rules go here, under this line. */
/* The line under "Move to photos" on a floorplan or EPC card: a line of its own, straight after the button it describes */
#section-studio .ws-hint { flex-basis: 100%; margin: -2px 0 4px; font-size: 12px; line-height: 1.4; color: var(--st-quiet); }

/* ── R151: staging accent swatches (studio/review.js) ── */
/* The Stage dialog's "Accent colour (optional)": None, then a round swatch for each of bootstrap's accents, in the colour
   it gives (--st-swatch). Each is a real radio, hidden only to the eye, so Tab and the arrow keys work as on any radio
   group; its label is the swatch. Chosen: a blue ring, clear of the swatch by a white gap. Keyboard focus: a second ring
   outside it. Under them, the dialog's summary (what Stage makes, in Switch version's words) above the notice line. */
#section-studio .st-rv-swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
#section-studio .st-rv-swatch-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#section-studio .st-rv-swatch { position: relative; display: block; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--st-swatch, white); box-shadow: inset 0 0 0 1px rgba(17,17,16,.14); cursor: pointer; transition: box-shadow .15s; forced-color-adjust: none; }
#section-studio .st-rv-swatch:hover { box-shadow: inset 0 0 0 1px rgba(17,17,16,.14), 0 0 0 2px white, 0 0 0 4px #D9D9D5; }
#section-studio .st-rv-swatch-none { background: white; box-shadow: inset 0 0 0 1px #D9D9D5; }
#section-studio .st-rv-swatch-none::after { content: ''; position: absolute; top: 5px; bottom: 5px; left: 50%; width: 1.5px; margin-left: -.75px; border-radius: 1px; background: var(--st-quiet); transform: rotate(45deg); }
#section-studio .st-rv-swatch-none:hover { box-shadow: inset 0 0 0 1px #D9D9D5, 0 0 0 2px white, 0 0 0 4px #D9D9D5; }
#section-studio .st-rv-swatch-input:checked + .st-rv-swatch { box-shadow: inset 0 0 0 1px rgba(17,17,16,.14), 0 0 0 2px white, 0 0 0 4px var(--accent); }
#section-studio .st-rv-swatch-input:checked + .st-rv-swatch-none { box-shadow: inset 0 0 0 1px #D9D9D5, 0 0 0 2px white, 0 0 0 4px var(--accent); }
#section-studio .st-rv-swatch-input:focus-visible + .st-rv-swatch { outline: 2px solid var(--accent); outline-offset: 6px; }
#section-studio .st-rv-stage-foot { display: flex; flex-direction: column; gap: 4px; }
#section-studio .st-rv-stage-sum { font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--black); overflow-wrap: anywhere; text-wrap: pretty; }   /* pretty: no lone word on its last line */

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-rv-swatch { transition: none; }
}

/* Windows' high-contrast themes drop box shadows: the chosen swatch and keyboard focus get outlines instead. The swatches
   keep their own colours there, as the colour is what they say. */
@media (forced-colors: active) {
  #section-studio .st-rv-swatch-input:checked + .st-rv-swatch { outline: 3px solid Highlight; outline-offset: 2px; }
  #section-studio .st-rv-swatch-input:focus-visible + .st-rv-swatch { outline: 2px dashed Highlight; outline-offset: 6px; }
}

/* Phones: the nine swatches across the dialog in one row (307px inside it on a 375px screen), far enough apart for the
   focus ring; a little smaller on the narrowest */
@media (max-width: 600px) {
  #section-studio .st-rv-swatches { gap: 6px 3px; justify-content: space-between; }
  #section-studio .st-rv-swatch { width: 26px; height: 26px; }
}
@media (max-width: 360px) {
  #section-studio .st-rv-swatch { width: 24px; height: 24px; }
}

/* ── R154–R155: style examples and Fun mode (studio/review.js) ── */
/* Under the Stage dialog's Style menu, the chosen style's example photo (3:2, rounded, in the page's off-white until it
   loads) beside its line; a photo that can't load is hidden and the line takes the row. Under the accent colours, "Make
   it fun": a switch. A real checkbox, hidden only to the eye, whose label is the whole row: the track (off: grey; on: a
   burst of colour, the knob moved across) and its words. Keyboard focus: a ring round the track. */
#section-studio .st-rv-example { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
#section-studio .st-rv-example-img { display: block; flex: 0 0 auto; width: 46%; max-width: 216px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--off); }
#section-studio .st-rv-example-line { min-width: 0; font-size: 13px; line-height: 1.45; color: var(--st-quiet); overflow-wrap: anywhere; text-wrap: pretty; }
#section-studio .st-rv-fun { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: white; cursor: pointer; }
#section-studio .st-rv-fun-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#section-studio .st-rv-fun-track { position: relative; flex-shrink: 0; width: 34px; height: 20px; margin-top: 1px; border-radius: 100px; background: var(--light); transition: background-color .2s; }
#section-studio .st-rv-fun-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(17,17,16,.25); transition: transform .2s; }
#section-studio .st-rv-fun:hover .st-rv-fun-input:not(:checked) + .st-rv-fun-track { background: #B5B5B0; }
#section-studio .st-rv-fun-input:checked + .st-rv-fun-track { background: linear-gradient(90deg, #F43F5E 0%, #F59E0B 36%, #10B981 68%, #2563EB 100%); }
#section-studio .st-rv-fun-input:checked + .st-rv-fun-track::after { transform: translateX(14px); }
#section-studio .st-rv-fun-input:focus-visible + .st-rv-fun-track { outline: 2px solid var(--accent); outline-offset: 2px; }
#section-studio .st-rv-fun-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#section-studio .st-rv-fun-name { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--black); }
#section-studio .st-rv-fun .st-hint { line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  #section-studio .st-rv-fun-track, #section-studio .st-rv-fun-track::after { transition: none; }
}

/* Windows' high-contrast themes drop the track's colours: it is drawn in the theme's own */
@media (forced-colors: active) {
  #section-studio .st-rv-fun-track { forced-color-adjust: none; background: Canvas; box-shadow: inset 0 0 0 1px CanvasText; }
  #section-studio .st-rv-fun-track::after { background: CanvasText; box-shadow: none; }
  #section-studio .st-rv-fun-input:checked + .st-rv-fun-track { background: Highlight; box-shadow: none; }
  #section-studio .st-rv-fun-input:checked + .st-rv-fun-track::after { background: HighlightText; }
  #section-studio .st-rv-fun-input:focus-visible + .st-rv-fun-track { outline: 2px dashed Highlight; outline-offset: 3px; }
}

/* Phones: a smaller photo beside the line, and the switch's row a little tighter */
@media (max-width: 600px) {
  #section-studio .st-rv-example { gap: 12px; }
  #section-studio .st-rv-example-img { width: 44%; }
  #section-studio .st-rv-fun { padding: 11px 12px; }
}
