/* Shared control layout; scoped to the seven annotated mobile interactions. */
body.restored-workspace .landscape-touchpad {
  --landscape-toolbar-height: 44px;
  height: var(--workspace-height, 100dvh);
  min-width: 0;
  grid-template-columns: clamp(140px, 20vw, 180px) minmax(0, 1fr) 44px;
  grid-template-rows: 44px 44px minmax(0, 1fr) 64px;
  grid-template-areas: "header header header" "utility utility utility" "actions touch scroll" "input input input";
  gap: 8px;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
body.restored-workspace .landscape-toolbar {
  grid-area: header !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
body.restored-workspace :is(.landscape-connection, .landscape-gesture-status, [data-viewport-menu-trigger], .pure-mouse-cluster, .pure-mouse-side-button, .ring-key-left, .ring-key-right, .ring-hit-button, .pure-gesture-labels, .landscape-zone-labels) { display: none !important; }
body.restored-workspace .landscape-brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; white-space: nowrap; }
body.restored-workspace .landscape-brand strong { font-size: 14px; font-weight: 700; letter-spacing: 0; line-height: 1.2; }
body.restored-workspace .landscape-brand .mobile-brand-mark { width: 24px; height: 26px; border-radius: 8px; }
body.restored-workspace .landscape-mode-menu-control { display: flex !important; gap: 4px; align-items: center; }
body.restored-workspace .landscape-mode-menu-control > :is(.viewport-mode-button, .theme-toggle, .landscape-mode-trigger) {
  height: 44px;
  min-width: 40px;
  padding-inline: 5px;
  font-size: 11px;
  border-radius: 10px;
}
body.restored-workspace .landscape-mode-menu-control > .viewport-mode-button {
  width: auto; color: var(--theme-text); background: var(--theme-raised); border: 1px solid var(--theme-line);
}
body.restored-workspace .landscape-mode-menu-control > .theme-toggle { width: 36px; min-width: 36px; }
body.restored-workspace .landscape-mode-menu-control > .landscape-mode-trigger { min-width: 112px; gap: 5px; padding-inline: 8px; }
body.restored-workspace .landscape-mode-trigger .mode-menu-caption { display: inline; font-size: 10px; color: var(--theme-text-soft); }
body.restored-workspace .landscape-mode-trigger .mode-current-dot { display: none; }
body.restored-workspace #landscapeModeMenuLabel { font-size: 12px; font-weight: 700; }
body.restored-workspace .landscape-mode-trigger .mode-menu-chevron { font-size: 15px; }
body.restored-workspace .landscape-window-actions .landscape-command-key { font-size: 12px; letter-spacing: 0; }
body.restored-workspace .landscape-touchpad > .landscape-input-utility-row {
  grid-area: utility !important; display: block; min-width: 0;
}
body.restored-workspace .landscape-window-actions { height: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.restored-workspace .landscape-touchpad > .landscape-trackpad-area { grid-area: touch !important; }
body.restored-workspace .landscape-trackpad-area {
  min-width: 0; min-height: 0; width: 100%; height: 100%; border-radius: 20px;
}
body.restored-workspace .pure-trackpad-area::before { display: none; }
body.restored-workspace #landscapeTrackpad .landscape-trackpad-mode { position: absolute; left: 50%; top: 50%; right: auto; transform: translate(-50%, -50%); white-space: nowrap; }
body.restored-workspace .landscape-touchpad > .common-action-portrait-slot {
  grid-area: actions !important; display: block; min-width: 0; min-height: 0;
}
body.restored-workspace .common-action-portrait-slot .common-rail-actions {
  display: grid; height: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(40px, 1fr)); gap: 6px;
}
body.restored-workspace .common-rail-actions .landscape-keyboard-toggle { grid-column: auto; }
body.restored-workspace .common-rail-actions .landscape-command-key { height: 100%; min-height: 0; min-width: 0; padding: 0 3px; font-size: 11px; letter-spacing: 0; }
body.restored-workspace #commonActionRail .landscape-command-key { font-size: 12px; }
body.restored-workspace .landscape-touchpad:not([data-control-mode="common"]) > .common-action-portrait-slot { display: none; }

/* One wheel control: horizontal under the pad in portrait, vertical at its right in landscape. */
body.restored-workspace .landscape-touchpad > .pure-scroll-strip { grid-area: scroll !important; }
body.restored-workspace .pure-scroll-strip {
  position: relative; inset: auto; display: flex; align-items: center; justify-content: center;
  grid-column: auto; width: 100%; height: 100%; min-width: 0; min-height: 44px; max-height: none;
  padding: 16px 10px; border-radius: 12px; touch-action: none;
}
body.restored-workspace .pure-scroll-strip :is(.pure-scroll-strip-arrow, .pure-scroll-strip-speed) { display: none; }
body.restored-workspace .pure-scroll-strip .pure-scroll-strip-rail { width: 7px; height: 100%; min-height: 0; }
body.restored-workspace .pure-scroll-strip .pure-scroll-strip-thumb { width: 24px; height: 14px; }

/* Bottom text area stays connected when idle; the editor opens on demand. */
body.restored-workspace .landscape-touchpad > .workspace-input-dock { grid-area: input !important; min-width: 0; width: 100%; }
body.restored-workspace .workspace-input-dock .quick-input {
  width: 100%; height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px;
  gap: 0; border: 1px solid var(--theme-line); border-radius: 15px; background: var(--theme-raised); overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
body.restored-workspace .workspace-input-dock .quick-input[hidden] { display: none; }
body.restored-workspace .workspace-input-dock :is(.quick-text, .quick-key, .input-dock-activator) {
  height: 62px; min-height: 62px; min-width: 0; border-radius: 0; font-size: 16px; box-shadow: none;
}
body.restored-workspace .workspace-input-dock :is(.quick-text, .input-dock-activator) {
  grid-column: 1; grid-row: 1; width: 100%; border: 0; padding-inline: 14px; color: var(--theme-text);
  background: transparent; text-align: left;
}
body.restored-workspace .input-dock-activator { font-weight: 500; }
body.restored-workspace .workspace-input-dock :is(.quick-text, .input-dock-activator)[hidden] { display: none; }
body.restored-workspace .workspace-input-dock .quick-send { grid-column: 2; border: 0; border-left: 1px solid var(--theme-line); font-size: 22px; }
body.restored-workspace .workspace-input-dock .enter-key { grid-column: 3; border: 0; border-left: 1px solid var(--theme-line); font-size: 18px; }
body.restored-workspace .quick-input.input-expanded { border-color: var(--theme-line-strong); box-shadow: 0 0 0 2px rgba(var(--landscape-accent-rgb), .12); }
body.restored-workspace .input-expanded .quick-text { animation: dock-editor-in 150ms ease-out; }
@keyframes dock-editor-in { from { opacity: .3; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { body.restored-workspace .quick-input, body.restored-workspace .input-expanded .quick-text { animation: none; transition: none; } }

/* Presentation controls have a dedicated, stable blind-operation row. */
body.restored-workspace .landscape-touchpad[data-control-mode="presentation"] {
  grid-template-rows: 44px 44px minmax(0, 1fr) clamp(72px, 19dvh, 116px) 64px;
  grid-template-areas: "header header header" "utility utility utility" "touch touch scroll" "pages pages pages" "input input input";
}
body.restored-workspace .landscape-touchpad[data-control-mode="presentation"] > .landscape-input-utility-row,
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"] > .landscape-input-utility-row { display: none; }
body.restored-workspace .landscape-touchpad > [data-mode-row="presentation"].landscape-command-row-top { grid-area: utility !important; }
body.restored-workspace .landscape-touchpad > .presentation-page-row { grid-area: pages !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 16px; }
body.restored-workspace .presentation-page-key { min-width: 0; min-height: 64px; height: 100%; font-size: 20px; border-radius: 18px; touch-action: none; }
body.restored-workspace #previousSlideButton::before { content: "‹"; font-size: 30px; margin-right: 12px; }
body.restored-workspace #nextSlideButton::after { content: "›"; font-size: 30px; margin-left: 12px; }
body.restored-workspace .presentation-page-key.pressed { transform: scale(.985); }

/* Presentation is a focused remote.  The screen keeps the touchpad clear,
   reserves the visual weight for page advance and moves aids into the pad. */
body.restored-workspace .presentation-assist-surface,
body.restored-workspace .presentation-timer-panel { display: none; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-surface {
  position: absolute; z-index: 4; top: 12px; left: 12px; right: 12px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 7px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture {
  min-height: 42px; border: 1px solid rgba(var(--landscape-accent-rgb), .35); border-radius: 14px;
  background: var(--theme-raised);
  color: var(--theme-text); box-shadow: var(--theme-shadow-small); touch-action: manipulation;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button {
  display: grid; grid-template-columns: auto 1fr; column-gap: 7px; align-items: center; padding: 6px 10px; text-align: left;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button > span { grid-row: 1 / span 2; font-size: 20px; color: var(--landscape-accent); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button strong { font-size: 13px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button small { font-size: 10px; color: var(--theme-text-soft); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button[aria-pressed="true"] { background: rgba(var(--landscape-accent-rgb), .28); border-color: var(--landscape-accent); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture { padding-inline: 13px; font-weight: 750; white-space: nowrap; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel:not([hidden]) {
  position: absolute; z-index: 5; top: 61px; right: 12px; left: 12px; display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px;
  border: 1px solid rgba(var(--landscape-accent-rgb), .4); border-radius: 14px; background: var(--theme-raised); box-shadow: var(--theme-shadow);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel label { display: flex; align-items: center; gap: 6px; color: var(--theme-text); font-size: 12px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel input[type="number"] { width: 54px; min-height: 30px; border: 1px solid var(--theme-line); border-radius: 8px; background: var(--theme-canvas); color: var(--theme-text); text-align: center; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel button { min-height: 30px; border: 1px solid rgba(var(--landscape-accent-rgb), .45); border-radius: 8px; color: var(--theme-text); background: rgba(var(--landscape-accent-rgb), .16); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel small { grid-column: 1 / -1; color: var(--theme-text-soft); font-size: 10px; }

/* Design differs only in its modifier, not in the underlying touch engine. */
body.restored-workspace .restored-design-actions { display: none; }
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"] {
  grid-template-rows: 44px minmax(0, 1fr) 64px;
  grid-template-areas: "header header header" "design touch scroll" "input input input";
}
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"] > .restored-design-actions {
  grid-area: design !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1fr 1.2fr; gap: 8px; min-height: 0;
}
body.restored-workspace .restored-design-actions button {
  min-width: 0; min-height: 48px; border: 1px solid var(--theme-line); border-radius: var(--brand-radius);
  color: var(--theme-text); background: var(--theme-raised); box-shadow: var(--theme-shadow-small); font-size: 15px;
}
body.restored-workspace .restored-design-actions .design-zoom-toggle { grid-column: 1 / -1; font-size: 19px; }
body.restored-workspace .design-zoom-toggle[aria-pressed="true"] { color: var(--theme-text); background: rgba(var(--landscape-accent-rgb), .25); border-color: var(--landscape-accent); }

/* The keyboard reuses both pad and wheel, rather than adding another implementation. */
body.restored-workspace .landscape-touchpad.keyboard-open {
  grid-template-rows: 44px minmax(0, 1fr) 64px;
  grid-template-areas: "header header header" "keyboard keyboard keyboard" "input input input";
}
body.restored-workspace .keyboard-open > :is(.restored-design-actions, .common-action-portrait-slot) { display: none !important; }
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].keyboard-open {
  grid-template-areas: "header header header" "design keyboard keyboard" "input input input";
}
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].keyboard-open > .restored-design-actions { display: grid !important; }
body.restored-workspace .computer-keyboard { grid-area: keyboard !important; min-height: 0; grid-template-rows: 24px minmax(0, 1fr); }
body.restored-workspace .computer-keyboard-header { grid-template-columns: minmax(0, 1fr); }
body.restored-workspace .computer-keyboard-trackpad-slot { display: grid; grid-template-columns: minmax(0, 1fr) 44px; grid-template-rows: minmax(0, 1fr); gap: 6px; }
body.restored-workspace .computer-keyboard-trackpad-slot > .landscape-trackpad-area { grid-column: 1; grid-row: 1; }
body.restored-workspace .computer-keyboard-trackpad-slot > .pure-scroll-strip { grid-column: 2; grid-row: 1; }

@media (orientation: portrait) {
  body.restored-workspace .landscape-touchpad {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px 52px 64px;
    grid-template-areas: "header" "utility" "touch" "scroll" "actions" "input";
  }
  body.restored-workspace .common-action-portrait-slot .common-rail-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 5px; }
  body.restored-workspace .common-rail-actions .landscape-keyboard-toggle { grid-column: auto; }
  body.restored-workspace .common-rail-actions .landscape-keyboard-toggle > span:first-child { display: none; }
  body.restored-workspace .common-rail-actions .landscape-command-key { font-size: 12px; }
  body.restored-workspace .pure-scroll-strip { padding: 10px 18px; }
  body.restored-workspace .pure-scroll-strip .pure-scroll-strip-rail { width: 100%; height: 7px; min-height: 0; }
  body.restored-workspace .pure-scroll-strip .pure-scroll-strip-rail::after { width: 1px; height: 15px; }
  body.restored-workspace .pure-scroll-strip .pure-scroll-strip-thumb { left: var(--scroll-strip-position); top: 50%; width: 14px; height: 24px; }
  body.restored-workspace .pure-scroll-strip .pure-scroll-strip-fill { top: 1px; bottom: 1px; left: min(50%, var(--scroll-strip-position)); right: calc(100% - max(50%, var(--scroll-strip-position))); }
  body.restored-workspace .landscape-touchpad[data-control-mode="presentation"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px clamp(96px, 18dvh, 148px) 64px;
    grid-template-areas: "header" "utility" "touch" "scroll" "pages" "input";
  }
  body.restored-workspace .landscape-touchpad[data-control-mode="sketch"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr) 44px 72px 64px;
    grid-template-areas: "header" "touch" "scroll" "design" "input";
  }
  body.restored-workspace .landscape-touchpad[data-control-mode="sketch"] > .restored-design-actions { grid-template-columns: 1fr 1fr 1.15fr; grid-template-rows: minmax(0, 1fr); }
  body.restored-workspace .restored-design-actions .design-zoom-toggle { grid-column: auto; }
  body.restored-workspace .landscape-touchpad.keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 64px; grid-template-areas: "header" "keyboard" "input"; }
  body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 52px 64px; grid-template-areas: "header" "keyboard" "design" "input"; }
  body.restored-workspace .computer-keyboard-layout { grid-template-rows: minmax(48px, .8fr) minmax(94px, 2fr) minmax(46px, .8fr) minmax(40px, .7fr) repeat(3, minmax(30px, .7fr)) minmax(32px, .7fr); }
  body.restored-workspace .computer-keyboard-trackpad-slot { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(44px, 1fr) 44px; }
  body.restored-workspace .computer-keyboard-trackpad-slot > .pure-scroll-strip { grid-column: 1; grid-row: 2; }
}
body.restored-workspace .landscape-touchpad.native-input-active {
  grid-template-rows: 44px minmax(0, 1fr) 64px;
  grid-template-areas: "header header header" "touch touch scroll" "input input input";
}
body.restored-workspace .native-input-active > :is(.landscape-input-utility-row, .mode-shortcut-row, .restored-design-actions, .common-action-portrait-slot) { display: none !important; }
body.restored-workspace .landscape-touchpad.native-input-active.keyboard-open { grid-template-areas: "header header header" "keyboard keyboard keyboard" "input input input"; }
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].native-input-active.keyboard-open { grid-template-areas: "header header header" "keyboard keyboard keyboard" "input input input"; }
body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].native-input-active.keyboard-open > .restored-design-actions { display: none !important; }
body.restored-workspace .native-input-active .computer-keyboard { grid-template-rows: minmax(0, 1fr); }
body.restored-workspace .native-input-active .computer-keyboard-layout { display: block; }
body.restored-workspace .native-input-active .computer-keyboard-trackpad-slot { height: 100%; }
body.restored-workspace .native-input-active :is(.computer-keyboard-header, .computer-keyboard-row, .computer-keyboard-navigation) { display: none; }
@media (orientation: portrait) {
  body.restored-workspace .landscape-touchpad.native-input-active { grid-template-rows: 44px minmax(0, 1fr) 44px 64px; grid-template-areas: "header" "touch" "scroll" "input"; }
  body.restored-workspace .landscape-touchpad.native-input-active.keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 64px; grid-template-areas: "header" "keyboard" "input"; }
  body.restored-workspace .landscape-touchpad[data-control-mode="sketch"].native-input-active.keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 64px; grid-template-areas: "header" "keyboard" "input"; }
}

/* Light-only correction; dark theme keeps the existing palette. */
:root[data-theme="light"] body.restored-workspace .common-rail-actions .landscape-command-key {
  color: #3f5044; background: #fafbf9; border-color: #dce2d8; box-shadow: 0 2px 4px #29382a08;
}
:root[data-theme="light"] body.restored-workspace .workspace-input-dock .quick-send { color: #31462b; background: #e8efdf; }
:root[data-theme="light"] body.restored-workspace .workspace-input-dock .enter-key { color: #263426; background: #f5f7f2; }
:root[data-theme="light"] body.restored-workspace .landscape-mode-trigger { background: #edf2e9; border-color: #cdd8c5; }
:root[data-theme="light"] body.restored-workspace .pure-scroll-strip { background: #f6f8f3; border-color: #dce3d6; box-shadow: inset 0 1px 0 #fff; }
:root[data-theme="light"] body.restored-workspace .pure-scroll-strip .pure-scroll-strip-rail { background: #e1e8da; border-color: #d3dec9; box-shadow: inset 0 1px 3px #344b2520; }
:root[data-theme="light"] body.restored-workspace .pure-scroll-strip .pure-scroll-strip-thumb { background: #70885b; border-color: #60784c; box-shadow: 0 2px 4px #31472125, inset 0 1px 0 #ffffff50; }
:root[data-theme="light"] body.restored-workspace .pure-scroll-strip .pure-scroll-strip-fill { background: #8fa27d; box-shadow: none; }
@media (max-width: 360px) {
  body.restored-workspace .landscape-brand .mobile-brand-mark { display: none; }
  body.restored-workspace .landscape-brand strong { font-size: 12px; }
  body.restored-workspace .landscape-mode-menu-control { gap: 3px; }
  body.restored-workspace .landscape-mode-menu-control > .landscape-mode-trigger { min-width: 104px; padding-inline: 5px; }
  body.restored-workspace #commonActionRail .landscape-command-key { font-size: 11px; }
}

/* Instrument-style shared strip: endpoint cues, fine ticks and a lit thumb. */
body.restored-workspace #pureScrollStrip {
  --strip-rgb: 115, 148, 92;
  padding: 34px 10px;
  border: 1px solid rgba(var(--strip-rgb), .3);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(var(--strip-rgb), .14), transparent 65%), var(--theme-raised);
  box-shadow: inset 0 1px 0 #ffffff16, 0 3px 10px #0000000a;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
body.restored-workspace #pureScrollStrip.zoom-mode { --strip-rgb: 118, 103, 209; }
body.restored-workspace #pureScrollStrip.active {
  border-color: rgba(var(--strip-rgb), .8);
  box-shadow: 0 0 0 2px rgba(var(--strip-rgb), .1), inset 0 0 24px rgba(var(--strip-rgb), .09);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow {
  display: grid; place-items: center; position: absolute; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; font-size: 19px; font-weight: 500; color: var(--theme-text-soft);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow-up { top: 3px; }
body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow-down { bottom: 3px; }
body.restored-workspace #pureScrollStrip .pure-scroll-strip-rail {
  width: 6px; height: 100%; border: 0; overflow: visible;
  background: rgba(var(--strip-rgb), .2); box-shadow: inset 0 1px 3px #00000015;
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-rail::before {
  content: ""; position: absolute; inset: 0 -7px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 11px, rgba(var(--strip-rgb), .3) 11px 12px);
  mask-image: linear-gradient(to right, #000 0 3px, transparent 3px 17px, #000 17px);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-fill {
  background: rgba(var(--strip-rgb), .85); box-shadow: 0 0 8px rgba(var(--strip-rgb), .28);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-thumb {
  width: 27px; height: 20px; border-radius: 7px; border: 1px solid rgba(var(--strip-rgb), .9);
  background: linear-gradient(155deg, rgba(255,255,255,.28), transparent 70%), rgb(var(--strip-rgb));
  box-shadow: 0 3px 7px #00000026, inset 0 1px 0 #ffffff60;
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-thumb::after {
  content: ""; position: absolute; inset: 6px 8px;
  border-top: 1px solid #ffffffb3; border-bottom: 1px solid #ffffffb3;
}
body.restored-workspace #pureScrollStrip.active .pure-scroll-strip-thumb {
  box-shadow: 0 0 0 5px rgba(var(--strip-rgb), .12), 0 0 18px rgba(var(--strip-rgb), .32), inset 0 1px 0 #ffffff80;
}
body.restored-workspace #pureScrollStrip:not(.active) .pure-scroll-strip-thumb { transition: left 160ms ease-out, top 160ms ease-out, box-shadow 160ms ease-out; }
body.restored-workspace #pureScrollStrip.direction-up .pure-scroll-strip-arrow-up,
body.restored-workspace #pureScrollStrip.direction-down .pure-scroll-strip-arrow-down { color: rgb(var(--strip-rgb)); text-shadow: 0 0 10px rgba(var(--strip-rgb), .4); }
:root[data-theme="light"] body.restored-workspace #landscapeTrackpad.gesture-feedback-active .landscape-trackpad-mode { color: #3c4d32; }
body.restored-workspace #pureScrollStrip:focus-visible { outline: 2px solid rgb(var(--strip-rgb)); outline-offset: 2px; }
body.restored-workspace .input-dock-activator { display: flex; flex-direction: column; justify-content: center; gap: 3px; line-height: 1.25; }
body.restored-workspace .input-dock-activator small { font-size: 11px; font-weight: 400; color: var(--theme-text-soft); }
body.restored-workspace .design-zoom-toggle[aria-pressed="true"] { background: rgba(118,103,209,.18); border-color: #9482db; }
@media (orientation: portrait) {
  body.restored-workspace #pureScrollStrip { padding: 24px 38px 11px; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-rail { width: 100%; height: 6px; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-rail::before {
    inset: -6px 0;
    background: repeating-linear-gradient(to right, transparent 0 11px, rgba(var(--strip-rgb), .3) 11px 12px);
    mask-image: linear-gradient(to bottom, #000 0 2px, transparent 2px 16px, #000 16px);
  }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-thumb { width: 20px; height: 24px; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-thumb::after { inset: 7px 6px; border: 0; border-left: 1px solid #ffffffb3; border-right: 1px solid #ffffffb3; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow { top: 50%; bottom: auto; transform: translateY(-50%); }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow-up { left: 5px; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-arrow-down { left: auto; right: 5px; }
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed {
    display: block; position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
    font-size: 10px; line-height: 12px; letter-spacing: .04em; white-space: nowrap; color: var(--theme-text-soft);
  }
}
@media (prefers-reduced-motion: reduce) { body.restored-workspace #pureScrollStrip, body.restored-workspace #pureScrollStrip .pure-scroll-strip-thumb { transition: none; } }

/* Every mode owns the same bottom dock, including the computer keyboard. */
body.restored-workspace #landscapeTouchpad {
  --dock-height: 64px;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: 44px 44px minmax(0, 1fr) var(--dock-height);
  grid-template-areas: "header header" "utility utility" "touch scroll" "input input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] {
  grid-template-rows: 44px 44px minmax(0, 1fr) clamp(72px, 19dvh, 116px) var(--dock-height);
  grid-template-areas: "header header" "utility utility" "touch scroll" "pages pages" "input input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] {
  grid-template-columns: clamp(140px, 20vw, 180px) minmax(0, 1fr) 44px;
  grid-template-rows: 44px minmax(0, 1fr) var(--dock-height);
  grid-template-areas: "header header header" "design touch scroll" "input input input";
}
body.restored-workspace #landscapeQuickInputSlot {
  display: grid; grid-template-columns: minmax(0, 1fr) 164px; gap: 8px; align-items: stretch;
}
body.restored-workspace #landscapeQuickInputSlot .quick-input { grid-column: 1; grid-row: 1; grid-template-columns: minmax(0, 1fr) 82px 64px; }
body.restored-workspace #landscapeQuickInputSlot #commonActionRail {
  display: grid; grid-column: 2; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 6px;
}
body.restored-workspace #commonActionRail .landscape-command-key {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  min-width: 0; min-height: 44px; height: 100%; padding: 4px; border-radius: 13px;
  font-size: 12px; letter-spacing: 0; color: var(--theme-text-soft); background: var(--theme-raised); border: 1px solid var(--theme-line);
}
body.restored-workspace #commonActionRail .landscape-keyboard-toggle > span { display: inline; }
body.restored-workspace #commonActionRail .dock-icon { display: block; width: 21px; height: 21px; flex: 0 0 auto; }
body.restored-workspace #commonActionRail button.pressed { color: var(--theme-text); border-color: var(--landscape-accent); background: rgba(var(--landscape-accent-rgb), .16); }
body.restored-workspace #sendTextButton.has-draft { font-size: 12px; font-weight: 650; white-space: nowrap; }

/* Non-interactive annotations travel with the one shared touch surface. */
body.restored-workspace #landscapeTrackpad .trackpad-instructions {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center; justify-items: center; gap: 12px 10px; padding: 28px 16px;
  color: var(--theme-text-soft); opacity: .52; font-size: 11px; line-height: 1.5;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
body.restored-workspace #landscapeTrackpad .trackpad-instructions * { pointer-events: none; }
body.restored-workspace #landscapeTrackpad .landscape-trackpad-mode { opacity: 0; }
body.restored-workspace #landscapeTrackpad:is(.active, .gesture-feedback-active, .drag-lock-active) .landscape-trackpad-mode { opacity: 1; z-index: 3; }
body.restored-workspace #landscapeTrackpad:is(.active, .gesture-feedback-active, .drag-lock-active) .trackpad-instructions { opacity: .13; }

/* Keep all keyboard rows reachable; do not clip them to a short viewport. */
body.restored-workspace #landscapeTouchpad.keyboard-open {
  grid-template-rows: 44px minmax(0, 1fr) var(--dock-height);
  grid-template-areas: "header header" "keyboard keyboard" "input input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open { grid-template-areas: "header header header" "design keyboard keyboard" "input input input"; }
body.restored-workspace #computerKeyboard { grid-template-rows: 18px minmax(0, 1fr); padding: 6px; }
body.restored-workspace #computerKeyboard .computer-keyboard-scroll { overflow: hidden; overscroll-behavior: contain; touch-action: manipulation; }
body.restored-workspace #computerKeyboard .computer-keyboard-layout { min-height: 270px; }
body.restored-workspace .keyboard-open #landscapeTrackpad .trackpad-instructions { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px; font-size: 9px; }
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad {
    --dock-height: 120px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header" "utility" "touch" "scroll" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] {
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px clamp(96px, 18dvh, 148px) var(--dock-height);
    grid-template-areas: "header" "utility" "touch" "scroll" "pages" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr) 44px 72px var(--dock-height);
    grid-template-areas: "header" "touch" "scroll" "design" "input";
  }
  body.restored-workspace #landscapeQuickInputSlot { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px 48px; }
  body.restored-workspace #landscapeQuickInputSlot #commonActionRail { grid-column: 1; grid-row: 2; }
  body.restored-workspace #landscapeQuickInputSlot .quick-input { grid-row: 1; }
  body.restored-workspace #commonActionRail .landscape-command-key { flex-direction: row; gap: 8px; }
  body.restored-workspace #landscapeTouchpad.keyboard-open {
    grid-template-rows: 44px minmax(0, 1fr) var(--dock-height); grid-template-areas: "header" "keyboard" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 52px var(--dock-height); grid-template-areas: "header" "keyboard" "design" "input"; }
  body.restored-workspace #computerKeyboard .computer-keyboard-layout {
    min-height: 540px;
    grid-template-rows: 64px minmax(142px, 1fr) 64px 56px repeat(3, minmax(40px, 1fr)) 40px;
  }
  body.restored-workspace .keyboard-open #landscapeTrackpad .trackpad-instructions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
}
body.restored-workspace #landscapeTouchpad.native-input-active {
  --dock-height: 64px;
  grid-template-rows: 44px minmax(0, 1fr) var(--dock-height);
  grid-template-areas: "header header" "touch scroll" "input input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active { grid-template-columns: minmax(0, 1fr) 44px; }
body.restored-workspace #landscapeTouchpad.native-input-active.keyboard-open { grid-template-areas: "header header" "keyboard keyboard" "input input"; }
body.restored-workspace .native-input-active #landscapeQuickInputSlot { display: block; }
body.restored-workspace .native-input-active #landscapeQuickInputSlot #commonActionRail { display: none; }
body.restored-workspace .native-input-active #computerKeyboard { grid-template-rows: minmax(0, 1fr); }
body.restored-workspace .native-input-active #computerKeyboard .computer-keyboard-layout { min-height: 0; }
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad.native-input-active,
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header" "touch" "scroll" "input";
  }
  body.restored-workspace #landscapeTouchpad.native-input-active.keyboard-open,
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active.keyboard-open { grid-template-rows: 44px minmax(0, 1fr) var(--dock-height); grid-template-areas: "header" "keyboard" "input"; }
}
@media (orientation: portrait) and (max-height: 640px) {
  body.restored-workspace #landscapeTrackpad .trackpad-instructions { font-size: 9px; gap: 5px; padding: 8px; }
}

/* A relative swipe surface, not a centered slider. */
body.restored-workspace #pureScrollStrip {
  padding: 0 16px; overflow: hidden; cursor: ew-resize;
  background: linear-gradient(90deg, rgba(var(--strip-rgb), .05), rgba(var(--strip-rgb), .14), rgba(var(--strip-rgb), .05)), var(--theme-raised);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed {
  display: block; position: static; transform: none; font-size: 11px; line-height: 1.4; color: var(--theme-text-soft); pointer-events: none;
}
body.restored-workspace #pureScrollStrip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent 15%, rgba(var(--strip-rgb), .25));
}
body.restored-workspace #pureScrollStrip.active.direction-right::after { opacity: 1; }
body.restored-workspace #pureScrollStrip.active.direction-left::after { opacity: 1; transform: rotate(180deg); }
body.restored-workspace #landscapeTouchpad.keyboard-open #pureScrollStrip { display: none !important; }
body.restored-workspace #computerKeyboardTrackpadSlot { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
body.restored-workspace #landscapeTouchpad.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) var(--dock-height);
  grid-template-areas: "header" "keyboard" "input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open > .restored-design-actions { display: none !important; }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad:not(.keyboard-open) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header" "utility" "touch" "scroll" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
    grid-template-columns: clamp(140px, 20vw, 180px) minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header header" "design touch" "design scroll" "input input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-columns: minmax(0, 1fr) minmax(180px, .6fr);
    grid-template-rows: 44px 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header header" "utility utility" "touch pages" "scroll pages" "input input";
  }
  body.restored-workspace #landscapeTouchpad.native-input-active:not(.keyboard-open) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) 44px var(--dock-height);
    grid-template-areas: "header" "touch" "scroll" "input";
  }
}

/* Text belongs below the header; common commands form one bottom row. */
body.restored-workspace #workspaceTextInputSlot {
  grid-area: text !important; min-width: 0; width: 100%;
}
body.restored-workspace #workspaceTextInputSlot .quick-input {
  height: 56px; grid-template-columns: minmax(0, 1fr) 96px;
}
body.restored-workspace #workspaceTextInputSlot :is(.quick-text, .quick-key, .input-dock-activator) { height: 54px; min-height: 54px; }
body.restored-workspace #landscapeQuickInputSlot {
  grid-area: input !important; display: block; height: 64px; min-height: 0;
}
body.restored-workspace #landscapeQuickInputSlot #commonActionRail {
  display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr);
  gap: 6px; height: 100%; min-width: 0;
}
body.restored-workspace #commonActionRail .landscape-command-key { flex-direction: column; gap: 4px; padding: 4px 2px; font-size: 11px; }
body.restored-workspace #commonActionRail .dock-symbol { display: grid; place-items: center; height: 22px; font-size: 25px; line-height: 1; }
body.restored-workspace #commonActionRail .dock-symbol-esc { font-size: 13px; font-weight: 650; }
body.restored-workspace #commonActionRail #enterButton { font-weight: 700; background: rgba(var(--landscape-accent-rgb), .13); }
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) {
  --dock-height: 64px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 44px 56px minmax(0, 1fr) var(--strip-height) 64px;
  grid-template-areas: "header" "text" "touch" "scroll" "input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
  grid-template-columns: clamp(140px, 20vw, 180px) minmax(0, 1fr);
  grid-template-rows: 44px 56px minmax(0, 1fr) var(--strip-height) 64px;
  grid-template-areas: "header header" "text text" "design touch" "design scroll" "input input";
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  grid-template-columns: minmax(0, 1fr) minmax(180px, .6fr);
  grid-template-rows: 44px 56px 44px minmax(0, 1fr) var(--strip-height) 64px;
  grid-template-areas: "header header" "text text" "utility utility" "touch pages" "scroll pages" "input input";
}
body.restored-workspace #landscapeTouchpad.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open {
  --dock-height: 64px; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 44px 56px minmax(0, 1fr) 64px;
  grid-template-areas: "header" "text" "keyboard" "input";
}
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 56px minmax(0, 1fr) var(--strip-height) 72px 64px;
    grid-template-areas: "header" "text" "touch" "scroll" "design" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 56px 44px minmax(0, 1fr) var(--strip-height) clamp(96px, 18dvh, 148px) 64px;
    grid-template-areas: "header" "text" "utility" "touch" "scroll" "pages" "input";
  }
}
body.restored-workspace #landscapeTouchpad.native-input-active:not(.keyboard-open) {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 56px minmax(0, 1fr) var(--strip-height) 64px;
  grid-template-areas: "header" "text" "touch" "scroll" "input";
}
body.restored-workspace #landscapeTouchpad.native-input-active.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active.keyboard-open {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 56px minmax(0, 1fr) 64px;
  grid-template-areas: "header" "text" "keyboard" "input";
}
@media (max-width: 360px) { body.restored-workspace #commonActionRail .landscape-command-key { font-size: 10px; } }

/* End zones accelerate only after a swipe enters them. */
body.restored-workspace #pureScrollStrip:not(.zoom-mode)::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--strip-rgb), .13) 0 24px, transparent 24px calc(100% - 24px), rgba(var(--strip-rgb), .13) calc(100% - 24px));
  border-radius: 7px;
}
body.restored-workspace #pureScrollStrip.edge-fast-left,
body.restored-workspace #pureScrollStrip.edge-fast-right { border-color: rgba(var(--strip-rgb), .8); box-shadow: inset 0 0 20px rgba(var(--strip-rgb), .14); }
body.restored-workspace #pureScrollStrip.edge-fast-left::after,
body.restored-workspace #pureScrollStrip.edge-fast-right::after { opacity: 1; }
body.restored-workspace #pureScrollStrip.edge-fast-left::after { transform: rotate(180deg); }
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed { z-index: 1; }

