/* shell-17.css — app shell alignment (sidebar/frame bottoms); owned by the shell workstream.
   Rule (owner): the left sidebar, the page frame and the lowest panels inside the page share ONE bottom edge,
   and the frame top equals the sidebar top. From 701px up the frame has the sidebar's height; long pages
   scroll inside the frame (#main; on Docs and on the stacked tablet Lucky Paw the frame itself) instead of stretching it.
   Frame border: drawn by ::after on top of the content, so a panel that reaches the bottom shares the
   frame's 1px line (same row as the sidebar's bottom border) instead of stacking a second line above it.
   The status line that used to sit at the bottom of the frame now lives in the sidebar (ui.mjs sidebarStatus). */

/* ---------------------------------------------------------------- sidebar status block (all widths) */
#app .sidebar-status17{display:grid;gap:5px;margin:8px 0 0;padding:7px 8px 6px;border:1px solid var(--ui-frame-ink,#67528f);border-radius:5px;
  background:linear-gradient(180deg,#0b1030e6,#070b22f0);box-shadow:inset 0 1px 0 #ffffff0d,0 2px 0 #02041280;text-align:center}
#app>.sidebar .sidebar-status17 .sidebar-note{display:block;margin:0;padding:0;font:600 10px/1.35 Interface,sans-serif;letter-spacing:.2px;color:#b3a6d6;text-align:center}
#app .sidebar-status-links17{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 10px}
#app .sidebar-status-link17{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:0;margin:0;padding:1px 0;border:0;background:none;
  color:#e7c768;font:600 10.5px/1.3 Interface,sans-serif;letter-spacing:.2px;text-decoration:underline;text-decoration-color:#e7c76866;text-underline-offset:2px;cursor:pointer}
#app .sidebar-status-link17:hover,#app .sidebar-status-link17:focus-visible{color:#ffe08a;text-decoration-color:currentColor}
#app .sidebar-status-link17 .icon{width:12px;height:12px;flex:none}
/* Compact rails (icon-only sidebar): the plaque collapses to an icon button like the Scene animation toggle. */
@media (min-width:701px) and (max-width:1150px){
  #app>.sidebar .sidebar-status17{margin-top:6px;padding:0;border:0;background:none;box-shadow:none;gap:6px}
  #app>.sidebar .sidebar-status17 .sidebar-note{display:none}
  #app>.sidebar .sidebar-status-links17{flex-direction:column;align-items:stretch;gap:6px}
  #app>.sidebar .sidebar-status-link17{min-height:30px;border:1px solid var(--ui-frame-ink,#67528f);border-radius:5px;background:var(--ui-surface,#080e24);color:#e7c768;text-decoration:none}
  #app>.sidebar .sidebar-status-link17>span{display:none}
  #app>.sidebar .sidebar-status-link17 .icon{width:15px;height:15px}
}
@media screen and (min-width:701px) and (max-width:959px){
  /* tablet rail (68px): the Scene animation label never fit (it spilled out of the button) — icon only, as on the 70px desktop rail */
  #app>.sidebar .motion-control10{justify-content:center;gap:0;padding:0;min-height:30px}
  #app>.sidebar .motion-control10>span{display:none}
  #app>.sidebar .motion-control10 .icon{width:15px;height:15px}
}
@media (min-width:1151px) and (max-height:780px){
  #app>.sidebar .sidebar-status17{margin-top:6px;padding:5px 6px 4px;gap:3px}
  #app>.sidebar .sidebar-status17 .sidebar-note{font-size:9px}
}

/* ---------------------------------------------------------------- locked frame (desktop + tablet) */
@media screen and (min-width:701px) and (max-width:959px){
  /* the tablet rail is calc(100svh - 24px) tall (viewport.css); the frame takes the same box */
  #app:has(>.sidebar){--frame-height:calc(100svh - 24px)}
}
@media screen and (min-width:701px){
  #app.ui15.live-ui>.workspace,#app.ui15>.docs-shell{position:relative;height:var(--frame-height)!important;min-height:0!important;max-height:none!important;
    display:flex!important;flex-direction:column!important;overflow:clip!important;border:0!important;padding:1px!important;border-radius:10px}
  #app.ui15.live-ui>.workspace::after,#app.ui15>.docs-shell::after{content:"";position:absolute;inset:0;border:1px solid var(--ui-frame-ink,#67528f);border-radius:inherit;pointer-events:none;z-index:40}
  #app.ui15.live-ui>.workspace>.page-head,#app.ui15>.docs-shell>.page-head,#app.ui15>.docs-shell>.docs-header{flex:0 0 auto}
  #app.ui15.live-ui>.workspace>.workspace-footer{display:none!important}
  /* the header strip (wallet, Fennec chooser, connection notice popover) stacks above the page content it drops over;
     owner-media-12 gave header and #main the same z-index, so the later #main covered the open notice popover */
  #app.ui15.live-ui>.workspace>.page-head,#app.ui15>.docs-shell>.page-head{z-index:6!important}

  /* content area: fills the frame to its bottom edge (margin -1px reaches the ring row), scrolls when taller */
  #app.ui15.live-ui>.workspace>#main{flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;margin:0 0 -1px!important}
  #app.ui15.live-ui>.workspace:not(.page-lucky-paw)>#main{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:auto;scrollbar-gutter:stable}
  /* page blocks: 14px from the frame on the left/top/right (the 8px scrollbar gutter + 6px on the right), 14px apart, 0 at the bottom */
  #app.ui15.live-ui>.workspace:not(.page-lucky-paw):not(.page-home)>#main{display:flex!important;flex-direction:column!important;gap:14px!important;
    padding:14px 6px 0 14px!important;grid-template-rows:none!important}
  #app.ui15.live-ui>.workspace:not(.page-lucky-paw):not(.page-home)>#main>*{flex-shrink:0;margin-top:0!important;margin-bottom:0!important}
  #app.ui15.live-ui>.workspace:not(.page-lucky-paw):not(.page-home)>#main>:last-child{flex-grow:1}
  /* a panel standing on the frame's bottom line gets square lower corners (its side rules meet the line) */
  #app.ui15.live-ui>.workspace>#main>.panel:last-child,#app.ui15.live-ui>.workspace>#main>:last-child>.panel,
  #app.ui15.live-ui>.workspace.page-trait-hunt .live-hunt .hunt-right08>.panel:last-child,
  #app.ui15.live-ui>.workspace.page-home .home-stats>.stat{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}
  #app.ui15.live-ui>.workspace>#main::-webkit-scrollbar,#app.ui15>.docs-shell::-webkit-scrollbar{width:8px}
  #app.ui15.live-ui>.workspace>#main::-webkit-scrollbar-track,#app.ui15>.docs-shell::-webkit-scrollbar-track{background:transparent}
  #app.ui15.live-ui>.workspace>#main::-webkit-scrollbar-thumb,#app.ui15>.docs-shell::-webkit-scrollbar-thumb{background:#5b3f98;border-radius:4px;border:1px solid #07061a}
  #app.ui15.live-ui>.workspace>#main::-webkit-scrollbar-thumb:hover,#app.ui15>.docs-shell::-webkit-scrollbar-thumb:hover{background:#7a58c4}

  /* Home: the hero scene is the page's panel; it runs to the frame bottom and its stat plaques stand on it */
  #app.ui15.live-ui>.workspace.page-home>#main{display:flex!important;flex-direction:column!important;padding:0!important;min-height:0!important;scrollbar-gutter:auto}
  #app.ui15.live-ui>.workspace.page-home>#main>.home{flex:1 0 auto;height:auto!important;min-height:540px!important}
  #app.ui15.live-ui>.workspace.page-home .home-stats{left:14px!important;right:14px!important;bottom:0!important}

  /* Mine: the scene/controls panel and the claim card fill the remaining height */
  #app.ui15.live-ui>.workspace.page-mine .mine-grid{flex:1 0 auto;height:auto!important;align-items:stretch}

  /* My Fox (wardrobe): preview and inventory panels both reach the bottom */
  #app.ui15.live-ui>.workspace.page-my-fox .live-wardrobe{flex:1 0 auto;height:auto!important;align-items:stretch}
  #app.ui15.live-ui>.workspace.page-my-fox .live-wardrobe>.panel{align-self:stretch;height:auto}

  /* My Fox rewards: identity + reward cards, the settled weeks panel last */
  #app.ui15.live-ui>.workspace.page-my-fox-rewards .live-rewards{align-items:stretch}

  /* Trait Hunt: columns to the bottom; the right-hand panels fill their row/column */
  #app.ui15.live-ui>.workspace.page-trait-hunt .live-hunt{flex:1 0 auto;height:auto!important;align-items:stretch}
  #app.ui15.live-ui>.workspace.page-trait-hunt .live-hunt .hunt-right08{grid-template-rows:auto!important;align-content:stretch!important}
  @media (min-width:1151px){
    /* one column of two panels: the lower one (weekly reward) takes the rest of the column */
    #app.ui15.live-ui>.workspace.page-trait-hunt .live-hunt .hunt-right08{grid-template-rows:auto minmax(0,1fr)!important}
  }

  /* Tickets: the three-column grid grows, the Redeem list stays last */
  #app.ui15.live-ui>.workspace.page-tickets .tickets-grid{flex:1 0 auto;height:auto!important}
  #app.ui15.live-ui>.workspace.page-tickets>#main>.tickets-grid~*{flex-grow:0!important}

  /* Lucky Paw keeps its own full-bleed scene layout (lucky-17.css): the scene sits under the transparent header
     and its subtitle overlaps it, so #main must not clip. The whole frame scrolls when the stage is taller
     (stacked tablet layout); a scroll container keeps its own border in place, so Lucky uses the real border. */
  #app.ui15.live-ui>.workspace.page-lucky-paw{border:1px solid var(--ui-frame-ink,#67528f)!important;padding:0!important}
  #app.ui15.live-ui>.workspace.page-lucky-paw::after{content:none}
  #app.ui15.live-ui>.workspace.page-lucky-paw>#main{margin:0!important;padding-bottom:0!important;overflow:visible!important}
  @media (max-width:1279px){
    /* stacked Lucky layout (one column below 1280px, lucky-17.css): #main grows with its content and the frame
       itself scrolls; the two-column desktop (>=1280px) stays clipped. Moved here from lucky-17.css (r3). */
    #app.ui15.live-ui>.workspace.page-lucky-paw{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#5b3f98 transparent}
    #app.ui15.live-ui>.workspace.page-lucky-paw>#main{flex:1 0 auto!important}
  }

  /* Docs: the whole frame scrolls (title and search scroll away as before, an in-page link lands its section at
     the top of the frame); the topics menu and "On this page" stick to the frame top. A scroll container keeps its
     own border in place, so Docs uses the real border; the menu column rule runs to the frame's bottom edge. */
  #app.ui15>.docs-shell{border:1px solid var(--ui-frame-ink,#67528f)!important;padding:0!important;overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain;scrollbar-width:auto;scrollbar-gutter:stable}
  #app.ui15>.docs-shell::after{content:none}
  #app.ui15>.docs-shell>.docs-layout{flex:1 0 auto;min-height:0;height:auto;margin:0;max-width:none;width:100%}
  #app.ui15>.docs-shell>.docs-layout>.docs-menu{position:sticky;top:0;align-self:start;height:calc(var(--frame-height) - 2px);max-height:none;overflow-y:auto;box-sizing:border-box}
  #app.ui15>.docs-shell>.docs-layout>.docs-toc{position:sticky;top:0;align-self:start;max-height:calc(var(--frame-height) - 2px);overflow-y:auto;box-sizing:border-box}
}
/* ---------------------------------------------------------------- preview demo app (no gateway; app.mjs grid shell) */
@media screen and (min-width:960px){
  /* the old 3-row frame grid kept a row for the status footer: #main now spans it and reaches the frame bottom */
  #app.ui15:not(.live-ui)>.workspace{border:0!important;padding:1px!important}
  #app.ui15:not(.live-ui)>.workspace::after{content:"";position:absolute;inset:0;border:1px solid var(--ui-frame-ink,#67528f);border-radius:inherit;pointer-events:none;z-index:40}
  #app.ui15:not(.live-ui)>.workspace>#main{grid-row:2/-1!important;padding-bottom:0!important;margin-bottom:-1px!important;min-height:0}
  #app.ui15:not(.live-ui)>.workspace>.workspace-footer{display:none!important}
}
/* r6 (QA r5: 14 shell failures at 768x1024 --preview): on the tablet rail (701-959px) the preview frame follows the
   live rule above — it takes the rail's height (--frame-height), long pages scroll inside it (#main; Lucky Paw: the
   frame itself) and the last panel ends on the frame's bottom line — instead of growing with the page. */
