:root {
  color-scheme: dark;
  --background: #191a1d;
  --chrome: #24262a;
  --panel: #242629;
  --line: rgba(255,255,255,.11);
  --text: #f5f4ef;
  --muted: #a6a8ac;
  --subtle: #777b82;
  --accent: #e6b582;
  --accent-dim: rgba(230,181,130,.14);
  --header-height: 58px;
  --sheet-height: 242px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; height: 100%; width: 100%; background: var(--background); overflow: hidden; overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; -webkit-touch-callout: none; }
button, input { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .3; cursor: not-allowed; }
.sr-only { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#lightcraft_loading {
  position: fixed; inset: 0; z-index: 18; display: flex; align-items: center; justify-content: center;
  background: var(--background); color: var(--muted); padding: 32px; text-align: center;
}
#lightcraft_viewport {
  position: fixed; left: 0; right: 0;
  top: calc(var(--safe-top) + var(--header-height));
  bottom: calc(var(--safe-bottom) + var(--sheet-height) + 34px);
  background: #191a1d;
  overflow: hidden;
  contain: layout paint;
}
#lightcraft_canvas {
  display: block; position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none; background: #191a1d;
  /* will-change is only enabled during a gesture: an always-layered Retina
     WebGL canvas wastes substantial iPhone texture memory. */
}
#mobile_studio[hidden] { display: none; }
.mobile-notice[hidden] { display: none; }
.mobile-notice {
  position: fixed; z-index: 8;
  top: calc(var(--safe-top) + var(--header-height) + 8px);
  left: calc(10px + var(--safe-left));
  max-width: calc(100% - var(--safe-left) - var(--safe-right) - 20px);
  border-radius: 14px; background: rgba(61, 49, 35, .94);
  border: 1px solid rgba(230, 181, 130, .48);
  box-shadow: 0 3px 18px rgba(0, 0, 0, .2);
}
.mobile-notice button {
  display: flex; gap: 9px; align-items: center; border: 0; background: none;
  color: #f4cfaa; min-height: 38px; padding: 7px 12px;
  font-size: 12px; font-weight: 620; text-align: left;
}
.mobile-notice button span {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%;
  font-size: 11px; font-weight: 760;
}
.notice-dialog {
  width: min(390px, calc(100% - 32px)); max-height: min(75dvh, 480px);
  border: 1px solid #56504b; border-radius: 18px;
  background: #27272b; color: var(--text); padding: 22px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .56); overflow-y: auto;
}
.notice-dialog::backdrop { background: rgba(0, 0, 0, .63); }
.notice-dialog h2 { margin: 0 0 14px; font-size: 18px; font-weight: 680; }
.notice-dialog p { white-space: pre-wrap; overflow-wrap: anywhere; color: #d6d4d0; font-size: 14px; line-height: 1.55; }
.notice-dialog button {
  background: var(--accent); border: 0; border-radius: 12px;
  color: #1a1a1a; min-height: 44px; padding: 0 20px;
  font-size: 13px; font-weight: 700;
}
.studio-header {
  z-index: 5; position: fixed; top: var(--safe-top); height: var(--header-height); left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 calc(12px + var(--safe-right)) 0 calc(12px + var(--safe-left)); background: rgba(30,31,35,.98); border-bottom: 1px solid var(--line);
}
.top-action {
  display: inline-flex; align-items: center; gap: 1px; min-width: 69px; height: 44px;
  padding: 0; border: none; background: transparent; color: var(--muted); font-size: 13px;
}
.top-action svg { width: 20px; height: 20px; }
.brand { color: var(--text); font-size: 12px; font-weight: 720; letter-spacing: .1em; white-space: nowrap; }
.brand span { display: block; color: var(--subtle); font-size: 9px; letter-spacing: .32em; text-align: center; }
.header-actions { display: flex; align-items: center; }
.icon-action { display: grid; place-items: center; border: none; background: transparent; padding: 0; width: 40px; height: 44px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-action svg { width: 21px; height: 21px; }
.photo-footer {
  position: fixed; bottom: calc(var(--safe-bottom) + var(--sheet-height)); left: 0; right: 0; height: 34px;
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: #1c1d21; padding: 0 calc(15px + var(--safe-right)) 0 calc(15px + var(--safe-left)); border-top: 1px solid var(--line);
}
.photo-name { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); max-width: 39%; min-width: 0; }
.photo-actions { display: flex; gap: 9px; flex-shrink: 0; align-items: center; }
.photo-actions button { background: transparent; border: 0; color: var(--muted); font-size: 11px; padding: 6px 1px; }
.edit-console {
  z-index: 5; position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--sheet-height) + var(--safe-bottom)); background: var(--panel);
  border-top: 1px solid var(--line); border-radius: 17px 17px 0 0;
  padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); padding-right: var(--safe-right); display: flex; flex-direction: column;
}
.grabber { height: 4px; width: 38px; background: #63676f; opacity: .45; border-radius: 3px; align-self: center; margin: 8px 0 6px; flex-shrink: 0; }
.console-heading {
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  padding: 1px 19px 7px; min-height: 51px;
}
.eyebrow { font-size: 9px; font-weight: 700; color: var(--subtle); letter-spacing: .18em; }
.console-heading h1 { margin: 1px 0 0; font-size: 19px; line-height: 1.2; font-weight: 630; letter-spacing: -.02em; }
.auto-button { border: 1px solid rgba(230,181,130,.35); color: var(--accent); background: var(--accent-dim); padding: 8px 16px; min-height: 38px; border-radius: 18px; font-size: 12px; font-weight: 600; }
.adjustment-scroller {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 20px 12px;
  scrollbar-width: none;
}
.adjustment-scroller::-webkit-scrollbar, .category-tabs::-webkit-scrollbar { display: none; }
.control-row { min-height: 77px; padding: 4px 0 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
.control-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.control-label { font-size: 13px; font-weight: 530; color: var(--text); }
.control-value { font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }
.control-range {
  width: 100%; height: 26px; appearance: none; -webkit-appearance: none;
  border: 0; outline: none; margin: 0; background: transparent;
  touch-action: pan-y; cursor: pointer;
}
.control-range::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--percent), #55575e var(--percent), #55575e 100%); }
.control-range::-moz-range-track { height: 4px; border-radius: 3px; background: #55575e; }
.control-range::-moz-range-progress { height: 4px; background: var(--accent); }
.control-range::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%; background: #f8f4ec; border: 3px solid var(--chrome); box-shadow: 0 0 0 1px rgba(255,255,255,.2); margin-top: -10px; }
.control-range::-moz-range-thumb { height: 19px; width: 19px; border-radius: 50%; background: #f8f4ec; border: 3px solid var(--chrome); }
.category-tabs {
  flex-shrink: 0; display: flex; gap: 4px; align-items: stretch; overflow-x: auto; overflow-y: hidden;
  padding: 0 12px; border-top: 1px solid var(--line); min-height: 58px; scrollbar-width: none;
}
.category-tabs button {
  flex: 0 0 auto; position: relative; background: transparent; border: 0;
  min-height: 56px; padding: 0 18px; font-size: 12px; color: var(--muted); font-weight: 540;
}
.category-tabs button[aria-selected="true"] { color: var(--text); font-weight: 680; }
.category-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; height: 3px; width: calc(100% - 35px);
  bottom: 1px; left: 17px; border-radius: 3px 3px 0 0; background: var(--accent);
}
.empty-adjustments { color: var(--muted); padding: 28px 8px; font-size: 13px; text-align: center; }
.library-dialog {
  position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; max-height: none; height: 100dvh;
  padding: calc(var(--safe-top) + 18px) 20px calc(var(--safe-bottom) + 24px); border: 0;
  background: #202125; color: var(--text); overflow-y: auto;
}
.library-dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; }
.dialog-header h2 { margin: 2px 0; font-size: 27px; letter-spacing: -.035em; font-weight: 620; }
.close-button { border: 0; background: #36383d; border-radius: 18px; padding: 9px 16px; min-height: 44px; }
.privacy-caption { color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 35em; margin: 17px 0; }
.import-button {
  border: 1px solid rgba(230,181,130,.5); color: #18191d; background: var(--accent);
  width: 100%; border-radius: 14px; min-height: 52px; font-weight: 720;
}
.library-count { margin: 22px 0 10px; color: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.library-items { display: flex; flex-direction: column; gap: 1px; }
.library-item { border: 0; background: #2b2c31; color: var(--text); width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 61px; }
.library-item:first-child { border-radius: 10px 10px 0 0; }
.library-item:last-child { border-radius: 0 0 10px 10px; }
.library-item .file-mark { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: #3a3c42; color: var(--accent); font-size: 11px; font-weight: 750; }
.library-item .file-name { display: block; font-size: 13px; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.library-item .file-meta { display: block; font-size: 11px; margin-top: 4px; color: var(--muted); }
.toast { position: fixed; z-index: 20; left: 14px; right: 14px; bottom: calc(var(--safe-bottom) + var(--sheet-height) + 44px); padding: 12px 15px; border-radius: 13px; background: #414348; box-shadow: 0 8px 25px #0008; font-size: 13px; color: white; text-align: center; pointer-events: none; }
@media (max-width: 370px) {
  .brand { font-size: 10px; }
  .top-action { min-width: 54px; font-size: 12px; }
  .icon-action { width: 35px; }
  .console-heading { padding-left: 15px; padding-right: 15px; }
}
/* A narrow iPad window can use the wider sheet; a phone in landscape
   must never inherit it merely because its viewport is over 720px wide. */
@media (min-width: 720px) and (min-height: 621px) {
  :root { --sheet-height: 284px; }
  .studio-header { padding-left: calc(28px + var(--safe-left)); padding-right: calc(28px + var(--safe-right)); }
  .edit-console { left: 12%; right: 12%; border: 1px solid var(--line); border-bottom: 0; }
  .photo-footer { padding-left: calc(28px + var(--safe-left)); padding-right: calc(28px + var(--safe-right)); }
  .category-tabs { justify-content: center; }
  .library-dialog { width: min(620px, 100%); margin: auto; left: 0; right: 0; }
}
@media (max-height: 620px) {
  :root { --sheet-height: clamp(154px, 40dvh, 180px); --header-height: 48px; }
  .brand { font-size: 10px; }
  .grabber { margin: 4px 0 3px; }
  .console-heading { min-height: 34px; padding-top: 0; padding-bottom: 3px; }
  .console-heading h1 { font-size: 16px; }
  .eyebrow { display: none; }
  .control-row { min-height: 60px; }
  .category-tabs, .category-tabs button { min-height: 46px; }
}
@media (prefers-reduced-motion: no-preference) {
  .category-tabs button, .auto-button { transition: color .15s ease, background .15s ease; }
}


/* Mobile Studio is the sole application shell, with a photo-first compact mode. */
.grabber-button {
  display: grid; place-items: center; align-self: stretch; width: 100%;
  height: 20px; padding: 0; border: 0; background: transparent;
  touch-action: manipulation; flex: 0 0 20px;
}
.grabber-button .grabber { display: block; margin: 0; }
:root.studio-immersive { --sheet-height: 80px; }
.studio-immersive .console-heading,
.studio-immersive .adjustment-scroller { display: none; }
.studio-immersive .category-tabs { flex: 1; min-height: 56px; }
.studio-immersive .category-tabs button { min-height: 56px; }
.looks-search {
  display: block; width: 100%; padding: 11px 14px; margin-bottom: 10px;
  border-radius: 12px; border: 1px solid var(--line);
  background: #36383b; color: var(--text); font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
.looks-search::placeholder { color: var(--muted); }
.looks-groups {
  display: flex; gap: 7px; margin: 4px -2px 12px;
  padding: 0 2px 6px; overflow-x: auto; scrollbar-width: none;
}
.looks-groups::-webkit-scrollbar { display: none; }
.looks-chip {
  flex: none; border-radius: 999px; padding: 8px 12px; min-height: 36px;
  border: 1px solid var(--line); color: var(--muted);
  background: rgba(255,255,255,.035); white-space: nowrap; font-size: 12px;
}
.looks-chip[aria-pressed="true"] {
  border-color: rgba(230,181,130,.58); color: var(--accent); background: var(--accent-dim);
}
.looks-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px,1fr));
  align-content: start; gap: 10px; padding-bottom: 18px;
}
.look-item {
  position: relative; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 13px;
  background: #313237; min-height: 122px;
}
.look-item.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(230,181,130,.38); }
.look-apply {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%;
  min-height: 122px; padding: 10px 12px; padding-right: 37px;
  gap: 4px; border: none; background: transparent; text-align: left;
}
.look-symbol {
  display: flex; align-items: center; justify-content: center;
  width: 35px; height: 35px; margin-bottom: 1px;
  border: 1px solid rgba(230,181,130,.28); border-radius: 10px;
  color: var(--accent); background: linear-gradient(145deg,#544c46,#292a30);
  font-size: 21px;
}
.look-name {
  display: block; width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; font-weight: 620;
}
.look-meta {
  display: block; width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 10px; color: var(--muted);
}
.look-favorite {
  position: absolute; top: 7px; right: 7px; display: grid; place-items: center;
  height: 34px; width: 34px; background: rgba(21,22,25,.65);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--accent); font-size: 20px;
}
.look-overflow { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
@media (max-height: 620px) {
  .studio-immersive .category-tabs, .studio-immersive .category-tabs button { min-height: 49px; }
}

.storage-status {
  color: var(--muted); font-size: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px;
  background: rgba(255,255,255,.025); line-height: 1.45;
}
.backup-button {
  display: block; width: 100%; min-height: 48px; margin-top: 10px;
  border: 1px solid rgba(230,181,130,.5); border-radius: 13px;
  background: rgba(230,181,130,.075); color: var(--accent);
  font-size: 13px; font-weight: 650;
}

/* Backups are not independent of WebKit until saved into iPhone Files. */
.backup-ready {
  padding: 10px 12px 14px;
  margin-top: 12px;
  border: 1px solid rgba(230,181,130,.38);
  border-radius: 13px;
  background: rgba(230,181,130,.065);
}
.backup-ready[hidden] { display: none; }
.backup-ready > p:first-child {
  margin: 0 0 9px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
.backup-ready .privacy-caption { margin: 12px 0 0; }
.backup-primary {
  background: var(--accent);
  color: #242019;
  font-weight: 740;
}

/* Finished photographs: one local pool, no folders or secondary catalog. */
.save-photo-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 68px;
  padding: 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 730;
}
.save-photo-action svg { width: 18px; height: 18px; }
.saved-dialog {
  width: min(410px, calc(100% - 22px));
  max-height: min(87dvh, 760px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 18px 70px rgba(0, 0, 0, .55);
}
.saved-dialog::backdrop, .saved-pool-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
}
.saved-dialog .dialog-header { margin-bottom: 12px; }
.saved-photo-preview {
  display: block;
  width: 100%;
  max-height: min(40dvh, 350px);
  object-fit: contain;
  border-radius: 12px;
  background: #151516;
}
.saved-photo-preview[hidden] { display: none; }
.saved-photo-title {
  margin: 12px 0;
  font-size: 13px;
  font-weight: 720;
  overflow-wrap: anywhere;
}
.saved-dialog .import-button,
.saved-dialog .backup-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  min-height: 48px;
}
.saved-pool-items { display: grid; gap: 8px; padding-bottom: 12px; }
.saved-pool-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  border-radius: 12px;
  background: var(--chrome);
  border: 1px solid var(--line);
  overflow: hidden;
}
.saved-pool-open {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 66px;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 6px 4px 6px 8px;
}
.saved-pool-thumbnail {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: #141516;
  border-radius: 8px;
  flex: 0 0 auto;
}
.saved-pool-details { display: grid; gap: 3px; min-width: 0; }
.saved-pool-details strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-pool-details small { color: var(--muted); font-size: 10px; }
.saved-pool-delete {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 10px;
  min-width: 65px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.saved-pool-dialog { max-height: min(86dvh, 820px); }

/* Dedicated zoom stepping is discoverable even without a successful pinch.
   Actual freehand gestures run on the compositor and commit to Rust on release. */
.photo-actions .zoom-step {
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  font-weight: 400;
  text-align: center;
  touch-action: manipulation;
}
@media (max-width: 375px) {
  .photo-name { max-width: 29%; }
  .photo-actions { gap: 6px; }
}


/* Landscape workspace: photo and adjustments side by side.
   Applies to landscape iPhone and iPad, without changing portrait layouts.
   The image retains the complete space to the left of the inspector instead
   of being squeezed above an enormous bottom sheet. */
@media (orientation: landscape) and (min-width: 560px) {
  :root {
    --inspector-width: clamp(230px, 38vw, 500px);
    --landscape-footer-height: 42px;
  }

  #lightcraft_viewport {
    left: var(--safe-left);
    right: calc(var(--inspector-width) + var(--safe-right));
    top: calc(var(--safe-top) + var(--header-height));
    bottom: calc(var(--safe-bottom) + var(--landscape-footer-height));
  }

  .photo-footer {
    left: var(--safe-left);
    right: calc(var(--inspector-width) + var(--safe-right));
    bottom: var(--safe-bottom);
    height: var(--landscape-footer-height);
    padding: 0 clamp(12px, 2vw, 24px);
  }

  .photo-name { max-width: 35%; }
  .photo-actions { gap: clamp(5px, 1vw, 14px); }

  .edit-console {
    left: auto;
    right: calc(var(--safe-right) + 8px);
    top: calc(var(--safe-top) + var(--header-height) + 8px);
    bottom: calc(var(--safe-bottom) + 8px);
    width: calc(var(--inspector-width) - 16px);
    height: auto;
    max-height: none;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: -8px 0 34px rgba(0, 0, 0, .16);
    overflow: visible;
  }

  /* Keep the existing adjustment and category DOM, only change visual order. */
  .category-tabs {
    order: 1;
    flex: 0 0 51px;
    min-height: 51px;
    justify-content: flex-start;
    padding: 0 9px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
  }
  .category-tabs button {
    min-height: 49px;
    padding: 0 12px;
    font-size: 12px;
  }
  .category-tabs button[aria-selected="true"]::after {
    left: 12px;
    width: calc(100% - 24px);
    bottom: 0;
  }
  .console-heading {
    order: 2;
    min-height: 75px;
    padding: 13px 20px 10px;
  }
  .console-heading h1 { font-size: 22px; }
  .console-heading .eyebrow { display: block; }
  .adjustment-scroller {
    order: 3;
    min-height: 0;
    flex: 1 1 auto;
    padding: 4px 20px 20px;
    -webkit-overflow-scrolling: touch;
  }
  .control-row { min-height: 73px; padding: 6px 0 10px; }

  /* Touch-friendly side handle; toggles the inspector to a narrow rail. */
  .grabber-button {
    position: absolute;
    top: 50%;
    left: -40px;
    z-index: 7;
    width: 40px;
    height: 82px;
    min-height: 82px;
    flex: none;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--panel);
  }
  .grabber-button .grabber { display: none; }
  .grabber-button::after {
    content: "›";
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    color: var(--accent);
  }
  .studio-immersive .grabber-button::after { content: "‹"; }

  .mobile-notice {
    max-width: calc(100% - var(--inspector-width) - var(--safe-left) - var(--safe-right) - 22px);
  }
  .toast {
    right: calc(var(--inspector-width) + var(--safe-right) + 12px);
    bottom: calc(var(--safe-bottom) + var(--landscape-footer-height) + 12px);
  }

  :root.studio-immersive { --inspector-width: 76px; }
  .studio-immersive .category-tabs { display: none; }
  .studio-immersive .edit-console {
    align-items: center;
  }
  .studio-immersive .edit-console::after {
    content: "EDIT";
    display: block;
    padding: 22px 0 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 740;
    letter-spacing: .2em;
    writing-mode: vertical-rl;
    pointer-events: none;
  }
}

/* Short iPhone landscape viewports still have accessible sliders and
   horizontal category scrolling without pushing the photo off-screen. */
@media (orientation: landscape) and (min-width: 560px) and (max-height: 480px) {
  .edit-console {
    top: calc(var(--safe-top) + var(--header-height) + 4px);
    bottom: calc(var(--safe-bottom) + 4px);
    border-radius: 12px;
  }
  .category-tabs {
    flex-basis: 42px;
    min-height: 42px;
    border-radius: 12px 12px 0 0;
  }
  .category-tabs button { min-height: 40px; padding: 0 10px; font-size: 11px; }
  .console-heading { min-height: 51px; padding: 7px 14px 6px; }
  .console-heading h1 { font-size: 17px; }
  .auto-button { min-height: 34px; padding: 5px 12px; }
  .adjustment-scroller { padding: 0 14px 12px; }
  .control-row { min-height: 65px; }
}

/* Narrow landscape iPhones keep their full photo beside a scrollable inspector. */
@media (orientation: landscape) and (min-width: 560px) and (max-width: 699px) {
  .photo-name { display: none; }
  .photo-footer { justify-content: center; }
  .photo-actions { gap: 7px; }
  .edit-console { border-radius: 12px; }
  .category-tabs button { padding-inline: 9px; }
  .console-heading { padding-inline: 12px; }
  .adjustment-scroller { padding-inline: 12px; }
}