/* Shared footer: phone input, backspace, computer keyboard, Enter. */
body.restored-workspace #workspaceTextInputSlot .quick-input { grid-template-columns: minmax(0, 1fr); }
body.restored-workspace #landscapeQuickInputSlot #commonActionRail { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.restored-workspace #commonActionRail > .landscape-command-key { grid-column: auto; grid-row: auto; }
body.restored-workspace #commonActionRail #sendTextButton { font-size: 11px; white-space: normal; }
body.restored-workspace #commonActionRail #sendTextButton > span:last-child { line-height: 1.2; }
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] > .restored-design-actions { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
body.restored-workspace #pureScrollStrip.design-edges { padding-inline: 48px; }
body.restored-workspace #pureScrollStrip.design-edges::before { display: none; }
body.restored-workspace #pureScrollStrip .strip-zoom-edge { display: none; }
body.restored-workspace #pureScrollStrip.design-edges .strip-zoom-edge {
  display: grid; place-items: center; position: absolute; inset-block: 5px; width: min(44px, 16%); border-radius: 9px;
  background: rgba(var(--strip-rgb), .12); color: var(--theme-text-soft); font-size: 22px; font-weight: 500; pointer-events: none; z-index: 1;
}
body.restored-workspace #pureScrollStrip .strip-zoom-in { left: 0; }
body.restored-workspace #pureScrollStrip .strip-zoom-out { right: 0; }
body.restored-workspace #pureScrollStrip.zoom-mode.direction-right .strip-zoom-in,
body.restored-workspace #pureScrollStrip.zoom-mode.direction-left .strip-zoom-out { background: rgba(var(--strip-rgb), .3); color: var(--theme-text); }