@media screen and (min-width:701px) and (max-width:959px){
  #app.ui15:not(.live-ui)>.workspace{position:relative;height:var(--frame-height)!important;min-height:0!important;max-height:none!important;
    display:flex!important;flex-direction:column!important;overflow:clip!important;border:0!important;padding:1px!important;border-radius:10px}
  #app.ui15:not(.live-ui)>.workspace::after{content:"";position:absolute;inset:0;border:1px solid var(--ui-frame-ink,#67528f);border-radius:inherit;pointer-events:none;z-index:40}
  #app.ui15:not(.live-ui)>.workspace>.page-head{flex:0 0 auto;z-index:6!important}
  #app.ui15:not(.live-ui)>.workspace>.workspace-footer{display:none!important}
  #app.ui15:not(.live-ui)>.workspace>#main{flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;margin:0 0 -1px!important}
  #app.ui15:not(.live-ui)>.workspace:not(.page-lucky-paw)>#main{overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:auto;scrollbar-gutter:stable}
  #app.ui15:not(.live-ui)>.workspace:not(.page-lucky-paw):not(.page-home)>#main{display:flex!important;flex-direction:column!important;gap:14px!important;
    padding:14px 6px 0 14px!important;grid-template-rows:none!important}
  #app.ui15:not(.live-ui)>.workspace:not(.page-lucky-paw):not(.page-home)>#main>*{flex-shrink:0;margin-top:0!important;margin-bottom:0!important}
  #app.ui15:not(.live-ui)>.workspace:not(.page-lucky-paw):not(.page-home)>#main>:last-child{flex-grow:1}
  #app.ui15:not(.live-ui)>.workspace>#main>.panel:last-child,#app.ui15:not(.live-ui)>.workspace>#main>:last-child>.panel{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}
  #app.ui15:not(.live-ui)>.workspace>#main::-webkit-scrollbar{width:8px}
  #app.ui15:not(.live-ui)>.workspace>#main::-webkit-scrollbar-track{background:transparent}
  #app.ui15:not(.live-ui)>.workspace>#main::-webkit-scrollbar-thumb{background:#5b3f98;border-radius:4px;border:1px solid #07061a}
  /* Home: the hero scene runs to the frame bottom, its stat plaques stand on it */
  #app.ui15:not(.live-ui)>.workspace.page-home>#main{display:flex!important;flex-direction:column!important;padding:0!important;min-height:0!important;scrollbar-gutter:auto}
  #app.ui15:not(.live-ui)>.workspace.page-home>#main>.home{flex:1 0 auto;height:auto!important;min-height:540px!important}
  /* My Fox rewards on a tall tablet (744x1133): the cards column reaches the frame bottom, the settled weeks tile
     (last) takes the spare height */
  #app.ui15:not(.live-ui)>.workspace .rewards15>.reward-content15{align-self:stretch;grid-template-rows:auto minmax(0,1fr)}
  /* Lucky Paw (stacked): the frame itself scrolls, with a real border, as in live */
  #app.ui15:not(.live-ui)>.workspace.page-lucky-paw{border:1px solid var(--ui-frame-ink,#67528f)!important;padding:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#5b3f98 transparent}
  #app.ui15:not(.live-ui)>.workspace.page-lucky-paw::after{content:none}
  #app.ui15:not(.live-ui)>.workspace.page-lucky-paw>#main{flex:1 0 auto!important;margin:0!important;padding-bottom:0!important;overflow:visible!important}
  /* a page shorter than the frame: the panels (History last) still end on the frame line, the spare height stays
     above them (panel sizes and gaps unchanged) */
  #app.ui15:not(.live-ui)>.workspace.page-lucky-paw .l17-side{flex:1 0 auto;align-content:end}
}
@supports not selector(::-webkit-scrollbar){
  @media screen and (min-width:701px){
    #app.ui15.live-ui>.workspace>#main,#app.ui15>.docs-shell{scrollbar-width:thin;scrollbar-color:#5b3f98 transparent}
  }
}

