/* Touch UI (tablet port M2). Every rule is scoped under body.touch (set by src/ui/touch/touchShell.js only when
   platform.isTouchUI), so this file is inert in the desktop app. Studio tokens only (theme-studio.css), no new colours. */

/* ---------- layout A: the canvas fills the screen; the desktop chrome is hidden (its elements stay in the DOM) ---------- */
body.touch #app { grid-template-rows: 0 0 minmax(0, 1fr) 0; }
body.touch #workspace { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
body.touch #menubar, body.touch #topbar, body.touch #statusbar, body.touch #toolbar,
body.touch .dock, body.touch #floatHost, body.touch #viewHud, body.touch .pen-quick,
body.touch .hsplit, body.touch .vsplit { display: none !important; }
body.touch #home { inset: 0; }
body.touch #touchShell { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
body.touch #touchShell [hidden], body.touch .tpop [hidden], body.touch .tmenu [hidden] { display: none !important; }
body.zen.touch #touchShell { display: none; }

/* ---------- top bar (topBar.js): two glass pills, start and end side; the canvas between them stays touchable ---------- */
body.touch #touchBar { position: fixed; top: 8px; inset-inline: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
body.touch .tpill { pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: calc(var(--r-md) + 4px);
  background: var(--glass); border: 1px solid var(--glassLine); box-shadow: var(--glassHi), var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
body.touch .tbtn { width: 44px; height: 44px; border-radius: var(--r-md); }
body.touch .tbtn .ic { width: 22px; height: 22px; }
body.touch .tbtn.active, body.touch .tbtn.open { background: var(--accentBg); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accentLine); }
body.touch .tbtn:disabled { opacity: .4; }
body.touch .tbdoc { display: flex; align-items: center; gap: 4px; padding-inline: 8px 0; min-width: 0; }
body.touch .tbtitle { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
body.touch .tbzoom { min-width: 56px; height: 44px; border-radius: var(--r-md); color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
body.touch .tbswatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--glassStrong); box-shadow: 0 0 0 1px var(--glassLine); }
@media (max-width: 900px) { body.touch .tbtitle { max-width: 90px; } }

/* ---------- pop-overs (popover.js) ---------- */
body.touch .tpop { position: fixed; z-index: 70; display: flex; flex-direction: column; min-width: 0; padding: 6px; border-radius: var(--r-xl);
  background: var(--glassStrong); border: 1px solid var(--glassLine); box-shadow: var(--glassHi), var(--shadowLg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: var(--text); animation: tpop-in var(--fast) var(--ease); }
body.touch .tpop-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 6px; border-radius: calc(var(--r-xl) - 6px); }
body.touch .tpop-arrow { position: absolute; top: -7px; left: calc(var(--ax, 24px) - 7px); width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--glassStrong); border-left: 1px solid var(--glassLine); border-top: 1px solid var(--glassLine); }
body.touch .tpop[data-side="above"] .tpop-arrow { top: auto; bottom: -7px; transform: rotate(225deg); }
body.touch .tpop .panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: none; border: 0; box-shadow: none; }
body.touch .tpop .panel .pbody { flex: 1 1 auto; min-height: 0; overflow: auto; }
body.touch .tpop .panel .pcollapse { display: none; }
body.touch .tpop #toolOptions { flex: 0 0 auto; height: auto; flex-wrap: wrap; white-space: normal; padding: 6px; background: none; border: 0; box-shadow: none; }
@keyframes tpop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { body.touch .tpop, body.touch .tmenu { animation: none !important; } }

/* ---------- menu lists and the tools grid (menuList.js, toolPops.js) ---------- */
body.touch .tlist { display: flex; flex-direction: column; gap: 2px; }
body.touch .trow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 4px 10px;
  border-radius: var(--r-md); text-align: start; color: var(--text); font-size: 14px; }
body.touch .trow:disabled { color: var(--faint); }
body.touch .trow .tlabel { display: flex; flex-direction: column; min-width: 0; }
body.touch .trow small { color: var(--faint); font-size: 11.5px; }
body.touch .trow .tkey { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
body.touch .tsub { margin-inline-start: 16px; padding-inline-start: 6px; border-inline-start: 1px solid var(--glassLine); }
body.touch .tlsep { height: 1px; margin: 4px 8px; background: var(--glassLine); }
body.touch .tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
body.touch .tgitem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 6px 2px;
  border-radius: var(--r-md); color: var(--text); font-size: 11.5px; text-align: center; }