/* In presentation the only bottom control is the full-width mode switcher.
   Text entry and the generic command rail are deliberately absent. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px minmax(0, 1fr) clamp(116px, 23dvh, 188px) 62px !important;
  grid-template-areas: "header" "touch" "pages" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #workspaceTextInputSlot,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > [data-mode-row="presentation"].landscape-command-row-top { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .presentation-page-row {
  grid-template-columns: minmax(0, .58fr) minmax(0, 1.72fr) !important; gap: 10px; padding: 0 2px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-page-key { min-height: 0; font-size: clamp(21px, 5vw, 30px); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #nextSlideButton { font-size: clamp(27px, 6.5vw, 40px); letter-spacing: .04em; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #nextSlideButton::after { font-size: 1.4em; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #landscapeQuickInputSlot { height: 62px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #landscapeQuickInputSlot #commonActionRail { grid-template-columns: minmax(0, 1fr) !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #commonActionRail > :not(#workspaceModeDock) { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #workspaceModeDock { display: grid; grid-column: 1 / -1; width: 100%; height: 100%; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #workspaceModeDock .workspace-mode-trigger {
  width: 100%; height: 100%; justify-content: center; border-radius: 16px; font-size: 16px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #workspaceModeDock .mode-menu-caption { display: inline; }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: 44px minmax(0, 1fr) clamp(92px, 30dvh, 150px) 58px !important;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #landscapeQuickInputSlot { height: 58px; }
}
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block {
  grid-column: 2; grid-row: 6 / 8; display: grid; min-width: 0; min-height: 0;
  grid-template-columns: minmax(0, 1fr) clamp(56px, 8vw, 90px); grid-template-rows: 1fr 1fr; gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block > .computer-keyboard-row-alpha-bottom {
  grid-column: 1; grid-row: 1; grid-template-columns: 1.3fr repeat(7, minmax(0, 1fr));
}
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block > .computer-keyboard-row-modifiers {
  grid-column: 1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, .8fr)) minmax(0, 3fr);
}
body.restored-workspace #computerKeyboardFnButton {
  grid-column: 2; grid-row: 1 / -1; flex-direction: column; gap: 5px; font-size: 15px;
  background: rgba(var(--landscape-accent-rgb), .18); color: var(--theme-text); border-color: rgba(var(--landscape-accent-rgb), .4);
}

/* Keyboard-only workspace. Extra room belongs to the upper keys, not letters. */
body.restored-workspace .keyboard-open #commonActionRail #sendTextButton,
body.restored-workspace .keyboard-open #workspaceTextInputSlot,
body.restored-workspace .keyboard-open #landscapeTrackpad { display: none !important; }
body.restored-workspace #landscapeTouchpad.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open,
body.restored-workspace #landscapeTouchpad.native-input-active.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active.keyboard-open {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px minmax(0, 1fr) 64px;
  grid-template-areas: "header" "keyboard" "input";
}
body.restored-workspace #computerKeyboard .computer-keyboard-numpad {
  grid-column: 1; grid-row: 1 / -1; display: grid; min-width: 0; min-height: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 4px;
}
body.restored-workspace #computerKeyboard .numpad-plus { grid-column: 4; grid-row: 2 / 4; }
body.restored-workspace #computerKeyboard .numpad-decimal { grid-column: 4; grid-row: 4 / 6; }
body.restored-workspace #computerKeyboard .numpad-zero { grid-column: 1 / 4; grid-row: 5; }
body.restored-workspace #computerKeyboard .computer-keyboard-numpad .computer-key { font-size: 18px; }
body.restored-workspace #computerKeyboard .computer-keyboard-numpad small { font-size: 8px; }
body.restored-workspace #computerKeyboard .computer-keyboard-numpad .computer-key-dual { position: relative; }
body.restored-workspace #computerKeyboard .computer-keyboard-numpad small { position: absolute; right: 5px; bottom: 4px; opacity: .6; }
body.restored-workspace #computerKeyboard.fn-active .computer-keyboard-numpad small { color: var(--theme-text); font-weight: 700; }
body.restored-workspace #computerKeyboard .computer-key-function { font-size: 13px; }
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block > .computer-keyboard-row-modifiers {
  grid-template-columns: repeat(3, minmax(0, .8fr)) minmax(0, 3fr);
}
body.restored-workspace #computerKeyboard .computer-keyboard-layout {
  min-height: 220px; grid-template-columns: minmax(170px, .62fr) minmax(0, 1.45fr);
  grid-template-rows: minmax(24px, 1fr) minmax(28px, 1fr) minmax(24px, 1fr) 32px 32px 26px 26px;
}
@media (orientation: portrait) {
  body.restored-workspace #computerKeyboard .computer-keyboard-layout {
    min-height: 590px; grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px minmax(150px, 1fr) 92px 48px clamp(40px, 7dvh, 60px) clamp(40px, 7dvh, 60px) 48px 48px;
  }
  body.restored-workspace #computerKeyboard .computer-keyboard-numpad { grid-column: 1; grid-row: 2; }
}
body.restored-workspace .keyboard-enter-symbol { font-size: 25px; }
body.restored-workspace .native-input-active #computerKeyboard .computer-keyboard-bottom-block { display: none; }
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] > .restored-design-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
  body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block { grid-column: 1; grid-row: 7 / 9; grid-template-columns: minmax(0, 1fr) 60px; }
}

/* Fn layers share the upper space; the lower key rows never grow with it. */
body.restored-workspace #computerKeyboard .computer-keyboard-layout {
  grid-template-rows: minmax(56px, 1fr) minmax(24px, .65fr) 32px 32px 26px 26px;
  min-height: 216px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-navigation {
  grid-column: 1; grid-row: 1 / -1; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 2fr 1fr; padding: 0; border: 0; background: transparent;
}
body.restored-workspace #computerKeyboard .computer-keyboard-nav-main { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
body.restored-workspace #computerKeyboard .computer-keyboard-nav-main > :last-child { grid-column: auto; }
body.restored-workspace #computerKeyboard .computer-keyboard-navigation .computer-key { font-size: 12px; }
body.restored-workspace #computerKeyboard .computer-keyboard-row-number { grid-column: 2; grid-row: 1; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols { grid-column: 2; grid-row: 2; }
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-top { grid-column: 2; grid-row: 3; }
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-home { grid-column: 2; grid-row: 4; }
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block { grid-column: 2; grid-row: 5 / 7; }
body.restored-workspace #computerKeyboard:not(.numeric-layer) .computer-keyboard-numpad,
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-navigation { display: none; }
body.restored-workspace #computerKeyboardFnButton small { font-size: 10px; }
body.restored-workspace #computerKeyboardFnButton.latched { background: rgba(var(--landscape-accent-rgb), .35); box-shadow: inset 0 0 0 2px var(--landscape-accent); }
@media (orientation: landscape) {
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-symbols { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-symbols :is([data-key="period"], [data-key="slash"]) { display: none; }
}

/* Taller relative swipe surface with contact glow and moving tactile ticks. */
body.restored-workspace #landscapeTouchpad { --strip-height: 64px; }
@media (orientation: landscape) { body.restored-workspace #landscapeTouchpad { --strip-height: 56px; } }
body.restored-workspace #pureScrollStrip {
  --strip-contact-x: 50%; --strip-phase: 0px;
  height: 100%; min-height: var(--strip-height); padding: 0 46px; border-radius: 17px;
  background: linear-gradient(180deg, rgba(var(--strip-rgb), .06), rgba(var(--strip-rgb), .14)), var(--theme-raised);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed { font-size: 12px; font-weight: 600; transform: translateY(-4px); }
body.restored-workspace #pureScrollStrip::before { display: none; }
body.restored-workspace #pureScrollStrip::after {
  transform: none !important; transition: opacity 120ms ease; opacity: 0;
  background: radial-gradient(ellipse 100px 65px at var(--strip-contact-x) 55%, rgba(var(--strip-rgb), .38), transparent 90%);
}
body.restored-workspace #pureScrollStrip.active::after { opacity: 1; }
body.restored-workspace #pureScrollStrip .strip-travel-feedback {
  position: absolute; left: 48px; right: 48px; bottom: 10px; height: 7px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(var(--strip-rgb), .6) 0 1px, transparent 1px 8px);
  background-position-x: var(--strip-phase); opacity: .4; border-radius: 4px;
}
body.restored-workspace #pureScrollStrip.active .strip-travel-feedback { opacity: .9; }
body.restored-workspace #pureScrollStrip .strip-edge-cue {
  position: absolute; top: 9px; bottom: 9px; width: 32px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(var(--strip-rgb), .1); color: var(--theme-text-soft);
  font-size: 10px; font-weight: 600; pointer-events: none; z-index: 1;
}
body.restored-workspace #pureScrollStrip .strip-edge-cue-left { left: 5px; }
body.restored-workspace #pureScrollStrip .strip-edge-cue-right { right: 5px; }
body.restored-workspace #pureScrollStrip.design-edges .strip-edge-cue { display: none; }
body.restored-workspace #pureScrollStrip.edge-fast-left .strip-edge-cue-left,
body.restored-workspace #pureScrollStrip.edge-fast-right .strip-edge-cue-right {
  background: rgba(var(--strip-rgb), .4); color: var(--theme-text); box-shadow: 0 0 12px rgba(var(--strip-rgb), .3);
}
body.restored-workspace #pureScrollStrip:is(.edge-fast-left, .edge-fast-right) .strip-travel-feedback { animation: strip-fast-ticks 480ms linear infinite; }
body.restored-workspace #pureScrollStrip.edge-fast-left .strip-travel-feedback { animation-direction: reverse; }
@keyframes strip-fast-ticks { from { background-position-x: 0; } to { background-position-x: 24px; } }
@media (prefers-reduced-motion: reduce) {
  body.restored-workspace #pureScrollStrip::after { transition: none; }
  body.restored-workspace #pureScrollStrip .strip-travel-feedback { animation: none !important; }
}
@media (orientation: portrait) {
  body.restored-workspace #computerKeyboard .computer-keyboard-layout {
    min-height: 624px;
    grid-template-rows: minmax(120px, .95fr) minmax(120px, 1fr) minmax(72px, .65fr) clamp(40px, 7dvh, 60px) clamp(40px, 7dvh, 60px) 48px 48px;
  }
  body.restored-workspace #computerKeyboard .computer-keyboard-navigation { grid-column: 1; grid-row: 1; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-number { grid-column: 1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols { grid-column: 1; grid-row: 3; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-top { grid-column: 1; grid-row: 4; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-home { grid-column: 1; grid-row: 5; }
  body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block { grid-column: 1; grid-row: 6 / 8; }
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-numpad { grid-column: 1; grid-row: 1 / 4; }
  body.restored-workspace #computerKeyboard.numeric-layer :is(.computer-keyboard-row-number, .computer-keyboard-row-symbols) { display: none; }
  body.restored-workspace #computerKeyboard .computer-key-function { font-size: 16px; }
}

