/* The mobile workspace reuses the desktop controls and their original handlers. */
.mobile-workspace,.mobile-feedback,.mobile-dialog{font-family:"Microsoft YaHei","PingFang SC","Segoe UI",sans-serif}
.mobile-dialog{padding:0;border:0;color:var(--ink);background:var(--paper)}
.mobile-dialog::backdrop{background:#26302666}
.mobile-feedback{display:none}
body.compact-studio{overflow:hidden;overscroll-behavior:none;height:100vh;height:100dvh}
.compact-studio>.masthead,.compact-studio>main{display:none}
.compact-studio .mobile-workspace{
  width:100%;height:100vh;height:100dvh;overflow:hidden;
  padding:calc(4px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:44px min(calc((100vw - 24px) * 2 / 3),34vh) 44px 44px 44px minmax(0,1fr);
  grid-template-rows:44px min(calc((100vw - 24px) * 2 / 3),34dvh) 44px 44px 44px minmax(0,1fr);
  gap:4px;
}
.mobile-workspace>*{min-width:0;min-height:0}
.mobile-topbar{display:flex;align-items:center;gap:6px}
#mobile-room-slot{flex:1;min-width:0}
.mobile-topbar .room-nav{padding:0;gap:3px;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
.mobile-topbar .room-nav button{min-width:44px;min-height:44px;padding:7px 6px;font-size:12px;white-space:nowrap;flex:1}
#mobile-more-button{min-height:44px;min-width:44px;padding:7px 6px;font-size:12px;border-color:var(--line);background:var(--white);flex-shrink:0}
.mobile-preview-slot{display:flex;align-items:center;justify-content:center;overflow:hidden;background:#deddd6;border-radius:7px}
.mobile-preview-slot .image-stage{position:relative;width:100%;height:100%;border-radius:0;background:transparent}
.mobile-preview-slot .image-stage canvas{width:100%;height:100%;object-fit:contain;aspect-ratio:auto;display:block}
.mobile-preview-slot .loading{font-size:12px}
.mobile-viewbar{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}
#mobile-angle-slot{min-width:0;flex:1}
.mobile-viewbar .view-thumbs{margin:0;gap:3px}
.mobile-viewbar .view-thumbs[data-multiple="false"]{display:none}
.mobile-viewbar .angle{padding:6px;min-height:44px;font-size:11px;white-space:nowrap;flex:1;justify-content:center;gap:0}
.mobile-viewbar .angle img{display:none}
#mobile-mode-slot{flex-shrink:0}
.mobile-viewbar .mode-switch{padding:0;border:0;background:none;gap:3px}
.mobile-viewbar .mode-switch button{min-height:44px;padding:6px;font-size:11px;white-space:nowrap;border:1px solid var(--line)}
.mobile-viewbar .mode-switch button[aria-pressed="true"]{border-color:#a8b59e}
.mobile-surface-slot .surface-switch{margin:0;max-width:none;padding:0;background:var(--soft);height:44px;gap:3px}
.mobile-surface-slot .surface-switch button{min-height:44px;padding:7px;font-size:13px}
.mobile-colorbar{display:flex;align-items:center;justify-content:space-between;gap:6px;overflow:hidden}
#mobile-color-current{display:flex;align-items:center;gap:7px;min-width:0}
#mobile-current-chip-slot{display:flex;flex-shrink:0}
#mobile-current-chip-slot .active-chip{width:23px;height:23px}
#mobile-color-name-slot #selected-color{font-size:12px;line-height:17px;white-space:nowrap;display:block}
#mobile-surface-status{font-size:10px;color:var(--muted);line-height:13px;display:block}
#mobile-surface-status:empty{display:none}
#mobile-restore-slot{flex-shrink:0}
#mobile-restore-slot .original-choice{font-size:11px;min-height:44px;padding:6px 8px;white-space:nowrap}
#mobile-restore-slot .original-mark{width:12px;height:12px}
.mobile-palette-slot{overflow:hidden;min-height:0;border-top:1px solid var(--line)}
.mobile-palette-slot .palette{
  height:100%;min-height:0;margin:0;padding:6px 2px 8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(82px,max-content);gap:6px;align-content:start;
  scrollbar-width:thin;scrollbar-color:#b6bfad transparent;
}
.mobile-palette-slot .palette-group-label{display:none}
.mobile-palette-slot .swatch-grid{display:contents}
.mobile-palette-slot .swatch{min-height:82px;padding-bottom:4px;align-self:stretch}
.mobile-palette-slot .swatch-color{height:27px}
.mobile-palette-slot .swatch-name{font-size:12px;margin:3px 3px 1px;line-height:15px;min-height:30px;white-space:normal;overflow:visible;text-overflow:clip}
.mobile-palette-slot .swatch-code{font-size:10px;margin:0 3px;line-height:13px;letter-spacing:0}
.compact-studio .mobile-dialog{
  position:fixed;inset:auto;left:0;top:var(--dialog-visible-top,0px);margin:0;width:100%;max-width:none;
  height:100vh;height:var(--dialog-visible-height,100dvh);max-height:none;border-radius:0;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.compact-studio .mobile-dialog[open]{display:flex;flex-direction:column}
.mobile-dialog-header{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px;border-bottom:1px solid var(--line);background:var(--white)}
.mobile-dialog-header h2{font-size:20px;line-height:1.3;letter-spacing:0;margin:0}
.mobile-dialog-header p{font-size:11px;color:var(--muted);margin:3px 0 0}
.mobile-dialog-header button{min-height:44px;flex-shrink:0;border-color:var(--line);font-size:12px}
.mobile-dialog-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;scroll-padding:16px}
.mobile-action-grid{display:grid;grid-template-columns:1fr;gap:8px;margin-bottom:18px}
.mobile-action-grid button{width:100%;min-height:44px;font-size:13px;border:1px solid var(--line);background:var(--white);text-align:center}
.mobile-action-grid button.primary{background:var(--green);color:white}
.mobile-dialog .schemes-section{margin:0;padding:18px 0;border-bottom:1px solid var(--line)}
.mobile-dialog .section-heading{display:block;margin:0 0 12px}
.mobile-dialog .section-heading .eyebrow{display:none}
.mobile-dialog .section-heading h2{font-size:20px}
.mobile-dialog .section-heading p{font-size:12px;margin-top:5px}
.mobile-dialog .scheme-grid{grid-template-columns:1fr;gap:10px}
.mobile-dialog .scheme-card{padding:14px}
.mobile-dialog .scheme-name{font-size:16px;scroll-margin:12px;min-height:44px}
.mobile-dialog .scheme-buttons button{min-height:44px;font-size:12px}
.mobile-file-section{padding:16px 0;border-bottom:1px solid var(--line)}
.mobile-file-section h3{font-size:16px;margin:0 0 10px;font-weight:500}
.mobile-file-section .file-actions{justify-content:flex-start;gap:8px}
.mobile-file-section .file-actions button{font-size:13px;min-height:44px}
.mobile-file-section .storage-status{width:100%;text-align:left;margin:0;order:-1;font-size:12px}
.mobile-explanation{font-size:12px;color:var(--muted);padding:12px 0}
.mobile-explanation summary{min-height:44px;line-height:44px;cursor:pointer;font-size:14px;color:var(--ink)}
.mobile-explanation .surface-note{min-height:0}
.mobile-explanation .accuracy-note{font-size:12px}
.mobile-explanation .selection-summary{margin:12px 0;gap:12px}
#mobile-gallery-slot .back{display:inline-flex;align-items:center;min-height:44px;font-size:13px}
.mobile-dialog .comparison-pickers{grid-template-columns:1fr 1fr;gap:8px}
.mobile-dialog select{font-size:16px;min-height:44px}
.mobile-dialog .comparison-images{grid-template-columns:1fr;gap:18px}
.mobile-dialog .comparison-images canvas{aspect-ratio:3/2}
.mobile-dialog .comparison-images figcaption{font-size:12px;padding-top:6px;line-height:1.6}
#mobile-comparison-actions{margin:18px 0 0}
.compact-studio .mobile-feedback{position:fixed;z-index:10;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));display:flex;gap:4px;align-items:center;padding:9px 6px 9px 12px;background:var(--white);border:1px solid var(--line);box-shadow:0 3px 18px #25332522;border-radius:8px}
.mobile-dialog-feedback{flex-shrink:0;max-height:30vh;overflow:auto}
.compact-studio .mobile-feedback.in-dialog{position:static;margin:8px 16px;box-shadow:none}
#mobile-feedback-content{min-width:0;flex:1}
.mobile-feedback .notice,.mobile-feedback .error{margin:0;padding:0;min-height:0;font-size:12px;border:0;background:transparent}
#mobile-feedback-close{min-width:44px;min-height:44px;padding:0;font-size:20px}
@media(min-width:560px){.mobile-dialog .comparison-images{grid-template-columns:1fr 1fr}}
@media(max-width:1100px) and (max-height:500px) and (orientation:landscape){
  .compact-studio .mobile-workspace{
    grid-template-columns:minmax(0,1fr) clamp(240px,36vw,360px);
    grid-template-rows:44px 44px 44px minmax(0,1fr) 44px;
    column-gap:12px;
  }
  .mobile-topbar{grid-column:1 / -1;grid-row:1}
  .mobile-preview-slot{grid-column:1;grid-row:2 / 5}
  .mobile-viewbar{grid-column:1;grid-row:5}
  .mobile-surface-slot{grid-column:2;grid-row:2}
  .mobile-colorbar{grid-column:2;grid-row:3}
  .mobile-palette-slot{grid-column:2;grid-row:4 / 6}
  .mobile-palette-slot .palette{grid-template-columns:repeat(4,minmax(0,1fr))}
  .mobile-topbar .room-nav{justify-content:flex-start}
  .mobile-topbar .room-nav button{flex:0;min-width:54px}
}
