@media (max-width: 900px) {
  :root { --toolbar-height: 52px; --filmstrip-height: 130px; --status-height: 0px; --mobile-photo-bar-height: 50px; }
  .toolbar { gap: 7px; padding-inline: 10px; }
  .brand span, .toolbar-files, .toolbar-view-actions, .toolbar-divider { display: none; }
  .toolbar-section-editing { gap: 0; }
  .toolbar-section-actions { gap: 5px; }
  .toolbar-ai { display: inline-grid; place-items: center; width: 36px; min-width: 36px; padding: 8px; }
  .toolbar-ai span { display: none; }
  .toolbar-ai svg { width: 18px; height: 18px; }
  .brand { margin-right: 0; }
  .tools-toggle { display: none; }
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
  .editor-column { height: auto; min-height: 0; grid-template-rows: minmax(0, 1fr) 0 var(--mobile-photo-bar-height); transition: grid-template-rows var(--motion-fast) ease-out; }
  .editor-column.has-no-photos { grid-template-rows: minmax(0, 1fr) 0 0; }
  .editor-column.is-filmstrip-open { grid-template-rows: minmax(0, 1fr) var(--filmstrip-height) var(--mobile-photo-bar-height); }
  .filmstrip-shell { min-height: 0; overflow: hidden; padding: 0; border-top-color: transparent; opacity: 0; visibility: hidden; transition: opacity var(--motion-fast) ease, visibility var(--motion-fast) ease; }
  .editor-column.is-filmstrip-open .filmstrip-shell { padding: 7px 8px; border-top-color: var(--color-border); opacity: 1; visibility: visible; }
  .mobile-photo-bar { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(112px, .85fr) 40px; align-items: center; gap: 4px; min-width: 0; padding: 5px 8px calc(5px + env(safe-area-inset-bottom)); background: var(--color-surface); border-top: 1px solid var(--color-border); }
  .mobile-filmstrip-toggle { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; align-items: center; gap: 7px; width: 100%; min-width: 0; height: 40px; padding: 3px 7px 3px 3px; color: var(--color-text); background: transparent; border: 1px solid transparent; border-radius: var(--radius-md); text-align: left; cursor: pointer; }
  .mobile-filmstrip-toggle:hover { background: rgba(255, 255, 255, .04); }
  .mobile-current-thumb { display: grid; place-items: center; width: 34px; height: 34px; overflow: hidden; background: var(--color-stage); border: 1px solid var(--color-border); border-radius: 7px; }
  .mobile-current-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-current-copy { display: grid; min-width: 0; line-height: 1.2; }
  .mobile-current-copy > span { font-size: var(--text-sm); font-weight: 600; }
  .mobile-current-copy small { overflow: hidden; color: var(--color-text-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-filmstrip-toggle output { color: var(--color-text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
  .mobile-filmstrip-toggle > svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--motion-fast) ease; }
  .mobile-filmstrip-toggle[aria-expanded="true"] { color: #e2ddff; background: var(--color-accent-soft); border-color: rgba(108, 77, 255, .3); }
  .mobile-filmstrip-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
  .mobile-edit-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-width: 0; height: 40px; padding: 7px 10px; color: var(--color-text-muted); background: rgba(255, 255, 255, .025); border: 1px solid var(--color-border); border-radius: var(--radius-md); font: inherit; font-size: var(--text-sm); cursor: pointer; white-space: nowrap; }
  .mobile-edit-toggle svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-edit-toggle:hover { color: var(--color-text); background: rgba(255, 255, 255, .05); border-color: var(--color-border-strong); }
  .mobile-edit-toggle[aria-expanded="true"] { color: #e2ddff; background: var(--color-accent-soft); border-color: rgba(108, 77, 255, .3); }
  .mobile-add-photos { width: 40px; height: 40px; min-height: 40px; padding: 9px; color: var(--color-text-muted); background: rgba(255, 255, 255, .025); border-color: var(--color-border); }
  .mobile-add-photos:hover { color: var(--color-text); background: rgba(255, 255, 255, .05); border-color: var(--color-border-strong); }
  .inspector { position: static; inset: auto; z-index: 1; display: none; width: 100%; max-height: min(42dvh, 350px); overflow: hidden; background: var(--color-surface-raised); border: 0; border-top: 1px solid var(--color-border-strong); border-radius: 0; transform: none; box-shadow: none; }
  .inspector.is-open { display: flex; transform: none; }
  .inspector-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px 0 16px; background: var(--color-surface-raised); border-bottom: 1px solid var(--color-border); border-radius: 0; font-weight: 600; }
  .inspector-close { display: inline-grid; }
  .mobile-tool-tabs { display: flex; flex: none; gap: 4px; min-height: 44px; padding: 6px 8px; overflow-x: auto; background: rgba(0, 0, 0, .1); border-bottom: 1px solid var(--color-border); scrollbar-width: none; }
  .mobile-tool-tabs::-webkit-scrollbar, .mobile-adjustment-tabs::-webkit-scrollbar { display: none; }
  .mobile-tool-tabs button, .mobile-adjustment-tabs button { flex: 0 0 auto; min-height: 32px; padding: 6px 11px; color: var(--color-text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-md); font: inherit; font-size: var(--text-xs); cursor: pointer; white-space: nowrap; }
  .mobile-tool-tabs button[aria-selected="true"], .mobile-adjustment-tabs button[aria-selected="true"] { color: #e2ddff; background: var(--color-accent-soft); border-color: rgba(108, 77, 255, .32); }
  .inspector .tool-section { display: none; min-height: 0; overflow: auto; border-bottom: 0; }
  .inspector .tool-section[open] { display: block; flex: 1 1 auto; overflow: auto; }
  .inspector .tool-section > summary { display: none; }
  .inspector .controls, .inspector .tool-body { padding: 10px 16px 14px; }
  .inspector-footer { display: none; margin-top: 0; overflow: auto; }
  .inspector[data-mobile-tool="presets"] .inspector-footer { display: grid; }
  body[data-mobile-focus] .editor-column { grid-template-rows: minmax(0, 1fr) 0 0; }
  body[data-mobile-focus] .filmstrip-shell, body[data-mobile-focus] .mobile-photo-bar { display: none; }
  body[data-mobile-focus] .mobile-tool-tabs { display: none; }
  .inspector[data-mobile-tool="crop"] { max-height: min(240px, 34dvh); }
  .inspector[data-mobile-tool="crop"] .tool-section[open] { overflow: hidden; }
  .inspector[data-mobile-tool="retouch"] { max-height: min(320px, 38dvh); }
  .inspector[data-mobile-tool="mask"] { max-height: min(350px, 42dvh); }
  .mobile-adjustment-tabs { display: flex; gap: 4px; margin: -2px -8px 6px; overflow-x: auto; padding: 0 8px 4px; scrollbar-width: none; }
  .controls > .control-row { display: none; }
  .controls > .control-row.is-mobile-active { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 5px 10px; min-height: 54px; }
  .controls > .control-row.is-mobile-active .control-label { align-self: center; }
  .controls > .control-row.is-mobile-active input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
  .controls > .control-row.is-mobile-active .control-value { grid-column: 2; grid-row: 1; }
  .filmstrip-item { flex-basis: 116px; height: 112px; }
  .statusbar { display: none; }
  .settings-layout { grid-template-columns: 1fr; min-height: min(560px, calc(100dvh - 90px)); }
  .settings-navigation { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--color-border); }
  .settings-nav-item { width: auto; flex: 1 0 auto; justify-content: center; }
  .settings-content { min-height: 0; }
}

@media (max-width: 560px) {
  :root { --filmstrip-height: 112px; }
  .toolbar { gap: 5px; padding-inline: 8px; }
  .toolbar .icon-button, .toolbar .button { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 8px; overflow: hidden; }
  .toolbar .button-primary { width: auto; min-width: 68px; padding-inline: 11px; }
  .toolbar-spacer { min-width: 0; }
  .filmstrip-item { flex-basis: 96px; height: 96px; grid-template-rows: minmax(0, 1fr) 23px; border-radius: 9px; }
  .photo-rating { right: 4px; bottom: 27px; padding-inline: 2px; }
  .photo-star { width: 16px; height: 18px; }
  .photo-star svg { width: 11px; height: 11px; }
  .control-row { grid-template-columns: 78px minmax(70px, 1fr) 44px; min-height: 42px; gap: 10px; }
  dialog { max-height: calc(100dvh - 16px); overflow: auto; }
  .form-grid > label, .dimension-fields > label, .text-input-field { grid-template-columns: 1fr; gap: 5px; }
  .settings-dialog { overflow: hidden; }
  .settings-dialog form { max-height: calc(100dvh - 16px); }
  .settings-nav-item { padding-inline: 9px; }
  .settings-nav-item svg { display: none; }
  .settings-section { padding: 20px 16px; }
  .settings-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .settings-row select, .settings-text-row input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