body.touch .tgitem .ic { width: 24px; height: 24px; }
body.touch .tgitem.active { background: var(--accentBg); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accentLine); }
body.touch .toolflyout { z-index: 80; }
body.touch .toolflyout .tfitem { min-height: 44px; }

/* ---------- ☰ command sheet (commandSheet.js): full height on the start side ---------- */
body.touch .tsheet { top: 0; bottom: 0; inset-inline-start: 0; width: min(380px, 92vw); padding: 10px; border-radius: 0;
  border-start-end-radius: var(--r-xl); border-end-end-radius: var(--r-xl); animation-name: tsheet-in; animation-duration: 180ms; }
html[dir="rtl"] body.touch .tsheet { animation-name: tsheet-in-rtl; }
@keyframes tsheet-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes tsheet-in-rtl { from { transform: translateX(100%); } to { transform: none; } }
body.touch .tcmds { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
body.touch .tcmdhead { position: sticky; top: 0; z-index: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; background: var(--glassStrong); }
body.touch .tcmdtitle { display: flex; align-items: center; justify-content: space-between; padding-inline-start: 8px; font-size: 16px; }
body.touch .tsearch { height: 48px; padding: 0 14px; border-radius: var(--r-md); font-size: 15px; }
body.touch .tcgroup + .tcgroup { border-top: 1px solid var(--glassLine); }
body.touch .tghead { width: 100%; }
body.touch .tghead .tlabel { font-weight: 600; }
body.touch .tempty { padding: 16px; color: var(--muted); text-align: center; }
body.touch #zenExit { width: 44px; height: 44px; }

/* ---------- side sliders (sideSliders.js): grip · size · undo · redo · opacity ---------- */
body.touch #touchSliders { position: fixed; z-index: 1; flex-direction: column; gap: 4px; padding: 6px 4px; width: 54px; direction: ltr; }
body.touch .tgrip { width: 44px; height: 44px; display: grid; place-content: center; gap: 3px; border-radius: var(--r-md); touch-action: none; cursor: grab; }
body.touch .tgrip i { display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--faint); }
body.touch #touchSliders.dragging { box-shadow: var(--glassHi), var(--shadowLg); }
body.touch #touchSliders .vslider { gap: 2px; touch-action: none; }
body.touch #touchSliders .vslider input { width: 44px; height: 150px; touch-action: none; }
body.touch #touchSliders .vslider output { font-size: 11px; }
@media (max-height: 860px) { body.touch #touchSliders .vslider input { height: 120px; } }
/* ---------- tool options strip (optionsStrip.js): centred under the top bar ---------- */
body.touch #touchStrip { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 140px); display: flex; align-items: center; gap: 8px; pointer-events: auto; }
/* pinned layers column on the end side: the strip is centred in the free area beside it, never under it */
body.touch.touch-pinned #touchStrip { left: auto; transform: none; inset-inline: 70px 456px; width: fit-content; max-width: none; margin-inline: auto; flex-wrap: wrap; justify-content: center; }
body.touch #touchStrip #toolOptions { height: 54px; max-width: 100%; box-shadow: var(--glassHi), var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
body.touch #tsCancelDrag, body.touch #tsTextDone, body.touch #tsTextCancel { min-height: 44px; padding-inline: 16px; background: var(--glassStrong); box-shadow: var(--shadow); }

/* ---------- size class "large": pinned layers column (pinLayers.js) on the end side ---------- */
body.touch #touchPin { position: fixed; top: 70px; bottom: 8px; inset-inline-end: 8px; width: 440px; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; }
body.touch #touchPin .panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: none; border: 0; box-shadow: none; }
body.touch #touchPin .panel .pbody { flex: 1 1 auto; min-height: 0; overflow: auto; }
body.touch #touchPin .panel .pcollapse { display: none; }
body.touch .tpinrow { display: flex; justify-content: flex-end; }
body.touch .tpintoggle { min-height: 44px; padding-inline: 14px; }
body.touch .tpintoggle.on { background: var(--accentBg); color: var(--accent); border-color: var(--accentLine); }
/* ---------- touch equivalents (touchAffordances.js) ---------- */
body.touch .brow .bbtns { opacity: 1; }          /* desktop shows them on hover only */
body.touch .tmenu { position: fixed; z-index: 80; padding: 6px; border-radius: var(--r-lg); background: var(--glassStrong); border: 1px solid var(--glassLine);
  box-shadow: var(--glassHi), var(--shadowLg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); animation: tpop-in var(--fast) var(--ease); }
body.touch #tooltip { white-space: normal; max-width: min(320px, 90vw); }
body.touch .lrow { -webkit-user-drag: none; }
body.touch #tbColor { touch-action: none; }       /* a drag from the colour = ColorDrop (fillTool.js), not a browser gesture */

/* ---------- sizes: every control >= 44 x 44 CSS px (Apple); 4 px gaps give a 48 dp pitch (Android) ---------- */
body.touch :is(#touchShell, .tpop, .tmenu) :is(button, [role="button"], select, input:not([type="range"]):not([type="checkbox"]):not([type="radio"])) { min-width: 44px; min-height: 44px; }
body.touch :is(#touchShell, .tpop) input[type="range"] { min-height: 44px; }
body.touch :is(#touchShell, .tpop) label:has(> input[type="checkbox"]), body.touch :is(#touchShell, .tpop) label.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
body.touch :is(#touchShell, .tpop) .seg { gap: 4px; }
body.touch :is(#touchShell, .tpop) .swatches { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 4px; }
body.touch :is(#touchShell, .tpop) .swatches button { width: 44px; height: 44px; }
/* Home and every dialog (New canvas, Image size, Settings ...): same >= 44 px rule; the controls keep their layout, only grow */
body.touch :is(#home, dialog) :is(button, select, input:not([type="range"]):not([type="checkbox"]):not([type="radio"])) { min-width: 44px; min-height: 44px; }
body.touch :is(#home, dialog) input[type="range"] { min-height: 44px; }
body.touch :is(#home, dialog) label:has(> input[type="checkbox"]), body.touch :is(#home, dialog) label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
body.touch :is(#home, dialog) .chip, body.touch :is(#home, dialog) .btn { display: inline-flex; align-items: center; justify-content: center; padding-inline: 16px; }
body.touch :is(#home, dialog) .seg button { padding-inline: 14px; }
body.touch :is(#home, dialog) .presetgrid { gap: 8px; }
body.touch :is(#home, dialog) .dlg > footer, body.touch :is(#home, dialog) .dfoot { gap: 10px; }
body.touch :is(#home, dialog) .ib { width: 44px; height: 44px; }
body.touch .brow .bbtns { flex-direction: row; gap: 4px; }
body.touch .brow .bbtns .ib { width: 44px; height: 44px; }
body.touch .lrow { grid-template-columns: 44px auto minmax(0, 1fr) auto; min-height: 52px; gap: 4px; padding-block: 4px; }
body.touch .lrow .flags { display: flex; gap: 4px; }
body.touch #touchStrip #toolOptions { gap: 10px; }
/* category chips: one swipeable row (the desktop's wrapped 2-row box clipped 44 px chips) */
body.touch :is(.tpop, #touchShell) .cats:not(.srcs) { flex-wrap: nowrap; overflow: auto hidden; max-height: none; padding-bottom: 6px; }
body.touch :is(.tpop, #touchShell) .cats .chip { flex: 0 0 auto; height: 44px; line-height: 1.2; }
body.touch .lrow .thumbs { gap: 4px; }
body.touch .lrow .thumb, body.touch .lrow .gicon { width: 52px; height: 44px; min-width: 44px; min-height: 44px; }
/* ---------- pressed states instead of hover-only styles ---------- */
body.touch :is(.ib, .btn, .chip, .trow, .tgitem, .tbtn, .tbzoom, .brow, .seg button):active:not(:disabled):not(.primary):not(.on):not(.active):not(.sel):not(.open) { background: var(--press); }
/* accent-filled controls keep their fill and darken a little instead */
body.touch :is(.btn.primary, .chip.on, .chip.active, .seg button.active, .ib.active, .tbtn.on, .tbtn.open, .tpintoggle.on):active:not(:disabled) { filter: brightness(.88); }
body.touch .swatches button { transition: transform var(--fast) var(--ease); }
body.touch .swatches button:active { transform: scale(.94); box-shadow: 0 0 0 2px var(--accentLine); }
/* touch screens keep :hover after a tap - undo only what :hover adds, never a selected / on / open state */
@media (hover: none) {
  body.touch :is(.ib, .trow, .tgitem, .tbzoom, .lrow):hover:not(.active):not(.on):not(.sel):not(.open):not(:active) { background: transparent; }
  body.touch :is(.chip, .brow):hover:not(.active):not(.on):not(.sel):not(.open):not(:active) { background: var(--panel2); }
}
@media (prefers-reduced-motion: reduce) { body.touch .swatches button { transition: none; } body.touch .swatches button:active { transform: none; } }
/* ---------- the page never scrolls, rubber-bands or zooms; only the canvas pans / zooms (canvasInput.js) ----------
   html.touch-ui is set by touchShell.js together with body.touch. 100dvh (the visible screen, without the browser's address
   bar) with a 100% fallback for older engines. touch-action: none everywhere except the scroll areas (pan-y / pan-x), so
   neither a pinch nor a double-tap zooms the page; the iOS page pinch (gesture* events) is also stopped in touchShell.js. */
html.touch-ui, html.touch-ui body { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; overflow: hidden;
  overscroll-behavior: none; touch-action: none; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body.touch #app { height: 100%; }
body.touch #stage, body.touch #touchShell, body.touch #touchShell * { touch-action: none; }
body.touch :is(.tpop-body, .tpop .pbody, #touchPin .pbody, .tmenu, #home, dialog, dialog .dbody, #webNotice p, .tlist) { touch-action: pan-y; overscroll-behavior: contain; }
body.touch :is(.cats, #touchStrip #toolOptions) { touch-action: pan-x; overscroll-behavior: contain; }
/* scroll areas inside #touchShell: their content must allow the pan too (touch-action is intersected with every ancestor up
   to the scroll container, and '#touchShell *' above says none); range sliders keep none (a drag sets the value) */
body.touch #touchStrip #toolOptions *:not(input[type="range"]) { touch-action: pan-x; }
body.touch #touchPin .pbody *:not(input[type="range"]) { touch-action: pan-y; }
/* notch / rounded corners (viewport-fit=cover in the web build): the top bar stays in the safe area */
body.touch #touchBar { top: max(8px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); }
body.touch #toast { pointer-events: none; max-width: calc(100vw - 32px); white-space: normal; text-align: center; bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- trial notice (webNotice.js) in the touch UI: a compact card above the bottom safe area, the text scrolls ---------- */
body.touch #webNotice { bottom: calc(12px + env(safe-area-inset-bottom)); inset-inline: max(12px, env(safe-area-inset-left)); max-height: 40vh; max-height: 40dvh;
  padding: 12px 14px; gap: 6px; line-height: 1.6; }
body.touch #webNotice p { flex: 0 1 auto; min-height: 0; overflow: auto; }
body.touch #webNotice .btn { flex: 0 0 auto; }

/* ---------- phones: size class compact (short side < 700 px) ---------- */
/* top bar: ☰ · Tools | Brush · Eraser · Layers · Colour. Home, Adjustments and Selection: a row on top of the Tools grid;
   Smudge and Move: in the grid. No title / zoom: they would not fit 360 px. */
body.touch[data-size-class="compact"] :is(#tbHome, #tbAdjust, #tbSelect, #tbMove, #tbBlend, .tbdoc) { display: none; }
body.touch[data-size-class="compact"] .tgwrap { display: flex; flex-direction: column; gap: 6px; }
body.touch[data-size-class="compact"] .tgrow { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 6px; border-bottom: 1px solid var(--glassLine); }
body.touch[data-size-class="compact"] .tgitem { min-height: 64px; }
@media (orientation: landscape) { body.touch[data-size-class="compact"] .tgrid:not(.tgrow) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* pop-overs and the ☰ sheet: bottom sheets (popover.js .tbottom) */
body.touch .tpop-handle { display: none; }
body.touch .tpop.tbottom { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 70vh; max-height: 70dvh; height: auto;
  padding: 4px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0; animation: tbottom-in 200ms var(--ease); }
body.touch .tpop.tbottom.tbottom-max, body.touch .tpop.tbottom.tsheet { height: 70vh; height: 70dvh; }
html body.touch .tpop.tbottom.tsheet, html[dir="rtl"] body.touch .tpop.tbottom.tsheet { animation-name: tbottom-in; animation-duration: 200ms; }
body.touch .tpop.tbottom .tpop-arrow { display: none; }
body.touch .tpop.tbottom .tpop-handle { display: block; flex: 0 0 auto; width: 40px; height: 5px; margin: 4px auto 6px; border-radius: 3px; background: var(--faint); opacity: .7; }
@keyframes tbottom-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.touch .tpop.tbottom { animation: none !important; } }
/* while a bottom sheet is open the slider pill steps aside (it would sit under the sheet) */
body.touch.tbottom-open #touchSliders { visibility: hidden; }
/* the layers panel's action bar scrolls sideways instead of running off a narrow sheet */
body.touch[data-size-class="compact"] .tpop .lbar { flex-shrink: 0; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; touch-action: pan-x; scrollbar-width: none; }
body.touch[data-size-class="compact"] .tpop .lbar > * { flex: 0 0 auto; }

/* side slider pill: shorter sliders */
body.touch[data-size-class="compact"] #touchSliders .vslider input { height: 112px; }
@media (max-height: 700px) { body.touch[data-size-class="compact"] #touchSliders .vslider input { height: 96px; } }
/* landscape phone (little height): two columns - grip on top, size | opacity, undo | redo */
@media (max-height: 520px) {
  body.touch[data-size-class="compact"] #touchSliders { display: grid; width: auto; grid-template-columns: 44px 44px;
    grid-template-areas: "grip grip" "size op" "undo redo"; justify-items: center; gap: 4px; padding: 4px; }
  body.touch[data-size-class="compact"] #touchSliders .tgrip { grid-area: grip; width: 92px; }
  body.touch[data-size-class="compact"] #touchSliders .vslider:has(#quickSize) { grid-area: size; }
  body.touch[data-size-class="compact"] #touchSliders .vslider:has(#quickOpacity) { grid-area: op; }
  body.touch[data-size-class="compact"] #touchSliders #tsUndo { grid-area: undo; }
  body.touch[data-size-class="compact"] #touchSliders #tsRedo { grid-area: redo; }
  body.touch[data-size-class="compact"] #touchSliders .vslider input { height: 112px; }
}

/* options strip: full width under the top bar, scrolls sideways, never wider than the screen */
body.touch[data-size-class="compact"] #touchStrip { top: calc(max(8px, env(safe-area-inset-top)) + 60px); left: 8px; right: 8px; transform: none; max-width: none; width: auto; }
body.touch[data-size-class="compact"] #touchStrip #toolOptions { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
  justify-content: flex-start; scrollbar-width: none; }
body.touch[data-size-class="compact"] #touchStrip #toolOptions > * { flex: 0 0 auto; }

/* welcome slides (welcome.js) on a phone: picture on top, text below (scrolls when long), buttons at the bottom; nothing overlaps */
body.touch[data-size-class="compact"] #dlg.welcome-mode { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
body.touch[data-size-class="compact"] .wl { display: flex; flex-direction: column; width: min(520px, calc(100vw - 16px)); aspect-ratio: auto; height: auto;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
body.touch[data-size-class="compact"] .wl-art { position: relative; inset: auto; flex: 0 0 auto; height: min(34vh, 230px); height: min(34dvh, 230px); }
body.touch[data-size-class="compact"] .wl-art img { left: 0; top: 0; width: 100%; height: 100%; object-position: left top;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
body.touch[data-size-class="compact"] .wl-text { position: static; width: auto; flex: 1 1 auto; min-height: 0; overflow: auto; touch-action: pan-y;
  justify-content: flex-start; gap: 10px; padding: 4px 20px 8px; }
body.touch[data-size-class="compact"] .wl-text h2 { font-size: 24px; }
body.touch[data-size-class="compact"] .wl-text p { font-size: 15px; line-height: 1.75; }
body.touch[data-size-class="compact"] .wl-text li { font-size: 14px; padding: 8px 10px; }
body.touch[data-size-class="compact"] .wl-foot { position: static; flex: 0 0 auto; flex-wrap: wrap; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
body.touch[data-size-class="compact"] .wl-btn { min-height: 44px; }
body.touch[data-size-class="compact"] .wl-x { width: 44px; height: 44px; top: 10px; left: 10px; }
/* landscape phone: picture on the left, text and buttons beside it */
@media (orientation: landscape) {
  body.touch[data-size-class="compact"] .wl { display: grid; width: min(760px, calc(100vw - 16px)); height: calc(100vh - 24px); height: calc(100dvh - 24px); direction: ltr;
    grid-template-columns: 42% minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  body.touch[data-size-class="compact"] .wl-art { grid-row: 1 / 3; grid-column: 1; height: auto; }
  body.touch[data-size-class="compact"] .wl-art img { object-position: left center;
    -webkit-mask-image: linear-gradient(to right, #000 70%, transparent); mask-image: linear-gradient(to right, #000 70%, transparent); }
  body.touch[data-size-class="compact"] .wl-text { grid-row: 1; grid-column: 2; padding: 16px 18px 6px; justify-content: center; }
  body.touch[data-size-class="compact"] .wl-foot { grid-row: 2; grid-column: 2; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); }
  body.touch[data-size-class="compact"] .wl[dir="rtl"] :is(.wl-text, .wl-foot) { direction: rtl; }
}
/* the welcome's keyboard shortcuts mean nothing on a touch screen */
body.touch .wl-text kbd { display: none; }

/* blending state chip: under the top bar pills (44px buttons + 8px margins), clear of the side sliders */
body.touch #blendState { position: fixed; top: 72px; z-index: 41; min-height: 32px; padding-inline: 12px; }
