/* emruth-v2 studio.css (Package P): the design studio editor in v2 tokens. Same layout model as before
   (tools 74px | stage | panel 340px; a bottom sheet at 900px and below, the switch studio.js also uses),
   square corners, no dotted stage, nothing under 14px, pink only on the order buttons. The ids and classes
   are studio.js's own (studio-*, #st-*, bulk-*), including the controls it builds at runtime. */

/* The studio fills the screen below the header, like the workshop it is. */
.em2-ctx-studio .em2-foot, .em2-ctx-studio .em2-ann, .em2-ctx-studio .em2-join { display:none; }
html:has(#studio), html:has(#studio) body { overflow:hidden; }
/* studio.js sets the exact height; this is the fallback before it runs. */
.studio { position:relative; display:flex; flex-direction:column; height:calc(100dvh - var(--hdr-h)); background:var(--paper); color:var(--ink); }
.studio button { font-family:var(--body); }

/* ---------- Top row: back link, sides, history ---------- */
.studio-top { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:56px; padding:6px 16px; border-bottom:2px solid var(--ink); }
.studio-back { display:inline-flex; align-items:center; gap:6px; min-width:0; min-height:44px; overflow:hidden; color:var(--ink); font:800 16px/1.2 var(--body); text-decoration:none; white-space:nowrap; }
.studio-back svg { flex:none; width:20px; height:20px; }
.studio-back span { overflow:hidden; text-overflow:ellipsis; }
.studio-back:hover span { text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:4px; }
.studio-sides { display:flex; flex-wrap:nowrap; align-items:center; gap:4px; overflow-x:auto; scrollbar-width:none; }
.studio-sides::-webkit-scrollbar { display:none; }
.studio-sides button, .studio-hist button { flex:none; height:40px; min-width:44px; padding:0 12px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:800 15px/1 var(--body); border-radius:0; cursor:pointer; transition:background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.studio-sides button:hover, .studio-hist button:hover { background:var(--hover-fill); }
.studio-sides [aria-pressed="true"], .studio-sides [aria-pressed="true"]:hover { background:var(--ink); color:var(--paper); }
.studio-hist { display:flex; flex:none; gap:4px; }
.studio-hist button:disabled { border-color:var(--line); background:var(--band); color:var(--muted); cursor:not-allowed; }
/* The Echoes free-tee badge (plugin style on ?echoes=1) at the 14px floor. */
html body #st-sides::after { font:700 14px/1.3 var(--mono); border-radius:0; color:var(--ink); border-color:var(--ink); }
/* Ink, not pink: pink stays on the one main action (Next: quantities). */

/* ---------- Body: tools | stage | panel ---------- */
.studio-body { display:grid; flex:1; grid-template-columns:74px minmax(0, 1fr) 340px; min-height:0; }
.studio-tools { display:flex; flex-direction:column; gap:2px; padding:6px 4px; background:var(--band-ink); overflow-y:auto; }
.studio-tools button { display:grid; justify-items:center; gap:4px; padding:10px 2px; border:0; background:transparent; color:var(--on-band-ink); font:700 14px/1.1 var(--body); border-radius:0; cursor:pointer; transition:background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.studio-tools button svg { width:24px; height:24px; }
.studio-tools button:hover { background:rgba(255, 255, 255, .12); }
.studio-tools button:hover span { text-decoration:underline; text-underline-offset:3px; }
.studio-tools [aria-pressed="true"], .studio-tools [aria-pressed="true"]:hover { background:var(--on-band-ink); color:var(--band-ink); }
.studio-tools button:focus-visible { outline-color:var(--on-band-ink); outline-offset:-4px; }

.studio-stage { position:relative; display:flex; align-items:center; justify-content:center; min-width:0; padding:12px; overflow:hidden; background:var(--tile); color:var(--ink); }
.studio-stage.is-drop { outline:2px dashed var(--ink); outline-offset:-10px; }
.studio-board { position:relative; flex:none; width:480px; aspect-ratio:1; background:#ffffff; border:2px solid var(--ink); }
#st-garment { position:absolute; inset:0; width:100%; height:100%; }
.studio-board .canvas-container { position:absolute !important; inset:0; width:100% !important; height:100% !important; }
.studio-guide { position:absolute; border:2px dashed var(--blue); pointer-events:none; }
.studio-guide span { position:absolute; left:50%; bottom:100%; margin-bottom:4px; padding:0 6px; transform:translateX(-50%); background:#ffffff; color:var(--blue); font:700 14px/1.4 var(--mono); white-space:nowrap; }
.studio-guide.is-over { border-color:var(--pink-ink); border-style:solid; }
.studio-guide.is-over span { color:var(--pink-ink); }
.is-preview .studio-guide { display:none; }
.studio-snap { position:absolute; display:none; background:var(--blue); pointer-events:none; }
.studio-snap-v { top:0; bottom:0; width:2px; margin-left:-1px; }
.studio-snap-h { left:0; right:0; height:2px; margin-top:-1px; }
.studio-empty { position:absolute; left:50%; bottom:18px; margin:0; padding:6px 12px; transform:translateX(-50%); background:#ffffff; border:2px solid var(--ink); color:var(--ink); font:700 15px/1.3 var(--body); white-space:nowrap; pointer-events:none; }
.studio-toast { position:absolute; left:50%; top:14px; z-index:6; margin:0; max-width:90%; padding:10px 16px; transform:translate(-50%, -80px); opacity:0; background:var(--ink); border:2px solid var(--ink); color:var(--paper); font:700 16px/1.3 var(--body); text-align:center; transition:transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease); }
.studio-toast.is-on { transform:translate(-50%, 0); opacity:1; }
.studio-draft { position:absolute; left:12px; right:12px; top:10px; z-index:5; display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 12px; background:#ffffff; border:2px solid var(--ink); color:var(--ink); font:700 16px/1.3 var(--body); }
/* One pink action per screen: the order button. The draft offer and the upload prompt use the ink look. */
.studio-draft .btn-pink, .studio-uploadcta.btn-pink { background:var(--ink); border-color:var(--ink); color:var(--paper); }
.studio-draft .btn-pink:hover, .studio-uploadcta.btn-pink:hover { background:var(--ink-2); border-color:var(--ink-2); }
.studio-uploadcta { position:absolute; left:50%; top:50%; z-index:5; transform:translate(-50%, -50%); }

/* ---------- Options panel and the controls studio.js builds ---------- */
.studio-panel { padding:16px; overflow-y:auto; border-left:2px solid var(--ink); background:var(--paper); overscroll-behavior:contain; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.panel-head h2 { margin:0; font:400 24px/1.1 var(--display); color:var(--ink); }
.panel-close { display:none; height:40px; padding:0 14px; border:2px solid var(--ink); background:var(--ink); color:var(--paper); font:800 15px/1 var(--body); border-radius:0; cursor:pointer; }
.studio-panel h3 { margin:16px 0 8px; font:800 16px/1.3 var(--body); color:var(--ink); }
.panel-note { margin:0 0 8px; font:500 15px/1.45 var(--body); color:var(--muted); }
.panel-note a { color:var(--ink); font-weight:700; }
.q-note[data-level="low"] { color:var(--pink-ink); font-weight:800; }
.q-note[data-level="good"] { color:var(--green); font-weight:800; }
.studio .panel-text, .studio .panel-search { display:block; width:100%; border:2px solid var(--ink); background:var(--paper); color:var(--ink); border-radius:0; -webkit-appearance:none; appearance:none; }
.studio .panel-text { min-height:72px; padding:10px 12px; font:600 18px/1.35 var(--body); resize:vertical; }
.studio .panel-search { height:44px; margin:0 0 8px; padding:0 12px; font:500 16px/1 var(--body); }
.font-list { display:grid; max-height:200px; overflow-y:auto; border:2px solid var(--ink); }
.font-row { min-height:44px; padding:8px 12px; border:0; border-bottom:2px solid var(--line); background:var(--paper); color:var(--ink); font-size:18px; line-height:1.2; text-align:left; border-radius:0; cursor:pointer; }
.font-row:hover { background:var(--hover-fill); }
.font-row[aria-pressed="true"] { background:var(--ink); color:var(--paper); }

.studio .color-row, .studio .swatches { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
.studio .color-row-many { max-height:204px; overflow-y:auto; padding:4px; }
.studio .swatch, .studio .color-row .swatch { position:relative; flex:none; width:44px; height:44px; padding:0; background:var(--c); border:2px solid var(--muted); border-radius:0; cursor:pointer; overflow:visible; }
.studio .swatch:hover { border-color:var(--ink); }
.studio .swatch[aria-pressed="true"] { border-color:var(--ink); outline:2px solid var(--ink); outline-offset:2px; }
.studio .swatch:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.studio .color-row input[type="color"] { flex:none; width:44px; height:44px; padding:2px; border:2px solid var(--ink); background:var(--paper); border-radius:0; cursor:pointer; }
.studio .pick-row { display:flex; flex-wrap:wrap; gap:8px; }
.studio .pick-row button { display:inline-flex; align-items:center; justify-content:center; height:44px; padding:0 12px; border:2px solid var(--muted); background:var(--paper); color:var(--ink); font:800 15px/1 var(--body); border-radius:0; cursor:pointer; transition:border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.studio .pick-row button:hover { border-color:var(--ink); }
.studio .pick-row button[aria-pressed="true"] { border-color:var(--ink); background:var(--ink); color:var(--paper); }
.studio .pick-sizes button { min-width:52px; }
/* By quote: still focusable, shown struck and muted; a swatch gets the sold-out diagonal instead. */
.studio .is-quote, .studio .pick-row button.is-quote { color:var(--muted); border-color:var(--line); text-decoration:line-through; }
.studio .pick-row button.is-quote[aria-pressed="true"] { background:var(--band); color:var(--muted); border-color:var(--ink); }
.studio .swatch.is-quote { text-decoration:none; border-color:var(--line); }
.studio .swatch.is-quote::after { content:""; position:absolute; left:50%; top:-3px; bottom:-3px; width:2px; margin-left:-1px; background:var(--ink); transform:rotate(45deg); pointer-events:none; }
.studio .swatch.is-quote[aria-pressed="true"] { border-color:var(--ink); }

.slider { display:grid; grid-template-columns:72px minmax(0, 1fr); align-items:center; gap:8px; margin-top:12px; color:var(--ink); font:800 15px/1.2 var(--body); }
.slider input { width:100%; accent-color:var(--ink); }
.obj-actions { display:flex; flex-wrap:wrap; gap:4px; margin-top:16px; }
.obj-actions button { flex:1 0 auto; height:40px; padding:0 10px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:800 15px/1 var(--body); border-radius:0; cursor:pointer; }
.obj-actions button:hover { background:var(--hover-fill); }
.obj-actions .is-done { background:var(--ink); color:var(--paper); }
.art-box { max-height:340px; overflow-y:auto; }
.art-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(52px, 1fr)); gap:4px; }
.art-item { padding:6px; border:2px solid var(--line); background:#ffffff; border-radius:0; cursor:pointer; }
.art-item:hover { border-color:var(--ink); }
.art-item img { width:100%; height:auto; }
.starter-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.starter { display:grid; justify-items:center; align-content:center; gap:2px; min-height:110px; padding:8px; overflow:hidden; border:2px solid var(--line); background:#ffffff; color:#111428; font-size:18px; line-height:1.05; text-align:center; border-radius:0; cursor:pointer; }
.starter:hover { border-color:var(--ink); }
.team-list { display:grid; gap:4px; margin:12px 0 8px; }
.team-row { display:grid; grid-template-columns:minmax(0, 1fr) 52px 72px 52px 44px; gap:4px; }
.team-row input, .team-row select { height:44px; min-width:0; padding:0 6px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:500 15px/1 var(--body); border-radius:0; }
.team-row button { height:44px; padding:0; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:800 14px/1 var(--body); border-radius:0; cursor:pointer; }
.team-row button:hover { background:var(--hover-fill); }
.team-paste { margin-top:12px; }
.team-paste summary { min-height:44px; display:flex; align-items:center; font:800 16px/1.2 var(--body); cursor:pointer; }
.team-paste textarea { display:block; width:100%; margin:6px 0; padding:10px 12px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:500 16px/1.4 var(--body); border-radius:0; }
.team-sum { margin-top:12px; font:800 16px/1.3 var(--body); }

/* ---------- Footer bar: quantity, method, ink, price, save, order ---------- */
.studio-foot { display:flex; align-items:center; gap:12px; padding:8px 16px; background:var(--paper); border-top:2px solid var(--ink); }
.foot-field { display:flex; align-items:center; gap:6px; color:var(--ink); font:800 15px/1 var(--body); }
.studio .foot-field input, .studio .foot-field select { height:44px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); border-radius:0; }
.studio .foot-field input { width:80px; padding:0 8px; font:700 16px/1 var(--mono); }
.studio .foot-field select { width:auto; max-width:200px; padding:0 8px; font:600 16px/1 var(--body); -webkit-appearance:none; appearance:none; }
.has-team .foot-field input:disabled, .has-team .foot-field select:disabled { border-color:var(--line); background:var(--band); color:var(--muted); }
.foot-price { flex:1; min-width:0; text-align:right; line-height:1.15; }
.foot-price strong { display:block; color:var(--ink); font:700 22px/1.1 var(--mono); letter-spacing:-0.01em; }
.foot-price small { display:block; overflow:hidden; color:var(--muted); font:500 14px/1.4 var(--body); text-overflow:ellipsis; white-space:nowrap; }
.studio-foot .btn { flex:none; }

/* ---------- Bulk order: the last step, after the design ---------- */
.bulk { position:absolute; inset:0; z-index:30; display:flex; flex-direction:column; background:var(--paper); color:var(--ink); }
.bulk-top { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:56px; padding:6px 16px; border-bottom:2px solid var(--ink); }
.bulk-back { padding:0 4px; border:0; background:none; cursor:pointer; }
.bulk-top .stamp { margin:0; }
.bulk-body { display:grid; flex:1; grid-template-columns:minmax(0, 2fr) minmax(0, 3fr); min-height:0; overflow-y:auto; }
.bulk-look { position:sticky; top:0; align-self:start; padding:24px; }
#bulk-preview { width:100%; max-width:480px; margin-inline:auto; border:2px solid var(--ink); background:#ffffff; }
.bulk-locked { max-width:480px; margin:12px auto 0; padding:10px 12px; background:var(--band); border-left:2px solid var(--ink); color:var(--ink); font:500 15px/1.4 var(--body); }
.bulk-order { padding:24px; border-left:2px solid var(--ink); }
.bulk-order h2 { margin:0 0 6px; font:400 32px/1.05 var(--display); color:var(--ink); }
.bulk-order h2:focus { outline:none; }
.bulk-intro { margin:0 0 16px; font:500 16px/1.5 var(--body); color:var(--ink-2); }
.bulk-row { position:relative; min-width:0; margin:0 0 16px; padding:12px 16px 16px; border:2px solid var(--ink); }
.bulk-row legend { padding:0 6px; font:700 14px/1.3 var(--mono); letter-spacing:.04em; text-transform:uppercase; }
.bulk-picks { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:12px; }
.bulk-pick { display:grid; flex:1 1 120px; gap:4px; min-width:0; font:800 15px/1.2 var(--body); }
.bulk-pick-color { flex:2 1 200px; }
.bulk-select { display:flex; align-items:center; gap:6px; min-width:0; }
.bulk-dot { flex:none; width:28px; height:28px; border:2px solid var(--ink); border-radius:0; }
.studio .bulk-pick select { width:100%; height:44px; padding:0 8px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); font:600 16px/1 var(--body); border-radius:0; }
.bulk-sizes { display:grid; grid-template-columns:repeat(auto-fill, minmax(76px, 1fr)); gap:8px; }
.bulk-size { display:grid; grid-template-columns:minmax(0, 1fr); align-content:start; gap:2px; justify-items:stretch; min-width:0; text-align:center; font:800 15px/1.2 var(--body); }
.studio .bulk-size input { height:44px; padding:0 4px; border:2px solid var(--ink); background:var(--paper); color:var(--ink); text-align:center; font:700 16px/1 var(--mono); border-radius:0; }
.studio .bulk-size.is-quote input { border-color:var(--line); }
/* The unit price may wrap to two lines inside its cell ("$13.50" / "each") instead of pushing the input wider. */
.bulk-unit { min-width:0; min-height:1.4em; font:700 14px/1.4 var(--mono); overflow-wrap:anywhere; }
.bulk-unit.is-bad { color:var(--pink-ink); }
.bulk-remove { position:absolute; top:-12px; right:10px; padding:0 6px; border:0; background:var(--paper); color:var(--ink); font:700 15px/1.4 var(--body); text-decoration:underline; cursor:pointer; }
.bulk-problem { margin:12px 0 0; padding:12px 14px; background:var(--band); border-left:2px solid var(--ink); color:var(--ink); font:700 16px/1.4 var(--body); }
.bulk-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px 24px; padding:10px 16px; background:var(--paper); border-top:2px solid var(--ink); }
.bulk-foot small { display:block; font:700 14px/1.3 var(--mono); letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.bulk-foot strong { font:700 22px/1.1 var(--mono); color:var(--ink); }
.bulk-foot p { flex:1 1 180px; margin:0; font:500 14px/1.4 var(--body); color:var(--muted); }
.bulk-foot .btn { flex:none; }

/* ---------- Phones and tablets: the panel becomes a bottom sheet (studio.js uses the same switch) ---------- */
@media (max-width:900px) {
  .studio-top { gap:8px; padding:4px 8px; }
  .studio-back { flex:0 0 44px; justify-content:center; }
  .studio-back svg { width:24px; height:24px; min-width:24px; }
  .studio-back span { display:none; }
  .studio-hist button { padding:0 10px; }
  .studio-body { position:relative; overflow:hidden; grid-template-columns:minmax(0, 1fr); grid-template-rows:minmax(0, 1fr) auto; }
  .studio-tools { order:2; flex-direction:row; justify-content:space-around; overflow-x:auto; padding:2px 4px; }
  .studio-tools button { flex:none; min-width:56px; padding:6px 2px; }
  .studio-stage { padding:6px; }
  .studio-panel { position:absolute; left:0; right:0; bottom:0; z-index:7; max-height:62%; border-left:0; border-top:2px solid var(--ink); transform:translateY(105%); transition:transform var(--t-base) var(--ease); }
  .sheet-open .studio-panel { transform:none; }
  .panel-close { display:block; }
  .studio-foot { flex-wrap:wrap; gap:6px 8px; padding:6px 8px; }
  .foot-price { flex:1 1 100px; order:-1; text-align:left; }
  #st-save { display:none; }
  .studio .foot-field input { width:64px; }
  /* Keep one layout while the price and print options load, so the studio does not jump (2026-11-16). */
  .foot-price { min-width:10.5rem; }
  .foot-price strong { white-space:nowrap; }
  .studio .foot-method select { width:120px; max-width:120px; }
  .bulk-body { display:block; }
  .bulk-look { position:static; display:grid; grid-template-columns:110px minmax(0, 1fr); gap:12px; align-items:center; padding:12px; }
  .bulk-locked { margin:0; font-size:14px; }
  .bulk-order { padding:16px 12px; border-left:0; border-top:2px solid var(--ink); }
  .bulk-foot { gap:4px 16px; padding:8px 12px max(8px, env(safe-area-inset-bottom)); }
  .bulk-foot p { display:none; }
  .bulk-foot .btn { margin-left:auto; }
}
/* Phones: the sides get their own full-width line under Back / Undo / Redo / Preview, so every side shows. */
@media (max-width:600px) {
  .studio-top { flex-wrap:wrap; row-gap:4px; }
  .studio-sides { order:3; flex:1 0 100%; }
}

/* Selects show the shared chevron; size inputs fill their grid cell. */
.studio .foot-field select, .studio .bulk-pick select { padding-right:32px; background-image:var(--chevron); background-repeat:no-repeat; background-position:right 8px center; background-size:20px 20px; cursor:pointer; }
.studio .bulk-size input { width:100%; min-width:0; }
