/* Reflow the existing tool elements so click handlers and permission checks stay intact. */
@media (max-width: 600px), (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  body:has(#ai-workbench.panel.active) { background: var(--bg); }
  #ai-workbench.panel { padding: 0; overflow: visible; }
  #ai-workbench .workbench-shell, #ai-workbench[data-workbench-fit] .workbench-shell {
    width: 100%; min-width: 0; height: auto; min-height: 0; margin: 0; overflow: visible; background: none; color: var(--text);
  }
  #ai-workbench .workbench-shell::before, #ai-workbench .workbench-shell::after { display: none; }
  #ai-workbench .workbench-title, #ai-workbench[data-workbench-fit] .workbench-title { position: static; transform: none; padding: 8px 2px 22px; color: var(--text); }
  #ai-workbench .workbench-title h2 { font-size: 26px; }
  #ai-workbench .workbench-title p { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
  #ai-workbench .workbench-room, #ai-workbench[data-workbench-fit] .workbench-room {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; position: static;
    width: 100%; height: auto; transform: none; filter: none;
  }
  #ai-workbench .workbench-room > [aria-hidden="true"],
  #ai-workbench .workbench-board, #ai-workbench .workbench-gifts { display: none; }
  #ai-workbench .workbench-tool-card, #ai-workbench .workbench-tree-tools {
    position: relative; inset: auto; display: flex; align-items: center; justify-content: center;
    width: 100%; height: auto; min-width: 0; min-height: 154px; margin: 0; padding: 106px 10px 14px;
    border: 1px solid color-mix(in srgb, var(--text) 9%, transparent); border-radius: 20px;
    background: var(--surface); color: var(--text); box-shadow: none; transform: none; filter: none; animation: none;
    text-align: center; cursor: pointer;
  }
  #ai-workbench .workbench-tool-card::before, #ai-workbench .workbench-tool-card::after,
  #ai-workbench .workbench-tool-card > .base-shadow { display: none; }
  /* Reuse the original artwork; only its mobile frame is new. */
  #ai-workbench .workbench-tool-card > :is(.workbench-ppt-shooting-board-icon, .iron-craft-art, .workbench-inspector-cat, .workbench-warehouse-art) { display: block; position: absolute; inset: 12px auto auto 50%; width: 84px; height: 84px; object-fit: contain; transform: translateX(-50%); filter: none; pointer-events: none; }
  #ai-workbench .workbench-tool-card > .monthly-vote-icon { display: block; position: absolute; inset: 14px auto auto calc(50% - 44px); width: 200px; height: 180px; transform: scale(.44); transform-origin: top left; }
  #ai-workbench .workbench-tool-card > .studio-booking-icon { display: block; top: 54px; left: 50%; transform: translate(-50%, -50%) scale(.36); }
  #ai-workbench .workbench-tool-card > .image-processing-center-icon { display: block; position: absolute; inset: 24px auto auto calc(50% - 48px); width: 158px; height: 92px; transform: scale(.65); transform-origin: top left; }
  #ai-workbench .workbench-tool-card:is(.folder, .monitor, .workbench-gamepad)::before { content: ""; display: block; position: absolute; inset: 14px auto auto calc(50% - 42px); width: 84px; height: 84px; border-radius: 0; background: var(--mobile-tool-art) center / contain no-repeat; box-shadow: none; transform: none; }
  #ai-workbench .workbench-tool-card.folder { --mobile-tool-art: url('/assets/images/file-namer-workbench-icon.png'); }
  #ai-workbench .workbench-tool-card.monitor { --mobile-tool-art: url('/assets/images/image-sync-preview.jpg'); }
  #ai-workbench .workbench-tool-card.workbench-gamepad { --mobile-tool-art: url('/assets/images/workbench-retro-handheld.svg?v=20260731-6'); }
  html.theme-dark #ai-workbench .workbench-tool-card.monitor { --mobile-tool-art: url('/assets/images/image-sync-preview-dark.jpg'); }
  #ai-workbench .workbench-tool-text, #ai-workbench .workbench-tool-title,
  #ai-workbench .workbench-tool-title .label-text {
    display: block; position: static; inset: auto; width: 100%; max-width: 100%; height: auto;
    padding: 0; margin: 0; transform: none; filter: none; opacity: 1; visibility: visible;
    color: var(--text); background: none; box-shadow: none; white-space: normal; text-shadow: none;
    font-size: 14px; font-weight: 600; line-height: 1.5; pointer-events: none; border: 0; border-radius: 0; animation: none;
  }
  #ai-workbench .workbench-tool-desc { display: none; }
  #ai-workbench .workbench-tool-title::before, #ai-workbench .workbench-tool-title::after { display: none; }
  #ai-workbench .workbench-shortcut-toggle { display: none; }
  #ai-workbench .workbench-tool-card[aria-disabled="true"] { opacity: .45; cursor: default; }
  #ai-workbench .workbench-tool-card:not([aria-disabled="true"]):active { background: var(--soft); }
  #ai-workbench .workbench-tree-tools { order: 2; padding: 0; }
  #ai-workbench .workbench-tree-tool { position: static; width: 100%; height: 100%; min-height: 154px; padding: 106px 10px 14px; transform: none; background: none; box-shadow: none; border: 0; color: var(--text); }
  #ai-workbench .workbench-tree-tool::before { content: ""; display: block; position: absolute; top: 12px; left: calc(50% - 42px); width: 84px; height: 84px; background: url("/assets/images/workbench-santa-tree-twemoji-tall.svg?v=20260904-18") center / contain no-repeat; }
  #ai-workbench .workbench-tree-tool-title { position: static; transform: none; color: inherit; font-size: 14px; background: none; border: 0; box-shadow: none; animation: none; white-space: normal; }
  #ai-workbench .workbench-tree-tool-title::before, #ai-workbench .workbench-tree-tool-title::after { display: none; }
  #ai-workbench .workbench-stats-board-wrap { position: relative; inset: auto; grid-column: 1 / -1; width: 100%; height: auto; margin: 0 0 8px; transform: none; filter: none; animation: none; }
  #ai-workbench .workbench-stats-board-link { display: block; position: static; }
  #ai-workbench .workbench-stats-board { position: static; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: none; transform: none; }
  #ai-workbench .workbench-stats-board::before, #ai-workbench .workbench-stats-board::after,
  #ai-workbench .workbench-stats-pin, #ai-workbench .workbench-stats-dust, #ai-workbench .workbench-stats-name-bubble { display: none; }
  #ai-workbench .workbench-stats-content { position: static; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); grid-template-rows: auto auto; gap: 12px; }
  #ai-workbench .workbench-stats-samples { grid-column: 1 / -1; padding: 0; background: none; box-shadow: none; }
  #ai-workbench .workbench-stats-sample, #ai-workbench .workbench-stats-metric { min-height: 68px; padding: 8px 2px; background: var(--soft); color: var(--text); box-shadow: none; border-radius: 12px; }
  #ai-workbench .workbench-stats-metric::before { display: none; }
  #ai-workbench .workbench-stats-sample-label, #ai-workbench .workbench-stats-label { color: var(--muted); font-size: 11px; }
  #ai-workbench .workbench-stats-sample-num, #ai-workbench .workbench-stats-value { font-size: 23px; font-weight: 650; }
  #ai-workbench [hidden] { display: none !important; }
}
@media (min-width: 700px) and (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  #ai-workbench .workbench-room { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