/* ---------------------------------------------------------------- R5 app-fixes: content stays inside its box */
/* Mine: the CPU threads select shows its whole 'N / M' value (at 66px the tablet rail cut '4 / 20' to '4 / 2(').
   Chromium sizes it to the selected value and never below the approved 73px (desktop) / 66px (compact rail);
   engines without field-sizing get a width that fits the longest value ('32 / 32', MAX_BROWSER_WORKERS). */
@media (min-width:701px){
  .cpu-settings select{width:82px}
  @supports (field-sizing:content){.cpu-settings select{field-sizing:content;width:auto;min-width:73px}}
}
@media (min-width:701px) and (max-width:1150px){
  @supports (field-sizing:content){.cpu-settings select{min-width:66px}}
}
/* Home phone: the ETH values shrink to fit their plaque (0.01234 ETH ran 17px past the card at 390px). The
   plaque is the size container; --home-value-chars (live-pages liveHome: the longer value) keeps both values
   one size. .54em is the widest average glyph advance of these values in Interface 600 (measured .504em). */
@media (max-width:700px){
  #app.ui15.live-ui>.workspace.page-home .home-stats>.stat{container-type:inline-size}
  #app.ui15.live-ui>.workspace.page-home .home-stats .value{font-size:min(clamp(17px,5.5vw,22px),calc(100cqi / (var(--home-value-chars,11) * .54)))!important}
}
/* Docs home: the hero art card stays inside the article column. Its 190px minimum height with the 1.4 ratio
   forced it 266px wide, past a narrower grid column: over the frame edge at 701-960px (cut) and over "On this
   page" at 1161-1380px. A narrow article stacks the hero as on phones; a wider one fits the card to its column
   (unchanged once the column is 266px or more). */
#app.ui15 .docs-article:has(>.docs-hero15){container:docs-article/inline-size}
@container docs-article (max-width:539.98px){
  #app.ui15 .docs-hero15{grid-template-columns:1fr;gap:14px}
  #app.ui15 .docs-scene15{height:190px;aspect-ratio:auto}
  #app.ui15 .docs-scene15 .docs-guide15{width:58%;right:3%}
}
@container docs-article (min-width:540px){
  #app.ui15 .docs-scene15{min-height:0}
}