/* Fit the actual workspace instead of making the keyboard a scrollable page. */
body.restored-workspace #landscapeTouchpad {
  --fit-header: 44px; --fit-text: 56px; --fit-footer: 64px; --fit-utility: 44px; --fit-history: 72px;
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) {
  grid-template-rows: var(--fit-header) var(--fit-text) minmax(0, 1fr) var(--strip-height) var(--fit-footer);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
  grid-template-rows: var(--fit-header) var(--fit-text) minmax(0, 1fr) var(--strip-height) var(--fit-footer);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  grid-template-rows: var(--fit-header) var(--fit-text) var(--fit-utility) minmax(0, 1fr) var(--strip-height) var(--fit-footer);
}
body.restored-workspace #landscapeTouchpad.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].keyboard-open,
body.restored-workspace #landscapeTouchpad.native-input-active.keyboard-open,
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"].native-input-active.keyboard-open {
  grid-template-rows: var(--fit-header) minmax(0, 1fr) var(--fit-footer);
}
body.restored-workspace #workspaceTextInputSlot,
body.restored-workspace #workspaceTextInputSlot .quick-input { height: var(--fit-text); min-height: 0; }
body.restored-workspace #workspaceTextInputSlot :is(.quick-text,.quick-key,.input-dock-activator) { height: calc(var(--fit-text) - 2px); min-height: 0; }
body.restored-workspace #landscapeQuickInputSlot { height: var(--fit-footer); min-height: 0; }
body.restored-workspace #computerKeyboard { min-height: 0; min-width: 0; }
body.restored-workspace #computerKeyboard .computer-keyboard-scroll { min-height: 0; min-width: 0; overflow: hidden; touch-action: manipulation; }
body.restored-workspace #computerKeyboard .computer-keyboard-layout {
  min-height: 0; height: 100%; min-width: 0;
  grid-template-rows: minmax(0, 1fr) minmax(0, .65fr) min(32px, 15%) min(32px, 15%) min(26px, 12%) min(26px, 12%);
}
body.restored-workspace #computerKeyboard .computer-key { min-height: 0; min-width: 0; height: 100%; max-height: 100%; padding-block: 0; }
body.restored-workspace #landscapeTouchpad .presentation-page-key,
body.restored-workspace #landscapeTouchpad .restored-design-actions button { min-height: 0; }
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
    grid-template-rows: var(--fit-header) var(--fit-text) minmax(0, 1fr) var(--strip-height) var(--fit-history) var(--fit-footer);
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: var(--fit-header) var(--fit-text) var(--fit-utility) minmax(0, 1fr) var(--strip-height) clamp(72px, 16dvh, 132px) var(--fit-footer);
  }
  body.restored-workspace #computerKeyboard .computer-keyboard-layout {
    grid-template-rows: minmax(0, .95fr) minmax(0, 1fr) minmax(0, .65fr) min(60px, 9%) min(60px, 9%) min(48px, 7.5%) min(48px, 7.5%);
  }
}

/* Keyboard is a self-contained panel. It must never inherit hidden command
   rows or ordinary workspace flow. */
body.restored-workspace #landscapeTouchpad.keyboard-open {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px minmax(0, 1fr) 62px !important;
  grid-template-areas: "header" "keyboard" "input" !important;
  overflow: hidden;
}
body.restored-workspace #landscapeTouchpad.keyboard-open > :not(.landscape-toolbar, #computerKeyboard, #landscapeQuickInputSlot) {
  display: none !important;
}
body.restored-workspace #landscapeTouchpad.keyboard-open > #computerKeyboard {
  grid-area: keyboard !important;
  display: grid !important;
  grid-template-rows: 24px minmax(0, 1fr) !important;
  min-width: 0;
  min-height: 0;
  height: 100% !important;
  overflow: hidden;
  padding: 6px;
  box-sizing: border-box;
}
body.restored-workspace #landscapeTouchpad.keyboard-open > #landscapeQuickInputSlot {
  grid-area: input !important;
  min-height: 0;
  height: 100% !important;
}
body.restored-workspace #computerKeyboard .computer-keyboard-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: 10px;
}
body.restored-workspace #computerKeyboardInputSlot { display: none !important; }
body.restored-workspace #computerKeyboardStatus {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.restored-workspace #computerKeyboard .computer-keyboard-scroll {
  display: block !important;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
body.restored-workspace #computerKeyboard .computer-keyboard-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 1.08fr) minmax(0, .65fr) minmax(0, .78fr) minmax(0, .78fr) minmax(0, 1.25fr) !important;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  height: 100% !important;
}
body.restored-workspace #computerKeyboard .computer-keyboard-navigation {
  display: grid !important;
  grid-column: 1; grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 2fr) minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  min-height: 0;
}
body.restored-workspace #computerKeyboard .computer-keyboard-nav-main {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-nav-arrows {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-number {
  display: grid !important;
  grid-column: 1; grid-row: 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols {
  display: grid !important;
  grid-column: 1; grid-row: 3;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-top {
  display: grid !important;
  grid-column: 1; grid-row: 4;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-home {
  display: grid !important;
  grid-column: 1; grid-row: 5;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  padding-inline: 5%;
}
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block {
  display: grid !important;
  grid-column: 1; grid-row: 6;
  grid-template-columns: minmax(0, 1fr) 52px;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  min-height: 0;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-bottom {
  display: grid !important;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: 1.2fr repeat(7, minmax(0, 1fr)) 1.2fr;
  gap: 4px;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-modifiers {
  display: grid !important;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: 42px 42px 42px minmax(0, 1fr);
  gap: 4px;
}
body.restored-workspace #computerKeyboard #computerKeyboardFnButton {
  grid-column: 2;
  grid-row: 2;
}
body.restored-workspace #computerKeyboard .computer-key {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 2px;
  border-radius: 10px;
  border: 1px solid var(--theme-line);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}
body.restored-workspace #computerKeyboard .computer-key small { font-size: 8px; }
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-numpad {
  display: grid !important;
  grid-column: 1;
  grid-row: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
body.restored-workspace #computerKeyboard.numeric-layer :is(.computer-keyboard-navigation, .computer-keyboard-row-number) {
  display: none !important;
}
@media (max-height: 640px) {
  body.restored-workspace #landscapeTouchpad { gap: 5px; --fit-history: 56px; }
  body.restored-workspace #computerKeyboard { padding: 4px; grid-template-rows: 14px minmax(0,1fr); }
  body.restored-workspace #computerKeyboard .computer-keyboard-layout,
  body.restored-workspace #computerKeyboard .computer-keyboard-row,
  body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block { gap: 3px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-navigation .computer-key { font-size: 10px; }
  body.restored-workspace #computerKeyboard .computer-key-function { font-size: 12px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha .computer-key { font-size: 14px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha .computer-key-shift { font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 400px) {
  body.restored-workspace #landscapeTouchpad { --fit-header: 40px; --fit-text: 44px; --fit-footer: 48px; --fit-utility: 36px; --strip-height: 52px; gap: 4px; padding-block: max(4px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-bottom)); }
  body.restored-workspace .landscape-mode-menu-control > :is(.viewport-mode-button,.theme-toggle,.landscape-mode-trigger) { height: 40px; }
  body.restored-workspace #landscapeTouchpad > .landscape-command-row-top { min-height: 0; height: 100%; }
  body.restored-workspace #landscapeTouchpad > .landscape-command-row-top .landscape-command-key { min-height: 0; height: 100%; }
  body.restored-workspace #commonActionRail .landscape-command-key { flex-direction: row; gap: 5px; }
  body.restored-workspace #landscapeTrackpad .trackpad-instructions { font-size: 8px; gap: 3px; padding: 6px; }
}
@media (orientation: landscape) and (max-width: 640px) {
  body.restored-workspace #landscapeTouchpad > .presentation-page-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  body.restored-workspace #landscapeTouchpad .presentation-page-key { font-size: 14px; white-space: nowrap; padding-inline: 3px; }
  body.restored-workspace #previousSlideButton::before { font-size: 18px; margin-right: 3px; }
  body.restored-workspace #nextSlideButton::after { font-size: 18px; margin-left: 3px; }
}
/* The visual viewport may shrink further when the phone's own keyboard opens. */
body.restored-workspace #landscapeTouchpad.native-input-active:not(.keyboard-open) {
  --fit-header: clamp(28px, calc(var(--workspace-height,100dvh) * .14),40px);
  --fit-text: clamp(32px, calc(var(--workspace-height,100dvh) * .16),44px);
  --fit-footer: clamp(36px, calc(var(--workspace-height,100dvh) * .18),48px);
  --strip-height: clamp(36px, calc(var(--workspace-height,100dvh) * .18),52px);
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: var(--fit-header) var(--fit-text) minmax(0,1fr) var(--strip-height) var(--fit-footer);
  grid-template-areas: "header" "text" "touch" "scroll" "input";
  gap: 4px; padding-block: max(4px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-bottom));
}
body.restored-workspace .native-input-active .landscape-mode-menu-control > :is(.viewport-mode-button,.theme-toggle,.landscape-mode-trigger) { height: var(--fit-header); }

/* Landscape uses the spare header width for the existing input, not a new dock. */
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad:not(.keyboard-open) {
    grid-template-rows: var(--fit-header) minmax(0,1fr) var(--strip-height) var(--fit-footer);
    grid-template-areas: "header" "touch" "scroll" "input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
    grid-template-rows: var(--fit-header) minmax(0,1fr) var(--strip-height) var(--fit-footer);
    grid-template-areas: "header header" "design touch" "design scroll" "input input";
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: var(--fit-header) var(--fit-utility) minmax(0,1fr) var(--strip-height) var(--fit-footer);
    grid-template-areas: "header header" "utility utility" "touch pages" "scroll pages" "input input";
  }
  body.restored-workspace #landscapeTouchpad.native-input-active:not(.keyboard-open) {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: var(--fit-header) minmax(0,1fr) var(--strip-height) var(--fit-footer);
    grid-template-areas: "header" "touch" "scroll" "input";
  }
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot {
    flex: 1 1 0; width: 0; min-width: 0; height: var(--fit-header); margin-inline: 6px;
  }
  body.restored-workspace .landscape-toolbar > .landscape-mode-menu-control { flex-shrink: 0; }
  body.restored-workspace .landscape-toolbar #workspaceTextInputSlot .quick-input { height: var(--fit-header); min-width: 0; border-radius: 12px; }
  body.restored-workspace .landscape-toolbar #workspaceTextInputSlot :is(.quick-text,.quick-key,.input-dock-activator) {
    height: calc(var(--fit-header) - 2px); min-height: 0; padding-block: 2px; padding-inline: 10px;
  }
  body.restored-workspace .landscape-toolbar #textInputActivator > span { font-size: 12px; }
  body.restored-workspace .landscape-toolbar #textInputActivator > small { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* A single roller surface; the moving grooves follow drag and physical decay. */
body.restored-workspace #pureScrollStrip:not(.design-edges) { padding-inline: 12px; }
body.restored-workspace #pureScrollStrip.coasting .strip-travel-feedback { opacity: .75; }
body.restored-workspace #pureScrollStrip.coasting { border-color: rgba(var(--strip-rgb), .55); }

/* Shared everyday / presentation palette. */
body.restored-workspace #landscapeTouchpad:is([data-control-mode="common"],[data-control-mode="presentation"]) {
  --landscape-accent: #91d731; --landscape-accent-rgb: 145, 215, 49;
}
:root[data-theme="dark"] body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] {
  --landscape-accent: #76d8ff; --landscape-accent-rgb: 118, 216, 255;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] {
  --landscape-accent: #1f8cb8; --landscape-accent-rgb: 31, 140, 184;
}
:root[data-theme="dark"] body.restored-workspace #landscapeTouchpad:is([data-control-mode="common"],[data-control-mode="presentation"]) {
  --landscape-accent: #a7f33f; --landscape-accent-rgb: 167, 243, 63;
}
body.restored-workspace #pureScrollStrip { padding-inline: 25%; }
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed { font-size: 11px; white-space: normal; text-align: center; line-height: 1.4; }
body.restored-workspace #pureScrollStrip .strip-edge-cue {
  top: 5px; bottom: 5px; width: calc(25% - 6px); border-radius: 12px;
  font-size: 11px; background: rgba(var(--strip-rgb), .12);
}
body.restored-workspace #pureScrollStrip .strip-node {
  position: absolute; top: 50%; width: 4px; height: 18px; margin-top: -9px;
  border-radius: 4px; background: rgba(var(--strip-rgb), .7); pointer-events: none; z-index: 2;
  transition: background 100ms ease, box-shadow 100ms ease;
}
body.restored-workspace #pureScrollStrip .strip-node-left { left: calc(25% - 2px); }
body.restored-workspace #pureScrollStrip .strip-node-right { right: calc(25% - 2px); }
/* Five proportional zones: turbo 10 / cruise 20 / manual 40 / cruise 20 / turbo 10. */
body.restored-workspace #pureScrollStrip:not(.design-edges) { padding-inline: 30%; }
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-edge-cue { width: calc(10% - 4px); border-radius: 9px; font-size: 10px; }
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-edge-cue-left { left: 2px; }
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-edge-cue-right { right: 2px; }
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-node-left { left: calc(30% - 2px); }
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-node-right { right: calc(30% - 2px); }
body.restored-workspace #pureScrollStrip .strip-cruise-cue {
  position: absolute; top: 5px; bottom: 5px; width: calc(20% - 4px);
  display: grid; place-items: center; border-radius: 9px; font-size: 11px;
  color: var(--theme-text-soft); background: rgba(var(--strip-rgb), .06); pointer-events: none;
}
body.restored-workspace #pureScrollStrip .strip-cruise-cue-left { left: calc(10% + 2px); }
body.restored-workspace #pureScrollStrip .strip-cruise-cue-right { right: calc(10% + 2px); }
body.restored-workspace #pureScrollStrip.design-edges .strip-cruise-cue { display: none; }
body.restored-workspace #pureScrollStrip.cruise-left .strip-cruise-cue-left,
body.restored-workspace #pureScrollStrip.cruise-right .strip-cruise-cue-right {
  background: rgba(var(--strip-rgb), .25); color: var(--theme-text);
}
/* One continuous surface: tint communicates speed, not separate button tiles. */
body.restored-workspace #pureScrollStrip:not(.design-edges) {
  background: linear-gradient(90deg,
    rgba(var(--strip-rgb), .29) 0%, rgba(var(--strip-rgb), .24) 10%,
    rgba(var(--strip-rgb), .13) 18%, rgba(var(--strip-rgb), .07) 30%,
    rgba(var(--strip-rgb), .025) 42%, rgba(var(--strip-rgb), .025) 58%,
    rgba(var(--strip-rgb), .07) 70%, rgba(var(--strip-rgb), .13) 82%,
    rgba(var(--strip-rgb), .24) 90%, rgba(var(--strip-rgb), .29) 100%), var(--theme-raised);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs {
  border-color: rgba(var(--landscape-accent-rgb), .48);
  background: linear-gradient(90deg,
    rgba(var(--landscape-accent-rgb), .18), rgba(var(--landscape-accent-rgb), .055) 28%,
    rgba(var(--landscape-accent-rgb), .02) 50%, rgba(var(--landscape-accent-rgb), .055) 72%,
    rgba(var(--landscape-accent-rgb), .18));
}
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs::before,
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs::after {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  color: var(--landscape-accent); font-size: 18px; font-weight: 700; pointer-events: none;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs::before { content: "‹"; left: 14px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs::after { content: "›"; right: 14px; }
body.restored-workspace .landscape-touchpad[data-control-mode="browser"] > .common-action-portrait-slot { display: block; }
body.restored-workspace #pureScrollStrip:not(.design-edges) :is(.strip-edge-cue,.strip-cruise-cue) {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
body.restored-workspace #pureScrollStrip:not(.design-edges) .strip-node { width: 2px; height: 12px; margin-top: -6px; opacity: .45; }
body.restored-workspace #pureScrollStrip:not(.design-edges).edge-fast-left .strip-edge-cue-left,
body.restored-workspace #pureScrollStrip:not(.design-edges).edge-fast-right .strip-edge-cue-right,
body.restored-workspace #pureScrollStrip:not(.design-edges).cruise-left .strip-cruise-cue-left,
body.restored-workspace #pureScrollStrip:not(.design-edges).cruise-right .strip-cruise-cue-right {
  color: var(--theme-text); text-shadow: 0 0 10px rgba(var(--strip-rgb), .5); font-weight: 700;
}
body.restored-workspace #pureScrollStrip.cruise-left .strip-node-left,
body.restored-workspace #pureScrollStrip.cruise-right .strip-node-right {
  background: rgb(var(--strip-rgb)); box-shadow: 0 0 0 4px rgba(var(--strip-rgb), .18), 0 0 14px rgba(var(--strip-rgb), .7);
}
body.restored-workspace #pureScrollStrip.design-edges { padding-inline: 33.333333%; }
body.restored-workspace #pureScrollStrip.design-edges .strip-zoom-edge {
  top: 5px; bottom: 5px; width: calc(33.333333% - 6px); border-radius: 12px;
  font-size: 15px; font-weight: 600; display: grid; place-items: center;
}
body.restored-workspace #pureScrollStrip.design-edges .strip-zoom-in { left: 5px; }
body.restored-workspace #pureScrollStrip.design-edges .strip-zoom-out { right: 5px; }
body.restored-workspace #pureScrollStrip.design-edges .strip-node-left { left: calc(50% - min(48px, 11.111111%) - 2px); }
body.restored-workspace #pureScrollStrip.design-edges .strip-node-right { right: calc(50% - min(48px, 11.111111%) - 2px); }
body.restored-workspace #landscapeTouchpad button:active:not(:disabled) {
  filter: brightness(1.12); box-shadow: inset 0 0 0 2px rgba(var(--landscape-accent-rgb), .35);
}
@media (orientation: landscape) {
  body.restored-workspace #pureScrollStrip::after {
    background: radial-gradient(ellipse 90px 45px at var(--strip-contact-x) var(--strip-contact-y,50%), rgba(var(--strip-rgb), .38), transparent 90%);
  }
  body.restored-workspace #pureScrollStrip .strip-travel-feedback {
    background-image: repeating-linear-gradient(0deg, rgba(var(--strip-rgb), .6) 0 1px, transparent 1px 8px);
    background-position: 0 var(--strip-phase);
  }
}
body.restored-workspace #pureScrollStrip:not(.design-edges) {
  padding-inline: 12px;
  background: linear-gradient(180deg, rgba(var(--strip-rgb), .13), rgba(var(--strip-rgb), .035) 45%, rgba(var(--strip-rgb), .13)), var(--theme-raised);
}

