/* ===== JP-S1 shell + tokens (jp-s3-1) =====
   Structure reference only (compact top bar, tag rail, mobile header + bottom nav). GH's own marks, copy and tokens.
   Loaded last so it can retire the left sidebar and floor every control size. */
:root{
  /* color: GH black surfaces, selective purple + pink */
  --gh-color-bg:#000;
  --gh-color-surface:#0b0b0c;
  --gh-color-raised:#141416;
  --gh-color-overlay:#1b1b1f;
  --gh-color-line:#26262b;
  --gh-color-line-strong:#3a3a41;
  --gh-color-text:#fff;
  --gh-color-muted:#a9a9b0;
  --gh-color-dim:#7d7d85;
  --gh-color-purple:#7b3cff;
  --gh-color-purple-soft:rgba(123,60,255,.16);
  --gh-color-pink:#ff66c4;
  --gh-color-pink-soft:rgba(255,102,196,.14);
  --gh-color-focus:#ff66c4;
  --gh-color-warn-bg:#1a1208;
  --gh-color-warn-line:#c9a227;
  /* spacing (4px grid) */
  --gh-space-1:4px;--gh-space-2:8px;--gh-space-3:12px;--gh-space-4:16px;--gh-space-5:20px;--gh-space-6:24px;--gh-space-8:32px;
  /* radius */
  --gh-radius-sm:6px;--gh-radius-md:8px;--gh-radius-lg:10px;--gh-radius-pill:999px;
  /* type scale */
  --gh-font-label:11px;--gh-font-sm:12px;--gh-font-md:13px;--gh-font-base:14px;--gh-font-lg:16px;--gh-font-xl:20px;--gh-font-2xl:28px;
  /* control sizes */
  --gh-bar-h:56px;--gh-control-h:36px;--gh-control-min:32px;--gh-hit:44px;
  --gh-rail-h:52px;
  /* bridge legacy theme vars onto the tokens */
  --bg:var(--gh-color-bg);--panel:var(--gh-color-surface);--raised:var(--gh-color-raised);
  --line:var(--gh-color-line);--line-strong:var(--gh-color-line-strong);
  --text:var(--gh-color-text);--muted:var(--gh-color-muted);--dim:var(--gh-color-dim);
  --pink:var(--gh-color-pink);--purple:var(--gh-color-purple);
}
body{background:var(--gh-color-bg);font-size:var(--gh-font-base)}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------- retire the left sidebar at every width ---------- */
.sidebar{display:none!important}
.main-shell{margin-left:0!important}
.skip-link{left:12px}
.toast{left:50%!important}

