/* Design studio (js/studio.js). Full-screen editor under the top tabs; the 3D viewer sleeps behind it. */
.studio {
  --st-bg: #1c1f27; --st-panel: #262a35; --st-panel2: #2d323e; --st-line: rgba(255, 255, 255, .12); --st-hi: #4da3ff;
  position: fixed; inset: 0; z-index: 4; padding-top: 56px; background: var(--st-bg); color: var(--text);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s;
}
.studio.open { opacity: 1; visibility: visible; pointer-events: auto; }
body.studio-open .rail, body.studio-open .dock, body.studio-open .scrim, body.studio-open .status { display: none; }
/* top tabs while the studio is open: a lighter, slim bar instead of the black strip */

.st-shell {
  height: 100%; display: grid; min-height: 0;
  grid-template-columns: 52px minmax(0, 1fr) 290px;
  grid-template-rows: 46px 40px minmax(0, 1fr) 34px;
  grid-template-areas: "top top top" "tools opts side" "tools view side" "tools stat side";
}
.st-top { grid-area: top; }
.st-tools { grid-area: tools; }
.st-opts { grid-area: opts; }
.st-view { grid-area: view; }
.st-stat { grid-area: stat; }
.st-side { grid-area: side; }

.studio .spacer { flex: 1; }
.studio .sep { width: 1px; height: 22px; background: var(--st-line); margin: 0 4px; }
.studio .muted { color: var(--muted); }
.studio .note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.studio .note.pad { padding: 10px 12px; }