/* One shared footer: mode switch, backspace, desktop keyboard and Enter.
   The phone keyboard stays attached to its text field in every orientation. */
body.restored-workspace #workspaceTextInputSlot .quick-input {
  grid-template-columns: minmax(0, 1fr) 68px;
}
body.restored-workspace #workspaceTextInputSlot .quick-input .input-phone-send {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--theme-line);
  color: var(--theme-text-soft);
  background: linear-gradient(180deg, rgba(var(--landscape-accent-rgb), .13), rgba(var(--landscape-accent-rgb), .05));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  touch-action: manipulation;
}
body.restored-workspace #workspaceTextInputSlot .input-phone-send .dock-symbol {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
  line-height: 1;
}
body.restored-workspace #workspaceTextInputSlot .input-phone-send.has-draft {
  color: var(--theme-text);
  background: rgba(var(--landscape-accent-rgb), .2);
}
body.restored-workspace #landscapeQuickInputSlot #commonActionRail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body.restored-workspace #commonActionRail > .workspace-mode-dock {
  position: relative;
  z-index: 20;
  display: block;
  min-width: 0;
  min-height: 0;
}
body.restored-workspace #commonActionRail .workspace-mode-trigger {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 44px;
  padding: 4px 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--theme-line);
  border-radius: 13px;
  color: var(--theme-text-soft);
  background: var(--theme-raised);
  box-shadow: var(--theme-shadow-small);
  touch-action: pan-y;
}
body.restored-workspace #commonActionRail .workspace-mode-trigger .mode-current-dot { display: none; }
body.restored-workspace #commonActionRail .workspace-mode-trigger .mode-menu-caption {
  display: block;
  color: var(--theme-text-soft);
  font-size: 10px;
  line-height: 1.1;
}
body.restored-workspace #commonActionRail .workspace-mode-trigger #landscapeModeMenuLabel {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.restored-workspace #commonActionRail .workspace-mode-trigger .mode-menu-chevron {
  position: absolute;
  right: 8px;
  bottom: 8px;
  margin: 0;
  font-size: 12px;
}
body.restored-workspace #commonActionRail .workspace-mode-dock .landscape-mode-menu {
  position: absolute;
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
  width: min(210px, calc(100vw - 24px));
  max-height: min(360px, calc(100dvh - 112px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
body.restored-workspace #commonActionRail .workspace-mode-dock .landscape-mode-menu::-webkit-scrollbar { display: none; }
body.restored-workspace #commonActionRail .workspace-mode-dock .landscape-mode-switch-hint {
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
}
body.restored-workspace #commonActionRail .workspace-mode-dock .landscape-mode-switch-hint::before {
  top: auto;
  right: auto;
  bottom: -5px;
  left: 18px;
}
@media (orientation: landscape) {
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .quick-input {
    grid-template-columns: minmax(0, 1fr) 52px;
  }
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .input-phone-send {
    font-size: 9px;
  }
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .input-phone-send .dock-symbol {
    display: inline;
    margin: 0 2px 0 0;
    font-size: 14px;
  }
  body.restored-workspace #landscapeQuickInputSlot #commonActionRail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.restored-workspace #commonActionRail .workspace-mode-trigger .mode-menu-caption { font-size: 9px; }
  body.restored-workspace #commonActionRail .workspace-mode-trigger #landscapeModeMenuLabel { font-size: 11px; }
}
/* Design keeps its dedicated history keys, but the zoom roller occupies the same
   final row as the shared roller in portrait. This avoids a mode-specific jump. */