/* ---------- compact top bar (desktop / tablet) ---------- */
.topbar.gh-shell-bar{
  position:sticky;top:0;z-index:60;
  display:flex;align-items:center;gap:var(--gh-space-4);
  height:var(--gh-bar-h)!important;min-height:var(--gh-bar-h)!important;max-height:none!important;
  padding:0 var(--gh-space-5)!important;margin:0;
  background:rgba(0,0,0,.94);border-bottom:1px solid var(--gh-color-line);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  overflow:visible!important;box-sizing:border-box;
}
html.gh-has-home-top .main-shell > .topbar.gh-shell-bar{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;height:var(--gh-bar-h)!important;max-height:none!important;min-height:var(--gh-bar-h)!important;padding:0 var(--gh-space-5)!important;border-bottom:1px solid var(--gh-color-line)!important;overflow:visible!important}
.shell-left{display:flex;align-items:center;gap:var(--gh-space-4);min-width:0;flex:0 0 auto}
.shell-brand{display:inline-flex;align-items:center;min-height:var(--gh-hit);padding:0 var(--gh-space-1);border-radius:var(--gh-radius-sm);flex:0 0 auto}
.shell-brand .shell-logo{height:24px;width:auto;filter:none}
.shell-nav{display:flex;align-items:center;gap:2px}
.shell-nav a{
  display:inline-flex;align-items:center;gap:6px;height:var(--gh-control-h);padding:0 var(--gh-space-3);
  border-radius:var(--gh-radius-md);font-size:var(--gh-font-md);font-weight:600;color:var(--gh-color-muted);white-space:nowrap;
}
.shell-nav a:hover{color:var(--gh-color-text);background:var(--gh-color-raised)}
.shell-nav a.active{color:var(--gh-color-text);background:var(--gh-color-raised);box-shadow:inset 0 -2px 0 var(--gh-color-pink)}
.shell-nav .nav-count{font-size:var(--gh-font-label);line-height:1;min-width:18px;height:18px;padding:0 5px;border-radius:var(--gh-radius-pill);display:inline-grid;place-items:center;background:var(--gh-color-purple-soft);color:#dccfff;border:1px solid rgba(123,60,255,.45)}/*tf12*/.shell-nav .nav-count{font-size:12px}/*/tf12*/
.shell-search{flex:1 1 auto;min-width:160px;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:var(--gh-space-2)}
.shell-search-field{
  flex:1;display:flex;align-items:center;gap:var(--gh-space-2);height:var(--gh-control-h);padding:0 var(--gh-space-2) 0 var(--gh-space-3);
  background:var(--gh-color-raised);border:1px solid var(--gh-color-line-strong);border-radius:var(--gh-radius-pill);color:var(--gh-color-muted);cursor:text;
}
.shell-search-field:focus-within{border-color:var(--gh-color-pink);box-shadow:0 0 0 3px var(--gh-color-pink-soft)}
.shell-search-field input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--gh-color-text);font-size:var(--gh-font-base);outline:none;padding:0}
.shell-search-field input::placeholder{color:var(--gh-color-dim)}
.shell-search-field input::-webkit-search-cancel-button{filter:invert(1) grayscale(1);opacity:.6}
.shell-search-field input:focus-visible{outline:none}
.shell-kbd{font:600 var(--gh-font-label)/1 Inter,Arial,sans-serif;min-width:22px;height:22px;display:inline-grid;place-items:center;padding:0 6px;border-radius:var(--gh-radius-sm);border:1px solid var(--gh-color-line-strong);color:var(--gh-color-muted);background:var(--gh-color-surface)}
.shell-search-field:focus-within .shell-kbd{display:none}
.shell-search-close{display:none}
.shell-ic{display:block;flex:0 0 auto}
.shell-right{display:flex;align-items:center;gap:var(--gh-space-3);flex:0 0 auto;min-width:0}
.shell-right .breadcrumb{display:none!important}
.shell-right .status-label{display:inline-flex;align-items:center;gap:6px;font-size:var(--gh-font-sm)!important;letter-spacing:.02em!important;color:var(--gh-color-muted);white-space:nowrap;max-width:none!important;overflow:visible}
.shell-right .status-label:empty{display:none}
.shell-right .status-label>span{width:7px;height:7px;border-radius:50%;display:inline-block}
.shell-actions{display:flex;align-items:center;gap:var(--gh-space-1)}
.shell-icon-btn,
.topbar .shell-icon-btn.circle-button{
  width:var(--gh-control-h)!important;height:var(--gh-control-h)!important;min-width:var(--gh-control-h)!important;min-height:var(--gh-control-h)!important;
  display:inline-grid;place-items:center;padding:0;border-radius:var(--gh-radius-pill);
  border:1px solid var(--gh-color-line-strong);background:var(--gh-color-raised);color:var(--gh-color-text);font-size:var(--gh-font-base);
}
.shell-icon-btn:hover{border-color:var(--gh-color-muted);background:var(--gh-color-overlay)}
.shell-icon-btn[aria-expanded="true"]{border-color:var(--gh-color-pink);color:var(--gh-color-pink)}
.shell-search-toggle{display:none!important}
/* visible focus for every shell control */
.gh-shell-bar a:focus-visible,.gh-shell-bar button:focus-visible,.tag-rail button:focus-visible,.mobile-nav a:focus-visible,
.notif-panel a:focus-visible,.notif-panel button:focus-visible,.account-menu-item:focus-visible{outline:2px solid var(--gh-color-focus)!important;outline-offset:2px!important}
.shell-search-field:has(input:focus-visible){outline:2px solid var(--gh-color-focus);outline-offset:2px}

/* ---------- session banner: in flow under the bar (never over the mark) ---------- */
.gh-pb-session-banner{position:relative!important;top:auto!important;z-index:1!important;background:var(--gh-color-warn-bg);border-bottom:1px solid var(--gh-color-warn-line);font-size:var(--gh-font-md)}
.gh-pb-session-banner-inner{padding:var(--gh-space-2) var(--gh-space-5);gap:var(--gh-space-3)}
.gh-pb-session-banner .button{min-height:var(--gh-control-h);font-size:var(--gh-font-sm)}

