  @font-face {
    font-family: 'SpotifyMix';
    src: url('uploads/SpotifyMix-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
  }
  @font-face {
    font-family: 'SFProText';
    src: url('uploads/SF-Pro-Text-Semibold.otf') format('opentype');
    font-weight: 600;
    font-display: swap;
  }
  @font-face {
    font-family: 'AmazonEmber';
    src: url('uploads/AmazonEmber_Bd.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
  }
  @font-face {
    font-family: 'AmazonEmber';
    src: url('uploads/Amazon-Ember-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
  }
  @font-face {
    font-family: 'DeezerProduct';
    src: url('uploads/DeezerProduct-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
  }
  /* Hub language (hub/styles.css). The chrome is paper + warm ink; the STAGE
     surround deliberately stays neutral so a warm cast never biases how the
     artwork reads. --field is split out of --bg because inputs, dropzones and
     the segmented control sit inside the ivory sidebar, not on the stage. */
  :root {
    --bg: #EAE8E4;
    --surface: #F2EFE8;
    --field: #F7F4ED;
    --paper-deep: #E8E3D7;
    --ink: #1A1916;
    --ink-mid: #4A4843;
    --ink-soft: #4A4843;
    --ink-faint: #7A766F;
    --line: #C9C2B5;
    --line-soft: #D8D2C5;
    --accent: #1A1916;
    --orange: #ff4d00;
    --alert: #A33B27;
    --radius: 14px;
    --sidebar-w: 372px;
    --header-h: 81px;
    --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  }
  /* Paper preference carried over from the hub. Stage stays neutral in both. */
  :root[data-paper="white"] {
    --bg: #EEECE9;
    --surface: #FFFFFF;
    --field: #F6F6F6;
    --paper-deep: #EDEDED;
    --line: #D2D2D2;
    --line-soft: #E4E4E4;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  #root { height: 100%; }
  .app { display: flex; height: 100vh; overflow: hidden; }

  /* ---- sidebar ---- */
  .sidebar {
    width: var(--sidebar-w);
    flex: none;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
  }
  .brand {
    display: flex; align-items: center; gap: 13px;
    min-height: var(--header-h); padding: 0 24px;
    border-bottom: 1px solid var(--line);
  }
  /* Matches the hub card glyph for tool 15 (hub/app.js ICONS.previews). */
  .brand-mark { width: 52px; height: 32.5px; flex: none; display: block; color: var(--ink); }
  .brand-title { font-weight: 500; font-size: 18px; letter-spacing: -0.015em; line-height: 1.1; }
  .brand-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; color: var(--ink-soft); margin-top: 4px; }

  .panel-scroll { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
  .group { margin-bottom: 26px; }
  /* Section marker follows the hub's .A-section-strip: small mono caps with a
     hairline running out across the panel. Rank comes from the rule, not size. */
  .group-title {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--ink-soft); margin: 0 0 18px;
  }
  .group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
  .field { margin-bottom: 16px; }
  .field-label { display: block; font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: -0.005em; color: var(--ink-mid, var(--ink-soft)); margin-bottom: 9px; }
  .field-foot { display: block; font-family: var(--mono); font-size: 9px; line-height: 1.6; color: var(--ink-faint); margin-top: 8px; }
  .text-input {
    width: 100%; font: inherit; font-size: 14.5px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 0;
    background: var(--field); color: var(--ink); outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  .text-input:focus { border-color: var(--ink); box-shadow: none; }
  input[type=number].text-input { -moz-appearance: textfield; }

  .switch-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 4px 0; }
  .switch-label { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-mid); }
  .switch { width: 40px; height: 22px; border-radius: 0; background: transparent; border: 1px solid var(--line); position: relative; transition: background .18s, border-color .18s; flex: none; }
  .switch.on { background: var(--ink); border-color: var(--ink); }
  .switch .knob { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 0; background: var(--ink); box-shadow: none; transition: transform .18s, background .18s; }
  .switch.on .knob { transform: translateX(18px); background: var(--surface); }

  /* dropzone */
  .dropzone {
    position: relative; width: 100%; border: 1px dashed var(--line);
    border-radius: 0; background: var(--field); cursor: pointer; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, background .15s;
  }
  .dropzone:hover { border-color: var(--ink-soft); }
  .dropzone.over { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--field)); }
  .dropzone.filled { border-style: solid; }
  .dz-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-faint); padding: 18px; }
  .dz-hint { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; }
  .dz-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
  .dz-remove {
    position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
    border: none; background: rgba(15,15,20,0.62); color: #fff; font-size: 18px; line-height: 1;
    cursor: pointer; backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  }
  .dz-remove:hover { background: rgba(15,15,20,0.85); }

  .primary-btn {
    width: 100%; margin-top: 6px;
    font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    padding: 14px; border: 1px solid var(--ink); border-radius: 0; cursor: pointer;
    background: var(--ink); color: var(--surface);
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    transition: background .15s, border-color .15s;
  }
  .primary-btn:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
  .primary-btn .arrow { color: var(--orange); font-size: 12px; }

  /* ---- main ---- */
  .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .topbar {
    display: flex; align-items: center; gap: 22px;
    min-height: var(--header-h); padding: 12px 28px; border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .seg { display: inline-flex; background: transparent; border: 1px solid var(--line); border-radius: 0; padding: 0; gap: 0; flex: none; }
  .seg-btn {
    font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-soft);
    border: none; background: none; cursor: pointer; padding: 9px 14px; border-radius: 0;
    display: inline-flex; align-items: center; gap: 8px; transition: color .15s, background .15s;
  }
  .seg-btn + .seg-btn { border-left: 1px solid var(--line); }
  .seg-btn:hover { color: var(--ink); }
  .seg-btn.active { background: var(--paper-deep, var(--field)); color: var(--ink); box-shadow: none; }
  .seg-btn svg { width: 12px; height: 12px; }
  .tabs { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; overflow-x: auto; }
  .tab {
    font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-faint);
    border: none; border-bottom: 1px solid transparent; background: none; cursor: pointer;
    padding: 0 0 5px; border-radius: 0; white-space: nowrap;
    transition: color .15s, border-color .15s;
  }
  .tab:hover { color: var(--ink-soft); background: none; }
  .tab.active { color: var(--ink); background: none; border-bottom-color: var(--orange); }

  /* ---- stage ---- */
  /* scrollbar-gutter: the 10px custom scrollbar is classic, not overlay, so it
     takes layout width. A tall (iOS) plate shows it and a short (desktop) one
     does not, and the centred surface bar used to jump 5px each way as it came
     and went - plus once more through the Loading placeholder in between. */
  .stage-scroll, .gallery-scroll { flex: 1; overflow: auto; scrollbar-gutter: stable; padding: 24px 40px 56px; }
  /* One control height across the bar. The ghosts carry 12px SVG icons and the
     iOS/Browser segment is text-only, so equal padding gives unequal heights. */
  .surface-bar { --ctl-h: 32px; display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; position: relative; }
  .surface-bar .adjust-btn, .surface-bar .dl-btn { min-height: var(--ctl-h); }
  .surface-bar .seg { min-height: var(--ctl-h); align-items: stretch; }
  .seg.small .seg-btn { font-size: 8px; padding: 0 13px; display: inline-flex; align-items: center; }
  /* Brand casing beats the uppercase rule: iOS, not IOS. */
  .seg-btn--literal { text-transform: none; letter-spacing: 0.12em; }
  .dl-btn {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-mid);
    border: 1px solid var(--line); background: transparent; cursor: pointer;
    padding: 9px 14px; border-radius: 0; display: inline-flex; align-items: center; gap: 8px;
    transition: border-color .15s, color .15s;
  }
  .dl-btn svg { width: 12px; height: 12px; }
  .dl-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
  .dl-btn:disabled { opacity: .4; cursor: not-allowed; }
  .adjust-btn {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-mid);
    border: 1px solid var(--line); background: transparent; cursor: pointer;
    padding: 9px 14px; border-radius: 0; display: inline-flex; align-items: center; gap: 8px;
    transition: border-color .15s, color .15s;
  }
  .adjust-btn svg { width: 12px; height: 12px; }
  .adjust-btn:hover { border-color: var(--ink); color: var(--ink); }
  .adjust-btn.on { background: #ff2d78; border-color: #ff2d78; color: #fff; }
  .adjust-btn.locked { color: var(--ink-soft); }
  .adjust-btn.locked:hover { border-color: var(--orange); color: var(--ink); }
  .adjust-cluster { position: absolute; left: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
  .adjust-btn.static { position: static; top: auto; left: auto; transform: none; }
  .relock-btn { font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mid); border: 1px solid var(--line); background: transparent; cursor: pointer; padding: 9px 12px; border-radius: 0; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: border-color .15s, color .15s; }
  .relock-btn svg { width: 12px; height: 12px; }
  .relock-btn:hover { border-color: var(--alert); color: var(--alert); }

  /* Locked reads as a quiet recessed panel; unlocked keeps a real warning,
     but in the hub's own alert red rather than an off-palette pink. */
  .lock-card { border: 1px solid var(--line); background: var(--field); border-radius: 0; padding: 14px; }
  .lock-card.unlocked { border-color: var(--alert); background: color-mix(in oklab, var(--alert) 5%, var(--field)); box-shadow: none; }
  .lock-head { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
  .lock-head svg { width: 12px; height: 12px; }
  .lock-head.open { color: var(--alert); }
  .lock-head .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--alert); box-shadow: none; flex: none; }
  .lock-card .ghost-wide.relock { margin-top: 8px; color: var(--ink); }

  .grp-sub { font-weight: 500; color: var(--ink-faint); text-transform: none; letter-spacing: 0; }
  /* Advanced / guard-rail section: sits last and reads quieter than the tasks
     above it. The public build hides it wholesale via this class. */
  .group--advanced { margin-top: 34px; padding-top: 4px; border-top: 1px solid var(--line-soft); opacity: .78; transition: opacity .15s; }
  .group--advanced:hover, .group--advanced:focus-within { opacity: 1; }
  .group--advanced .group-title { color: var(--ink-faint); }

  .pan-ctl { display: block; margin-top: 10px; }
  .pan-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
  .pan-head em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--ink-faint); }
  /* accent-color leaves the UA styling track, fill and thumb separately, which
     gives three different hover states. Own all three instead; --fill is set
     inline from the value so the filled portion still reads. */
  .pan-ctl input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; outline: none;
  }
  .pan-ctl input[type="range"]::-webkit-slider-runnable-track {
    height: 3px; border-radius: 0;
    background: linear-gradient(to right, var(--orange) 0 var(--fill, 0%), var(--line) var(--fill, 0%) 100%);
  }
  .pan-ctl input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 11px; height: 11px; border-radius: 50%; border: none;
    background: var(--orange); margin-top: -4px;
    transition: transform .12s ease;
  }
  .pan-ctl input[type="range"]::-moz-range-track { height: 3px; border-radius: 0; background: var(--line); }
  .pan-ctl input[type="range"]::-moz-range-progress { height: 3px; background: var(--orange); }
  .pan-ctl input[type="range"]::-moz-range-thumb {
    width: 11px; height: 11px; border-radius: 50%; border: none; background: var(--orange);
    transition: transform .12s ease;
  }
  /* One hover state: track, fill and thumb all resolve to this. */
  .pan-ctl input[type="range"]:hover::-webkit-slider-thumb,
  .pan-ctl input[type="range"]:focus-visible::-webkit-slider-thumb { transform: scale(1.35); }
  .pan-ctl input[type="range"]:hover::-moz-range-thumb,
  .pan-ctl input[type="range"]:focus-visible::-moz-range-thumb { transform: scale(1.35); }
  /* Touch: an 11px thumb cannot be grabbed with a finger (taps on the bar land, drags on
     the dot do not). Same 11px dot, drawn in the middle of a 32px thumb. The input is
     widened by the difference so the dot still travels edge to edge, and the track is
     painted only inside the original box, with the fill ending under the dot's centre
     (--fill-n is the value, unitless, set inline). */
  @media (pointer: coarse) {
    .pan-ctl input[type="range"] { height: 32px; width: calc(100% + 21px); margin: 0 -10.5px; touch-action: pan-y; }
    .pan-ctl input[type="range"]::-webkit-slider-runnable-track {
      background: linear-gradient(to right,
        transparent 0 10.5px,
        var(--orange) 10.5px calc(16px + (100% - 32px) * var(--fill-n, 0)),
        var(--line) calc(16px + (100% - 32px) * var(--fill-n, 0)) calc(100% - 10.5px),
        transparent calc(100% - 10.5px) 100%);
    }
    /* The dot is the thumb's own fill, clipped to an 11px core by a transparent border
       that is the grab area. No gradient, no shadow: iOS paints its default white,
       shadowed thumb behind anything it does not fully recognise. */
    .pan-ctl input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none; appearance: none; box-sizing: border-box;
      width: 32px; height: 32px; margin-top: -14.5px; transition: none;
      border: 10.5px solid transparent; border-radius: 50%;
      background: var(--orange); background-clip: padding-box;
      box-shadow: none; -webkit-box-shadow: none;
    }
    .pan-ctl input[type="range"]::-moz-range-thumb {
      box-sizing: border-box; width: 32px; height: 32px; transition: none;
      border: 10.5px solid transparent; border-radius: 50%;
      background: var(--orange); background-clip: padding-box; box-shadow: none;
    }
    .pan-ctl input[type="range"]:hover::-webkit-slider-thumb,
    .pan-ctl input[type="range"]:focus-visible::-webkit-slider-thumb,
    .pan-ctl input[type="range"]:hover::-moz-range-thumb,
    .pan-ctl input[type="range"]:focus-visible::-moz-range-thumb { transform: none; }
  }

  .unlock-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(15,15,18,.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; }
  .unlock-modal { width: 360px; max-width: calc(100vw - 40px); background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
  .unlock-modal.wide { width: 560px; }
  .unlock-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
  .unlock-body { margin: 10px 0 14px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
  .unlock-input { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg, #fafafa); color: var(--ink); letter-spacing: .05em; }
  .unlock-input:focus { outline: none; border-color: #ff2d78; }
  .certify-text { width: 100%; height: 200px; font: 11px/1.4 ui-monospace, Menlo, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg, #fafafa); color: var(--ink); resize: vertical; }
  .unlock-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
  .unlock-cancel, .unlock-go { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; border: 1px solid var(--line); white-space: nowrap; line-height: 1.2; }
  .unlock-cancel { background: var(--surface); color: var(--ink-soft); }
  .unlock-cancel:hover { border-color: var(--ink-faint); color: var(--ink); }
  .unlock-go { background: #ff2d78; border-color: #ff2d78; color: #fff; }
  .unlock-go:disabled { opacity: .4; cursor: not-allowed; }

  .stage-wrap { display: block; }
  /* Deliberately NOT square: the screenshots are full-bleed rectangles with no
     corners of their own, so this radius is what makes a device read as a
     device. Note the exported PNG is the raw canvas, so it has neither this
     radius nor the shadow - the preview flatters the output at the corners. */
  .stage-card {
    /* Transparent, NOT white: the desktop plates (Spotify, Apple Music) carry a
       transparent margin around a rounded window, and a white fill behind that
       reads as a pale band around the window. Letting it composite onto the
       stage removes the band. No plate bakes its own shadow any more - the
       Spotify desktop one used to, clipped hard at the bitmap edge, and was
       rebuilt clean - so this box-shadow is the only shadow the card gets.
       The card is sized to the plate's WINDOW (see plateInset in app.jsx) with
       the full plate offset inside it, so the shadow hugs the window rather
       than starting a margin's width outside it. */
    position: relative; border-radius: 14px; overflow: hidden; background: transparent; margin: 0 auto;
    box-shadow: 0 14px 34px -20px rgba(20,20,30,0.30);
  }
  /* The stage owns touches only while a template is being adjusted; otherwise a finger
     on the preview must scroll the page (on a phone the preview fills the screen). */
  .stage-canvas-wrap { position: relative; line-height: 0; touch-action: auto; }
  .stage-wrap.adjusting .stage-canvas-wrap { touch-action: none; }
  .stage-canvas { width: 100%; height: 100%; display: block; }
  .stage-loading { display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; background: var(--surface); border-radius: 14px; }
  .adjust-hint { text-align: center; margin: 18px auto 0; font-size: 12.5px; color: var(--ink-faint); }
  .adjust-tools { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 16px; }
  .adjust-tools .adjust-hint { margin: 0; }
  /* Hub language (adjust mode only): mono-caps label, hairline square group,
     a 1px track with a square ink thumb - no pill, no circle, no drop shadow. */
  .opacity-ctl { display: inline-flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 8px; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mid);
    background: var(--surface); border: 1px solid var(--line); padding: 0 14px; min-height: 30px; border-radius: 0; }
  .opacity-ctl input[type=range] { -webkit-appearance: none; appearance: none; width: 150px; height: 1px; border-radius: 0;
    background: var(--line); outline: none; margin: 0; }
  .opacity-ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 14px;
    border-radius: 0; background: var(--ink); cursor: pointer; border: none; box-shadow: none; }
  .opacity-ctl input[type=range]::-moz-range-thumb { width: 10px; height: 14px; border-radius: 0; background: var(--ink); cursor: pointer; border: none; }
  .opacity-val { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--ink-soft); min-width: 34px; text-align: right; }
  .adjust-row { display: flex; align-items: center; gap: 12px; }
  /* Filled-ink hub button (page.css .A-btn shape) at the opacity control's height. */
  .blackout-add { font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--surface); background: var(--ink); border: 1px solid var(--ink); border-radius: 0; padding: 0 14px; min-height: 30px;
    cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; }
  .blackout-add:hover { background: var(--ink-mid); border-color: var(--ink-mid); filter: none; }
  .blackout-box { position: absolute; background: rgba(0,0,0,0.88); border: 1.5px dashed #fff; cursor: move; touch-action: none; z-index: 4; }
  .bo-tag { position: absolute; top: -11px; left: 6px; font-size: 10px; font-weight: 700; color: #000; background: #fff;
    padding: 2px 6px; border-radius: 4px; font-family: var(--mono); }
  .bo-del { position: absolute; top: -11px; right: -11px; width: 21px; height: 21px; border-radius: 50%; border: none;
    background: #ff2d78; color: #fff; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
  .bo-grip { position: absolute; right: -7px; bottom: -7px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid #000; cursor: nwse-resize; }

  /* Hub language: one square hairline group, hairline dividers between the
     controls rather than three separate rounded keys on a floating pill. */
  .zoombar { position: sticky; bottom: 0; display: flex; align-items: stretch; justify-content: center; gap: 0;
    margin: 18px auto 0; width: max-content; background: var(--surface); border: 1px solid var(--line);
    border-radius: 0; padding: 0; box-shadow: none; }
  .zoombar button { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); border: none;
    background: transparent; width: 32px; min-height: 30px; border-radius: 0; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; transition: background .15s, color .15s; }
  .zoombar button + *, .zoombar .zoom-val + button { border-left: 1px solid var(--line); }
  .zoombar button:hover:not(:disabled) { background: var(--paper-deep); }
  .zoombar button:disabled { color: var(--ink-faint); cursor: not-allowed; }
  .zoom-val { display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9px;
    letter-spacing: 0.14em; color: var(--ink-soft); min-width: 58px; text-align: center; }
  .zoombar .zoom-reset { width: auto; padding: 0 14px; font-size: 8px; font-weight: 500; letter-spacing: 0.18em;
    text-transform: uppercase; color: var(--ink-soft); }
  .zoombar .zoom-reset:hover { color: var(--ink); }
  .stage-wrap.adjusting .stage-card { box-shadow: 0 0 0 2px var(--orange), 0 24px 60px -22px rgba(20,20,30,0.4); }

  /* region boxes */
  .region-box {
    position: absolute; box-sizing: border-box; cursor: move;
    border: 2px solid #ff2d78; background: rgba(255,45,120,0.10);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.6) inset;
  }
  .region-box.shape-circle { border-radius: 50%; }
  .region-box.shape-square { border-radius: 4px; }
  .region-tag {
    position: absolute; top: -11px; left: 8px; font-size: 10.5px; font-weight: 700; line-height: 1;
    color: #fff; background: #ff2d78; padding: 3px 7px; border-radius: 5px; white-space: nowrap; pointer-events: none;
    font-family: var(--mono); letter-spacing: -0.02em;
  }
  .region-handle {
    position: absolute; right: -8px; bottom: -8px; width: 17px; height: 17px; border-radius: 50%;
    background: #fff; border: 2.5px solid #ff2d78; cursor: nwse-resize; touch-action: none;
  }
  .region-pan {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 30px; height: 30px; border-radius: 50%; background: rgba(255,45,120,0.92); color: #fff;
    border: 2px solid #fff; cursor: move; touch-action: none; display: flex; align-items: center; justify-content: center;
    font-size: 15px; box-shadow: 0 1px 5px rgba(0,0,0,0.3); user-select: none;
  }
  /* foreground (text / icon) handles — blue to distinguish from photo regions */
  .fg-handle {
    position: absolute; cursor: move; touch-action: none; z-index: 3;
    display: inline-flex; align-items: center; white-space: nowrap;
    background: #2d7bff; color: #fff; font-size: 10.5px; font-weight: 700;
    padding: 4px 9px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    font-family: var(--mono); letter-spacing: -0.02em;
  }
  .fg-handle::after { content: ""; position: absolute; left: 9px; bottom: -5px; width: 8px; height: 8px;
    background: #2d7bff; transform: rotate(45deg); border-radius: 1px; }
  .fg-handle.icon { border-radius: 50%; width: 26px; height: 26px; justify-content: center; padding: 0;
    background: rgba(45,123,255,0.92); border: 2px solid #fff; }
  .fg-handle.icon::after { display: none; }
  .fg-handle.icon span { font-size: 9px; }
  .fg-grip { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #2d7bff;
    margin-left: 7px; cursor: ew-resize; flex: none; }
  .fg-handle.icon .fg-grip { position: absolute; right: -6px; bottom: -6px; margin: 0; }
  /* gradient band handle */
  .fg-scrim { position: absolute; cursor: move; touch-action: none; z-index: 2;
    border: 1.5px dashed #b06cff; background: rgba(176,108,255,0.10); }
  .fg-scrim-tag { position: absolute; top: 4px; right: 8px; font-size: 10px; font-weight: 700; color: #fff;
    background: #b06cff; padding: 3px 7px; border-radius: 5px; font-family: var(--mono); }
  .fg-scrim-grip { position: absolute; bottom: -7px; right: -7px;
    width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid #b06cff; cursor: nwse-resize; }
  .fg-scrim.overlay { border-color: #19b36b; background: rgba(25,179,107,0.08); }
  .fg-scrim.overlay .fg-scrim-tag { background: #19b36b; }
  .fg-scrim.overlay .fg-scrim-grip { border-color: #19b36b; }
  .fg-scrim.overlay.locked { cursor: default; pointer-events: none; border-style: solid; border-color: rgba(25,179,107,0.55); background: transparent; }

  /* gallery */
  /* Gallery bar: the same slot as the single view's Download PNG (top right of the stage). */
  .gallery-bar { justify-content: flex-end; min-height: var(--ctl-h); max-width: 1180px; margin: 0 auto 22px; }
  .gallery-group { max-width: 1180px; margin: 0 auto; }
  .gallery-group + .gallery-group { margin-top: 40px; }
  .gallery-group .group-title { margin-bottom: 18px; }
  .gallery { display: grid; gap: 26px 20px; width: 100%; max-width: 1180px; margin: 0 auto; align-items: start; }
  .gtile { display: flex; flex-direction: column; gap: 10px; align-items: stretch; border: none; background: none; padding: 0; cursor: pointer; font: inherit; }
  /* Same reasoning as .stage-card: the screenshots are full-bleed rectangles
     with no corners of their own, so the radius is what makes a device read as
     a device. Kept soft deliberately; the labels below follow the hub. */
  .gtile-frame { position: relative; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 10px 26px -12px rgba(20,20,30,0.35), 0 1px 4px rgba(20,20,30,0.08); transition: transform .12s, box-shadow .12s; }
  .gtile:hover .gtile-frame { transform: translateY(-3px); box-shadow: 0 18px 36px -14px rgba(20,20,30,0.45); }
  .gtile-canvas { width: 100%; height: 100%; display: block; }
  .gtile-loading { width: 100%; height: 100%; background: var(--line-soft); }
  .gtile-label { display: flex; align-items: baseline; gap: 8px; font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding-left: 0; transition: color .15s; }
  .gtile:hover .gtile-label { color: var(--ink); }
  .gtile-label em { font-style: normal; color: var(--ink-faint); font-weight: 500; letter-spacing: 0.1em; }
  /* iOS keeps its brand casing, as in the surface switcher. */
  .gtile-label em.literal { text-transform: none; }

  .ghost-wide {
    width: 100%; margin-top: 12px;
    font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-mid, var(--ink-soft));
    border: 1px solid var(--line); background: transparent; cursor: pointer; padding: 10px; border-radius: 0;
    transition: border-color .15s, color .15s;
  }
  .ghost-wide:hover { border-color: var(--ink); color: var(--ink); }
  .primary-btn:disabled { opacity: .4; cursor: not-allowed; }

  /* scrollbars */
  .panel-scroll::-webkit-scrollbar, .stage-scroll::-webkit-scrollbar, .gallery-scroll::-webkit-scrollbar { width: 10px; }
  .panel-scroll::-webkit-scrollbar-thumb, .stage-scroll::-webkit-scrollbar-thumb, .gallery-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; border: 3px solid var(--bg); }

/* ═══ Hub hosting layer (additions — everything above is the prototype CSS, untouched) ═══ */

/* artist picker (editor entry screen) */
/* ── Artist picker: ported to the OOC hub language (hub/styles.css + page.css).
   Hub tokens are declared HERE rather than loading hub/styles.css globally,
   because both sheets define --ink and a global load would restyle the editor. ── */
.picker-wrap {
  --paper: #F2EFE8; --paper-deep: #E8E3D7; --paper-soft: #F7F4ED;
  --rule: #C9C2B5; --rule-soft: #D8D2C5; --backdrop: #DCD7CB;
  --ink: #1A1916; --ink-mid: #4A4843; --ink-soft: #7A766F; --ink-faint: #A8A39A;
  --orange: #ff4d00;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--backdrop); font-family: var(--sans); color: var(--ink); padding: 40px 20px;
}
/* Paper preference set on the hub (localStorage 'ooc.paper', same origin) —
   mirrors :root[data-paper="white"] in hub/styles.css. */
:root[data-paper="white"] .picker-wrap {
  --paper: #FFFFFF; --paper-deep: #EDEDED; --paper-soft: #F6F6F6;
  --rule: #D2D2D2; --rule-soft: #E4E4E4; --backdrop: #D9D9D9;
}
.picker-card { --knockout: var(--paper); width: 560px; max-width: 100%; background: var(--paper); border: none; border-radius: 18px; padding: 36px 40px 30px; box-shadow: none; }

.picker-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.picker-title { font-family: var(--sans); font-weight: 500; font-size: 22px; letter-spacing: -0.015em; line-height: 1.1; color: var(--ink); }
.picker-sub { font-family: var(--mono); font-size: 10px; line-height: 1.6; color: var(--ink-soft); margin-top: 4px; }

.picker-label { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }

/* Hairline-separated rows, the hub's .A-row pattern — no boxes, no radius. */
.picker-list { display: block; margin: 0 0 26px; max-height: 320px; overflow-y: auto; border-top: 1px solid var(--rule); }
.picker-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; text-align: left;
  font-family: var(--sans); color: var(--ink); background: transparent;
  border: none; border-bottom: 1px solid var(--rule-soft); border-radius: 0; padding: 15px 4px; cursor: pointer;
  transition: background .2s; }
.picker-item:hover { background: var(--paper-soft); }
.picker-item b { flex: 1; min-width: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .meta { flex: none; font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.picker-item .del { flex: none; border: none; background: none; color: var(--ink-faint); font-family: var(--mono); font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 0; transition: color .15s; }
.picker-item .del:hover { color: var(--orange); background: transparent; }
.picker-empty { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); text-align: left; padding: 26px 4px; border-bottom: 1px solid var(--rule-soft); }

.picker-new { display: flex; gap: 10px; margin-top: 0; }
.picker-new .text-input { flex: 1; width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 0;
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; outline: none; transition: border-color .15s; }
.picker-new .text-input:focus { border-color: var(--ink); }
.picker-new .text-input::placeholder { color: var(--ink-faint); }
.picker-new .primary-btn { width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 0; padding: 12px 20px;
  cursor: pointer; transition: background .15s, border-color .15s; }
.picker-new .primary-btn .arrow { color: var(--orange); font-size: 12px; }
.picker-new .primary-btn:hover { background: var(--ink-mid); border-color: var(--ink-mid); }
.picker-new .primary-btn:disabled { background: var(--ink-faint); border-color: var(--ink-faint); cursor: not-allowed; }

.picker-foot { font-family: var(--mono); font-size: 9px; line-height: 1.6; color: var(--ink-faint); margin: 22px 0 0; }
.picker-hub { display: inline-block; margin-top: 18px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; transition: color .15s; }
.picker-hub:hover { color: var(--ink); }

/* sidebar artist bar + share section */
.artist-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.artist-switch { font-family: var(--mono); font-size: 8px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line);
  background: transparent; cursor: pointer; padding: 7px 12px; border-radius: 0; white-space: nowrap; transition: border-color .15s, color .15s; }
.artist-switch:hover { border-color: var(--ink); color: var(--ink); }
.share-row { display: flex; gap: 8px; }
.share-row .ghost-wide { margin-top: 0; }
.save-dot { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.save-dot.saving { color: var(--orange); }
.brand a.hub-back { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mid); background: transparent; border: 1px solid var(--rule); border-radius: 0; padding: 7px 14px; text-decoration: none; margin-left: auto; white-space: nowrap; transition: border-color .15s, color .15s; }
.brand a.hub-back:hover { border-color: var(--ink); color: var(--ink); }

/* tweaks activator (posts __activate_edit_mode; panel comes from tweaks-panel.jsx) */
.tweaks-fab { position: fixed; right: 14px; bottom: 14px; z-index: 999; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-faint); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px -6px rgba(20,20,30,0.3); }
.tweaks-fab:hover { color: var(--ink); border-color: var(--ink-faint); }

/* shared (view-only) topbar badge */
.shared-badge { margin-left: auto; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-faint); font-family: var(--mono); white-space: nowrap; }

/* ═══ Phone layout (≤768px): preview first, controls below, one gallery column ═══
   The stage width and gallery columns follow in app.jsx (NARROW_PX). */
@media (max-width: 768px) {
  /* Nothing may push the page wider than the phone: an overflow makes the browser widen
     its viewport and everything after is laid out against the wrong width. */
  html, body { overflow-x: clip; max-width: 100%; }
  .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .main { order: 1; }
  .sidebar { order: 2; width: 100%; border-right: none; border-top: 1px solid var(--line); }
  .panel-scroll { overflow: visible; padding: 16px 12px 28px; }
  .topbar { padding: 12px; gap: 14px; overflow-x: auto; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .stage-scroll, .gallery-scroll { overflow: visible; scrollbar-gutter: auto; padding: 16px 12px 28px; }
  .surface-bar { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
  .surface-bar .dl-btn { position: static; transform: none; margin-left: auto; }
  .zoombar { display: none; }
  /* Photo position sliders, docked above the preview and stuck to the top of the screen
     while it scrolls, so the photo moves under the finger that is moving it. Only there
     once a photo is in (the markup is conditional). */
  .pan-dock {
    position: sticky; top: 0; z-index: 30;
    margin: 0 -12px 12px; padding: 8px 12px 2px;
    background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .pan-dock .pan-ctl { margin-top: 0; }
  .pan-dock .pan-head { margin-bottom: 0; }
  .gallery-bar { justify-content: flex-start; }
  .gallery-bar .dl-btn { margin-left: 0; }
  .gallery { width: 100%; }
}