@media (orientation: portrait) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) {
    grid-template-areas: "header" "text" "touch" "design" "scroll" "input";
  }
}
.haptic-failure-notice {
  position: fixed; z-index: 10000; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 24px); padding: 10px 16px; border-radius: 12px;
  background: #333b30; color: #fff; font: 13px system-ui, sans-serif; pointer-events: none;
}
#landscapeTrackpad, #trackpad, #computerKeyboard { position: relative; }
.surface-fullscreen-notice {
  position: absolute; z-index: 10; top: 12px; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 7px 14px; border-radius: 999px;
  background: var(--theme-raised); color: var(--theme-text-soft);
  border: 1px solid rgba(130,150,130,.2); font: 12px/1.4 system-ui, sans-serif;
  pointer-events: none; user-select: none;
}
.trackpad-coast-feedback {
  position: absolute; z-index: 4; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 6px 14px 12px; border-radius: 10px; pointer-events: none; user-select: none;
  color: var(--theme-text-soft); background-color: var(--theme-raised); font: 11px/1.4 system-ui, sans-serif;
  background-image: repeating-linear-gradient(90deg, rgba(145,185,125,.55) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(0deg, rgba(145,185,125,.55) 0 1px, transparent 1px 8px);
  background-size: calc(100% - 20px) 4px, 3px calc(100% - 14px);
  background-position: var(--coast-x,0px) bottom, right var(--coast-y,0px);
  background-repeat: no-repeat;
}
.haptic-debug-panel {
  position: fixed; z-index: 10001; top: max(62px, env(safe-area-inset-top));
  left: 12px; right: 12px; max-width: 420px; margin-inline: auto;
  padding: 12px; border: 1px solid #809276; border-radius: 14px;
  background: #172017; color: #f4f8ef; font: 12px/1.4 system-ui, sans-serif;
}
.haptic-debug-panel button { display: block; width: 100%; min-height: 44px; margin-top: 8px; color: #172017; background: #cbe9ab; border: 0; border-radius: 8px; }
.haptic-debug-panel pre { margin-bottom: 0; font: 11px/1.5 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Design is one dedicated zoom roller, not three separate hit regions. */
body.restored-workspace #pureScrollStrip.design-zoom-wheel {
  --strip-rgb: 118, 103, 209; padding-inline: 42px;
  background: linear-gradient(180deg, rgba(var(--strip-rgb), .18), rgba(var(--strip-rgb), .045) 48%, rgba(var(--strip-rgb), .16)), var(--theme-raised);
}
body.restored-workspace #pureScrollStrip.design-zoom-wheel .strip-zoom-edge {
  width: 30px; top: 8px; bottom: 8px; background: transparent; border: 0; box-shadow: none;
  color: var(--theme-text-soft); font-size: 24px; pointer-events: none;
}
body.restored-workspace #pureScrollStrip.design-zoom-wheel .strip-zoom-out { left: 8px; right: auto; }
body.restored-workspace #pureScrollStrip.design-zoom-wheel .strip-zoom-in { right: 8px; left: auto; }
body.restored-workspace #pureScrollStrip.design-zoom-wheel.direction-right .strip-zoom-in,
body.restored-workspace #pureScrollStrip.design-zoom-wheel.direction-left .strip-zoom-out { color: var(--theme-text); text-shadow: 0 0 10px rgba(var(--strip-rgb), .6); }
body.restored-workspace #pureScrollStrip.design-zoom-wheel .pure-scroll-strip-speed { font-size: 12px; }
@media (orientation: landscape) {
  body.restored-workspace #pureScrollStrip.design-zoom-wheel .strip-zoom-in { left: 9px; right: auto; top: 1px; bottom: 50%; font-size: 19px; }
  body.restored-workspace #pureScrollStrip.design-zoom-wheel .strip-zoom-out { left: 9px; right: auto; top: 50%; bottom: 1px; font-size: 19px; }
}

/* Keep the presentation surface single-column in both orientations.  This is
   deliberately last because the legacy responsive sheet also describes the
   retired presentation command rows. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px minmax(0, 1fr) clamp(116px, 23dvh, 188px) 62px !important;
  grid-template-areas: "header" "touch" "pages" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #landscapeTrackpad {
  grid-area: touch !important; width: 100% !important; min-width: 0;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #pureScrollStrip { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) #landscapeTrackpad > :is(.pure-mouse-cluster, .trackpad-instructions, .landscape-trackpad-mode, .landscape-zone-labels, .pure-gesture-labels) { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .presentation-page-row {
  grid-area: pages !important; grid-template-columns: minmax(0, .58fr) minmax(0, 1.72fr) !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #landscapeQuickInputSlot { grid-area: input !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #landscapeQuickInputSlot #commonActionRail {
  display: grid !important; width: 100% !important; height: 100% !important; grid-template-columns: minmax(0, 1fr) !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #commonActionRail > #workspaceModeDock {
  display: block !important; grid-column: 1 / 2 !important; width: 100% !important; height: 100% !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #commonActionRail > #workspaceModeDock > .workspace-mode-trigger {
  display: flex !important; width: 100% !important; height: 100% !important; min-height: 0 !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-surface { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(76px, .9fr); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button strong { white-space: nowrap; }
@media (max-width: 480px) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button { grid-template-columns: auto minmax(0, 1fr); padding-inline: 7px; }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button small { display: none; }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture { padding-inline: 8px; font-size: 12px; }
}
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: 44px minmax(0, 1fr) clamp(92px, 30dvh, 150px) 58px !important;
  }
}

/* Presentation aids are intentionally generous touch targets.  They are a
   separate control deck inside the pad, so they never donate their contact to
   the mouse/trackpad gesture recogniser. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-surface {
  top: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 64px;
  gap: 10px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture {
  min-height: 64px;
  border-radius: 17px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button {
  padding: 10px 13px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button > span { font-size: 24px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button strong,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture { font-size: 15px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel:not([hidden]) {
  top: 162px;
  grid-template-columns: minmax(0, 1fr) auto;
  max-height: none;
  overflow: visible;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode button {
  min-height: 48px;
  padding: 6px 9px;
  text-align: left;
  background: var(--theme-canvas);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode button[aria-checked="true"] {
  border-color: var(--landscape-accent);
  background: rgba(var(--landscape-accent-rgb), .18);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode strong,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode span { display: block; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode strong { font-size: 13px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timing-mode span { margin-top: 2px; color: var(--theme-text-soft); font-size: 10px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-practice-guide {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(var(--landscape-accent-rgb), .24);
  border-radius: 11px;
  background: rgba(var(--landscape-accent-rgb), .075);
  color: var(--theme-text-soft);
  font-size: 10px;
  line-height: 1.45;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-practice-guide[hidden] {
  display: none !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-practice-guide strong { color: var(--theme-text); font-size: 12px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-practice-guide output { color: var(--landscape-accent); }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-surface {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 60px;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel:not([hidden]) { top: 82px; }
}

/* Presentation is a focused remote, not a general-purpose trackpad.  The
   timer/start bar lives above the surface, and visual tools live below it so
   neither can accidentally become a touchpad contact. */
body.restored-workspace #presentationAssistSurface,
body.restored-workspace #presentationToolDeck,
body.restored-workspace #presentationPadStatus { display: none; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  position: relative;
  /* The ordinary portrait shell is block flow. Keep the focused presentation
     remote in a constrained grid so controls never require page scrolling. */
  display: grid !important;
  height: 100% !important;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px 64px minmax(0, 1fr) 108px clamp(96px, 17dvh, 126px) 58px !important;
  grid-template-areas: "header" "top" "touch" "tools" "pages" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationAssistSurface {
  grid-area: top !important;
  position: static;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 8px;
  min-width: 0;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(var(--landscape-accent-rgb), .34);
  border-radius: 16px;
  color: var(--theme-text);
  background: linear-gradient(135deg, rgba(var(--landscape-accent-rgb), .14), rgba(var(--landscape-accent-rgb), .035)), var(--theme-raised);
  box-shadow: var(--theme-shadow-small);
  touch-action: manipulation;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 11px;
  text-align: left;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button > span {
  grid-row: 1 / span 2;
  color: var(--landscape-accent);
  font-size: 24px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button strong,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture { font-size: 15px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-assist-button small {
  overflow: hidden;
  color: var(--theme-text-soft);
  font-size: 9px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-start-gesture {
  padding-inline: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(var(--landscape-accent-rgb), .34), rgba(var(--landscape-accent-rgb), .16));
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #landscapeTrackpad {
  grid-area: touch !important;
  min-width: 0;
  width: 100% !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #landscapeTrackpad > :is(.pure-mouse-cluster, .trackpad-instructions, .landscape-trackpad-mode, .landscape-zone-labels, .pure-gesture-labels) { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus {
  position: absolute;
  inset: 14px;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 22px;
  border: 1px solid rgba(var(--landscape-accent-rgb), .18);
  border-radius: 20px;
  color: var(--theme-text-soft);
  text-align: center;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(var(--landscape-accent-rgb), .12), transparent 42%),
    linear-gradient(145deg, rgba(var(--landscape-accent-rgb), .04), transparent 62%);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus strong {
  color: var(--theme-text);
  font-size: clamp(17px, 5vw, 23px);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus span {
  max-width: 300px;
  font-size: 12px;
  line-height: 1.5;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"][data-presentation-tool="spotlight"] #presentationPadStatus {
  border-color: rgba(var(--landscape-accent-rgb), .52);
  background:
    radial-gradient(circle at 50% 45%, rgba(var(--landscape-accent-rgb), .26), transparent 38%),
    linear-gradient(145deg, rgba(var(--landscape-accent-rgb), .12), transparent 65%);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"][data-presentation-tool="annotation"] #presentationPadStatus {
  border-color: rgba(186, 169, 255, .55);
  background:
    radial-gradient(circle at 50% 45%, rgba(163, 143, 255, .2), transparent 44%),
    linear-gradient(145deg, rgba(163, 143, 255, .12), transparent 66%);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationToolDeck {
  grid-area: tools !important;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 48px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(var(--landscape-accent-rgb), .16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(var(--landscape-accent-rgb), .075), transparent 74%);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck .presentation-assist-button {
  min-height: 0;
  padding: 6px 9px;
  border-radius: 13px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck .presentation-assist-button > span { font-size: 20px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck .presentation-assist-button strong { font-size: 13px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck .presentation-assist-button small { font-size: 8px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck .presentation-assist-button[aria-pressed="true"] {
  border-color: var(--landscape-accent);
  background: linear-gradient(135deg, rgba(var(--landscape-accent-rgb), .34), rgba(var(--landscape-accent-rgb), .11));
  box-shadow: inset 0 0 0 1px rgba(var(--landscape-accent-rgb), .16), 0 0 18px rgba(var(--landscape-accent-rgb), .16);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(171, 150, 255, .42);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(145, 120, 240, .16), rgba(145, 120, 240, .045));
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control > button {
  display: grid;
  place-content: center;
  gap: 1px;
  min-width: 0;
  border: 0;
  color: var(--theme-text);
  background: rgba(145, 120, 240, .10);
  font-size: 25px;
  touch-action: manipulation;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control > button:active { background: rgba(145, 120, 240, .28); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control > button small { font-size: 9px; color: var(--theme-text-soft); }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control > div {
  display: grid;
  place-content: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control strong { font-size: 12px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control small { color: var(--theme-text-soft); font-size: 9px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel:not([hidden]) {
  position: absolute;
  z-index: 30;
  top: 116px;
  right: 10px;
  left: 10px;
  display: grid;
  max-height: none;
  overflow: visible;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel[hidden] { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel[data-running="true"] { opacity: .72; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel :is(input, button):disabled { opacity: .52; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .presentation-page-row {
  grid-area: pages !important;
  grid-template-columns: minmax(0, .56fr) minmax(0, 1.78fr) !important;
  gap: 10px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #landscapeQuickInputSlot { grid-area: input !important; }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: 44px 56px minmax(0, 1fr) 82px clamp(70px, 21dvh, 94px) 52px !important;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-timer-panel:not([hidden]) { top: 106px; }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationToolDeck { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, .85fr) minmax(0, .85fr) minmax(0, 1.3fr); }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control { grid-column: auto; grid-template-columns: 40px minmax(0, 1fr) 40px; }
}

/* -------------------------------------------------------------------------
   Unified fixed workspace layout

   Earlier iterations left the workspace as normal block flow while also
   assigning grid areas.  That made the legacy remote, input dock and control
   rows stack into a second screen.  This is the single authoritative layout:
   a tall, fixed roller always sits directly above the touch surface.
   ------------------------------------------------------------------------- */
body.restored-workspace #landscapeTouchpad {
  box-sizing: border-box;
  display: grid !important;
  position: relative;
  height: var(--workspace-height, 100dvh) !important;
  min-height: 0;
  max-height: var(--workspace-height, 100dvh);
  overflow: hidden;
  gap: 6px;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open):not(.native-input-active) {
  --fixed-roller-height: clamp(96px, 20dvh, 144px);
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px 56px var(--fixed-roller-height) minmax(0, 1fr) 62px !important;
  grid-template-areas: "header" "text" "scroll" "touch" "input" !important;
}
body.restored-workspace #landscapeTouchpad > .landscape-toolbar { grid-area: header !important; }
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #workspaceTextInputSlot {
  grid-area: text !important;
  display: block !important;
  min-height: 0;
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #landscapeTrackpad {
  grid-area: touch !important;
  min-width: 0;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #pureScrollStrip {
  grid-area: scroll !important;
  display: flex !important;
  min-width: 0;
  min-height: 0;
  width: 100% !important;
  height: 100% !important;
  padding: 12px 24%;
  border-radius: 18px;
  touch-action: none;
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #landscapeQuickInputSlot {
  grid-area: input !important;
  min-height: 0;
  height: 100% !important;
}
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > .landscape-input-utility-row,
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > .landscape-command-row,
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > .presentation-page-row,
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #presentationAssistSurface,
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #presentationTimerPanel,
body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #presentationToolDeck {
  display: none !important;
}

/* Design reuses that same physical roller, but it dispatches zoom detents. */
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) {
  grid-template-rows: 44px 56px var(--fixed-roller-height) minmax(0, 1fr) var(--fixed-roller-height) 62px !important;
  grid-template-areas: "header" "text" "scroll" "touch" "history" "input" !important;
}
body.restored-workspace #landscapeTouchpad > .restored-design-actions { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) > .restored-design-actions {
  grid-area: history !important;
  display: grid !important;
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
}
body.restored-workspace #landscapeTouchpad > .restored-design-actions button {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  font-size: clamp(16px, 2dvh, 20px);
  touch-action: manipulation;
}

/* Browser-only blind-operation tool. Keep the destructive action at the top
   of the touch surface, away from the lower roller and common footer. */
body.restored-workspace #landscapeTrackpad .browser-close-tab-button {
  display: none;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"]:not(.keyboard-open):not(.native-input-active) #landscapeTrackpad .browser-close-tab-button {
  position: absolute;
  z-index: 7;
  top: 12px;
  right: 12px;
  bottom: auto;
  left: 12px;
  display: flex;
  min-height: clamp(72px, 14%, 90px);
  height: clamp(72px, 14%, 90px);
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid rgba(255, 128, 122, .46);
  border-radius: 18px;
  color: #ffe2de;
  background: linear-gradient(100deg, rgba(143, 45, 49, .62), rgba(93, 33, 40, .42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 22px rgba(0, 0, 0, .2);
  text-align: center;
  touch-action: manipulation;
}
body.restored-workspace #landscapeTrackpad .browser-close-tab-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff4f2;
  background: rgba(255, 133, 126, .2);
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
}
body.restored-workspace #landscapeTrackpad .browser-close-tab-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
body.restored-workspace #landscapeTrackpad .browser-close-tab-copy strong {
  color: inherit;
  font-size: clamp(15px, 2.2dvh, 19px);
  letter-spacing: .03em;
}
body.restored-workspace #landscapeTrackpad .browser-close-tab-copy small {
  color: rgba(255, 237, 233, .7);
  font-size: 11px;
}
:root:not([data-theme="dark"]) body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #landscapeTrackpad .browser-close-tab-button {
  color: #7a2f31;
  background: linear-gradient(100deg, rgba(255, 218, 214, .88), rgba(255, 242, 239, .75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 20px rgba(92, 45, 45, .1);
}
:root:not([data-theme="dark"]) body.restored-workspace #landscapeTrackpad .browser-close-tab-icon {
  color: #923d3e;
  background: rgba(190, 68, 69, .14);
}
:root:not([data-theme="dark"]) body.restored-workspace #landscapeTrackpad .browser-close-tab-copy small { color: rgba(112, 52, 52, .68); }
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #landscapeTrackpad .browser-close-tab-button:active {
  transform: translateY(1px);
  border-color: rgba(255, 178, 173, .9);
  background: linear-gradient(100deg, rgba(170, 56, 60, .8), rgba(116, 39, 48, .58));
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open) #pureScrollStrip {
  --strip-rgb: 118, 103, 209;
}

/* Presentation has its own compact command rows, but the actual PPT zoom
   roller remains in the same fixed position above the touchpad. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  --fixed-roller-height: 72px;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px 60px var(--fixed-roller-height) minmax(0, 1fr) 70px 104px 56px !important;
  grid-template-areas: "header" "top" "scroll" "touch" "tools" "pages" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #workspaceTextInputSlot,
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .landscape-input-utility-row { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationAssistSurface {
  grid-area: top !important;
  display: grid !important;
  position: static;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 8px;
  min-width: 0;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #pureScrollStrip {
  /* Override the retired presentation rule which hid the shared roller. */
  grid-area: scroll !important;
  display: flex !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationToolDeck {
  grid-area: tools !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding: 6px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .presentation-page-row {
  grid-area: pages !important;
  display: grid !important;
  min-height: 0;
  grid-template-columns: minmax(0, .56fr) minmax(0, 1.78fr) !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #pureScrollStrip {
  --strip-rgb: 118, 103, 209;
  background: linear-gradient(180deg, rgba(145, 120, 240, .18), rgba(145, 120, 240, .045)), var(--theme-raised);
}

/* The keyboard is also a fixed panel; it is deliberately the only state that
   hides the roller because it replaces the touch surface entirely. */
body.restored-workspace #landscapeTouchpad.keyboard-open {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 44px minmax(0, 1fr) 62px !important;
  grid-template-areas: "header" "keyboard" "input" !important;
}
body.restored-workspace #landscapeTouchpad.keyboard-open > #computerKeyboard { grid-area: keyboard !important; min-height: 0; }

@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad:not(.keyboard-open):not(.native-input-active) {
    /* Daily and design use one shared hit-target height on rotation. */
    --fixed-roller-height: clamp(48px, calc(50dvh - 107px), 112px);
    grid-template-rows: 44px var(--fixed-roller-height) minmax(0, 1fr) 56px !important;
    grid-template-areas: "header" "scroll" "touch" "input" !important;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) {
    /* History buttons reuse the shared roller height on short phones too. */
    grid-template-rows: 44px var(--fixed-roller-height) minmax(0, 1fr) var(--fixed-roller-height) 56px !important;
    grid-template-areas: "header" "scroll" "touch" "history" "input" !important;
  }
  body.restored-workspace #landscapeTouchpad:not(.keyboard-open) > #workspaceTextInputSlot { display: none !important; }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    --fixed-roller-height: 62px;
    grid-template-rows: 44px 54px var(--fixed-roller-height) minmax(0, 1fr) 62px 76px 52px !important;
    grid-template-areas: "header" "top" "scroll" "touch" "tools" "pages" "input" !important;
  }
}

/* Presentation is intentionally not a scrolling remote. Keep the touchpad
   clear for pointer / highlight work and expose PPT zoom as two direct keys
   in the separate visual-tools deck instead. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
  grid-template-rows: 44px 60px minmax(0, 1fr) clamp(100px, 18dvh, 152px) 56px !important;
  grid-template-areas: "header" "top" "touch" "pages" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #pureScrollStrip {
  display: none !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationToolDeck {
  grid-template-rows: 46px minmax(0, 1fr);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-zoom-control {
  display: grid !important;
}
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) {
    grid-template-rows: 44px 52px minmax(0, 1fr) 80px 48px !important;
    grid-template-areas: "header" "top" "touch" "pages" "input" !important;
  }
}

/* Keyboard Fn is a compact upper-layer switch, not a second full-screen
   keyboard.  Default to the numeric keypad and keep the letter rows visible;
   Fn swaps only the upper slot to navigation plus F1–F12. */
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block {
  grid-template-columns: minmax(0, 1fr) clamp(52px, 17%, 72px);
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha-bottom {
  grid-column: 1;
  grid-row: 1;
}
body.restored-workspace #computerKeyboard .computer-keyboard-row-modifiers {
  grid-column: 1;
  grid-row: 2;
}
body.restored-workspace #computerKeyboard #computerKeyboardFnButton {
  grid-column: 2;
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 5px;
  padding: 4px;
  font-size: 15px;
  background: rgba(var(--landscape-accent-rgb), .14);
  border-color: rgba(var(--landscape-accent-rgb), .36);
}
body.restored-workspace #computerKeyboard #computerKeyboardFnButton small {
  font-size: 9px;
  color: var(--theme-text-soft);
}
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-navigation,
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-number {
  display: none !important;
}
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-numpad {
  display: grid !important;
  grid-column: 1;
  grid-row: 1 / 3;
}
body.restored-workspace #computerKeyboard.numeric-layer :is(.computer-keyboard-row-symbols, .computer-keyboard-row-alpha-top, .computer-keyboard-row-alpha-home, .computer-keyboard-bottom-block) {
  display: grid !important;
}
body.restored-workspace #computerKeyboard:not(.numeric-layer) .computer-keyboard-numpad {
  display: none !important;
}
body.restored-workspace #computerKeyboard:not(.numeric-layer) :is(.computer-keyboard-navigation, .computer-keyboard-row-number, .computer-keyboard-row-symbols, .computer-keyboard-row-alpha-top, .computer-keyboard-row-alpha-home, .computer-keyboard-bottom-block) {
  display: grid !important;
}

/* Shared typography and component finish for every workspace mode. */
body.restored-workspace {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.restored-workspace #landscapeTouchpad button {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-weight: 650;
  letter-spacing: 0;
  border-width: 1px;
  border-style: solid;
}
body.restored-workspace #landscapeTouchpad #textInputActivator {
  border: 0;
  font-weight: 500;
}
body.restored-workspace #landscapeTouchpad > .landscape-toolbar {
  height: 44px;
  min-height: 0;
  padding: 0;
}
body.restored-workspace #landscapeTouchpad .landscape-mode-menu-control { gap: 6px; }
body.restored-workspace #landscapeTouchpad .landscape-mode-menu-control > :is(.viewport-mode-button, .theme-toggle) {
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  font-size: 12px;
}
body.restored-workspace #landscapeTouchpad :is(.landscape-command-key, .workspace-mode-trigger) {
  border-radius: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,.08);
}
body.restored-workspace #computerKeyboard {
  border: 1px solid var(--theme-line);
  border-radius: 18px;
  box-shadow: none;
}
body.restored-workspace #computerKeyboard .computer-key {
  box-shadow: 0 2px 3px rgba(0,0,0,.09), inset 0 1px rgba(255,255,255,.04);
  transition: background 100ms, border-color 100ms, transform 100ms;
}
body.restored-workspace #computerKeyboard .computer-key:focus-visible {
  outline: 2px solid var(--landscape-accent);
  outline-offset: -2px;
}
body.restored-workspace #computerKeyboard .computer-key:is(.pressed, :active, .latched) {
  background: rgba(var(--landscape-accent-rgb), .19);
  border-color: rgba(var(--landscape-accent-rgb), .5);
}
body.restored-workspace #computerKeyboardStatus { font-size: 10px; font-weight: 500; }
body.restored-workspace #computerKeyboardStatus.pending { color: var(--landscape-accent); font-weight: 650; }
body.restored-workspace #computerKeyboard .computer-key small { font-weight: 500; }
body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols > button { grid-column: span 5; }
body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols > button:nth-child(n+5) { grid-column: span 4; }
body.restored-workspace #computerKeyboard .computer-keyboard-bottom-block > .computer-keyboard-row-modifiers {
  grid-template-columns: repeat(3, minmax(0, .9fr)) minmax(0, 3fr);
}
body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-alpha-bottom { display: grid !important; }
body.restored-workspace #computerKeyboard #computerKeyboardFnButton.latched {
  box-shadow: none;
  background: rgba(var(--landscape-accent-rgb), .14);
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed { font-size: 12px; font-weight: 600; }
body.restored-workspace #landscapeTrackpad .trackpad-instructions {
  opacity: .65;
  font-size: 10px;
  font-weight: 400;
  gap: 12px 8px;
}
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] #landscapeTrackpad .trackpad-instructions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 8px;
  }
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus {
  border: 0;
  background: none;
  inset: 0;
  padding: 16px;
  justify-items: center;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--theme-text-soft);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationPadStatus span {
  font-size: 11px;
  color: var(--theme-text-faint);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > .presentation-page-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.25fr) !important;
  gap: 8px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .presentation-page-key {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0 6px;
}
body.restored-workspace #landscapeTouchpad #previousSlideButton { font-size: 15px; }
body.restored-workspace #landscapeTouchpad #previousSlideButton::before { font-size: 24px; margin-right: 6px; }
body.restored-workspace #landscapeTouchpad #nextSlideButton { font-size: 25px; font-weight: 700; }
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #commonActionRail > #workspaceModeDock > .workspace-mode-trigger {
  flex-direction: row;
  gap: 8px;
  font-size: 12px;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #workspaceModeDock .mode-menu-caption { font-size: 11px; }