/* ---------- tag rail (discover) ---------- */
.tag-rail{background:var(--gh-color-bg);border-bottom:1px solid var(--gh-color-line);position:relative;z-index:5}
.tag-rail-inner{display:flex;align-items:center;gap:var(--gh-space-2);padding:var(--gh-space-2) var(--gh-space-5);max-width:100%;box-sizing:border-box}
.tag-rail-track{flex:1 1 auto;min-width:0;display:flex;gap:var(--gh-space-2);overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;scroll-behavior:smooth;padding:2px}
.tag-rail-track::-webkit-scrollbar{display:none}
.tag-rail.is-expanded .tag-rail-track{flex-wrap:wrap;overflow:visible}
.tag-rail.is-expanded .tag-rail-scroll{display:none}
.rail-chip{
  flex:0 0 auto;display:inline-flex;align-items:center;height:var(--gh-control-h);padding:0 var(--gh-space-4);
  border-radius:var(--gh-radius-pill);border:1px solid var(--gh-color-line-strong);background:var(--gh-color-raised);
  color:var(--gh-color-muted);font-size:var(--gh-font-md);font-weight:600;white-space:nowrap;
}
.rail-chip:hover{color:var(--gh-color-text);border-color:var(--gh-color-muted)}
.rail-chip.active{background:var(--gh-color-pink);border-color:var(--gh-color-pink);color:#12030c}
.rail-chip[data-tag-filter=""].active{background:var(--gh-color-purple);border-color:var(--gh-color-purple);color:#fff}
.tag-rail-scroll{flex:0 0 auto;width:var(--gh-control-h);height:var(--gh-control-h);border-radius:var(--gh-radius-pill);border:1px solid var(--gh-color-line-strong);background:var(--gh-color-surface);color:var(--gh-color-text);font-size:20px;line-height:1;display:inline-grid;place-items:center}
.tag-rail-toggle{flex:0 0 auto;height:var(--gh-control-h);padding:0 var(--gh-space-3);border-radius:var(--gh-radius-md);color:var(--gh-color-pink);font-size:var(--gh-font-md);font-weight:600;white-space:nowrap}
.tag-rail-toggle:hover{background:var(--gh-color-pink-soft);color:var(--gh-color-pink)}

/* ---------- notifications popover (honest empty state, no badge) ---------- */
.notif-panel{position:fixed;top:64px;right:12px;z-index:1000;width:min(340px,calc(100vw - 16px));box-sizing:border-box;padding:var(--gh-space-4);background:var(--gh-color-surface);border:1px solid var(--gh-color-line-strong);border-radius:var(--gh-radius-lg);box-shadow:0 16px 40px rgba(0,0,0,.65)}
.notif-title{font-size:var(--gh-font-lg);letter-spacing:-.01em;margin:0 0 var(--gh-space-3);color:var(--gh-color-text)}
.notif-empty{display:grid;justify-items:start;gap:var(--gh-space-2);padding:var(--gh-space-4);border:1px dashed var(--gh-color-line-strong);border-radius:var(--gh-radius-md)}
.notif-empty-title{font-size:var(--gh-font-base);font-weight:600;color:var(--gh-color-text);margin:0}
.notif-empty-copy{font-size:var(--gh-font-md);color:var(--gh-color-muted);margin:0}
.notif-cta{margin-top:var(--gh-space-1);min-height:var(--gh-control-h);font-size:var(--gh-font-md)!important}

/* ---------- account menu on tokens ---------- */
.account-menu{background:var(--gh-color-surface);border-color:var(--gh-color-line-strong);border-radius:var(--gh-radius-lg);min-width:220px}
.account-menu-item{min-height:var(--gh-control-h);font-size:var(--gh-font-base);display:flex;align-items:center;border-radius:var(--gh-radius-sm)}
.account-menu-item:hover,.account-menu-item:focus-visible{background:var(--gh-color-raised)}

/* ---------- page offsets under a sticky bar (desktop body scroll) ---------- */
@media (min-width:651px){
  .mobile-nav{display:none!important}
  .chat-page{height:calc(100dvh - var(--gh-bar-h) - var(--gh-banner-h,0px))!important}
  .notebook.open{top:calc(var(--gh-bar-h) + var(--gh-banner-h,0px))!important}
}
@media (min-width:651px) and (max-width:1100px){
  .topbar.gh-shell-bar{gap:var(--gh-space-3);padding:0 var(--gh-space-4)!important}
  .shell-left{gap:var(--gh-space-2)}
  .shell-brand .shell-logo{height:21px}
  .shell-nav a{padding:0 var(--gh-space-2)}
  /* JP-S1.2: the '/' hint shows at 850 too */
  .shell-right .status-label{display:none}
}
@media (min-width:651px) and (max-width:860px){
  .shell-nav a{font-size:var(--gh-font-sm)}
}

/* ---------- ≤650: compact mobile header + bottom nav ---------- */
@media (max-width:650px){
  .topbar.gh-shell-bar,
  html.gh-has-home-top .main-shell > .topbar.gh-shell-bar{
    position:relative;height:var(--mobile-topbar-h,57px)!important;min-height:57px!important;max-height:57px!important;
    padding:0 var(--gh-space-3)!important;gap:var(--gh-space-2);justify-content:space-between;flex:0 0 auto!important;
  }
  .shell-nav{display:none}
  .shell-brand .shell-logo{height:22px}
  .shell-right .status-label{display:none!important}
  .shell-search-toggle{display:inline-grid!important}
  .shell-icon-btn,
  .topbar .shell-icon-btn.circle-button{width:var(--gh-hit)!important;height:var(--gh-hit)!important;min-width:var(--gh-hit)!important;min-height:var(--gh-hit)!important}
  .shell-search{display:none}
  .gh-shell-bar.search-open .shell-search{
    display:flex;position:absolute;inset:0;z-index:2;max-width:none;margin:0;padding:0 var(--gh-space-3);gap:var(--gh-space-2);
    background:var(--gh-color-bg);
  }
  .gh-shell-bar.search-open .shell-search-field{height:var(--gh-hit)}
  .gh-shell-bar.search-open .shell-search-field input{font-size:16px}
  .shell-kbd{display:none}
  .gh-shell-bar.search-open .shell-search-close{display:inline-grid;place-items:center;width:var(--gh-hit);height:var(--gh-hit);flex:0 0 auto;border-radius:var(--gh-radius-pill);font-size:24px;line-height:1;color:var(--gh-color-text)}
  .mobile-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex!important;align-items:stretch;
    height:calc(60px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);
    background:#0b0b0c!important;border-top:1px solid var(--gh-color-line);
  }
  .mobile-nav a{flex:1 1 0;min-width:0;min-height:var(--gh-hit);display:flex;align-items:center;justify-content:center;font-size:var(--gh-font-sm)!important;font-weight:600;color:var(--gh-color-muted);white-space:nowrap;border-top:2px solid transparent;margin-top:-1px;padding:0 2px}
  .mobile-nav a.active{color:var(--gh-color-text);border-top-color:var(--gh-color-pink);background:var(--gh-color-raised)}
  .gh-pb-session-banner{flex:0 0 auto}
  .gh-pb-session-banner-inner{padding:var(--gh-space-2) var(--gh-space-3)}
  .gh-pb-session-banner .button{min-height:var(--gh-hit)}
  .tag-rail{flex:0 0 auto}
  .tag-rail-inner{padding:var(--gh-space-2) var(--gh-space-3);gap:var(--gh-space-2)}
  .tag-rail-scroll{display:none}
  .rail-chip,.tag-rail-toggle{height:var(--gh-hit);font-size:var(--gh-font-md)}
  .tag-rail.is-expanded .tag-rail-track{max-height:40dvh;overflow-y:auto}
  .notif-panel{top:64px;right:8px}
  .account-menu-item{min-height:var(--gh-hit)}
  .notif-cta{min-height:var(--gh-hit)}
  .chat-page{
    height:calc(100dvh - var(--mobile-topbar-h,57px) - var(--gh-banner-h,0px) - var(--mobile-nav-h,60px) - var(--chat-nav-gap,8px))!important;
    max-height:calc(100dvh - var(--mobile-topbar-h,57px) - var(--gh-banner-h,0px) - var(--mobile-nav-h,60px) - var(--chat-nav-gap,8px))!important;
  }
}

/* ---------- JP-S1 control floors (fixes every sub-12px / short control from the jp-s0-2/3 QA inventory) ----------
   All widths: control text >= 12px. Desktop: controls >= 32px tall/wide. <=650: >= 44px tall/wide. */
.button{font-size:var(--gh-font-sm)!important}
.button.notif-cta{font-size:var(--gh-font-md)!important}
.filter,.filter.tag-filter,.choice,.tool-btn,.suggestion,.text-button,.mobile-notebook,.continue-card-cta,
.message-actions button,.market-tabs button,.page-foot button,.home-rail-link,
#market-search,#market-genre,.studio-controls select,#boundary-select,#tone-select,#branch-select,.search-wrap input,
.gh-access-form input,.notebook select,.notebook input,.memory-panel input,.memory-panel select,.memory-panel textarea{font-size:var(--gh-font-sm)!important}
.filter{min-height:var(--gh-control-min)}
.suggestion{min-height:var(--gh-control-min)!important;line-height:1.3}
#branch-select{min-height:var(--gh-control-min)}
.home-rail-link{display:inline-flex;align-items:center;min-height:var(--gh-control-min);padding:0 var(--gh-space-1)}
.back-button{display:inline-grid;place-items:center;min-width:var(--gh-control-min);min-height:var(--gh-control-min)}
.page-foot button{display:inline-flex;align-items:center;min-height:var(--gh-control-min);padding:0 var(--gh-space-2);border-radius:var(--gh-radius-sm)}
.market-tabs button{min-height:var(--gh-control-min);padding:0 var(--gh-space-3)}
.choice{min-width:44px}
.discover-honesty .text-button,p .text-button{display:inline-flex;align-items:center;min-height:var(--gh-control-min);vertical-align:middle}
@media (min-width:651px){.age-check{min-height:var(--gh-control-min)!important;align-items:center}}
/* chat suggestion chips: one row that never scrolls sideways; chips share the width and wrap their own text */
.chat-page .suggestions{flex-wrap:nowrap!important;overflow:visible!important}
.chat-page .suggestion{flex:1 1 0!important;min-width:0!important;white-space:normal!important;text-align:center;justify-content:center}
@media (max-width:650px){
  .button,.text-button,.filter,.choice,.tool-btn,.suggestion,.mobile-notebook,.continue-card-cta,.message-actions button,.market-tabs button,
  .page-foot button,.home-rail-link,.scene-tools-toggle,#branch-select,.chat-page select,
  .gh-access-form input,.notebook select,.notebook input:not([type=checkbox]):not([type=radio]),.memory-panel input:not([type=checkbox]):not([type=radio]),.memory-panel select,
  .studio-controls select,#market-search,#market-genre,#shell-search,.search-wrap input{min-height:var(--gh-hit)!important}
  .mobile-notebook,.chat-page .mobile-notebook{height:auto!important;min-height:var(--gh-hit)!important}
  .age-check{min-height:var(--gh-hit)!important;align-items:center}
  .back-button{min-width:var(--gh-hit)!important;min-height:var(--gh-hit)!important}
  .close-modal{width:var(--gh-hit)!important;height:var(--gh-hit)!important;min-width:var(--gh-hit)!important;min-height:var(--gh-hit)!important;display:inline-grid;place-items:center}
  .market-tabs{display:flex;flex-wrap:wrap;gap:var(--gh-space-1)}
  .market-tabs button{min-width:var(--gh-hit);flex:1 1 auto}
  .studio-controls{grid-template-columns:minmax(0,1fr)!important}
  .choice-row{flex-wrap:wrap}
  .choice{flex:1 1 auto;min-width:var(--gh-hit)!important}
  .gh-shell-bar.search-open .shell-search-field input{height:var(--gh-hit)}
}

/* ---------- JP-S1 label floor: no visible text under 11px (label token) ----------
   Every selector below measured 6-10px in jp-s0-4; none measured above 12px, so the floor only raises. */
/* JP-S1.2: desktop only. At <=650 the generated type floor in theme.css governs (body/control 12px, uppercase eyebrow/meta 11px);
   below 11px no longer exists in source (tools/type-floor.py), so this rule only keeps the desktop label floor. */
@media (min-width:651px){
.eyebrow,.small-label,.tag,.tag-filters-label,.wm-label,.cast-shown-count,.sort-label,.promo-kicker,.home-count-pill,.home-rail-note,
.card-age-chip,.meter-num,.memory-counter,.notebook-label,.field-label,.setting-tag,.scene-ambiance-tag,.scene-watermark,
.branch-badge,.heat-badge,.chat-badge,.world-strip-note,.chapter-divider,.speaker-name,.continue-card-meta,
.detail-boundary,.credit-note,.stage-note,.studio-status,.studio-boundary,.studio-boundary strong,.collection-note,
.modal-footnote,.notebook-footnote,.gate-footnote,.memory-empty,.scene-controls-note,.session-revoke-guidance,
.gate-rules span,.page-foot span,.rule-list li span,.section-header p,.market-notice p,.market-notice p strong,.market-future p,.market-future strong,
.market-results-head span,.limit-soft strong,.limit-hard strong,.control-block h3,.notebook-section p,.notebook-section label,
.scene-intro p,.scene-option span small,.studio-stage-top span,.studio-controls label,.studio-controls legend,.branch-switch label,
.composer-foot span,.chat-header div p{font-size:var(--gh-font-label)!important}/*tf12*/.small-label,.tag,.tag-filters-label,.wm-label,.cast-shown-count,.sort-label,.home-count-pill,.home-rail-note,.card-age-chip,.meter-num,.memory-counter,.notebook-label,.field-label,.setting-tag,.scene-ambiance-tag,.scene-watermark,.branch-badge,.heat-badge,.chat-badge,.world-strip-note,.chapter-divider,.speaker-name,.detail-boundary,.credit-note,.stage-note,.studio-status,.studio-boundary,.studio-boundary strong,.collection-note,.modal-footnote,.notebook-footnote,.gate-footnote,.memory-empty,.scene-controls-note,.session-revoke-guidance,.gate-rules span,.page-foot span,.rule-list li span,.section-header p,.market-notice p,.market-notice p strong,.market-future p,.market-future strong,.market-results-head span,.limit-soft strong,.limit-hard strong,.control-block h3,.notebook-section p,.notebook-section label,.scene-intro p,.scene-option span small,.studio-stage-top span,.studio-controls label,.studio-controls legend,.branch-switch label,.composer-foot span,.chat-header div p{font-size:12px!important}/*/tf12*/
}
@media (max-width:650px){
  .chat-page .message-body{font-size:var(--gh-font-sm)!important}
  .toast{font-size:var(--gh-font-sm)!important}
}

/* ---------- JP-S1: keep the <=650 chat header from getting worse under the label floor ----------
   Title block keeps a readable width; Notebook stays on row one; branch/heat badges drop to a second row.
   (The Mara/Vale two-line name is the known S6 item and is left as-is.) */
@media (max-width:650px){
  .chat-page .chat-header{flex-wrap:wrap!important;row-gap:6px!important;overflow:visible!important;height:auto!important}
  .chat-page .chat-header>div{flex:1 1 120px;min-width:0}
  .chat-page .chat-header .mobile-notebook{order:1;margin-left:auto}
  .chat-page .chat-header .branch-badge,.chat-page .chat-header .heat-badge,.chat-page .chat-header .chat-badge{order:2}
  .chat-page .chat-header .branch-badge{margin-left:calc(var(--gh-hit) + 34px)}
}

/* ---------- JP-S1: Quinn's tools-open items at <=650 (jp-s0-4 round): limit-chip x, branch select, heat slider, persona/lore inputs, Enter access code ---------- */
@media (max-width:650px){
  .limit-chip-x{display:inline-grid!important;place-items:center;width:var(--gh-hit)!important;height:var(--gh-hit)!important;min-width:var(--gh-hit)!important;min-height:var(--gh-hit)!important;font-size:18px!important;margin:-6px -8px -6px 0;border-radius:var(--gh-radius-pill)}
  #branch-select{min-height:var(--gh-hit)!important;font-size:var(--gh-font-sm)!important}
  #heat-slider{height:var(--gh-hit)!important;min-height:var(--gh-hit)!important;width:100%;touch-action:pan-y;accent-color:var(--gh-color-pink)}
  #heat-slider::-webkit-slider-thumb{width:28px;height:28px}
  .memory-panel input:not([type=checkbox]):not([type=radio]):not([type=range]),.scene-controls input:not([type=checkbox]):not([type=radio]):not([type=range]),.memory-panel textarea,.scene-controls textarea{min-height:var(--gh-hit)!important;font-size:var(--gh-font-sm)!important}
  .access-needed .button,.chat-page .button{min-height:var(--gh-hit)!important}
}
/* desktop floors for the same scene-controls items (>=32px), and their 9-10px labels */
.limit-chip-x{display:inline-grid;place-items:center;min-width:var(--gh-control-min);min-height:var(--gh-control-min);margin:-6px -8px -6px 0;border-radius:var(--gh-radius-pill);font-size:16px}
#heat-slider{min-height:var(--gh-control-min);accent-color:var(--gh-color-pink)}
@media (min-width:651px){.heat-slider-label span,.detail-limits li strong,.char-limits-reflect li strong{font-size:var(--gh-font-label)!important}/*tf12*/.heat-slider-label span,.detail-limits li strong,.char-limits-reflect li strong{font-size:12px!important}/*/tf12*/}
/* JP-S1 (Quinn soft 2): with Scene & tools open at <=650 the column is the only scroller; keep the Scene & tools header
   pinned to the top of the column so HIDE is always one tap away after the newest-message pin */
@media(max-width:650px){
  .chat-page.scene-tools-open > .chat-column > .scene-tools-toggle{position:sticky;top:0;z-index:9;background:#141414}
}
/* (JP-S2's own desktop sticky-bar fix was here; deduped: the single fix now lives in styles.css + theme.css, ported from JP-S1.2) */

/* ---------- JP-S1.2 ---------- */
/* results scroll under the pinned bar, not behind it */
#cast-section{scroll-margin-top:8px}
@media (min-width:651px){#cast-section{scroll-margin-top:calc(var(--gh-bar-h) + var(--gh-space-2))}}
/* Studio create: "Cancel scene" was a 76x17 underlined 10px text button (Quinn hard fail 5) */
.queue-overlay button[data-action="cancel-image"]{display:inline-flex;align-items:center;justify-content:center;min-height:var(--gh-control-min);min-width:var(--gh-control-min);padding:0 var(--gh-space-3);font-size:var(--gh-font-sm)!important;border:1px solid var(--gh-color-line-strong);border-radius:var(--gh-radius-md);background:var(--gh-color-raised);color:var(--gh-color-text);text-decoration:none}
.queue-overlay button[data-action="cancel-image"]:hover{border-color:var(--gh-color-muted)}
@media (max-width:650px){.queue-overlay button[data-action="cancel-image"]{min-height:var(--gh-hit);min-width:var(--gh-hit)}}
/* My Chats empty state: eyebrow, title, copy and actions share one centred axis (Quinn soft / Nina known soft) */
.empty-state{text-align:center}
.empty-state .eyebrow{display:block;text-align:center;margin-left:auto;margin-right:auto}
.empty-state p,.chats-empty p{margin-left:auto;margin-right:auto}
.chats-empty-actions{display:flex;flex-wrap:wrap;gap:var(--gh-space-2);justify-content:center}

/* ---------- JP-S1.3 (ported into jp-s3-1) ---------- */
/* Only the top bar is sticky (CoS): the Discover filter chrome (S2: the collapsible Filters <details>) scrolls with the page at every width (Quinn fail: it had
   become sticky over the cards once body got overflow-x:clip). z-index kept so its menus still paint over the cards. */
.cast-filter-chrome{position:relative!important;top:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
/* Top-bar cluster 651-1280 (Quinn fail: search field overflowed its form into the bell/account; '/' sat under the bell at 850).
   The field and input may shrink inside the form; the right cluster never shrinks. */
.shell-search{min-width:0}
.shell-search-field{min-width:0;flex:1 1 0}
.shell-search-field input{width:0;flex:1 1 0;min-width:0}
.shell-right{flex:0 0 auto}
/* 651-800: not enough room for a usable field beside brand + nav + bell + account, so search collapses to the icon toggle
   and opens across the bar (same pattern as <=650). The '/' shortcut still opens it. */
@media (min-width:651px) and (max-width:800px){
  .shell-search-toggle{display:inline-grid!important}
  .shell-search{display:none}
  .shell-right{margin-left:auto}
  .gh-shell-bar.search-open .shell-search{
    display:flex;position:absolute;inset:0;z-index:2;max-width:none;margin:0;padding:0 var(--gh-space-4);gap:var(--gh-space-2);
    background:var(--gh-color-bg);
  }
  .gh-shell-bar.search-open .shell-kbd{display:none}
  .gh-shell-bar.search-open .shell-search-close{display:inline-grid;place-items:center;width:var(--gh-control-h);height:var(--gh-control-h);flex:0 0 auto;border-radius:var(--gh-radius-pill);font-size:22px;line-height:1;color:var(--gh-color-text)}
}
