/* MAJLIS Studio on phones (2026-10-18), with assets/v2/studio-phone.js.
   The room fills the screen; Color, Size, Style and Info open one short sheet at a time. */
@media (max-width: 900px) {
  html.mj-phone-ui { --mj-tab-h: 62px; --mj-tab-full: calc(var(--mj-tab-h) + env(safe-area-inset-bottom)); }
  html.mj-phone-ui body #studio#studio.app > main.workspace {
    display: block !important; position: relative !important;
    height: calc(100dvh - var(--mj-tab-full)) !important; min-height: 0 !important; overflow: hidden !important;
  }
  html.mj-phone-ui.mj-bare body #studio#studio.app > main.workspace { height: 100dvh !important; }
  html.mj-phone-ui body #studio#studio.app .stage { position: absolute !important; inset: 0 !important; height: auto !important; border: 0 !important; }
  html.mj-phone-ui body #studio#studio.app.is-3d .stage .view-3d, html.mj-phone-ui body #studio#studio.app.is-3d .stage .view-3d iframe { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; }
  html.mj-phone-ui body #studio#studio.app:not(.is-3d) .stage .view-2d.active { padding-bottom: 24px !important; }
  html.mj-phone-ui body #studio#studio.app .rug-2d-wrap { width: min(76vw, 420px) !important; }

  /* the price bar's figures and Request Quote live under Info now */
  html.mj-phone-ui body #studio#studio.app .stage .summary { display: none !important; }
  /* Hide panel works in 2D and 3D on a phone */
  html.mj-phone-ui body #studio#studio.app .stage .stage-tools #stageHidePanel { display: inline-flex !important; align-items: center; order: -1; }
  html.mj-phone-ui body #studio#studio.app .stage .stage-tools #toggleStudioView { order: -2; }
  /* Share design lives under Info */
  html.mj-phone-ui body #studio#studio.app .stage .stage-tools #stageShare { display: none !important; }

  /* the four buttons */
  .mj-tabbar { display: none; }
  html.mj-phone-ui .mj-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 400; display: grid; grid-template-columns: repeat(4, 1fr);
    height: var(--mj-tab-full); padding-bottom: env(safe-area-inset-bottom); background: #FBF6EC; border-top: 1px solid rgba(84, 13, 0, .16);
    transition: transform .28s ease;
  }
  html.mj-phone-ui.mj-bare .mj-tabbar { transform: translateY(100%); }
  .mj-tabbar button {
    appearance: none; border: 0; background: transparent; color: #540D00; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .mj-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .mj-tabbar button[aria-pressed="true"] { background: #540D00; color: #FFF8EA; }
  .mj-tabbar button:focus-visible { outline: 2px solid #540D00; outline-offset: -4px; }

  /* the sheet: the Studio's own panel, showing one tab's groups */
  html.mj-phone-ui body #studio#studio.app aside.panel {
    position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: var(--mj-tab-full) !important;
    width: auto !important; height: auto !important; max-height: min(58dvh, 520px) !important; z-index: 390 !important;
    display: block !important; overflow-y: auto !important; overflow-x: hidden !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 0 0 12px !important; margin: 0 !important; background: #FBF6EC !important; border: 0 !important; border-top: 1px solid rgba(84, 13, 0, .18) !important;
    border-radius: 14px 14px 0 0 !important; box-shadow: 0 -14px 34px rgba(40, 12, 4, .16) !important;
    transform: translateY(calc(100% + var(--mj-tab-full) + 20px)); transition: transform .3s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
  }
  html.mj-phone-ui.mj-sheet-open body #studio#studio.app aside.panel { transform: none; visibility: visible; }
  html.mj-phone-ui body #studio#studio.app aside.panel > [data-mtab] { display: none !important; }
  html.mj-phone-ui body #studio#studio.app[data-mtab="color"] aside.panel > [data-mtab="color"]:not([hidden]),
  html.mj-phone-ui body #studio#studio.app[data-mtab="size"] aside.panel > [data-mtab="size"]:not([hidden]),
  html.mj-phone-ui body #studio#studio.app[data-mtab="style"] aside.panel > [data-mtab="style"]:not([hidden]),
  html.mj-phone-ui body #studio#studio.app[data-mtab="info"] aside.panel > [data-mtab="info"]:not([hidden]) { display: block !important; }
  html.mj-phone-ui body #studio#studio.app aside.panel { display: flex !important; flex-direction: column !important; }
  html.mj-phone-ui body #studio#studio.app aside.panel > .mj-sheet-head { order: -3; }
  html.mj-phone-ui body #studio#studio.app aside.panel > .mj-info { order: -2; }
  html.mj-phone-ui body #studio#studio.app aside.panel .group { padding: 12px 16px !important; border-bottom: 1px solid rgba(84, 13, 0, .1) !important; }
  html.mj-phone-ui body #studio#studio.app aside.panel .swatches { max-height: none !important; grid-template-columns: repeat(6, 1fr) !important; gap: 8px !important; }

  .mj-sheet-head { display: none; }
  html.mj-phone-ui .mj-sheet-head {
    position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px 10px; background: #FBF6EC; border-bottom: 1px solid rgba(84, 13, 0, .12);
  }
  html.mj-phone-ui .mj-sheet-head::before { content: ""; position: absolute; left: 50%; top: 5px; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: rgba(84, 13, 0, .22); }
  .mj-sheet-title { font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #540D00; }
  .mj-sheet-close { appearance: none; border: 1px solid rgba(84, 13, 0, .3); background: transparent; color: #540D00; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; padding: 8px 12px; }

  /* Info */
  .mj-info-price { display: grid; gap: 2px; margin-bottom: 12px; }
  .mj-info-price b { font-size: 26px; font-weight: 600; color: #540D00; letter-spacing: .02em; }
  .mj-info-price small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #8A5A4E; }
  .mj-info-spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 13px; color: #540D00; }
  .mj-info-spec dt { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8A5A4E; align-self: center; }
  .mj-info-spec dd { margin: 0; }
  .mj-info-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mj-info-actions button { appearance: none; min-height: 46px; border: 1px solid #540D00; background: transparent; color: #540D00; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
  .mj-info-actions button.primary { grid-column: 1 / -1; background: #540D00; color: #FFF8EA; }
}