@media (orientation: landscape) {
  /* Preserve the portrait order on rotation; only the input joins the header. */
  body.restored-workspace #landscapeTouchpad.keyboard-open { grid-template-rows: 44px minmax(0, 1fr) 48px !important; }
  body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]) .landscape-toolbar > #workspaceTextInputSlot { display: block !important; }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] .landscape-toolbar > #workspaceTextInputSlot { display: none !important; }
  body.restored-workspace #landscapeTouchpad.keyboard-open > #computerKeyboard { grid-template-rows: 16px minmax(0, 1fr) !important; }
  body.restored-workspace #computerKeyboard .computer-keyboard-layout {
    grid-template-rows: minmax(0, 1.5fr) minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .65fr) minmax(0, .65fr) minmax(0, 1.1fr) !important;
  }
  body.restored-workspace #computerKeyboard .computer-keyboard-numpad .computer-key { font-size: clamp(9px, 3.3dvh, 14px); }
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-numpad { gap: 3px; }
  body.restored-workspace #computerKeyboard :is(.computer-keyboard-navigation, .computer-keyboard-nav-main, .computer-keyboard-nav-arrows, .computer-keyboard-row-number) { gap: 2px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-navigation .computer-key,
  body.restored-workspace #computerKeyboard .computer-keyboard-row-number .computer-key { font-size: clamp(9px, 2.8dvh, 12px); }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols .computer-key { font-size: 9px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols small { font-size: 7px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-alpha .computer-key,
  body.restored-workspace #computerKeyboard .computer-keyboard-row-modifiers .computer-key { font-size: clamp(10px, 3.3dvh, 13px); }
  body.restored-workspace #computerKeyboard #computerKeyboardFnButton { font-size: 12px; gap: 2px; }
  body.restored-workspace .landscape-toolbar #workspaceTextInputSlot .input-phone-send { white-space: nowrap; padding-inline: 4px; }
  body.restored-workspace #computerKeyboard .computer-keyboard-row-symbols,
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-symbols { grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 2px; }
  body.restored-workspace #computerKeyboard.numeric-layer .computer-keyboard-row-symbols :is([data-key="period"], [data-key="slash"]) { display: flex; }
}

/* Timer settings remain available after retiring the visual-tools deck. */
body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationTimerPanel:not([hidden]) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}
body.restored-workspace #presentationTimerPanel > :is(label, button, aside) { grid-column: 1 / -1; }
body.restored-workspace #presentationTimerPanel > label { justify-content: space-between; }
body.restored-workspace #presentationTimerPanel > .presentation-timer-switch { justify-content: flex-start; }
body.restored-workspace #presentationTimerPanel .presentation-timing-mode :is(strong, span) { display: block; }
body.restored-workspace #presentationTimerPanel .presentation-timing-mode strong { font-size: 12px; }
body.restored-workspace #presentationTimerPanel .presentation-timing-mode span { margin-top: 3px; font-size: 10px; font-weight: 400; }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"]:not(.keyboard-open) > #presentationTimerPanel:not([hidden]) {
    top: 54px;
    gap: 6px 12px;
    padding: 10px 12px;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="presentation"] #presentationTimerPanel .presentation-timing-mode { grid-column: 1; grid-row: 1; }
  body.restored-workspace #presentationTimerPanel > .presentation-timer-switch { grid-column: 2; grid-row: 1; }
  body.restored-workspace #presentationTimerPanel > label:not(.presentation-timer-switch) { grid-column: 1; grid-row: 2; }
  body.restored-workspace #presentationTimerPanel > #presentationTimerApplyButton { grid-column: 2; grid-row: 2; }
}

/* Smart switching is deliberately next to orientation / fullscreen instead
   of buried in the footer, while the same state remains available in the
   mode menu for one-handed switching. */
body.restored-workspace .landscape-mode-menu-control > .smart-mode-toggle {
  display: inline-flex;
  min-width: 48px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 7px;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  color: var(--theme-text-soft);
  background: var(--theme-raised);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  touch-action: manipulation;
}
body.restored-workspace .landscape-mode-menu-control > .smart-mode-toggle > span:first-child { color: var(--theme-text-faint); font-size: 14px; }
body.restored-workspace .landscape-mode-menu-control > .smart-mode-toggle.is-active {
  border-color: rgba(145, 215, 49, .62);
  color: #94d93b;
  background: linear-gradient(145deg, rgba(145, 215, 49, .22), rgba(145, 215, 49, .075)), var(--theme-raised);
}
body.restored-workspace .landscape-mode-menu-control > .smart-mode-toggle.is-active > span:first-child { color: #a7f33f; }
body.restored-workspace .mode-menu-item-smart[aria-checked="true"] {
  border-color: rgba(145, 215, 49, .55);
  color: var(--theme-text);
  background: linear-gradient(115deg, rgba(145, 215, 49, .22), rgba(145, 215, 49, .07)), var(--theme-raised);
}
body.restored-workspace .mode-menu-item-smart[aria-checked="true"] .mode-item-dot { background: #a7f33f; box-shadow: 0 0 0 3px rgba(167, 243, 63, .13); }
body.restored-workspace .pointer-sensitivity-control {
  display: grid;
  gap: 6px;
  margin: 4px 3px 7px;
  padding: 9px 10px 8px;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  background: rgba(var(--landscape-accent-rgb), .045);
}
body.restored-workspace .pointer-sensitivity-heading,
body.restored-workspace .pointer-sensitivity-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--theme-text-soft);
  font-size: 10px;
  line-height: 1.1;
}
body.restored-workspace .pointer-sensitivity-heading output {
  color: var(--landscape-accent);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
body.restored-workspace .pointer-sensitivity-control input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  accent-color: var(--landscape-accent);
  cursor: ew-resize;
  touch-action: pan-y;
}
body.restored-workspace .pointer-sensitivity-scale { color: var(--theme-text-faint); font-size: 9px; }
@media (orientation: landscape) and (max-height: 400px) {
  body.restored-workspace .landscape-mode-menu-control > .smart-mode-toggle { height: 40px; min-width: 44px; padding-inline: 5px; }
}

/* Media is a focused remote: one gentle timeline strip above the touchpad,
   then three large transport targets below it.  Keeping this as a separate
   grid row prevents playback controls from becoming accidental mouse input. */
body.restored-workspace #landscapeTouchpad > #mediaTransportControls { display: none !important; }
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] {
  --landscape-accent: #7852b7;
  --landscape-accent-rgb: 120, 82, 183;
}
:root[data-theme="dark"] body.restored-workspace #landscapeTouchpad[data-control-mode="media"] {
  --landscape-accent: #c59aff;
  --landscape-accent-rgb: 197, 154, 255;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek {
  border-color: rgba(var(--landscape-accent-rgb), .52);
  background: linear-gradient(90deg,
    rgba(var(--landscape-accent-rgb), .21), rgba(var(--landscape-accent-rgb), .06) 30%,
    rgba(var(--landscape-accent-rgb), .025) 50%, rgba(var(--landscape-accent-rgb), .06) 70%,
    rgba(var(--landscape-accent-rgb), .21)), var(--theme-raised);
}
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek::before,
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek::after {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  color: var(--landscape-accent);
  font-size: 17px;
  font-weight: 760;
  pointer-events: none;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek::before { content: "−"; left: 17px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek::after { content: "+"; right: 17px; }
/* Win + Tab temporarily reuses the roller without changing the active mode.
   Blue differentiates selecting a window from browsing tabs or seeking media. */
body.restored-workspace #pureScrollStrip.task-switcher-picker {
  --strip-rgb: 72, 166, 235;
  border-color: rgba(var(--strip-rgb), .62);
  background: linear-gradient(90deg, rgba(61, 156, 228, .2), rgba(61, 156, 228, .045) 48%, rgba(61, 156, 228, .2)), var(--theme-raised);
}
body.restored-workspace #pureScrollStrip.task-switcher-picker::before,
body.restored-workspace #pureScrollStrip.task-switcher-picker::after {
  position: absolute;
  z-index: 3;
  top: 50%;
  transform: translateY(-50%);
  color: #71caff;
  font-size: 22px;
  font-weight: 760;
  pointer-events: none;
}
body.restored-workspace #pureScrollStrip.task-switcher-picker::before { content: "‹"; left: 17px; }
body.restored-workspace #pureScrollStrip.task-switcher-picker::after { content: "›"; right: 17px; }
body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) {
  grid-template-rows: 44px 56px var(--fixed-roller-height) minmax(0, 1fr) var(--fixed-roller-height) 62px !important;
  grid-template-areas: "header" "text" "scroll" "touch" "media" "input" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) > #mediaTransportControls {
  grid-area: media !important;
  display: grid !important;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.3fr) minmax(0, .88fr);
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
body.restored-workspace #mediaTransportControls > button {
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(var(--landscape-accent-rgb), .3);
  border-radius: 18px;
  color: var(--theme-text);
  background: linear-gradient(145deg, rgba(var(--landscape-accent-rgb), .11), rgba(var(--landscape-accent-rgb), .035)), var(--theme-raised);
  box-shadow: var(--theme-shadow-small);
  touch-action: manipulation;
}
body.restored-workspace #mediaTransportControls > button > span { color: var(--landscape-accent); font-size: clamp(20px, 3dvh, 28px); line-height: 1; }
body.restored-workspace #mediaTransportControls > button strong { min-width: 0; font-size: clamp(14px, 2dvh, 18px); font-weight: 720; white-space: nowrap; }
body.restored-workspace #mediaTransportControls > .media-play-pause-button {
  color: var(--theme-text);
  border-color: rgba(var(--landscape-accent-rgb), .58);
  background: linear-gradient(145deg, rgba(var(--landscape-accent-rgb), .34), rgba(var(--landscape-accent-rgb), .13)), var(--theme-raised);
}
body.restored-workspace #mediaTransportControls > button:active { transform: translateY(1px) scale(.988); background: rgba(var(--landscape-accent-rgb), .26); }
@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) {
    grid-template-rows: 44px var(--fixed-roller-height) minmax(0, 1fr) var(--fixed-roller-height) 56px !important;
    grid-template-areas: "header" "scroll" "touch" "media" "input" !important;
  }
}

/* -------------------------------------------------------------------------
   Unified tactile roller finish

   Every roller mode uses this same high-contrast instrument surface. The
   accent tells the user what the strip currently controls; the moving rail,
   contact thumb, glow and direction halo confirm that a drag was received.
   ------------------------------------------------------------------------- */
body.restored-workspace #pureScrollStrip {
  --strip-rgb: 86, 166, 31;
  --roller-ink: #203418;
  --roller-label: #365728;
  --roller-surface:
    radial-gradient(ellipse 44% 160% at var(--strip-contact-x, 50%) 50%, rgba(var(--strip-rgb), .3), transparent 74%),
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(var(--strip-rgb), .12) 46%, rgba(45,78,29,.08)),
    var(--theme-raised);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(var(--strip-rgb), .72);
  background: var(--roller-surface);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 -1px 0 rgba(var(--strip-rgb), .24),
    0 6px 15px rgba(32, 52, 24, .13);
  transition: border-color 150ms ease, background 190ms ease, box-shadow 150ms ease, transform 150ms ease;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip {
  --strip-rgb: 166, 242, 60;
  --roller-ink: #e9f9d9;
  --roller-label: #c2d9af;
  --roller-surface:
    radial-gradient(ellipse 44% 160% at var(--strip-contact-x, 50%) 50%, rgba(var(--strip-rgb), .22), transparent 74%),
    linear-gradient(180deg, rgba(203,255,155,.11), rgba(8,15,10,.32) 46%, rgba(0,0,0,.18)),
    var(--theme-raised);
  border-color: rgba(var(--strip-rgb), .62);
  background: var(--roller-surface);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(var(--strip-rgb), .18),
    0 8px 20px rgba(0,0,0,.3);
}
body.restored-workspace #pureScrollStrip.zoom-mode,
body.restored-workspace #pureScrollStrip.design-zoom-wheel,
body.restored-workspace #pureScrollStrip.presentation-zoom-wheel {
  --strip-rgb: 105, 77, 210;
  --roller-ink: #31245f;
  --roller-label: #58459a;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip:is(.zoom-mode,.design-zoom-wheel,.presentation-zoom-wheel) {
  --strip-rgb: 185, 154, 255;
  --roller-ink: #f1eaff;
  --roller-label: #d1c0ff;
}
body.restored-workspace #pureScrollStrip.browser-tabs {
  --strip-rgb: 27, 139, 190;
  --roller-ink: #123d54;
  --roller-label: #256785;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip.browser-tabs {
  --strip-rgb: 97, 211, 255;
  --roller-ink: #e1f8ff;
  --roller-label: #b9eaff;
}
body.restored-workspace #pureScrollStrip.media-seek {
  --strip-rgb: 143, 73, 188;
  --roller-ink: #4c205f;
  --roller-label: #7e3a9a;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip.media-seek {
  --strip-rgb: 211, 148, 255;
  --roller-ink: #f6e9ff;
  --roller-label: #e4bdff;
}
body.restored-workspace #pureScrollStrip.task-switcher-picker {
  --strip-rgb: 33, 149, 221;
  --roller-ink: #0e3b58;
  --roller-label: #236989;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip.task-switcher-picker {
  --strip-rgb: 103, 204, 255;
  --roller-ink: #e2f6ff;
  --roller-label: #b7e9ff;
}
body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed {
  display: block;
  position: absolute;
  z-index: 4;
  top: 18%;
  left: 50%;
  max-width: calc(100% - 92px);
  margin: 0;
  transform: translateX(-50%);
  color: var(--roller-label);
  font-size: clamp(11px, 1.7dvh, 13px);
  font-weight: 760;
  letter-spacing: .035em;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
  transition: color 120ms ease, transform 120ms ease, letter-spacing 120ms ease;
}
body.restored-workspace #pureScrollStrip:not(.design-edges),
body.restored-workspace #pureScrollStrip.design-edges,
body.restored-workspace #landscapeTouchpad[data-control-mode="browser"] #pureScrollStrip.browser-tabs,
body.restored-workspace #landscapeTouchpad[data-control-mode="media"] #pureScrollStrip.media-seek {
  background: var(--roller-surface) !important;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed {
  text-shadow: 0 1px 0 rgba(0,0,0,.42);
}
body.restored-workspace #pureScrollStrip .strip-tactile-rail {
  position: absolute;
  z-index: 2;
  right: 14%;
  bottom: 21%;
  left: 14%;
  height: clamp(14px, 2.3dvh, 19px);
  border: 1px solid rgba(var(--strip-rgb), .33);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.52), rgba(var(--strip-rgb), .05)),
    rgba(var(--strip-rgb), .10);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.11), 0 1px 0 rgba(255,255,255,.45);
  overflow: hidden;
  pointer-events: none;
}
:root[data-theme="dark"] body.restored-workspace #pureScrollStrip .strip-tactile-rail {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(var(--strip-rgb), .07)), rgba(0,0,0,.2);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.04);
}
body.restored-workspace #pureScrollStrip .strip-tactile-rail::before {
  content: "";
  position: absolute;
  inset: 4px 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(var(--strip-rgb), .76) 0 1px, transparent 1px 10px);
  background-position: var(--strip-phase, 0px) 0;
  opacity: .9;
  transition: background-position 80ms linear, opacity 120ms ease;
}
body.restored-workspace #pureScrollStrip .strip-tactile-thumb {
  position: absolute;
  top: 2px;
  left: var(--strip-contact-x, 50%);
  width: clamp(24px, 7vw, 34px);
  height: calc(100% - 4px);
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(var(--strip-rgb), .95) 62%, rgba(var(--strip-rgb), .72));
  box-shadow: 0 2px 7px rgba(0,0,0,.22), 0 0 0 2px rgba(var(--strip-rgb), .17), 0 0 13px rgba(var(--strip-rgb), .28);
  transform: translateX(-50%);
  transition: left 160ms cubic-bezier(.2,.75,.2,1), width 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