/* top bar */
.st-top { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--st-panel); border-bottom: 1px solid var(--st-line); }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(255, 255, 255, .07); border: 1px solid var(--st-line); }
.seg-div { width: 1px; margin: 5px 3px; background: rgba(255, 255, 255, .22); }
.seg button { border: 0; background: transparent; padding: 5px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); }
.seg button[aria-pressed="true"] { background: #fff; color: #0c1222; font-weight: 600; }
.studio .btn.sm { padding: 5px 11px; font-size: 12.5px; gap: 6px; border-radius: 8px; }
.studio .btn.sm .ic { width: 15px; height: 15px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; }

.ib {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer;
}
.ib .ic { width: 17px; height: 17px; }
.ib:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.ib:disabled { opacity: .3; cursor: default; }
.ib.sm { width: 24px; height: 24px; }
.ib.sm .ic { width: 14px; height: 14px; }
.studio button:focus-visible, .studio select:focus-visible, .studio input:focus-visible, .studio textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* tool column */
.st-tools { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--st-panel); border-right: 1px solid var(--st-line); overflow-y: auto; scrollbar-width: none; }
.tsep { width: 28px; height: 1px; background: var(--st-line); margin: 6px 0 4px; flex: none; }
.swgrid { display: grid; grid-template-columns: repeat(2, 18px); gap: 5px; margin-top: 6px; padding-bottom: 6px; }
.swgrid .sw { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .35); background: var(--c); cursor: pointer; padding: 0; }
.swgrid .sw:hover { transform: scale(1.15); }
.swgrid .sw.on { outline: 2px solid var(--st-hi); outline-offset: 1px; }
.nav-save {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%); pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 13px/1 inherit; background: #3ddc84; color: #062712; box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.nav-save:hover { background: #5fe89b; }
.nav-save i { display: none; width: 8px; height: 8px; border-radius: 50%; background: #ff8a1f; box-shadow: 0 0 0 2px #fff; }
.nav-save.dirty i { display: inline-block; }
.tb { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: rgba(255, 255, 255, .75); cursor: pointer; }
.tb:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tb.on { background: var(--st-hi); color: #06121f; }
.tb .ic { width: 19px; height: 19px; }
input[type="color"].primary { width: 34px; height: 34px; padding: 0; border: 2px solid rgba(255, 255, 255, .6); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
input[type="color"].primary::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].primary::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* tool options */
.st-opts { display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--st-panel2); border-bottom: 1px solid var(--st-line); overflow: hidden; white-space: nowrap; }
.st-opts .hint { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.st-opts .inl { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.st-opts .inl input { width: 110px; accent-color: var(--accent); }
.st-opts .inl b { color: #fff; font-variant-numeric: tabular-nums; min-width: 42px; }
.chip {
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--st-line); background: rgba(255, 255, 255, .06);
  color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: rgba(255, 255, 255, .4); }
.chip[aria-pressed="true"] { background: #fff; color: #0c1222; border-color: transparent; font-weight: 600; }
.swatches .sw { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: var(--c); cursor: pointer; padding: 0; }
.swatches .sw.on { outline: 2px solid var(--accent); outline-offset: 1px; }

/* viewport */
.st-view {
  position: relative; min-height: 0; min-width: 0; overflow: hidden; background: #3a404d;
}
/* in-place text editing: the real text is drawn on the canvas, this box only shows the caret + selection */
.st-inline {
  position: absolute; z-index: 6; margin: 0; padding: 0; border: 1px dashed #4da3ff; border-radius: 2px; background: transparent;
  color: transparent; caret-color: #4da3ff; outline: none; resize: none; overflow: hidden; white-space: pre;
}
.st-inline::selection { background: rgba(77, 163, 255, .4); color: transparent; }
.st-inline::placeholder { color: rgba(110, 120, 145, .85); }
/* floating editor for text on a shape (the caret can't follow curved text) */
.st-inline.pop {
  width: 260px; height: 92px; padding: 8px 10px; color: #fff; background: #1d212a; caret-color: #4da3ff; border: 1px solid #4da3ff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); font: 14px/1.4 system-ui, sans-serif; white-space: pre-wrap; transform: none;
}
.st-inline.pop::selection { background: rgba(77, 163, 255, .5); color: #fff; }
.st-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.st-stat { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--st-panel); border-top: 1px solid var(--st-line); font-size: 12px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.st-stat > * { flex: none; }
.coords { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 120px; }
.zoomv { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }

/* right column */
.st-side { display: flex; flex-direction: column; min-height: 0; background: var(--st-panel); border-left: 1px solid var(--st-line); }
.pv { flex: none; border-bottom: 1px solid var(--st-line); }
.pv-head, .pn-h { display: flex; align-items: center; gap: 6px; padding: 7px 10px; font-size: 12px; }
.pv-head b, .pn-h b { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-right: auto; }
.pv-body {
  position: relative; height: 190px; margin: 0 10px 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--st-line);
  background: radial-gradient(ellipse at 50% 35%, #3a3f4b, #1b1e26 70%); transition: height .25s;
}
.pv.big .pv-body { height: 360px; }
.mp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.mp-canvas:active { cursor: grabbing; }
.pv-body .note { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }

.st-tabs { flex: none; display: flex; gap: 4px; padding: 7px 10px; border-bottom: 1px solid var(--st-line); }
.st-tabs .tab { flex: 1; padding: 6px 8px; border: 1px solid var(--st-line); border-radius: 8px; background: rgba(255, 255, 255, .05); color: var(--text); font-size: 12.5px; cursor: pointer; }
.st-tabs .tab[aria-selected="true"] { background: #fff; color: #0c1222; font-weight: 600; border-color: transparent; }
.st-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.st-pane.others { overflow-y: auto; }
.st-pane.others .pn-body { overflow: visible; padding: 12px 10px 16px; gap: 14px; }
.st-pane.others .note { font-size: 12px; }
.st-pane.others .btn { padding: 7px 10px; font-size: 13px; }
.st-pane.others .actions { grid-template-columns: 1fr 1fr; }
.ly { flex: none; border-bottom: 1px solid var(--st-line); }
.ly .pn-h { padding-right: 6px; }
.ly-bar { display: flex; gap: 0; }
.ly-list { max-height: 120px; min-height: 44px; overflow-y: auto; padding: 0 6px 8px; }
.lyr { display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 8px; cursor: pointer; font-size: 12.5px; border: 1px solid transparent; }
.lyr:hover { background: rgba(255, 255, 255, .06); }
.lyr.sel { background: rgba(77, 163, 255, .2); border-color: rgba(77, 163, 255, .55); }
.lyr.off .ly-name, .lyr.off .ly-ic { opacity: .4; }
.lyr.over { border-top: 2px solid var(--st-hi); }
.ly-ic { width: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.ly-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-edit { flex: 1; min-width: 0; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--st-hi); background: var(--st-bg); color: var(--text); font: inherit; }

.pp { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 14px; }
.pp-body::-webkit-scrollbar, .ly-list::-webkit-scrollbar { width: 8px; }
.pp-body::-webkit-scrollbar-thumb, .ly-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 4px; }
.sec { display: flex; flex-direction: column; gap: 7px; padding: 10px 0; border-bottom: 1px solid var(--st-line); }
.sec:last-child { border-bottom: 0; }
.sec h4 { margin: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 26px; }
.row .lbl { width: 92px; flex: none; color: var(--muted); }
.row input[type="number"], .row select, .sec textarea {
  flex: 1; min-width: 0; padding: 5px 7px; border-radius: 7px; border: 1px solid var(--st-line); background: rgba(255, 255, 255, .06);
  color: var(--text); font: 12.5px/1.2 inherit;
}
.row select option { color: #111; background: #fff; }
.row input[type="color"] { flex: 1; min-width: 0; width: auto; height: 26px; padding: 0 2px; border: 1px solid var(--st-line); border-radius: 7px; background: none; cursor: pointer; }
.row .mini { flex: none; width: 28px; padding: 4px 0; text-align: center; }
.row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.row .rv { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 11.5px; }
.row.chk { cursor: pointer; }
.row.chk .lbl { width: auto; color: var(--text); }
.row.chk input { accent-color: var(--accent); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; min-width: 0; }
.fld { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 8px; border-radius: 7px; border: 1px solid var(--st-line); background: rgba(255, 255, 255, .06); }
.fld:focus-within { border-color: var(--st-hi); }
.fld span { color: var(--muted); font-size: 11px; font-weight: 600; flex: none; }
.fld input[type="number"] { flex: 1; min-width: 0; width: 100%; padding: 5px 0; border: 0; background: transparent; color: var(--text); font: 12.5px/1.2 inherit; outline: none; text-align: right; }
.row input[type="number"] { text-align: right; }
.sec textarea { width: 100%; resize: vertical; font-family: inherit; }
.btns { display: grid; gap: 6px; }
.btns.g1 { grid-template-columns: 1fr; }
.btns.g2 { grid-template-columns: 1fr 1fr; }
.btns.g3 { grid-template-columns: repeat(3, 1fr); }
.btns.g4 { grid-template-columns: repeat(4, 1fr); }
.btns .mini { width: 100%; text-align: center; padding: 6px 4px; }
.mini.wide { width: 100%; padding: 6px 8px; text-align: center; }
.ly-foot { padding: 0 10px 10px; }
.mini { padding: 4px 9px; border-radius: 7px; border: 1px solid var(--st-line); background: rgba(255, 255, 255, .06); color: var(--text); font-size: 12px; cursor: pointer; }
.mini:hover { border-color: rgba(255, 255, 255, .45); }
.mini[aria-pressed="true"] { background: #fff; color: #0c1222; border-color: transparent; font-weight: 600; }

/* narrower windows */
@media (max-width: 1100px) {
  .st-shell { grid-template-columns: 52px minmax(0, 1fr) 260px; }
  .pv-body { height: 160px; }
  .st-opts .hint { display: none; }
}
@media (max-width: 800px) {
  .st-shell { grid-template-columns: 46px minmax(0, 1fr); grid-template-areas: "top top" "tools opts" "tools view" "tools stat"; }
  .st-side { display: none; }
}

/* ---- panel mode: Ribbings / NBA cut / Inside color (picked in the top switch) fill the centre; the artboard tools step aside ---- */
.st-panelview { grid-area: view; min-height: 0; min-width: 0; overflow-y: auto; padding: 28px 20px; background: #3a404d; display: flex; justify-content: center; align-items: flex-start; }
.st-panelcard { width: 100%; max-width: 640px; padding: 22px 26px 28px; border-radius: 16px; background: var(--st-panel); border: 1px solid var(--st-line); box-shadow: 0 12px 40px rgba(0, 0, 0, .3); }
.st-panelcard header h3 { margin: 0 0 4px; font-size: 20px; }
.st-panelbody .modes.three { display: none; }                      /* the top switch replaces these sub-tabs */
.st-panelbody .pn-body { padding: 16px 0 0; overflow: visible; gap: 16px; }
.st-panelbody .note { font-size: 12.5px; }
.st-panelbody .actions { grid-template-columns: 1fr 1fr; }
.st-shell.panel-mode {
  grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: 46px minmax(0, 1fr); grid-template-areas: "top top" "view side";
}
.st-shell.panel-mode .st-tools, .st-shell.panel-mode .st-opts, .st-shell.panel-mode .st-stat, .st-shell.panel-mode .art-only { display: none; }
.st-shell.panel-mode .st-pane { display: none; }                   /* layers + properties belong to the artboard */
.st-shell.panel-mode .pv { flex: 1; display: flex; flex-direction: column; border-bottom: 0; }
.st-shell.panel-mode .pv-body { flex: 1; height: auto; }

/* ---- Processing-style look: glass cards on the blurred backdrop, even gaps, balanced columns ---- */
.studio { background: rgba(10, 12, 20, .5); -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); }
.st-shell { padding: 10px 14px 14px; gap: 10px; grid-template-columns: 60px minmax(0, 1fr) 340px; grid-template-rows: 52px 44px minmax(0, 1fr) 40px; }
.st-top, .st-tools, .st-opts, .st-stat, .st-side, .st-view, .st-panelview {
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03) 60%), rgba(24, 28, 40, .62);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.st-view, .st-panelview { background: rgba(48, 54, 68, .7); }
.st-tools { overflow-y: auto; }
.st-stat { overflow-x: auto; }
.st-top { padding: 0 14px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.st-opts { padding: 0 16px; }
.st-side { border-left: 1px solid rgba(255, 255, 255, .18); }
.st-panelview { padding: 28px 24px; overflow-y: auto; }
.st-shell.panel-mode { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: 52px minmax(0, 1fr); }
.st-shell.panel-mode .st-side { display: flex; }
.pv-body { height: 220px; }
.pv-head, .pn-h { padding: 10px 14px; }
.pv-body { margin: 0 14px 12px; }
.pp-body { padding: 0 14px 16px; }
.ly-list { padding: 0 10px 10px; }
.st-tabs { padding: 9px 14px; }
@media (max-width: 1100px) {
  .st-shell { grid-template-columns: 56px minmax(0, 1fr) 290px; }
  .st-shell.panel-mode { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (max-width: 800px) {
  .st-shell { grid-template-columns: 52px minmax(0, 1fr); }
  .st-shell.panel-mode { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "view"; grid-template-rows: 52px minmax(0, 1fr); }
  .st-shell.panel-mode .st-side { display: none; }
}

/* =====================================================================================================================
   Lightroom-style layout (Develop module): module tabs on top, panels left + right, image in the middle with its toolbar,
   filmstrip of the pattern pieces along the bottom. Flat, dark, small-caps panel headers, thin sliders. Overrides everything above.
   ===================================================================================================================== */
.studio {
  --lr-bg: #1b1b1b; --lr-panel: #2b2b2b; --lr-head: #333; --lr-line: #121212; --lr-edge: #3b3b3b; --lr-text: #bdbdbd; --lr-dim: #8a8a8a; --lr-hi: #f0f0f0; --lr-sel: #4d4d4d;
  --st-bg: var(--lr-bg); --st-panel: var(--lr-panel); --st-panel2: var(--lr-panel); --st-line: var(--lr-line); --st-hi: #8fc1ff;
  background: var(--lr-bg); -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--lr-text);
}
.studio [hidden] { display: none !important; }
.studio .st-shell {
  padding: 0; gap: 0; height: 100%;
  grid-template-columns: 270px minmax(0, 1fr) 306px; grid-template-rows: 40px minmax(0, 1fr) 36px 118px;
  grid-template-areas: "top top top" "left view right" "left stat right" "film film film";
}
.studio .st-shell.panel-mode {
  grid-template-columns: 400px minmax(0, 1fr); grid-template-rows: 40px minmax(0, 1fr) 118px; grid-template-areas: "top top" "left view" "film film";
}
.studio .st-top, .studio .st-left, .studio .st-right, .studio .st-view, .studio .st-panelview, .studio .st-stat, .studio .st-film {
  border: 0; border-radius: 0; box-shadow: none; background: var(--lr-panel); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.st-left { grid-area: left; } .st-right { grid-area: right; } .st-film { grid-area: film; }
.studio .st-view, .studio .st-panelview { background: #1f1f1f; }
.studio .st-top { background: #1a1a1a; border-bottom: 1px solid #000; padding: 0 14px; gap: 6px; }
.studio .st-left { border-right: 1px solid #000; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: thin; }
.studio .st-right { border-left: 1px solid #000; display: flex; flex-direction: column; overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.studio .st-stat { background: #232323; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0 12px; }

/* top bar: identity plate left, module tabs right */
.lr-id { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lr-hi); margin-right: 4px; }
.lr-mods { display: flex; align-items: center; gap: 2px; }
.lr-msep { color: #555; font-size: 13px; padding: 0 4px; }
.lr-mod { border: 0; background: none; color: var(--lr-dim); font: 500 13px/1 inherit; letter-spacing: .02em; padding: 8px 8px; cursor: pointer; border-radius: 4px; }
.lr-mod:hover { color: var(--lr-text); }
.lr-mod[aria-pressed="true"] { color: var(--lr-hi); background: none; text-shadow: 0 0 1px #fff; }
.studio .live { color: var(--lr-dim); }
.studio .btn.sm { background: #3a3a3a; border: 1px solid #1c1c1c; border-radius: 3px; color: var(--lr-text); box-shadow: none; }
.studio .btn.sm:hover { background: #474747; color: #fff; }
.studio .btn.sm.primary { background: #4a4a4a; color: #fff; }
.studio select.btn.sm { padding: 5px 8px; }

/* panels (left column + the right-hand Tools / Properties) */
.lr-panel, .pp { border-bottom: 1px solid #000; background: var(--lr-panel); flex: none; }
.lr-ph, .pv-head {
  display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; height: 28px; background: var(--lr-head); border-top: 1px solid var(--lr-edge); border-bottom: 1px solid #1d1d1d;
  cursor: pointer; user-select: none; position: relative;
}
.lr-ph.static { cursor: default; }
.lr-ph b, .pv-head b { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #cfcfcf; margin-right: auto; }
.lr-ph:hover b { color: #fff; }
.lr-tri { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #9a9a9a; margin-left: 4px; transition: transform .15s; }
.lr-panel.closed .lr-tri { transform: rotate(-90deg); }
.lr-panel.closed .lr-pb { display: none; }
.lr-ph .ly-bar { margin-left: auto; margin-right: 2px; }
.lr-ph .ib { width: 24px; height: 24px; color: #bbb; }
.lr-pb { padding: 0; }
.lr-pb .ly-list { max-height: 190px; padding: 6px 8px 6px; }
.lr-pb .ly-foot { padding: 0 10px 10px; }
.lr-colour { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px 12px; }
.lr-colour .swgrid { margin: 0; padding: 0; grid-template-columns: repeat(7, 20px); gap: 5px; }
.lr-colour .swgrid .sw { width: 20px; height: 20px; border-radius: 3px; }
.lr-colour input[type="color"].primary { flex: none; border-radius: 4px; width: 38px; height: 38px; }
.lr-colour input[type="color"].primary::-webkit-color-swatch { border-radius: 2px; }
.lr-export { display: grid; gap: 6px; padding: 10px 12px 12px; }
.lr-export .btn { justify-content: center; width: 100%; }
.pv-head { cursor: default; }
.pv-head .chip, .pv-head .ib { margin: 0; }
.studio .pv { border: 0; }
.studio .pv-body { margin: 8px 10px 10px; border-radius: 3px; border: 1px solid #111; height: 210px; background: radial-gradient(ellipse at 50% 35%, #3a3a3a, #161616 72%); }
.studio .pv.big .pv-body { height: 380px; }
.studio .chip { border-radius: 3px; background: #3a3a3a; border: 1px solid #1c1c1c; color: var(--lr-text); padding: 3px 9px; }
.studio .chip:hover { background: #474747; color: #fff; }
.studio .chip[aria-pressed="true"] { background: #6a6a6a; color: #fff; font-weight: 500; }

/* layers */
.lyr { border-radius: 2px; }
.lyr:hover { background: #353535; }
.lyr.sel { background: var(--lr-sel); border-color: transparent; color: #fff; }

/* right column: tool strip + options + properties */
.lr-toolp { }
.studio .st-tools { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 8px 8px 6px; border: 0; background: transparent; overflow: visible; }
.studio .tb { width: 40px; height: 32px; border-radius: 3px; background: transparent; color: #a9a9a9; }
.studio .tb:hover { background: #3a3a3a; color: #fff; }
.studio .tb.on { background: #555; color: #fff; box-shadow: inset 0 0 0 1px #777; }
.studio .st-opts { display: flex; flex-wrap: wrap; align-items: center; white-space: normal; gap: 6px 6px; height: auto; padding: 4px 12px 12px; background: transparent; border: 0; overflow: visible; }
.studio .st-opts .hint { font-size: 11.5px; line-height: 1.4; color: var(--lr-dim); white-space: normal; overflow: visible; text-overflow: clip; flex: 1 1 100%; }
.studio .st-opts .sep { display: none; }
.studio .st-opts .inl { flex: 1 1 100%; display: grid; grid-template-columns: 50px 1fr 52px; gap: 8px; }
.studio .st-opts .inl input { width: 100%; }
.studio .pp { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; border-bottom: 0; }
.studio .pp-body { padding: 0; overflow: visible; flex: none; }
.studio .sec { padding: 0 0 8px; gap: 8px; border-bottom: 1px solid #000; border-top: 1px solid var(--lr-edge); }
.studio .sec > :not(h4) { margin-left: 12px; margin-right: 12px; }
.studio .sec h4 {
  display: flex; align-items: center; margin: 0 0 2px; padding: 0 10px 0 12px; height: 28px; background: var(--lr-head); border-bottom: 1px solid #1d1d1d;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #cfcfcf; cursor: pointer; user-select: none;
}
.studio .sec h4 .lr-tri { margin-left: auto; }
.studio .sec.closed { padding-bottom: 0; }
.studio .sec.closed h4 { margin-bottom: 0; }
.studio .sec.closed > :not(h4) { display: none; }
.studio .sec.closed h4 .lr-tri { transform: rotate(-90deg); }
.studio .row { font-size: 11.5px; }
.studio .row .lbl { color: var(--lr-dim); width: 88px; }
.studio .row input[type="number"], .studio .row select, .studio .sec textarea, .studio .fld {
  background: #1f1f1f; border: 1px solid #111; border-radius: 3px; color: #ddd;
}
.studio .row input[type="color"] { border-color: #111; border-radius: 3px; }
.studio .mini { background: #3a3a3a; border: 1px solid #1c1c1c; border-radius: 3px; color: var(--lr-text); }
.studio .mini:hover { background: #474747; color: #fff; }
.studio .mini[aria-pressed="true"] { background: #6a6a6a; color: #fff; font-weight: 500; }
/* Lightroom sliders: label + value on one line, thin track with a small round knob under it */
.studio .row.rng { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; min-height: 0; }
.studio .row.rng .lbl { grid-column: 1; grid-row: 1; width: auto; }
.studio .row.rng .rv { grid-column: 2; grid-row: 1; color: #ddd; }
.studio .row.rng input[type="range"] { grid-column: 1 / -1; grid-row: 2; width: 100%; }
.studio input[type="range"] { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; accent-color: auto; }
.studio input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: #6a6a6a; border-radius: 1px; }
.studio input[type="range"]::-moz-range-track { height: 2px; background: #6a6a6a; border-radius: 1px; }
.studio input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%; background: #c9c9c9; border: 1px solid #111; }
.studio input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #c9c9c9; border: 1px solid #111; }
.studio input[type="range"]:hover::-webkit-slider-thumb { background: #fff; }

/* toolbar under the image */
.studio .coords, .studio .muted { color: var(--lr-dim); }

/* filmstrip of pattern pieces */
.studio .st-film { display: flex; flex-direction: column; background: #232323; border-top: 1px solid #000; min-height: 0; overflow: hidden; }
.lr-fh { display: flex; align-items: center; gap: 12px; height: 22px; padding: 0 14px; background: #2b2b2b; border-bottom: 1px solid #111; flex: none; }
.lr-fh b { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: #cfcfcf; }
.lr-fi { font-size: 11px; color: var(--lr-dim); }
.st-tiles { flex: 1; min-height: 0; display: flex; align-items: center; gap: 8px; padding: 6px 14px; overflow: hidden; }   /* no scrolling: the tiles shrink to fit the row */
.st-tiles .seg-div { width: 1px; align-self: stretch; margin: 6px 2px; background: #444; flex: none; }
.tile {
  flex: 1 1 0; min-width: 0; max-width: 116px; width: auto; height: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden;
  border: 1px solid #111; border-radius: 2px; background: #2e2e2e; color: var(--lr-text); cursor: pointer; font: inherit;
}
.tile:hover { background: #3a3a3a; }
.tile[aria-pressed="true"] { background: #4a4a4a; box-shadow: 0 0 0 2px #cfcfcf; color: #fff; }
.tile .thumb { flex: 1; min-height: 0; width: 100%; display: block; background: #1a1a1a; object-fit: contain; }
.tile .mark { background: #1a1a1a; position: relative; }
.tile .mark::after { content: ''; position: absolute; inset: 14px 22px; border-radius: 3px; }
.tile .mk-rib::after { background: repeating-linear-gradient(90deg, #111 0 7px, #e8e8e8 7px 14px); border: 1px solid #555; }
.tile .mk-nba::after { background: linear-gradient(120deg, transparent 42%, #c8102e 42% 58%, transparent 58%); border: 1px dashed #666; }
.tile .mk-inside::after { background: #777; border: 1px solid #555; }
.tile .tl { flex: none; padding: 3px 6px; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #2b2b2b; }

/* panel mode (Ribbings / NBA cut / Inside color): big 3D box on the left, the controls in the centre */
.studio .st-shell.panel-mode .pv { flex: 1; display: flex; flex-direction: column; }
.studio .st-shell.panel-mode .pv-body { flex: 1; height: auto; }
.studio .st-shell.panel-mode .st-left { overflow: hidden; }
.studio .st-panelcard { border-radius: 4px; background: var(--lr-panel); border: 1px solid #111; box-shadow: none; }

@media (max-width: 1280px) {
  .studio .st-shell { grid-template-columns: 236px minmax(0, 1fr) 270px; }
  .studio .st-shell.panel-mode { grid-template-columns: 320px minmax(0, 1fr); }
  .studio .pv-body { height: 170px; }
}
@media (max-height: 760px) {
  .studio .st-shell { grid-template-rows: 40px minmax(0, 1fr) 36px 96px; }
  .tile { width: 96px; }
}

/* =====================================================================================================================
   Phone layout of the SAME studio (class .phone, set from app.js on phones/tablets): artboard fills the screen, the pattern filmstrip
   and a tab bar sit at the bottom, and each tab opens one panel as a bottom sheet over the artboard.
   ===================================================================================================================== */
.studio:not(.phone) .phone-only { display: none !important; }
.st-dock { grid-area: dock; }
.studio.phone { padding-top: 54px; }
.studio.phone .st-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr) 34px 76px 50px; grid-template-areas: "top" "view" "stat" "film" "dock"; }
.studio.phone .st-shell.panel-mode { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr) 76px 50px; grid-template-areas: "top" "view" "film" "dock"; }
.studio.phone .st-top { overflow-x: auto; scrollbar-width: none; padding: 0 8px; gap: 4px; }
.studio.phone .st-top::-webkit-scrollbar { display: none; }
.studio.phone .st-top > * { flex: none; }
.studio.phone .lr-id, .studio.phone .live, .studio.phone .quota, .studio.phone .st-top .sep, .studio.phone .lr-msep { display: none; }
.studio.phone .st-top .spacer { flex: 1 0 4px; }
.studio.phone .lr-mod { font-size: 12.5px; padding: 8px 7px; }
.studio.phone .st-top .btn.sm { padding: 6px 10px; }
.studio.phone .st-stat .coords { display: none; }
.studio.phone .lr-fh { display: none; }
.studio.phone .st-tiles { padding: 5px 8px; gap: 6px; }
.studio.phone .tile { width: 74px; }
.studio.phone .tile .tl { font-size: 10px; padding: 2px 3px; }
.studio.phone .st-panelview { padding: 12px 10px; }
.studio.phone .st-panelcard { padding: 14px 14px 20px; }

.st-dock { display: flex; background: #1a1a1a; border-top: 1px solid #000; }
.st-dock button { flex: 1; border: 0; background: none; color: var(--lr-dim); font: 500 12.5px/1 inherit; cursor: pointer; border-top: 2px solid transparent; }
.st-dock button[aria-pressed="true"] { color: #fff; background: #2b2b2b; border-top-color: #cfcfcf; }

/* the sheets: left + right asides float over the bottom of the artboard; only the chosen panel shows */
.studio.phone .st-left, .studio.phone .st-right {
  display: none; position: absolute; left: 0; right: 0; bottom: 126px; z-index: 12; max-height: 46vh; overflow-y: auto; overflow-x: hidden;
  border: 0; border-top: 1px solid #000; box-shadow: 0 -12px 30px rgba(0, 0, 0, .55); background: var(--lr-panel); flex-direction: column;
}
.studio.phone .st-shell[data-sheet="tools"] .st-right, .studio.phone .st-shell[data-sheet="props"] .st-right,
.studio.phone .st-shell[data-sheet="layers"] .st-left, .studio.phone .st-shell[data-sheet="3d"] .st-left,
.studio.phone .st-shell[data-sheet="colour"] .st-left, .studio.phone .st-shell[data-sheet="export"] .st-left { display: flex; }
.studio.phone .st-shell[data-sheet="tools"] .st-right .pp { display: none; }
.studio.phone .st-shell[data-sheet="props"] .st-right .lr-toolp { display: none; }
.studio.phone .st-shell[data-sheet="layers"] .st-left > :not(.p-layers),
.studio.phone .st-shell[data-sheet="3d"] .st-left > :not(.pv),
.studio.phone .st-shell[data-sheet="colour"] .st-left > :not(.p-colour),
.studio.phone .st-shell[data-sheet="export"] .st-left > :not(.p-export) { display: none; }
.studio.phone .lr-panel.closed .lr-pb { display: block; }
.studio.phone .lr-panel .lr-tri { display: none; }
.studio.phone .st-shell .pv-body, .studio.phone .st-shell.panel-mode .pv-body { flex: none; height: 230px; }
.studio.phone .st-shell.panel-mode .pv { flex: none; }
.studio.phone .st-shell.panel-mode .st-left { overflow-y: auto; }
/* bigger touch targets */
.studio.phone .tb { width: 48px; height: 42px; }
.studio.phone .row { min-height: 34px; }
.studio.phone .row input[type="number"], .studio.phone .row select { padding: 8px 8px; font-size: 14px; }
.studio.phone .mini, .studio.phone .chip { padding: 8px 10px; font-size: 13px; }
.studio.phone input[type="range"] { height: 26px; }
.studio.phone input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -9px; }
.studio.phone .ib.sm { width: 32px; height: 32px; }

/* fonts from the user's device: picker for the fonts installed on a PC */
.fontpick { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.fp-card { width: min(440px, 100%); max-height: min(620px, 86vh); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #2b2b2b; border: 1px solid #000; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); color: #ddd; }
.fp-card header { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.fp-card input[type="search"] { padding: 8px 10px; border-radius: 4px; border: 1px solid #111; background: #1f1f1f; color: #fff; font: 14px inherit; }
.fp-list { overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.fp-item { text-align: left; padding: 9px 10px; border: 0; border-bottom: 1px solid #1f1f1f; background: none; color: #eee; font-size: 20px; cursor: pointer; }
.fp-item:hover { background: #444; }

/* =====================================================================================================================
   Processing in the same Lightroom-style look as the Design Studio: flat dark panels with small-caps headers, no glass, full window under
   the top tabs. On phones (class .phone, any width <= 900px) the three areas stack: preview, properties, players.
   ===================================================================================================================== */
.page.processing, .page.processing.open {
  --lr-panel: #2b2b2b; --lr-head: #333; --lr-edge: #3b3b3b; --lr-text: #bdbdbd; --lr-dim: #8a8a8a;
  left: 0; top: 56px; width: 100vw; height: calc(100vh - 56px); max-height: none; border-radius: 0; border: 0; box-shadow: none;
  background: #1b1b1b; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--lr-text); padding: 0; gap: 0; transform: none;
}
.page.processing .x { top: 8px; right: 12px; background: #3a3a3a; z-index: 3; }
.page.processing .pc-head { padding: 8px 56px 8px 14px; background: #1a1a1a; border-bottom: 1px solid #000; gap: 8px 14px; flex: none; }
.page.processing .pc-head h2 { font-size: 13px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #f0f0f0; }
.page.processing .pc-sub { font-size: 11.5px; color: var(--lr-dim); }
.page.processing .wp-banner, .page.processing .pc-prog { margin: 6px 14px 0 !important; flex: none; }
.page.processing .pc-grid { padding: 0; gap: 0; grid-template-columns: var(--ro-w, minmax(440px, 1fr)) 1px minmax(560px, 1.35fr); }
.page.processing .pc-roster, .page.processing .pc-side, .page.processing .pc-propcol, .page.processing .pc-pvcol { background: var(--lr-panel); }
.page.processing .pc-split { background: #000; }
.page.processing .pc-split i { display: none; }
.page.processing .pc-roster { padding: 0 0 10px; gap: 8px; border-right: 1px solid #000; }
.page.processing .pc-roster > *:not(.pc-tablewrap):not(.pc-head2) { margin-left: 12px; margin-right: 12px; }
.page.processing .pc-roster::before, .page.processing .pc-pvcol::before, .page.processing .pc-propcol::before {
  display: block; flex: none; height: 28px; line-height: 28px; padding: 0 12px; background: var(--lr-head); border-top: 1px solid var(--lr-edge); border-bottom: 1px solid #1d1d1d;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #cfcfcf;
}
.page.processing .pc-roster::before { content: 'Players'; }
.page.processing .pc-pvcol::before { content: 'Preview'; }
.page.processing .pc-propcol::before { content: 'Properties'; }
.page.processing .pc-pvcol, .page.processing .pc-propcol { padding: 0 0 10px; gap: 8px; }
.page.processing .pc-pvcol > *:not(.pc-previews), .page.processing .pc-propcol > * { margin-left: 12px; margin-right: 12px; }
.page.processing .pc-pvcol > .pc-previews { padding: 0 12px; box-sizing: border-box; }
.page.processing .pc-side { padding: 0; border: 0; }
.page.processing .pc-tablewrap { margin: 0; border: 0; border-radius: 0; background: #232323; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.page.processing .pc-table th { background: #333; color: #cfcfcf; font-size: 10.5px; letter-spacing: .09em; border-bottom: 1px solid #1d1d1d; }
.page.processing .pc-table td { border-top: 1px solid #2f2f2f; }
.page.processing .pc-table tr.sel td { background: #3a3a3a; }
.page.processing .pc-previews canvas { border-radius: 2px; box-shadow: 0 0 0 1px #000; }

/* controls: flat, small radius, grey (same as the studio's .btn.sm / inputs) */
.page.processing .btn, .page.processing .pc-tabs button, .page.processing .pc-garment .chips button, .page.processing .chips button {
  background: #3a3a3a; border: 1px solid #1c1c1c; border-radius: 3px; color: var(--lr-text); box-shadow: none; font-weight: 500;
}
.page.processing .btn:hover, .page.processing .pc-tabs button:hover { background: #474747; color: #fff; border-color: #1c1c1c; }
.page.processing .btn.primary { background: #5a5a5a; color: #fff; }
.page.processing .btn.danger { color: #ffb4b4; }
.page.processing .pc-actions select, .page.processing .pc-form select, .page.processing .pc-form input:not([type=checkbox]):not([type=color]):not([type=file]), .page.processing .pc-table input {
  background: #1f1f1f; border: 1px solid #111; border-radius: 3px; color: #ddd;
}
.page.processing .pc-form input[type=color] { border: 1px solid #111; border-radius: 3px; background: #1f1f1f; }
.page.processing .pc-garment, .page.processing .pc-dblock, .page.processing .pc-layers li { background: #333; border: 1px solid #1c1c1c; border-radius: 3px; }
.page.processing .pc-layers li.on { background: #4d4d4d; border-color: #777; }
.page.processing .pc-layers li.locked { background: #4a4430; border-color: #8b7a2f; }
.page.processing .pc-garment .chips button[aria-pressed="true"], .page.processing .chips button[aria-pressed="true"] { background: #6a6a6a; color: #fff; border-color: #1c1c1c; }
.page.processing .pc-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid #000; }
.page.processing .pc-tabs button { min-height: 34px; border-radius: 0; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 12px; }
.page.processing .pc-tabs button[aria-selected="true"] { background: #3a3a3a; color: #fff; border-bottom-color: #cfcfcf; box-shadow: none; font-weight: 600; }
.page.processing .pc-sec { border-top: 1px solid #000; }
.page.processing .pc-sec > h4 { color: #cfcfcf; }
.page.processing .pc-hint, .page.processing .pc-count, .page.processing .pc-lab, .page.processing .pc-form label { color: var(--lr-dim); }
.page.processing input[type="range"] { -webkit-appearance: none; appearance: none; height: 14px; background: transparent; }
.page.processing input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: #6a6a6a; }
.page.processing input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%; background: #c9c9c9; border: 1px solid #111; }

/* ---- phones / narrow windows: one column, big touch targets ---- */
@media (max-width: 900px) {
  .page.processing, .page.processing.open { top: 54px; height: calc(100vh - 54px); height: calc(100dvh - 54px); overflow-y: auto; display: block; }
  .page.processing .pc-head { position: sticky; top: 0; z-index: 4; padding-right: 54px; }
  .page.processing .pc-sub { display: none; }
  .page.processing .pc-actions { gap: 6px 10px; }
  .page.processing .pc-group + .pc-group { padding-left: 0; border-left: 0; }
  .page.processing .pc-actions .btn, .page.processing .pc-actions select { min-height: 38px; padding: 0 10px; }
  .page.processing .pc-grid { display: flex; flex-direction: column; gap: 0; }
  .page.processing .pc-side { order: -1; display: flex; flex-direction: column; overflow: visible; }
  .page.processing .pc-roster { border-right: 0; overflow: visible; }
  .page.processing .pc-tablewrap { max-height: 56vh; overflow: auto; }
  .page.processing .pc-table { min-width: 620px; }
  .page.processing .pc-table input { min-height: 38px; }
  .page.processing .pc-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.processing .pc-previews canvas { max-height: 46vh; width: auto; }
  .page.processing .pc-tabs { position: sticky; top: 0; }
  .page.processing .pc-tabs button { min-height: 42px; font-size: 12.5px; }
  .page.processing .pc-form { grid-template-columns: 1fr; }
  .page.processing .pc-two { grid-template-columns: 1fr; }
  .page.processing .pc-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page.processing .pc-form select, .page.processing .pc-form input:not([type=checkbox]):not([type=color]):not([type=file]) { min-height: 40px; font-size: 14px; }
  .page.processing .pc-layers .nm { min-height: 42px; }
  .page.processing .pc-layers .eye, .page.processing .pc-layers .del, .page.processing .pc-layers .lock { min-width: 42px; min-height: 42px; }
}

/* "What is this text?" dialog (Design Studio): same card as the font picker, with a one-line explanation under each choice */
.rolepick .fp-item { font-size: 15px; display: block; padding: 11px 12px; }
.rolepick .fp-item small { display: block; margin-top: 2px; font-size: 12px; color: #8a8a8a; }
.rolepick .fp-item.hint { background: #3a3a3a; box-shadow: inset 0 0 0 1px #777; }
.rolepick .note.pad { margin: 0; padding: 0 4px 6px; }

/* Processing: one part at a time (Front / Back / sleeves switch), preview fixed, only Properties scrolls */
.pc-pvsw { display: flex; gap: 0; flex: none; border: 1px solid #1c1c1c; border-radius: 3px; overflow: hidden; align-self: stretch; }
.pc-pvsw button { flex: 1; min-height: 32px; padding: 0 6px; border: 0; border-right: 1px solid #1c1c1c; background: #3a3a3a; color: #bdbdbd; font: inherit; font-size: 12.5px; cursor: pointer; }
.pc-pvsw button:last-child { border-right: 0; }
.pc-pvsw button:hover { background: #474747; color: #fff; }
.pc-pvsw button[aria-selected="true"] { background: #6a6a6a; color: #fff; font-weight: 600; }
.page.processing .pc-pvcol .pc-previews, .page.processing .pc-previews { grid-template-columns: minmax(0, 1fr); }
.page.processing .pc-pvcol { overflow: hidden; }
.page.processing .pc-pvcol > .pc-pvsw { margin-top: 8px; }
.page.processing.phone .pc-previews canvas { max-height: 36vh; }
.page.processing.phone .pc-pvcol { position: sticky; top: var(--pc-head-h, 0px); z-index: 3; padding-bottom: 6px; box-shadow: 0 6px 12px #0008; }
.page.processing.phone .pc-pvcol .pc-snap, .page.processing.phone .pc-pvcol .pc-hint { display: none; }
/* Processing: CSV / player / export in one row; part switch + size caption in the players panel; preview as big as the column allows */
.page.processing .pc-head { flex-wrap: nowrap; }
.page.processing .pc-head > div:first-child { min-width: 0; flex: 0 1 auto; }
.page.processing .pc-actions, .page.processing .pc-group { flex-wrap: nowrap; }
.page.processing .pc-actions { margin-left: auto; min-width: 0; }
.page.processing .pc-actions select { min-width: 0; max-width: 46vw; }
.page.processing .pc-actions .btn { white-space: nowrap; }
@media (max-width: 1250px) { .page.processing .pc-sub { display: none; } }
.page.processing .pc-previews figcaption { display: none; }

.pc-pvinfo { margin: 0 !important; font-size: 12.5px; color: #cfcfcf; }
.pc-pvinfo.bad { color: #ffb4b4; }
.page.processing .pc-pvcol { justify-content: flex-start; }
@media (max-width: 900px) {
  .page.processing .pc-head { flex-wrap: wrap; }
  .page.processing .pc-actions, .page.processing .pc-group { flex-wrap: nowrap; }
}
/* Processing preview: [Front/Back switch] [picture] [size lines] in one row; no "Preview" heading */
.page.processing .pc-pvcol::before { display: none; }
.pc-pvrow { display: grid; grid-template-columns: 62px minmax(0, 1fr) 76px; gap: 8px; align-items: start; width: 100%; }
.pc-pvrow .pc-pvsw { flex-direction: column; align-self: start; margin-top: 8px; }
.pc-pvrow .pc-pvsw button { min-height: 40px; border-right: 0; border-bottom: 1px solid #1c1c1c; font-size: 12px; padding: 0 2px; }
.pc-pvrow .pc-pvsw button:last-child { border-bottom: 0; }
.pc-pvrow .pc-pvinfo { margin-top: 8px !important; font-size: 12px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.page.processing .pc-pvcol > .pc-pvrow { margin-left: 8px; margin-right: 8px; width: auto; }

/* Processing preview: desktop = switch + size line in the Players panel (left); device (<= 900 px) = switch left of the picture, size lines right of it */
.pc-pvrow { display: block; margin-left: 12px !important; margin-right: 12px !important; }
.pc-pvsw-dv, .pc-pvinfo-dv { display: none; }
.pc-pvsw-pc { margin-top: 0; }
.page.processing .pc-pvcol > .pc-pvinfo-pc { text-align: center; }
.page.processing .pc-pvcol > .pc-pvsw-pc { margin-top: 2px; }
.page.processing.phone .pc-pvsw-pc, .page.processing.phone .pc-pvinfo-pc { display: none; }
.page.processing.phone .pc-pvrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) 64px; gap: 8px; align-items: start; margin-left: 8px !important; margin-right: 8px !important; }
.page.processing.phone .pc-pvrow .pc-pvsw-dv { display: flex; flex-direction: column; margin-top: 8px; }
.page.processing.phone .pc-pvrow .pc-pvinfo-dv { display: block; }
/* device: picture up to half of the screen height, thinner side strips so the picture gets the width */
.page.processing.phone .pc-previews canvas { max-height: 50vh; max-height: 50dvh; }
.page.processing.phone .pc-pvrow { grid-template-columns: 46px minmax(0, 1fr) 54px; gap: 6px; }
.page.processing.phone .pc-pvrow .pc-pvinfo-dv { font-size: 11px; }
.page.processing.phone .pc-pvrow .pc-pvsw-dv button { font-size: 11px; }

/* device: the picture takes the full width (up to half the screen high); the Front/Back strip sits on the far left edge and the size lines on the far right edge, over the free space beside the picture */
.page.processing.phone .pc-pvrow { display: block; position: relative; margin: 0 !important; width: 100%; }
.page.processing.phone .pc-pvrow .pc-previews { width: 100%; padding: 0; }
.page.processing.phone .pc-previews canvas { max-height: 50vh; max-height: 50dvh; width: auto; max-width: 100%; margin: 0 auto; display: block; }
.page.processing.phone .pc-pvrow .pc-pvsw-dv { position: absolute; left: 0; top: 8px; width: 44px; z-index: 2; margin: 0; border-left: 0; border-radius: 0 3px 3px 0; background: #2b2b2b; }
.page.processing.phone .pc-pvrow .pc-pvinfo-dv { position: absolute; right: 0; top: 8px; width: 54px; z-index: 2; margin: 0 !important; padding: 4px 6px 4px 2px; text-align: right; background: #2b2b2bcc; border-radius: 3px 0 0 3px; }