/* [mob-c] phone fixes, group c (see scratchpad/mobile-issues.md). Loaded after theme.css. */
/* the nav pieces only the sideways phone shows (phone.js adds them; elsewhere the look is unchanged) */
.ph-nav .ph-nic,.ph-nav .ph-nw,.ph-nav .ph-x{display:none}
.ph-nav .ph-back .ph-bt{display:inline}
.ph-dock .ph-lb{display:none}

/* Kitaab: the touch-only Close on the book's corner (reading.js) */
.rdb>.rd-xclose{position:absolute;top:6px;right:22px;z-index:8;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px 0 10px;border-radius:999px;border:1.5px solid #b08a55;background:#fff8e6;color:#6b4a2b;font:700 13px var(--body);box-shadow:0 2px 8px rgba(80,50,20,.25);cursor:pointer;touch-action:manipulation}
.rdb>.rd-xclose.arm{background:#B3261E;border-color:#B3261E;color:#fff}
.rdb>.rd-xclose .rd-xclose-i{display:inline-flex;line-height:0}

/* desk work: the touch-only Leave in the window's title bar (work.js) */
.wk-bar .wk-leave{margin-left:6px;min-height:40px;padding:0 14px;border-radius:8px;border:1px solid rgba(238,241,248,.35);background:transparent;color:#eef1f8;font:700 13px var(--body);cursor:pointer;flex:none;touch-action:manipulation}
.wk-bar .wk-leave.arm{background:#B3261E;border-color:#B3261E;color:#fff}

@media (pointer:coarse) and (orientation:landscape) and (max-height:500px){
  /* ---- the in-game phone: the whole screen height, no drawn bezel or notch, the nav a column on its left ---- */
  html body.phone-on #mwrap{inset:max(6px,env(safe-area-inset-top,0px)) calc(max(10px,env(safe-area-inset-right,0px)) + 72px) max(6px,env(safe-area-inset-bottom,0px)) auto;
    width:min(560px,calc(100vw - 96px - max(10px,env(safe-area-inset-left,0px))));max-height:none;border:0;border-radius:16px;
    display:grid;grid-template-columns:62px minmax(0,1fr);grid-template-rows:minmax(0,1fr);box-shadow:0 0 0 1px rgba(255,255,255,.1),0 18px 50px rgba(0,0,0,.5);overflow:hidden}
  html body.phone-on #mwrap::before{display:none}
  html body.phone-on #mwrap>.ph-status{display:none}
  html body.phone-on #mwrap>.card{grid-column:2;grid-row:1;min-height:0;height:auto;zoom:1}
  html body.phone-on #mwrap>.pk-shade,html body.phone-on #mwrap>.pk-sheet{grid-column:2}
  html body.phone-on #mwrap>.ph-nav{grid-column:1;grid-row:1;height:auto;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;padding:6px 4px;background:#0b0d14;border-right:1px solid rgba(255,255,255,.08)}
  html body.phone-on #mwrap>.ph-nav>span:empty{display:none}
  html body.phone-on #mwrap .ph-nav button{justify-self:auto;width:54px;min-height:54px;height:auto;margin:0;padding:4px 2px;border-radius:12px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#e8ecf2;font:600 12px/1.1 var(--body);touch-action:manipulation}
  html body.phone-on #mwrap .ph-nav button:active{background:rgba(255,255,255,.12)}
  html body.phone-on #mwrap .ph-nav .ph-nic,html body.phone-on #mwrap .ph-nav .ph-nw,html body.phone-on #mwrap .ph-nav .ph-x{display:flex}
  html body.phone-on #mwrap .ph-nav .ph-nic svg{display:block}
  html body.phone-on #mwrap .ph-nav .ph-back .ph-nic{transform:rotate(-90deg)}
  html body.phone-on #mwrap .ph-nav .ph-back .ph-bt{display:none}
  html body.phone-on #mwrap .ph-nav .ph-x{margin-top:auto;background:rgba(255,255,255,.08)}
  html body.phone-on #mwrap[data-kind=phone] .ph-nav .ph-homebtn{display:none}
  /* the home screen: a wide grid, every icon labelled (the dock too), nothing below the fold that needs a scroll to be found */
  html body.phone-on #mwrap .ph-home{padding:8px 10px 10px;display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));align-content:start;gap:6px 2px}
  html body.phone-on #mwrap .ph-now{grid-column:1/-1;display:flex;align-items:baseline;gap:10px;justify-content:center;margin:0 0 2px}
  html body.phone-on #mwrap .ph-now b{display:inline;font-size:22px}
  html body.phone-on #mwrap .ph-now span{font-size:13px}
  html body.phone-on #mwrap .ph-grid,html body.phone-on #mwrap .ph-dock{display:contents}
  html body.phone-on #mwrap .ph-app{min-height:44px}
  html body.phone-on #mwrap .ph-ic{width:44px;height:44px;border-radius:12px}
  html body.phone-on #mwrap .ph-lb{font-size:12px;line-height:1.2;white-space:nowrap}
  html body.phone-on #mwrap .ph-dock .ph-lb{display:block}

  /* phone apps (phonekit): a slimmer title bar and tab bar, so the screen gets the height; every control at least 40 px, words at least 12 px */
  html body.phone-on #mwrap .pk-top{padding:4px 6px 4px 10px}
  html body.phone-on #mwrap .pk-toprow{min-height:40px}
  html body.phone-on #mwrap .pk-tabs button{min-height:48px;padding-top:4px;padding-bottom:4px}
  html body.phone-on #mwrap .pk-tabs span{font-size:12px}
  html body.phone-on #mwrap .pk-ib{min-width:40px;min-height:40px}
  html body.phone-on #mwrap .pk-btn,html body.phone-on #mwrap .pk-seg button,html body.phone-on #mwrap :is(.hm-chip,.nt-chip,.mail-chip,.gv-chip,.miles-cats>button,.sw-times>button,.oo-areas>button,.gd-act,.hr-mode){min-height:40px}
  html body.phone-on #mwrap .pk-btn.primary{min-height:44px}
  html body.phone-on #mwrap .oo-search{min-height:44px}html body.phone-on #mwrap .oo-search input{min-height:40px;font-size:16px}
  html body.phone-on #mwrap .pk:has(.pk-fab) .pk-main{padding-bottom:76px}
  html body.phone-on #mwrap .pk-empty{padding:18px 20px}
  html body.phone-on #mwrap .pk-fab{bottom:60px;min-height:44px;padding:10px 16px}

  /* ---- games that need room go full screen inside the phone: the daily puzzle, Beat the Bot, the seat map (the phone's nav column stays) ---- */
  html body.phone-on #mwrap:is([data-kind=puzzle],[data-kind=bots]),html body.phone-on #mwrap:has(.sw-hall){inset:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);width:auto;border-radius:0;z-index:1000}
  /* Seatwala's seat map: the hall fills the left, the film, the date-night switch and Book stay in a column on the right */
  html body.phone-on #mwrap>.card.pk:has(.sw-hall){display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,264px);grid-template-rows:auto auto minmax(0,1fr) auto;overflow:hidden}
  html body.phone-on #mwrap .pk:has(.sw-hall)>.pk-main,html body.phone-on #mwrap .pk:has(.sw-hall) .sw-page{display:contents}
  html body.phone-on #mwrap .pk:has(.sw-hall)>.pk-top{grid-column:2;grid-row:1;border-left:1px solid var(--line)}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-head{grid-column:2;grid-row:2;margin:6px 8px 0;padding:8px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-head>img,html body.phone-on #mwrap .pk:has(.sw-hall) .sw-head>.sw-ph{width:40px;height:54px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-hmid>b{padding-right:0;font-size:14px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-yt{display:none}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-leg{grid-column:2;grid-row:3;align-self:start;justify-content:flex-start;padding:8px 10px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-hall{grid-column:1;grid-row:1/5;margin:0;min-height:0;overflow:auto;overscroll-behavior:contain;background:rgba(0,0,0,.18)}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-map{overflow:visible;padding:4px 4px 10px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-tier{margin:4px 18px 2px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-screen{height:36px;margin-bottom:2px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-foot{grid-column:2;grid-row:4;position:static;margin:0;padding:8px 10px 10px;box-shadow:none}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-date{min-height:44px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-foot .sw-book{min-height:48px;min-width:96px;padding:10px 16px}
  html body.phone-on #mwrap .pk:has(.sw-hall) .sw-zoom{height:40px;padding:0 12px 0 9px;font-size:12px}

  /* ---- the daily puzzle (in the phone or opened from the city): the board on the left at the full height, "How it works" behind a button,
     the feedback and Give up / Reset / Check pinned in a column on the right; the clock always in the header ---- */
  html #mwrap[data-kind=puzzle]:not(.x){padding:0}
  html #mwrap[data-kind=puzzle]>.card.pz-card{width:100%;max-width:none;height:100%;max-height:100%;border-radius:0}
  html #mwrap[data-kind=puzzle]>.card.pz-card.pz-intro,html #mwrap[data-kind=puzzle]>.card.pz-card.pz-done{display:flex;flex-direction:column;overflow:hidden}
  html #mwrap[data-kind=puzzle] .pz-intro .pz-in{flex:1;min-height:0;overflow:auto;padding:10px 14px 0}
  html #mwrap[data-kind=puzzle] .pz-intro .pz-go{position:sticky;bottom:0;z-index:2;margin:0 -14px;padding:8px 14px 10px;background:var(--ink);border-top:1px solid var(--line);display:flex;gap:8px}
  html #mwrap[data-kind=puzzle] .pz-intro .pz-go .pz-btn{flex:1;min-height:48px}
  html #mwrap[data-kind=puzzle] .pz-done>:not(.pz-top){flex:1;min-height:0;overflow:auto}
  html #mwrap[data-kind=puzzle] .pz-top{height:52px;padding:4px 6px 4px 12px;gap:8px}
  html #mwrap[data-kind=puzzle] .pz-badge,html #mwrap[data-kind=puzzle] .pz-city{display:none}
  html #mwrap[data-kind=puzzle] .pz-ttl h2{font-size:18px}html #mwrap[data-kind=puzzle] .pz-ttl small{font-size:12px}
  html #mwrap[data-kind=puzzle] .pz-stat{gap:10px}html #mwrap[data-kind=puzzle] .pz-clock{padding:4px 9px}html #mwrap[data-kind=puzzle] .pz-clock b{font-size:18px}
  html #mwrap[data-kind=puzzle] .pz-pips small{font-size:12px}
  html #mwrap[data-kind=puzzle] .pz-close{width:44px;height:44px;margin-left:4px}
  html #mwrap[data-kind=puzzle]>.card.pz-card.pz-play{display:grid;grid-template-columns:minmax(0,1fr) clamp(170px,26vw,220px);grid-template-rows:52px auto minmax(0,1fr);overflow:hidden}
  html #mwrap[data-kind=puzzle] .pz-play>.pz-top{grid-column:1/-1;grid-row:1}
  html #mwrap[data-kind=puzzle] .pz-play .pz-body{display:contents}
  html #mwrap[data-kind=puzzle] .pz-play .pz-main{grid-column:1;grid-row:2/4;padding:8px 10px;gap:8px;order:0}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side{grid-column:2;grid-row:2;order:0;max-height:none;border:0;border-left:1px solid var(--line);border-bottom:1px solid var(--line);transition:none}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side-hd{min-height:46px;padding:0 10px;cursor:pointer;font-size:12px;letter-spacing:.04em}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side-hd .pz-caret{display:inline-flex}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side:not(.open) .pz-side-in{display:none}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side.open{position:absolute;z-index:8;grid-column:1/2;grid-row:2/4;inset:0;border-right:1px solid var(--line);box-shadow:10px 0 30px rgba(42,28,18,.25)}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side.open .pz-caret{transform:rotate(180deg)}
  html #mwrap[data-kind=puzzle] .pz-play .pz-side.open .pz-side-in{visibility:visible;display:flex;padding:0 14px 14px}
  html #mwrap[data-kind=puzzle] .pz-play .pz-bar{grid-column:2;grid-row:3;min-height:0;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:8px;padding:8px;border-top:0;border-left:1px solid var(--line)}
  html #mwrap[data-kind=puzzle] .pz-play .pz-fb{flex:1 1 auto;min-height:0;overflow:auto;font-size:13px;flex-basis:auto}
  html #mwrap[data-kind=puzzle] .pz-play .pz-acts{display:grid;grid-template-columns:1fr 1fr;gap:6px;width:auto}
  html #mwrap[data-kind=puzzle] .pz-play .pz-acts .pz-btn{min-width:0;padding:0 6px;min-height:44px;font-size:13px}
  html #mwrap[data-kind=puzzle] .pz-play .pz-acts .pz-btn.go{grid-column:1/-1;order:3;min-height:52px;font-size:15px}
  html #mwrap[data-kind=puzzle] .pz-btn kbd{display:none}
  /* Tiffin Tetris: the box as big as the height allows, the dishes beside it */
  html #mwrap[data-kind=puzzle] .tf{grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:start}
  html #mwrap[data-kind=puzzle] .tf-left{gap:6px}
  html #mwrap[data-kind=puzzle] .tf-dabba{width:min(300px,calc(100dvh - 124px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));padding:3.6%}
  html #mwrap[data-kind=puzzle] .tf-tools{gap:6px;flex-wrap:nowrap}
  html #mwrap[data-kind=puzzle] .tf-tools .pz-btn{min-height:44px;padding:0 10px}
  html #mwrap[data-kind=puzzle] .tf-hold{display:none}
  html #mwrap[data-kind=puzzle] .tf-tray{padding:8px;gap:6px}
  html #mwrap[data-kind=puzzle] .tf-tiles{grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px}
  html #mwrap[data-kind=puzzle] .tf-pc{min-height:72px;padding:6px 4px;font-size:12px}
  /* Signal Room: the junction map sized by the height, not the width */
  html #mwrap[data-kind=puzzle] .sg{width:min(100%,calc(100dvh - 76px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)))}
  /* Merge Conflict and Stand-up: staging beside the graph when there is room */
  html #mwrap[data-kind=puzzle] .su-chip{min-height:40px}

  /* ---- Beat the Bot (in the phone or not): full screen; in a race the task on the left, the bot, the brief and Hand it in / Walk away
     pinned in a column on the right, the clock in the header; in the lobby "Start the race" stays pinned ---- */
  html #mwrap[data-kind=bots]:not(.x){padding:0}
  html #mwrap[data-kind=bots]>.card.bb-card{width:100%;max-width:none;height:100%;max-height:100%;border-radius:0;padding:6px 12px 0;gap:6px;display:flex;flex-direction:column;overflow:hidden}
  html #mwrap[data-kind=bots] .bb-top{flex:none;gap:10px}
  html #mwrap[data-kind=bots] .bb-top .bb-logo{width:32px;height:32px}
  html #mwrap[data-kind=bots] .bb-top h2{font-size:19px}html #mwrap[data-kind=bots] .bb-top small{font-size:12px}
  html #mwrap[data-kind=bots] .bb-tabs{flex:none;padding:3px}html #mwrap[data-kind=bots] .bb-tabs button{min-height:40px}
  html #mwrap[data-kind=bots] .bb-lobby{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:start;padding-bottom:0}
  html #mwrap[data-kind=bots] .bb-lobby .bb-ladder{position:static}
  html #mwrap[data-kind=bots] .bb-go{position:sticky;bottom:0;margin:0;padding:8px 0 10px}
  html #mwrap[data-kind=bots] .bb-play{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) clamp(190px,29vw,260px);grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px 10px;align-items:stretch}
  html #mwrap[data-kind=bots] .bb-play>.bb-main{grid-column:1;grid-row:1/-1;min-height:0;contain:size;overflow:auto;overscroll-behavior:contain;order:0;padding-bottom:10px}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>*{grid-column:2;order:0}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>.bb-rival{grid-row:1;grid-template-columns:1fr;padding:6px 8px}
  html #mwrap[data-kind=bots] .bb-play .bb-rival .bb-av{display:none}
  html #mwrap[data-kind=bots] .bb-play .bb-say{margin:2px 0 6px;font-size:12.5px;min-height:0;padding:5px 8px}
  html #mwrap[data-kind=bots] .bb-play .bb-say::before,html #mwrap[data-kind=bots] .bb-play .bb-say::after{display:none}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>.bb-how{grid-row:2;max-height:34dvh;overflow:auto;font-size:13px;padding:6px 8px}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>div:not(.bb-rival):not(.bb-row){grid-row:3;min-height:0;overflow:auto}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>.bb-row{grid-row:4;position:static;margin:0;padding:0 0 8px;box-shadow:none;display:flex;flex-direction:column;gap:6px}
  html #mwrap[data-kind=bots] .bb-play>.bb-side>.bb-row>*{flex:none;width:100%;min-height:48px;margin:0}

  /* ---- timed mini-games (printer, server rack, whiteboard and the rest): a compact title, the clock pinned at the top while the job scrolls,
     the whiteboard's notes small enough that COMMIT shows, and COMMIT pinned anyway ---- */
  html #mwrap[data-kind=mini]>.card{width:min(760px,100%);padding:8px 16px 10px;gap:6px}
  html #mwrap[data-kind=mini]>.card>h2{font-size:18px;margin:0;padding-bottom:4px}
  html #mwrap[data-kind=mini]>.card>.sub{font-size:13px;margin:0}
  html #mwrap[data-kind=mini]>.card>.tbar,html #mwrap[data-kind=mini]>.card>.stn-time{position:sticky;z-index:5}
  html #mwrap[data-kind=mini]>.card>.tbar{top:-8px;height:8px;margin:0 -16px;border-radius:0}
  html #mwrap[data-kind=mini]>.card>.stn-time{top:0;margin:0 -16px;padding:4px 16px;font:700 16px var(--mono);opacity:1;background:var(--surface,#FBF5EA);box-shadow:0 6px 10px -8px rgba(42,28,18,.4)}
  html #mwrap[data-kind=mini] .rack-row{min-height:40px}
  html #mwrap[data-kind=mini] .wb{padding:8px 10px}
  html #mwrap[data-kind=mini] .wb-h{margin:0 0 6px;font-size:13px}
  html #mwrap[data-kind=mini] .wb-notes{gap:6px}
  html #mwrap[data-kind=mini] .wb-note{min-height:52px;padding:4px 6px;gap:2px}
  html #mwrap[data-kind=mini] .wb-tot{margin:6px 0 4px}
  html #mwrap[data-kind=mini] .wb>.opt.go{position:sticky;bottom:-10px;z-index:5;min-height:46px;box-shadow:0 -8px 12px -6px rgba(42,28,18,.3)}

  /* ---- the wardrobe / your character: wide, a bigger preview that stays in view, Save pinned beside Cancel ---- */
  html #mwrap[data-kind=profile]>.card{width:min(800px,100%);max-width:none;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row dense;column-gap:10px;row-gap:6px;align-content:start}
  html #mwrap[data-kind=profile]>.card>*{grid-column:1/-1}
  html #mwrap[data-kind=profile]>.card>.opt.go,html #mwrap[data-kind=profile]>.card>.ghost:last-child{order:2;position:sticky;bottom:-12px;z-index:4;margin:0;min-height:48px;box-shadow:0 0 0 5px var(--surface,#FBF5EA),0 -12px 14px -4px rgba(42,28,18,.3)}
  html #mwrap[data-kind=profile]>.card>.opt.go{grid-column:2}
  html #mwrap[data-kind=profile]>.card>.ghost:last-child{grid-column:1;display:flex;align-items:center;justify-content:center;width:auto;padding:0 12px;border:1px solid var(--line-strong,#c9b596);border-radius:10px;background:var(--raised,#fff)}
  html #mwrap[data-kind=profile] .looked{grid-template-columns:190px minmax(0,1fr)}
  html #mwrap[data-kind=profile] .looked .lookcv{display:block;width:180px;height:254px;max-height:calc(100dvh - 150px);position:sticky;top:0}
  html #mwrap[data-kind=profile] .looked .kindrow .hb{min-height:44px;font-size:13px}
  html #mwrap:is([data-kind=profile],[data-kind=shop]) .swatch{width:40px;height:40px;min-width:40px}

  /* ---- the office designer (More, Design): one slim top row, the palette a column on the left, the floor big enough to tap and
     scrolling in its frame (Move / Whole floor in editor.js), Cancel and Save always on screen ---- */
  html #editor{padding:max(6px,env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));gap:6px}
  html #edTop{flex-wrap:nowrap;overflow-x:auto;gap:6px;scrollbar-width:none}
  html #edTop h2{font-size:17px;white-space:nowrap;margin:0 4px 0 0}
  html #edTop label.fld{display:none}
  html #edTabs{flex-wrap:nowrap}
  html #edTop .hb,html #edTabs .hb{min-height:40px;white-space:nowrap;font-size:13px}
  html #edName{width:150px;min-height:40px;flex:none}
  html #edBody{grid-template-columns:172px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:8px}
  html #edPal{flex-direction:column;flex-wrap:nowrap;overflow:auto;overscroll-behavior:contain}
  html #edPal .pal{min-height:40px;flex:none}
  html #edPal .ed-view{display:flex;gap:4px;position:sticky;top:0;z-index:2;background:var(--ink);padding-bottom:4px}
  html #edPal .ed-view .hb{flex:1;min-height:44px;padding:4px 6px;font-size:13px}
  html #edWrap{justify-content:flex-start;overscroll-behavior:contain}
  html #edFoot{flex-wrap:nowrap;gap:8px}
  html #edFoot .grow{font-size:12px;line-height:1.3;min-width:0;max-height:3.9em;overflow:auto}
  html #edFoot .hb,html #edFoot #edSave{min-height:44px;flex:none}
  html #edOpenRow{min-height:44px;display:inline-flex;align-items:center;gap:6px}html #edOpenRow[hidden]{display:none}html #edOpen{width:24px;height:24px}
  html #edPal h3{font-size:12px}

  /* ---- the car card: Test drive, Buy outright, Buy on EMI and Close pinned at the bottom while the details scroll ---- */
  html #mwrap[data-kind=carcard] .cc-buy{position:sticky;bottom:-12px;z-index:5;margin:0 -16px -12px;padding:8px 16px 10px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;background:var(--surface,#FBF5EA);border-top:1px solid var(--line);box-shadow:0 -10px 14px -8px rgba(42,28,18,.3);order:9}
  html #mwrap[data-kind=carcard] .cc-buy>button{min-height:46px;justify-content:center;white-space:normal;line-height:1.15;padding:4px 6px;margin:0;width:auto}
  html #mwrap[data-kind=carcard] .cc-buy>.ghost{position:static;display:flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:10px;box-shadow:none}
  html #mwrap[data-kind=carcard] .cc-why{order:8}
  html #mwrap[data-kind=carcard] .cc-view{min-height:40px}html #mwrap[data-kind=carcard] .cc-spin{width:44px;height:44px}
  /* ---- driving: the steering pads in the bottom corners (left and right together, brake and gas together), the dashboard smaller between them ---- */
  html #drv3 .d3-pads{bottom:max(10px,env(safe-area-inset-bottom,0px));padding:0 max(10px,env(safe-area-inset-right,0px)) 0 max(10px,env(safe-area-inset-left,0px));gap:8px;justify-content:flex-start}
  html #drv3 .d3-pads button{width:70px;height:64px}
  html #drv3 .d3-pads button:nth-child(1){order:1}html #drv3 .d3-pads button:nth-child(4){order:2}
  html #drv3 .d3-pads button:nth-child(2){order:3;margin-left:auto}html #drv3 .d3-pads button:nth-child(3){order:4}
  html #drv3 .d3-dash{transform:translateX(-50%) scale(.72);transform-origin:50% 100%;bottom:max(6px,env(safe-area-inset-bottom,0px))}
  html #drv3 .d3-skip{min-height:44px;padding:8px 16px}

  /* ---- the mall rack (shop): a bigger preview that stays in view, readable pieces, Buy / Done / Wardrobe pinned at the bottom ---- */
  html #mwrap[data-kind=shop]>.card{width:min(820px,100%);max-width:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-flow:row dense;column-gap:8px;row-gap:6px;align-content:start}
  html #mwrap[data-kind=shop]>.card>*{grid-column:1/-1}
  html #mwrap[data-kind=shop]>.card>.opt.go,html #mwrap[data-kind=shop]>.card>.ghost{grid-column:auto;order:2;position:sticky;bottom:-12px;z-index:4;margin:0;min-height:48px;width:auto;display:flex;align-items:center;justify-content:center;padding:0 10px;box-shadow:0 0 0 5px var(--surface,#FBF5EA),0 -12px 14px -4px rgba(42,28,18,.3)}
  html #mwrap[data-kind=shop]>.card>.opt.go:disabled,html #mwrap[data-kind=profile]>.card>.opt.go:disabled{opacity:1;background:#d9a08a;border-color:#d9a08a}
  html #mwrap[data-kind=shop]>.card>.ghost{border:1px solid var(--line-strong,#c9b596);border-radius:10px;background:var(--raised,#fff)}
  html #mwrap[data-kind=shop] .looked{grid-template-columns:190px minmax(0,1fr)}
  html #mwrap[data-kind=shop] .looked .lookcv{display:block;width:180px;height:254px;max-height:calc(100dvh - 140px);position:sticky;top:0}
  html #mwrap[data-kind=shop] .looked .kindrow .hb{min-height:44px;font-size:13px}

  /* ---- Kitaab: answers and the "continued" cue big enough to tap ---- */
  html .rdb .ws-o{min-height:40px;padding-top:8px;padding-bottom:8px}
  html .rdb .rd-more{min-height:40px;padding:6px 16px}
  html .rdb .ws-tap{min-height:40px}

  /* ---- desk work: the window uses the height; the brief and pay tighter, and a shade at the bottom says more options are below ---- */
  html #mwrap[data-kind=work]>.wk{max-height:100%}
  html #mwrap .wk-bar{padding:2px 6px 2px 12px;min-height:44px}
  html #mwrap .wk-main{padding:8px 14px 0;gap:6px}
  html #mwrap .wk-brief{margin:0;font-size:13.5px;line-height:1.4}
  html #mwrap .wk-pay{margin:0;font-size:12px}
  html #mwrap .wk-main>.wk-clock{margin:2px 0!important}
  html #mwrap .wk-opt,html #mwrap .wk-btn,html #mwrap .wk-line,html #mwrap .wk-row{min-height:44px}
  html #mwrap .wk-main::after{content:'';position:sticky;bottom:0;display:block;flex:none;height:22px;margin:0 -14px;background:linear-gradient(rgba(244,241,234,0),rgba(27,32,51,.22));pointer-events:none}

  /* ---- toasts and banners stay above the phone (they were drawn behind it) ---- */
  html body.phone-on #banner{z-index:1200}
  html body #toasts.ph-toasts{position:fixed;z-index:1200;left:50%;transform:translateX(-50%);top:max(8px,env(safe-area-inset-top,0px));width:max-content;max-width:min(520px,calc(100vw - 40px));pointer-events:none}
  html body.phone-on:has(#banner:not([hidden])) #toasts.ph-toasts{top:calc(max(8px,env(safe-area-inset-top,0px)) + 92px)}
  html body #toasts.ph-toasts .toast{pointer-events:auto;font-size:13px;box-shadow:0 8px 24px rgba(0,0,0,.35)}
}