body.restored-workspace #pureScrollStrip .strip-tactile-thumb::before {
  content: "";
  position: absolute;
  top: 30%;
  right: 30%;
  bottom: 30%;
  left: 30%;
  border-inline: 1px solid rgba(255,255,255,.78);
}
body.restored-workspace #pureScrollStrip .strip-travel-feedback {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(var(--strip-rgb), .12) 50%, transparent 80%);
  opacity: .38;
  pointer-events: none;
  transform: translateX(0);
  transition: opacity 120ms ease, transform 120ms ease;
}
body.restored-workspace #pureScrollStrip.direction-right .strip-travel-feedback { opacity: .92; transform: translateX(18%); }
body.restored-workspace #pureScrollStrip.direction-left .strip-travel-feedback { opacity: .92; transform: translateX(-18%); }
body.restored-workspace #pureScrollStrip.active {
  border-color: rgb(var(--strip-rgb));
  box-shadow:
    0 0 0 2px rgba(var(--strip-rgb), .16),
    0 0 24px rgba(var(--strip-rgb), .26),
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 0 30px rgba(var(--strip-rgb), .14);
  transform: translateY(-1px);
}
body.restored-workspace #pureScrollStrip.active .pure-scroll-strip-speed {
  color: var(--roller-ink);
  letter-spacing: .055em;
  transform: translateX(-50%) translateY(-1px);
}
body.restored-workspace #pureScrollStrip.active .strip-tactile-thumb {
  width: clamp(29px, 8.5vw, 40px);
  filter: saturate(1.18) brightness(1.07);
  box-shadow: 0 2px 8px rgba(0,0,0,.28), 0 0 0 3px rgba(var(--strip-rgb), .2), 0 0 22px rgba(var(--strip-rgb), .62);
}
body.restored-workspace #pureScrollStrip.coasting {
  animation: roller-breathe 850ms ease-in-out infinite alternate;
}
body.restored-workspace #pureScrollStrip.coasting .strip-tactile-rail::before {
  animation: roller-ticks 430ms linear infinite;
}
body.restored-workspace #pureScrollStrip:focus-visible {
  outline: 2px solid rgb(var(--strip-rgb));
  outline-offset: 3px;
}
@keyframes roller-breathe {
  from { box-shadow: 0 0 0 2px rgba(var(--strip-rgb), .14), 0 0 15px rgba(var(--strip-rgb), .18), inset 0 0 18px rgba(var(--strip-rgb), .08); }
  to { box-shadow: 0 0 0 3px rgba(var(--strip-rgb), .22), 0 0 30px rgba(var(--strip-rgb), .42), inset 0 0 28px rgba(var(--strip-rgb), .16); }
}
@keyframes roller-ticks {
  to { background-position: 20px 0; }
}
@media (orientation: landscape) {
  body.restored-workspace #pureScrollStrip .pure-scroll-strip-speed { top: 20%; }
  body.restored-workspace #pureScrollStrip .strip-tactile-rail { right: 20%; bottom: 19%; left: 20%; }
}
@media (prefers-reduced-motion: reduce) {
  body.restored-workspace #pureScrollStrip,
  body.restored-workspace #pureScrollStrip .strip-tactile-thumb,
  body.restored-workspace #pureScrollStrip .strip-travel-feedback,
  body.restored-workspace #pureScrollStrip .strip-tactile-rail::before { animation: none !important; transition: none !important; }
}

/* Final non-presentation order: toolbar, touch surface, text, actions, roller. */
body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) {
  --fixed-roller-height: clamp(96px, 20dvh, 144px);
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: var(--fit-header) minmax(0, 1fr) var(--fit-text) var(--fit-footer) var(--fixed-roller-height) !important;
  grid-template-areas: "header" "touch" "text" "input" "scroll" !important;
}
body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) > #landscapeTrackpad { grid-area: touch !important; }
body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) > #workspaceTextInputSlot { grid-area: text !important; }
body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) > #landscapeQuickInputSlot { grid-area: input !important; }
body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) > #pureScrollStrip { grid-area: scroll !important; }

body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) {
  --design-history-height: clamp(60px, 10dvh, 86px);
  grid-template-rows: var(--fit-header) var(--design-history-height) minmax(0, 1fr) var(--fit-text) var(--fit-footer) var(--fixed-roller-height) !important;
  grid-template-areas: "header" "design" "touch" "text" "input" "scroll" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) > .restored-design-actions {
  grid-area: design !important;
  display: grid !important;
  position: static;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"] > .restored-design-actions button {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  font-size: clamp(15px, 2dvh, 19px);
  touch-action: manipulation;
}

body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) {
  grid-template-rows: var(--fit-header) minmax(0, 1fr) var(--fit-text) var(--fixed-roller-height) var(--fit-footer) !important;
  grid-template-areas: "header" "touch" "text" "media" "input" "scroll" !important;
}
body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) > #mediaTransportControls { grid-area: media !important; }

@media (orientation: landscape) {
  body.restored-workspace #landscapeTouchpad:not([data-control-mode="presentation"]):not(.keyboard-open):not(.native-input-active) {
    --fixed-roller-height: clamp(48px, calc(50dvh - 107px), 112px);
    grid-template-rows: var(--fit-header) minmax(0, 1fr) var(--fit-footer) var(--fixed-roller-height) !important;
    grid-template-areas: "header" "touch" "input" "scroll" !important;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="sketch"]:not(.keyboard-open):not(.native-input-active) {
    grid-template-rows: var(--fit-header) var(--design-history-height) minmax(0, 1fr) var(--fit-footer) var(--fixed-roller-height) !important;
    grid-template-areas: "header" "design" "touch" "input" "scroll" !important;
  }
  body.restored-workspace #landscapeTouchpad[data-control-mode="media"]:not(.keyboard-open):not(.native-input-active) {
    grid-template-rows: var(--fit-header) minmax(0, 1fr) var(--fixed-roller-height) var(--fit-footer) !important;
    grid-template-areas: "header" "touch" "media" "input" "scroll" !important;
  }
}

/* The horizontal strip has generous left and right hold zones. They share
   the strip's pointer surface, so a press can start continuous scrolling
   without stealing the existing drag gesture from the centre rail. */
body.restored-workspace #pureScrollStrip .strip-continuous-zone {
  position: absolute;
  z-index: 3;
  top: 8px;
  bottom: 8px;
  width: 31%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-inline: 9px;
  color: var(--roller-label);
  font-size: clamp(9px, 1.55dvh, 12px);
  font-weight: 720;
  letter-spacing: .02em;
  opacity: .72;
  pointer-events: none;
  transition: color 120ms ease, background 120ms ease, opacity 120ms ease, transform 120ms ease;
}
body.restored-workspace #pureScrollStrip .strip-continuous-left {
  left: 3px;
  justify-content: flex-start;
  border-radius: 10px 4px 4px 10px;
}
body.restored-workspace #pureScrollStrip .strip-continuous-right {
  right: 3px;
  justify-content: flex-end;
  border-radius: 4px 10px 10px 4px;
}
body.restored-workspace #pureScrollStrip .strip-continuous-arrow {
  color: rgb(var(--strip-rgb));
  font-size: clamp(18px, 3.6dvh, 27px);
  font-weight: 500;
  line-height: 1;
}
body.restored-workspace #pureScrollStrip.continuous-hold .strip-continuous-zone {
  opacity: 1;
  color: var(--roller-ink);
  background: rgba(var(--strip-rgb), .2);
  box-shadow: inset 0 0 14px rgba(var(--strip-rgb), .12);
}
body.restored-workspace #pureScrollStrip.continuous-left .strip-continuous-left { transform: translateX(-2px); }
body.restored-workspace #pureScrollStrip.continuous-right .strip-continuous-right { transform: translateX(2px); }
body.restored-workspace #pureScrollStrip.presentation-zoom-wheel .strip-continuous-zone,
body.restored-workspace #pureScrollStrip[data-control-mode="presentation"] .strip-continuous-zone { display: none; }
@media (orientation: landscape) {
  body.restored-workspace #pureScrollStrip .strip-continuous-zone { display: none; }
}
@media (max-width: 380px) {
  body.restored-workspace #pureScrollStrip .strip-continuous-caption { display: none; }
  body.restored-workspace #pureScrollStrip .strip-continuous-zone { width: 24%; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  body.restored-workspace #pureScrollStrip .strip-continuous-zone { transition: none; }
}

/* Voice input sits beside the phone keyboard action in the text dock. */
body.restored-workspace #workspaceTextInputSlot .quick-input {
  grid-template-columns: minmax(0, 1fr) 64px 72px !important;
  align-items: stretch;
}
body.restored-workspace #workspaceTextInputSlot .quick-text {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding-inline: 12px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
}
body.restored-workspace #workspaceTextInputSlot .input-voice-key {
  --voice-rgb: 38, 153, 168;
  position: relative;
  display: grid;
  grid-column: 3;
  grid-row: 1;
  grid-template-rows: 25px auto;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  padding: 4px 3px;
  border: 0;
  border-left: 1px solid var(--theme-line);
  border-radius: 0;
  color: var(--theme-text-soft);
  background: linear-gradient(180deg, rgba(var(--voice-rgb), .17), rgba(var(--voice-rgb), .07));
  font-size: 11px;
  font-weight: 720;
  line-height: 1.1;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
:root[data-theme="dark"] body.restored-workspace #workspaceTextInputSlot .input-voice-key {
  --voice-rgb: 91, 211, 224;
  color: var(--theme-text);
}
body.restored-workspace #workspaceTextInputSlot .input-voice-key:active {
  color: var(--theme-text);
  background: rgba(var(--voice-rgb), .25);
  box-shadow: inset 0 0 0 2px rgba(var(--voice-rgb), .25);
}
body.restored-workspace #workspaceTextInputSlot .voice-microphone-icon {
  width: 23px;
  height: 23px;
  color: rgb(var(--voice-rgb));
}
body.restored-workspace #workspaceTextInputSlot .voice-input-settings-mark {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--theme-text-soft);
  font-size: 8px;
  line-height: 1;
  opacity: .68;
}
body.restored-workspace #workspaceTextInputSlot .input-voice-key:focus-visible {
  outline: 2px solid rgb(var(--voice-rgb));
  outline-offset: -3px;
}
body.restored-workspace .voice-shortcut-dialog {
  width: min(410px, calc(100vw - 20px));
  height: min(92dvh, 680px);
  min-height: min(360px, 88dvh);
  max-width: none;
  max-height: min(92dvh, 720px);
  grid-template-rows: minmax(0, 1fr);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--theme-line-strong, var(--theme-line));
  border-radius: 18px;
  color: var(--theme-text);
  background: var(--theme-raised);
  box-shadow: 0 18px 60px rgba(0,0,0,.34);
  font: 14px/1.45 system-ui, sans-serif;
}
body.restored-workspace .voice-shortcut-dialog:not([open]) { display: none; }
body.restored-workspace .voice-shortcut-dialog[open] { display: grid; }
body.restored-workspace .voice-shortcut-dialog::backdrop {
  background: rgba(8, 13, 10, .58);
  backdrop-filter: blur(3px);
}
body.restored-workspace .voice-shortcut-form {
  display: grid;
  grid-template-rows: auto auto auto 46px auto 40px minmax(80px, 1fr) auto auto 44px;
  gap: 8px;
  min-height: 0;
  height: 100%;
  padding: 16px;
  overflow: hidden;
}
body.restored-workspace .voice-shortcut-form h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
body.restored-workspace .voice-shortcut-form p {
  margin: 0;
  color: var(--theme-text-soft);
  font-size: 12px;
}
body.restored-workspace .voice-shortcut-form label { font-size: 12px; font-weight: 700; }
body.restored-workspace .voice-shortcut-form input {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--theme-line-strong, var(--theme-line));
  border-radius: 11px;
  color: var(--theme-text);
  background: var(--theme-canvas);
  font: 700 16px/1.2 system-ui, sans-serif;
  text-align: center;
  cursor: crosshair;
}
body.restored-workspace .voice-shortcut-form > small {
  color: var(--theme-text-soft);
  font-size: 11px;
}
body.restored-workspace .voice-shortcut-form .voice-shortcut-error { min-height: 0; color: #c34444; }
body.restored-workspace .voice-shortcut-modifiers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
body.restored-workspace .voice-shortcut-modifiers button {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--theme-line);
  border-radius: 10px;
  color: var(--theme-text);
  background: var(--theme-canvas);
  font: 700 12px/1 system-ui, sans-serif;
  touch-action: manipulation;
}
body.restored-workspace .voice-shortcut-modifiers button.selected {
  border-color: rgba(var(--landscape-accent-rgb), .7);
  background: rgba(var(--landscape-accent-rgb), .24);
  box-shadow: inset 0 0 0 1px rgba(var(--landscape-accent-rgb), .32);
}
body.restored-workspace .voice-shortcut-keyboard {
  display: grid;
  gap: 7px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 1px;
  touch-action: pan-y;
}
body.restored-workspace .voice-shortcut-key-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}
body.restored-workspace .voice-shortcut-key-row.home { padding-inline: 4%; }
body.restored-workspace .voice-shortcut-key-row.bottom { grid-template-columns: repeat(7, minmax(0, 1fr)); padding-inline: 10%; }
body.restored-workspace .voice-shortcut-key-row.symbols { grid-template-columns: repeat(11, minmax(0, 1fr)); }
body.restored-workspace .voice-shortcut-key-row.functions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.restored-workspace .voice-shortcut-key-row.special { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.restored-workspace .voice-shortcut-key-row.numpad { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.restored-workspace .voice-shortcut-key {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 36px;
  padding: 2px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  color: var(--theme-text);
  background: var(--theme-canvas);
  font: 650 11px/1 system-ui, sans-serif;
  box-shadow: 0 1px 2px rgba(0,0,0,.09);
  touch-action: manipulation;
}
body.restored-workspace .voice-shortcut-key:active {
  border-color: rgba(var(--landscape-accent-rgb), .72);
  background: rgba(var(--landscape-accent-rgb), .24);
}
body.restored-workspace .voice-shortcut-capture-status { min-height: 15px; }
body.restored-workspace .voice-shortcut-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 4px;
}
body.restored-workspace .voice-shortcut-actions button {
  min-height: 44px;
  border: 1px solid var(--theme-line);
  border-radius: 11px;
  color: var(--theme-text);
  background: var(--theme-canvas);
  font: 700 14px/1 system-ui, sans-serif;
}
body.restored-workspace .voice-shortcut-actions .voice-shortcut-save {
  border-color: rgba(var(--landscape-accent-rgb), .62);
  color: var(--theme-text);
  background: rgba(var(--landscape-accent-rgb), .22);
}
@media (max-width: 360px) {
  body.restored-workspace #workspaceTextInputSlot .quick-input { grid-template-columns: minmax(0, 1fr) 54px 64px !important; }
  body.restored-workspace #workspaceTextInputSlot .input-voice-key { font-size: 10px; }
  body.restored-workspace .voice-shortcut-form {
    grid-template-rows: auto auto auto 42px auto 38px minmax(70px, 1fr) auto auto 42px;
    gap: 6px;
    padding: 12px;
  }
  body.restored-workspace .voice-shortcut-key-row { gap: 3px; }
  body.restored-workspace .voice-shortcut-key { min-height: 34px; font-size: 10px; }
}
@media (orientation: landscape) {
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .quick-input {
    grid-template-columns: minmax(0, 1fr) 52px 60px !important;
  }
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .input-voice-key { font-size: 9px; }
  body.restored-workspace .landscape-toolbar > #workspaceTextInputSlot .voice-microphone-icon { width: 20px; height: 20px; }
  body.restored-workspace .voice-shortcut-dialog { height: min(94dvh, 680px); min-height: min(320px, 90dvh); }
  body.restored-workspace .voice-shortcut-form {
    grid-template-rows: auto auto auto 40px auto 36px minmax(48px, 1fr) auto auto 40px;
    gap: 4px;
    padding: 10px;
  }
  body.restored-workspace .voice-shortcut-form p,
  body.restored-workspace #voiceShortcutHelp { display: none; }
}
