/* Spatial Studio V2 — task-first 2.5D interface */

@layer base {
  :root {
    --studio-bg: #0e1214;
    --studio-panel: #151a1d;
    --studio-panel-2: #1c2225;
    --studio-line: #333b3f;
    --studio-text: #f4f3ed;
    --studio-muted: #a9b0ae;
    --studio-accent: #d8ff59;
    --studio-accent-ink: #12170b;
    --studio-amber: #ff9a52;
    --studio-success: #58d39b;
    --studio-danger: #ff6f61;
    --studio-shadow: 0 30px 80px rgb(16 18 18 / 20%);
  }

  body {
    background:
      radial-gradient(circle at 72% -8%, rgb(216 255 89 / 10%), transparent 28rem),
      radial-gradient(circle at 5% 18%, rgb(255 154 82 / 9%), transparent 24rem),
      #f0eee8;
  }
}

@layer components {
  .intro--studio {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 35rem);
    align-items: end;
    gap: clamp(1.2rem, 4vw, 5rem);
    padding-top: clamp(1.35rem, 2.5vw, 2.4rem);
    padding-bottom: clamp(1.1rem, 2vw, 1.7rem);
  }

  .intro--studio h1 {
    max-width: none;
    font-size: clamp(2.2rem, 4.4vw, 4.35rem);
    line-height: 0.94;
  }

  .intro--studio .intro__lede {
    max-width: 34rem;
    margin: 0 0 0.15rem;
    font-size: clamp(0.98rem, 1.45vw, 1.18rem);
  }

  .calculator {
    width: min(calc(100% - 2rem), 1540px);
    border: 1px solid #303638;
    border-radius: 1.7rem;
    background: var(--studio-bg);
    box-shadow: var(--studio-shadow);
  }

  .mode-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.7rem;
    padding: 0.7rem;
    border-bottom: 1px solid var(--studio-line);
    background: var(--studio-bg);
  }

  .mode-tabs__primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
    gap: 0.65rem;
    max-width: 47rem;
  }

  .mode-tab {
    min-height: 4.7rem;
    justify-content: flex-start;
    gap: 0.9rem;
    padding: 0.72rem 1rem;
    border: 1px solid var(--studio-line);
    border-radius: 1rem;
    color: var(--studio-muted);
    background: var(--studio-panel);
    text-align: left;
  }

  .mode-tab:last-child {
    border-right: 1px solid var(--studio-line);
  }

  .mode-tab::after {
    display: none;
  }

  .mode-tab > span:last-child {
    display: grid;
    gap: 0.08rem;
  }

  .mode-tab strong {
    color: inherit;
    font-size: 0.95rem;
    font-weight: 780;
    letter-spacing: -0.025em;
  }

  .mode-tab small {
    color: #7f8988;
    font-size: 0.7rem;
    font-weight: 560;
  }

  .mode-tab__number {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    border-radius: 0.72rem;
    color: var(--studio-accent);
    background: rgb(216 255 89 / 9%);
    font-size: 0.68rem;
  }

  .mode-tab:hover {
    color: var(--studio-text);
    border-color: #4b5559;
    background: #1c2225;
  }

  .mode-tab.is-active {
    color: #151815;
    border-color: #f6f5ee;
    background: #f6f5ee;
    box-shadow: 0 12px 28px rgb(0 0 0 / 20%);
  }

  .mode-tab.is-active .mode-tab__number {
    color: var(--studio-accent-ink);
    background: var(--studio-accent);
  }

  .mode-tab.is-active small {
    color: #696e68;
  }

  .mode-tab--utility {
    align-self: center;
    min-height: 3.25rem;
    padding-inline: 1rem;
    color: #d7dcda;
    background: transparent;
    font-size: 0.79rem;
  }

  .mode-tab--utility svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  .mode-tab--utility.is-active {
    color: #151815;
    background: var(--studio-accent);
    border-color: var(--studio-accent);
  }

  .calculator__workspace {
    grid-template-columns: minmax(21.5rem, 25rem) minmax(0, 1fr);
    min-height: 42rem;
    height: clamp(42rem, calc(100svh - 13.5rem), 50rem);
    background: var(--studio-bg);
  }

  .control-rail {
    padding: clamp(1.15rem, 2vw, 1.75rem);
    border-right-color: #d8d5cc;
    color: #161815;
    background: #f7f5ee;
  }

  .panel-heading {
    margin-bottom: 1.1rem;
  }

  .panel-heading__step {
    color: #73756f;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
  }

  .panel-heading h2 {
    max-width: 18ch;
    font-size: clamp(1.4rem, 2vw, 1.92rem);
  }

  .number-input--stepper {
    display: grid;
    grid-template-columns: 2.85rem minmax(0, 1fr) auto 2.85rem;
    align-items: center;
    min-height: 4.4rem;
    overflow: hidden;
    border: 1px solid #bcb9b0;
    border-radius: 1rem;
    background: #fffefa;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
  }

  .number-input--stepper input {
    min-width: 0;
    min-height: 4.25rem;
    padding: 0 0.25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-family: var(--font-mono);
    font-size: clamp(2.25rem, 4vw, 3.45rem);
    font-weight: 760;
    letter-spacing: -0.08em;
    line-height: 1;
    text-align: center;
  }

  .number-input--stepper input:focus {
    outline: none;
  }

  .number-input--stepper .number-input__unit {
    position: static;
    padding-right: 0.45rem;
    transform: none;
    color: #686b65;
    font-size: 0.78rem;
  }

  .number-step {
    display: grid;
    place-items: center;
    width: 2.85rem;
    height: 100%;
    min-height: 4.35rem;
    color: #3f443f;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 1.35rem;
    transition: background 140ms ease, color 140ms ease;
  }

  .number-step:hover {
    color: #111411;
    background: #eceae2;
  }

  .range-control--hero {
    height: 2.35rem;
    margin: 0.55rem 0 0.35rem;
    background: transparent;
  }

  .range-control--hero::-webkit-slider-runnable-track {
    height: 0.42rem;
    border-radius: 999px;
    background:
      linear-gradient(90deg, #171a18 0 var(--range-progress), #d7d3c9 var(--range-progress) 100%);
  }

  .range-control--hero::-moz-range-track {
    height: 0.42rem;
    border-radius: 999px;
    background: #d7d3c9;
  }

  .range-control--hero::-moz-range-progress {
    height: 0.42rem;
    border-radius: 999px;
    background: #171a18;
  }

  .range-control--hero::-webkit-slider-thumb {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: -0.46rem;
    border: 4px solid #171a18;
    background: var(--studio-accent);
    box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
  }

  .range-control--hero::-moz-range-thumb {
    width: 1.05rem;
    height: 1.05rem;
    border: 4px solid #171a18;
    background: var(--studio-accent);
  }

  .live-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0.35rem 0 0.8rem;
    border-block: 1px solid #d8d4ca;
    background: transparent;
  }

  .live-summary > div {
    display: grid;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.75rem 0.4rem 0.72rem 0;
    border-right: 1px solid #d8d4ca;
  }

  .live-summary > div:last-child {
    padding-left: 0.85rem;
    border-right: 0;
  }

  .live-summary dt {
    color: #6d706a;
    font-size: 0.66rem;
    font-weight: 720;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .live-summary dd {
    color: #121512;
    font-family: var(--font-mono);
    font-size: clamp(1.1rem, 2vw, 1.38rem);
    font-weight: 780;
    letter-spacing: -0.04em;
  }

  .preset-row--sizes {
    display: flex;
    gap: 0.42rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .preset-row--sizes::-webkit-scrollbar {
    display: none;
  }

  .preset-row--sizes button {
    min-width: 3.1rem;
    min-height: 2.5rem;
    flex: 0 0 auto;
    border-color: #d1cec5;
    border-radius: 0.72rem;
    background: #fffefa;
    font-family: var(--font-mono);
    font-size: 0.76rem;
  }

  .preset-row--sizes button.is-selected {
    color: var(--studio-accent-ink);
    border-color: #b7dc3f;
    background: var(--studio-accent);
  }

  .panel-primary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    margin-top: 0.8rem;
  }

  .button--wide {
    width: 100%;
  }

  .panel-primary-actions .button--primary,
  .fit-maximum-action {
    color: var(--studio-accent-ink);
    background: var(--studio-accent);
  }

  .panel-primary-actions .button--primary:hover,
  .fit-maximum-action:hover {
    color: #0c0f09;
    background: #c8f53d;
  }

  .panel-primary-actions svg,
  .fit-maximum-action svg {
    margin-left: auto;
  }

  .advanced-options--studio {
    margin-top: 0.9rem;
    border-color: #d1cec5;
    background: #efede6;
  }

  .advanced-options--studio summary {
    min-height: 2.8rem;
    color: #50534e;
    font-size: 0.76rem;
  }

  .advanced-options--studio[open] {
    background: #fffefa;
  }

  #panelFit.is-active {
    display: flex;
    flex-direction: column;
  }

  #panelFit .panel-heading { order: 1; }
  #panelFit .fit-opening-control { order: 2; }
  #panelFit .fit-size-control { order: 3; }
  #panelFit .fit-size-range { order: 4; }
  #panelFit .fit-size-presets { order: 5; }
  #panelFit .fit-clearance-control { order: 6; }
  #panelFit .fit-live-result { order: 7; }
  #panelFit .fit-maximum-action { order: 8; }
  #panelFit .fit-advanced-options { order: 9; }

  .fit-opening-control {
    margin: 0 0 1rem;
    padding: 0.85rem;
    border-color: #c9c6bd;
    border-radius: 0.9rem;
    background: #fffefa;
  }

  .fit-opening-control legend {
    padding: 0 0.35rem;
    color: #2a2d29;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .fit-clearance-control {
    margin-top: 0.75rem;
  }

  .fit-clearance-control .number-input {
    max-width: 11rem;
  }

  .fit-live-result dd.is-fit {
    color: #16724f;
  }

  .fit-live-result dd.is-no-fit {
    color: #b43d32;
  }

  .fit-maximum-action {
    order: 7;
    margin-top: 0;
  }

  .fit-maximum-action:disabled {
    color: #747a73;
    background: #d9d8d1;
    cursor: not-allowed;
  }

  .rail-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #d7d3ca;
  }

  .rail-actions .button--primary {
    color: #f8f7f1;
    background: #191d1a;
  }

  .output-area {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-width: 0;
    padding: 0;
    color: var(--studio-text);
    background: var(--studio-bg);
  }

  .output-heading--studio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 5.2rem;
    padding: 0.8rem clamp(1rem, 2vw, 1.45rem);
    border-bottom: 1px solid var(--studio-line);
  }

  .output-heading__copy {
    min-width: 0;
  }

  .output-heading__label {
    margin-bottom: 0.15rem;
    color: var(--studio-accent);
    font-size: 0.66rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .output-heading--studio h2 {
    overflow: hidden;
    color: var(--studio-text);
    font-size: clamp(1.05rem, 1.8vw, 1.45rem);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .output-heading--studio .output-heading__note {
    margin-top: 0.08rem;
    color: #87908e;
    font-size: 0.69rem;
  }

  .stage-toolbar {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .stage-toggle {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(2.7rem, auto);
    gap: 0.2rem;
    padding: 0.2rem;
    border: 1px solid var(--studio-line);
    border-radius: 0.75rem;
    background: #111618;
  }

  .stage-toggle button,
  .stage-reset {
    min-height: 2rem;
    padding: 0 0.68rem;
    border-radius: 0.54rem;
    color: #8f9997;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 720;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .stage-toggle button:hover,
  .stage-reset:hover {
    color: #f4f4ed;
    background: #232a2d;
  }

  .stage-toggle button.is-active {
    color: var(--studio-accent-ink);
    background: var(--studio-accent);
  }

  .stage-reset {
    display: grid;
    place-items: center;
    width: 2.45rem;
    padding: 0;
    border: 1px solid var(--studio-line);
  }

  .stage-reset svg {
    width: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .visual-stage {
    --scene-yaw: -18deg;
    --scene-pitch: 4deg;
    --scene-zoom: 0.96;
    position: relative;
    min-height: 0;
    height: auto;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 52% 32%, rgb(216 255 89 / 7%), transparent 26rem),
      linear-gradient(180deg, #151b1e 0%, #0f1315 100%);
    box-shadow: none;
    isolation: isolate;
    touch-action: pan-y;
  }

  .visual-stage::after {
    right: 1rem;
    bottom: 0.72rem;
    left: auto;
    width: auto;
    height: auto;
    border: 0;
    color: #66706e;
    background: transparent;
    content: "Illustrative room depth · exact 2D dimensions";
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.04em;
  }

  .stage-grid {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    opacity: 0.14;
    background-image:
      linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px),
      linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px);
    background-size: 3rem 3rem;
    mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 76%, transparent);
  }

  .stage-hud {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 30;
    display: grid;
    max-width: min(17.25rem, calc(100% - 1.5rem));
    gap: 0.04rem;
    padding: 0.55rem 0.68rem;
    border: 1px solid rgb(255 255 255 / 11%);
    border-radius: 0.72rem;
    color: var(--studio-text);
    background: rgb(11 15 17 / 80%);
    box-shadow: 0 8px 22px rgb(0 0 0 / 22%);
    backdrop-filter: blur(9px);
  }

  .stage-hud > span {
    color: var(--studio-accent);
    font-family: var(--font-mono);
    font-size: 0.54rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .stage-hud strong {
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    font-weight: 760;
    letter-spacing: -0.045em;
    line-height: 1.04;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-hud small {
    overflow: hidden;
    color: #a1aaa8;
    font-size: 0.59rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-gesture-hint {
    position: absolute;
    left: 1rem;
    bottom: 0.9rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    color: #7f8987;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    pointer-events: none;
  }

  .stage-gesture-hint svg {
    width: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
  }

  .room-viewport {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
    perspective: 1200px;
    perspective-origin: 50% 48%;
  }

  .room-scene {
    position: absolute;
    inset: 0;
    transform: rotateX(var(--scene-pitch)) rotateY(var(--scene-yaw)) scale(var(--scene-zoom));
    transform-origin: 50% 52%;
    transform-style: preserve-3d;
    transition: transform 320ms cubic-bezier(0.2, 0.75, 0.2, 1);
    will-change: transform;
  }

  .visual-stage.is-dragging .room-scene {
    transition: none;
  }

  .visual-stage.is-front {
    --scene-yaw: 0deg;
    --scene-pitch: 0deg;
    --scene-zoom: 1;
  }

  .visual-stage.is-perspective {
    --scene-yaw: -18deg;
    --scene-pitch: 4deg;
    --scene-zoom: 0.96;
  }

  .output-area.is-room-preview .stage-toggle--placement,
  .output-area.is-room-preview .stage-reference-control,
  .output-area.is-room-preview .stage-reset {
    display: none;
  }

  .visual-stage.is-room-preview {
    background:
      linear-gradient(180deg, rgb(5 7 8 / 4%), rgb(5 7 8 / 16%)),
      url('/tv-wall-preview.webp?v=20260811-compact-hud') center center / cover no-repeat,
      #111416;
  }

  .visual-stage.is-room-preview::after {
    color: #a7afac;
    content: "Fixed 1.80 m person · TV drawn to scale";
    text-shadow: 0 1px 3px rgb(0 0 0 / 72%);
  }

  .visual-stage.is-room-preview .room-viewport {
    perspective: none;
  }

  .visual-stage.is-room-preview .room-scene {
    transform: none !important;
    transform-style: flat;
    transition: none;
  }

  .visual-stage.is-room-preview .room-wall,
  .visual-stage.is-room-preview .room-floor,
  .visual-stage.is-room-preview .scale-reference,
  .visual-stage.is-room-preview .stage-grid,
  .visual-stage.is-room-preview .stage-gesture-hint {
    display: none !important;
  }

  .preview-tv-bay {
    position: absolute;
    z-index: 6;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 5%);
    border-radius: 0.32rem;
    background:
      linear-gradient(90deg, transparent 32.9%, rgb(255 255 255 / 3%) 33%, transparent 33.1%, transparent 66%, rgb(255 255 255 / 3%) 66.1%, transparent 66.2%),
      linear-gradient(180deg, #24282a, #181b1d);
    box-shadow:
      inset 0 0 64px rgb(0 0 0 / 28%),
      0 18px 42px rgb(0 0 0 / 26%);
    pointer-events: none;
  }

  .preview-tv-bay::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgb(255 255 255 / 3%), transparent 38%);
    content: "";
  }

  .preview-tv-bay[hidden] {
    display: none;
  }

  .visual-stage.is-room-preview .tv-visual {
    box-shadow:
      0 20px 46px rgb(0 0 0 / 58%),
      0 3px 8px rgb(0 0 0 / 52%);
    transform: none;
  }

  .visual-stage.is-room-preview .tv-visual__edge,
  .visual-stage.is-room-preview .tv-visual__back,
  .visual-stage.is-room-preview .tv-visual__mount,
  .visual-stage.is-room-preview .tv-visual__foot {
    display: none;
  }

  .visual-stage.is-room-preview .tv-visual__screen {
    background:
      radial-gradient(circle at 62% 42%, rgb(216 255 89 / 12%), transparent 29%),
      radial-gradient(circle at 32% 64%, rgb(255 154 82 / 9%), transparent 31%),
      linear-gradient(138deg, #111719 0%, #020303 67%, #0b1012 100%);
  }

  .visual-stage.is-side {
    --scene-yaw: -54deg;
    --scene-pitch: 2deg;
    --scene-zoom: 0.91;
  }

  .room-wall {
    position: absolute;
    inset: 4.5% 4% 11%;
    border: 1px solid rgb(255 255 255 / 8%);
    border-radius: 0.45rem;
    background:
      linear-gradient(120deg, rgb(255 255 255 / 4%), transparent 34%),
      linear-gradient(180deg, #252c2f, #1a2023);
    box-shadow:
      inset 0 0 80px rgb(0 0 0 / 24%),
      0 35px 70px rgb(0 0 0 / 34%);
    transform: translateZ(-42px);
  }

  .room-wall__seam {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgb(255 255 255 / 4%);
  }

  .room-wall__seam--one { left: 33.333%; }
  .room-wall__seam--two { left: 66.666%; }

  .room-floor {
    position: absolute;
    right: 0;
    bottom: -36%;
    left: 0;
    height: 52%;
    overflow: hidden;
    background:
      linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px),
      linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
      #111619;
    background-size: 5.5rem 5.5rem;
    box-shadow: inset 0 20px 40px rgb(0 0 0 / 28%);
    transform: rotateX(68deg) translateZ(-38px);
    transform-origin: 50% 0;
  }

  .reference-console {
    position: absolute;
    z-index: 3;
    transform: translateZ(8px);
    transform-style: preserve-3d;
    transition: left 220ms ease, top 220ms ease, width 220ms ease, height 220ms ease, opacity 180ms ease;
  }

  .reference-console__front,
  .reference-console__top,
  .reference-console__side {
    position: absolute;
    border: 1px solid rgb(255 255 255 / 8%);
    background: #35302a;
  }

  .reference-console__front {
    inset: 0;
    border-radius: 0.2rem;
    background:
      linear-gradient(90deg, transparent 49.6%, rgb(255 255 255 / 7%) 49.8% 50.2%, transparent 50.4%),
      linear-gradient(180deg, #484037, #2f2a25);
    box-shadow: 0 20px 30px rgb(0 0 0 / 28%);
  }

  .reference-console__top {
    right: 0;
    bottom: 100%;
    left: 0;
    height: 18px;
    background: #5a5045;
    transform: rotateX(74deg);
    transform-origin: 50% 100%;
  }

  .reference-console__side {
    top: 0;
    bottom: 0;
    left: 100%;
    width: 18px;
    background: #292520;
    transform: rotateY(74deg);
    transform-origin: 0 50%;
  }

  .reference-console__label {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    color: #77817f;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    white-space: nowrap;
  }

  .tv-visual {
    z-index: 12;
    overflow: visible;
    border: 0;
    border-radius: 0.24rem;
    background: #080a0b;
    box-shadow:
      0 28px 55px rgb(0 0 0 / 45%),
      0 4px 9px rgb(0 0 0 / 45%);
    transform: translateZ(46px);
    transform-style: preserve-3d;
    transition:
      left 220ms cubic-bezier(0.2, 0.75, 0.2, 1),
      top 220ms cubic-bezier(0.2, 0.75, 0.2, 1),
      width 220ms cubic-bezier(0.2, 0.75, 0.2, 1),
      height 220ms cubic-bezier(0.2, 0.75, 0.2, 1),
      box-shadow 180ms ease;
  }

  .tv-visual__screen {
    position: absolute;
    top: var(--bezel-y-px, 3px);
    right: var(--bezel-x-px, 3px);
    bottom: var(--bezel-y-px, 3px);
    left: var(--bezel-x-px, 3px);
    overflow: hidden;
    border: 0;
    border-radius: max(1px, calc(0.18rem - 1px));
    background:
      radial-gradient(circle at 58% 45%, rgb(216 255 89 / 17%), transparent 28%),
      radial-gradient(circle at 32% 62%, rgb(255 154 82 / 13%), transparent 31%),
      linear-gradient(138deg, #11191d 0%, #030506 64%, #12191b 100%);
    box-shadow: inset 0 0 30px rgb(255 255 255 / 3%);
  }

  .tv-visual__screen::before {
    width: 48%;
    opacity: 0.25;
    background: linear-gradient(105deg, transparent, rgb(255 255 255 / 10%), transparent);
    transform: skewX(-18deg);
  }

  .tv-visual__screen::after {
    inset: auto 6% 7% 6%;
    height: 1px;
    opacity: 0.32;
    background: linear-gradient(90deg, transparent, var(--studio-accent), transparent);
  }

  .tv-visual__edge,
  .tv-visual__back {
    position: absolute;
    display: block;
    pointer-events: none;
  }

  .tv-visual__edge--top {
    right: 0;
    bottom: 100%;
    left: 0;
    height: 10px;
    background: #282d2f;
    transform: rotateX(78deg);
    transform-origin: 50% 100%;
  }

  .tv-visual__edge--right {
    top: 0;
    bottom: 0;
    left: 100%;
    width: 10px;
    background: #090b0c;
    transform: rotateY(78deg);
    transform-origin: 0 50%;
  }

  .tv-visual__back {
    inset: 4%;
    background: #030404;
    transform: translateZ(-12px);
    filter: blur(4px);
    opacity: 0.8;
  }

  .tv-visual__mount {
    position: absolute;
    top: 42%;
    left: 50%;
    z-index: -2;
    width: 18%;
    height: 28%;
    border-radius: 0.18rem;
    background: #07090a;
    box-shadow: 0 0 0 1px #303638;
    transform: translate(-50%, -50%) translateZ(-23px);
    transition: opacity 160ms ease;
  }

  .tv-visual__foot {
    position: absolute;
    top: calc(100% - 1px);
    width: 18%;
    height: clamp(9px, 4.5%, 18px);
    border-radius: 0 0 0.18rem 0.18rem;
    background: #080a0b;
    transform: translateZ(6px) skewX(-18deg);
    transform-origin: 50% 0;
    transition: opacity 160ms ease;
  }

  .tv-visual__foot--left { left: 12%; }
  .tv-visual__foot--right { right: 12%; transform: translateZ(6px) skewX(18deg); }

  .visual-stage.is-wall .tv-visual__foot {
    opacity: 0;
  }

  .visual-stage.is-stand .tv-visual__mount {
    opacity: 0;
  }

  .tv-visual__tag {
    top: -2.15rem !important;
    bottom: auto !important;
    padding: 0.32rem 0.55rem;
    border: 1px solid rgb(216 255 89 / 35%);
    border-radius: 999px;
    color: var(--studio-accent);
    background: rgb(9 13 14 / 84%);
    font-size: 0.62rem;
    box-shadow: none;
    backdrop-filter: blur(8px);
  }

  .tv-visual--secondary {
    z-index: 11;
    border: 2px solid var(--studio-amber);
    background: transparent;
    box-shadow: 0 0 0 1px rgb(255 154 82 / 20%);
    transform: translateZ(52px);
  }

  .tv-visual--secondary .tv-visual__screen {
    inset: 0;
    background: rgb(255 154 82 / 8%);
  }

  .tv-visual--secondary .tv-visual__edge {
    display: none;
  }

  .tv-resize-handle {
    position: absolute;
    right: -1.15rem;
    bottom: -1.15rem;
    z-index: 25;
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border: 3px solid #0f1315;
    border-radius: 50%;
    color: var(--studio-accent-ink);
    background: var(--studio-accent);
    box-shadow: 0 8px 22px rgb(0 0 0 / 36%);
    cursor: nwse-resize;
    touch-action: none;
  }

  .tv-resize-handle span,
  .tv-resize-handle span::before,
  .tv-resize-handle span::after {
    position: absolute;
    width: 0.8rem;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transform: rotate(-45deg);
  }

  .tv-resize-handle span::before { transform: translateY(-0.28rem); }
  .tv-resize-handle span::after { transform: translateY(0.28rem); }

  .space-frame {
    z-index: 7;
    border: 2px solid rgb(216 255 89 / 68%);
    border-radius: 0.3rem;
    background: rgb(216 255 89 / 2%);
    box-shadow:
      inset 0 0 0 1px rgb(255 255 255 / 7%),
      0 0 40px rgb(216 255 89 / 8%);
    transform: translateZ(18px);
    transition:
      left 220ms ease,
      top 220ms ease,
      width 220ms ease,
      height 220ms ease,
      border-color 160ms ease,
      background 160ms ease;
  }

  .space-frame.is-fit {
    border-color: var(--studio-success);
    background: rgb(88 211 155 / 4%);
  }

  .space-frame.is-no-fit {
    border-color: var(--studio-danger);
    background: rgb(255 111 97 / 6%);
    box-shadow: inset 0 0 35px rgb(255 111 97 / 12%);
  }

  .space-frame__label {
    top: -2rem;
    left: 0;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    color: #d8dedc;
    background: rgb(10 14 15 / 82%);
    font-size: 0.6rem;
    backdrop-filter: blur(8px);
  }

  .space-frame__safe-zone {
    position: absolute;
    inset: var(--safe-inset-y, 8px) var(--safe-inset-x, 8px);
    border: 1px dashed rgb(216 255 89 / 48%);
    border-radius: 0.18rem;
    background: rgb(216 255 89 / 2%);
  }

  .space-frame.is-no-fit .space-frame__safe-zone {
    border-color: rgb(255 111 97 / 62%);
    background: rgb(255 111 97 / 4%);
  }

  .space-frame__edge {
    position: absolute;
    opacity: 0;
    background: var(--studio-danger);
    transition: opacity 150ms ease;
  }

  .space-frame.is-width-limited .space-frame__edge--left,
  .space-frame.is-width-limited .space-frame__edge--right {
    opacity: 0.85;
  }

  .space-frame.is-height-limited .space-frame__edge--top,
  .space-frame.is-height-limited .space-frame__edge--bottom {
    opacity: 0.85;
  }

  .space-frame__edge--left,
  .space-frame__edge--right {
    top: 0;
    bottom: 0;
    width: 4px;
  }

  .space-frame__edge--left { left: -3px; }
  .space-frame__edge--right { right: -3px; }

  .space-frame__edge--top,
  .space-frame__edge--bottom {
    right: 0;
    left: 0;
    height: 4px;
  }

  .space-frame__edge--top { top: -3px; }
  .space-frame__edge--bottom { bottom: -3px; }

  .dimension-line {
    z-index: 23;
    color: var(--studio-accent);
    transition: opacity 160ms ease;
  }

  .dimension-line--horizontal,
  .dimension-line--vertical {
    border-color: var(--studio-accent);
  }

  .dimension-line span {
    color: var(--studio-accent-ink);
    background: var(--studio-accent);
    box-shadow: 0 6px 16px rgb(0 0 0 / 24%);
  }

  .visual-stage:not(.is-front) .dimension-line,
  .visual-stage:not(.is-front) .diagonal-measure {
    opacity: 0;
  }

  .fit-badge {
    top: 1rem;
    right: 1rem;
    bottom: auto;
    z-index: 32;
    max-width: min(23rem, calc(100% - 2rem));
    min-height: 3rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.9rem;
    font-size: 0.75rem;
    backdrop-filter: blur(12px);
  }

  .fit-badge.is-fit {
    color: #dffff0;
    border-color: rgb(88 211 155 / 45%);
    background: rgb(18 82 60 / 78%);
  }

  .fit-badge.is-no-fit {
    color: #ffe8e4;
    border-color: rgb(255 111 97 / 48%);
    background: rgb(111 35 31 / 80%);
  }

  .fit-gap-readout {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    display: flex;
    gap: 0.8rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 0.75rem;
    color: #8f9997;
    background: rgb(9 13 14 / 78%);
    font-size: 0.62rem;
    backdrop-filter: blur(10px);
  }

  .fit-gap-readout strong {
    display: block;
    color: #f4f5ef;
    font-family: var(--font-mono);
    font-size: 0.72rem;
  }

  .result-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--studio-line);
    border-bottom: 1px solid var(--studio-line);
    background: #121719;
  }

  .result-strip > div {
    min-height: 5.25rem;
    padding: 0.82rem 0.9rem;
    border-right-color: var(--studio-line);
  }

  .result-strip dt {
    color: #7f8987;
    font-size: 0.62rem;
  }

  .result-strip dd {
    color: #f2f3ed;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
  }

  .result-strip .result-secondary {
    color: #7f8987;
    font-size: 0.65rem;
  }

  .output-footnote {
    min-height: 2.7rem;
    padding: 0.62rem 1rem;
    color: #77817f;
    background: #0e1214;
    font-size: 0.65rem;
  }

  .stage-reference-control {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    min-height: 2.4rem;
    padding: 0.18rem 0.24rem 0.18rem 0.55rem;
    border: 1px solid var(--studio-line);
    border-radius: 0.75rem;
    color: #aeb6b4;
    background: #111618;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .stage-reference-control select {
    min-width: 8.8rem;
    min-height: 2rem;
    padding: 0 1.65rem 0 0.55rem;
    border: 0;
    border-radius: 0.54rem;
    color: #f4f5ef;
    background-color: #232a2d;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: none;
  }

  .stage-hud__reference {
    display: block;
    margin-top: 0.14rem;
    padding-top: 0.18rem;
    border-top: 1px solid rgb(255 255 255 / 9%);
    color: #c4cbc9 !important;
    font-size: 0.56rem !important;
  }

  @media (min-width: 681px) {
    .visual-stage.is-room-preview .stage-hud {
      top: auto;
      bottom: 0.75rem;
    }
  }

  .stage-state-banner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 34;
    display: grid;
    max-width: min(21rem, calc(100% - 2rem));
    gap: 0.1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgb(255 111 97 / 55%);
    border-radius: 0.8rem;
    color: #fff4f1;
    background: rgb(76 24 22 / 90%);
    box-shadow: 0 14px 34px rgb(0 0 0 / 28%);
    backdrop-filter: blur(12px);
  }

  .stage-state-banner[hidden] {
    display: none;
  }

  .stage-state-banner strong {
    font-size: 0.76rem;
  }

  .stage-state-banner span {
    color: #ffd6d0;
    font-size: 0.65rem;
  }

  .visual-stage.has-input-issue .room-scene {
    opacity: 0.46;
    filter: saturate(0.35);
  }

  .scale-reference {
    position: absolute;
    z-index: 4;
    pointer-events: none;
    opacity: 0.78;
    transition:
      left 220ms ease,
      top 220ms ease,
      width 220ms ease,
      height 220ms ease,
      opacity 180ms ease;
  }

  .scale-reference[hidden] {
    display: none;
  }

  .visual-stage.is-dragging .scale-reference,
  .visual-stage.is-resizing .scale-reference {
    opacity: 0.16 !important;
  }

  .scale-reference__label {
    position: absolute;
    left: 50%;
    bottom: -1.45rem;
    max-width: 15rem;
    padding: 0.18rem 0.38rem;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 999px;
    color: #c4cdca;
    background: rgb(9 13 14 / 82%);
    font-family: var(--font-mono);
    font-size: 0.54rem;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  .reference-person {
    color: #c6cfcc;
    transform: translateZ(18px);
    filter: drop-shadow(0 16px 18px rgb(0 0 0 / 32%));
  }

  .reference-person svg {
    width: 100%;
    height: 100%;
    overflow: visible;
  }

  .reference-person circle,
  .reference-person path {
    fill: currentColor;
  }

  .reference-door {
    z-index: 2;
    transform: translateZ(-28px);
    opacity: 0.56;
  }

  .reference-door__frame {
    position: absolute;
    inset: 0;
    border: max(2px, 0.22em) solid #76807d;
    border-bottom-width: max(3px, 0.3em);
    border-radius: 0.16rem 0.16rem 0 0;
    background: linear-gradient(145deg, #2d3436, #1c2224);
    box-shadow:
      inset 0 0 0 1px rgb(255 255 255 / 7%),
      0 18px 36px rgb(0 0 0 / 24%);
  }

  .reference-door__panel {
    position: absolute;
    inset: 5% 7% 3%;
    border: 1px solid rgb(255 255 255 / 8%);
    background:
      linear-gradient(90deg, transparent 49.5%, rgb(255 255 255 / 6%) 50%, transparent 50.5%),
      #252c2e;
  }

  .reference-door__knob {
    position: absolute;
    top: 53%;
    right: 10%;
    width: clamp(3px, 4%, 8px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--studio-amber);
    box-shadow: 0 0 0 2px rgb(0 0 0 / 28%);
  }

  .reference-door__height-mark {
    position: absolute;
    top: 0;
    right: -0.55rem;
    bottom: 0;
    width: 1px;
    background: linear-gradient(var(--studio-amber), var(--studio-amber));
  }

  .reference-door__height-mark::before,
  .reference-door__height-mark::after {
    position: absolute;
    right: -0.2rem;
    width: 0.42rem;
    height: 1px;
    background: var(--studio-amber);
    content: "";
  }

  .reference-door__height-mark::before { top: 0; }
  .reference-door__height-mark::after { bottom: 0; }

  .space-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin: -0.45rem 0 0.85rem;
  }

  .space-presets > span {
    width: 100%;
    color: var(--studio-muted);
    font-family: var(--font-mono);
    font-size: 0.61rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .space-presets button {
    min-height: 2.2rem;
    padding: 0.42rem 0.58rem;
    border: 1px solid var(--studio-line);
    border-radius: 0.62rem;
    color: #bac2c0;
    background: #171d20;
    font-size: 0.67rem;
    font-weight: 700;
  }

  .space-presets button:hover {
    border-color: #596367;
    color: #f4f5ef;
  }

  .space-presets button.is-selected {
    border-color: rgb(216 255 89 / 58%);
    color: var(--studio-accent);
    background: rgb(216 255 89 / 7%);
  }

  .control-error {
    border-color: #e4aaa4;
    background: #fff0ed;
  }
}

@media (max-width: 1180px) {
  .calculator__workspace {
    grid-template-columns: minmax(20rem, 23rem) minmax(0, 1fr);
  }

  .stage-toggle--placement {
    display: none;
  }

  .output-heading--studio h2 {
    max-width: 22rem;
  }
}

@media (max-width: 900px) {
  .intro--studio {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .calculator__workspace {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    color: #161815;
    background: #f7f5ee;
  }

  .control-rail {
    display: contents;
  }

  .control-panel.is-active {
    display: contents;
  }

  .control-panel[hidden] {
    display: none !important;
  }

  .calculator__workspace > .output-area {
    grid-column: 1;
    grid-row: 7;
  }

  .calculator[data-active-mode="dimensions"] .output-area {
    grid-row: 5;
  }

  .calculator[data-active-mode="compare"] .output-area {
    grid-row: 4;
  }

  .control-panel.is-active > .panel-heading,
  .control-panel.is-active > .field,
  .control-panel.is-active > .field-cluster,
  .control-panel.is-active > .range-control,
  .control-panel.is-active > .live-summary,
  .control-panel.is-active > .preset-row,
  .control-panel.is-active > .space-presets,
  .control-panel.is-active > .panel-primary-actions,
  .control-panel.is-active > .button,
  .control-panel.is-active > .advanced-options,
  .control-panel.is-active > .compare-inputs,
  .control-panel.is-active > .preset-comparisons,
  .control-panel.is-active > .comparison-note,
  .control-error,
  .rail-actions {
    grid-column: 1;
    margin-inline: 1rem;
  }

  #panelDimensions > .panel-heading { grid-row: 1; margin-top: 1rem; }
  #panelDimensions > .dimension-size-control { grid-row: 2; }
  #panelDimensions > .range-control { grid-row: 3; }
  #panelDimensions > .live-summary { grid-row: 4; }
  #panelDimensions > .preset-row { grid-row: 6; margin-top: 0.9rem; }
  #panelDimensions > .panel-primary-actions { grid-row: 7; }
  #panelDimensions > .advanced-options { grid-row: 8; }

  #panelFit > .panel-heading { grid-row: 1; margin-top: 1rem; }
  #panelFit > .fit-opening-control { grid-row: 2; }
  #panelFit > .space-presets { grid-row: 3; }
  #panelFit > .fit-size-control { grid-row: 4; }
  #panelFit > .fit-size-range { grid-row: 5; }
  #panelFit > .fit-live-result { grid-row: 6; }
  #panelFit > .fit-size-presets { grid-row: 8; margin-top: 0.9rem; }
  #panelFit > .fit-clearance-control { grid-row: 9; margin-top: 0.75rem; }
  #panelFit > .fit-maximum-action { grid-row: 10; }
  #panelFit > .fit-advanced-options { grid-row: 11; }

  #panelCompare > .panel-heading { grid-row: 1; margin-top: 1rem; }
  #panelCompare > .compare-inputs { grid-row: 2; }
  #panelCompare > .live-summary { grid-row: 3; }
  #panelCompare > .preset-comparisons { grid-row: 5; margin-top: 0.9rem; }
  #panelCompare > .comparison-note { grid-row: 6; }

  .control-error { grid-row: 12; }
  .rail-actions { grid-row: 13; margin-bottom: 1rem; }

  .output-area {
    border-top: 1px solid var(--studio-line);
  }

  .visual-stage {
    height: 28rem;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 3.65rem;
  }

  .brand__text {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .intro--studio {
    padding: 0.7rem 1rem 0.35rem;
  }

  .intro--studio h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .intro--studio .intro__lede {
    font-size: 0.9rem;
  }

  .calculator {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .mode-tabs {
    position: sticky;
    top: 3.65rem;
    z-index: 40;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding: 0.45rem;
  }

  .mode-tabs__primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .mode-tab {
    min-height: 3.65rem;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem;
    border-radius: 0.72rem;
  }

  .mode-tab__number {
    width: 1.72rem;
    height: 1.72rem;
    border-radius: 0.52rem;
    font-size: 0.58rem;
  }

  .mode-tab strong {
    font-size: 0.78rem;
  }

  .mode-tab small {
    display: none;
  }

  .mode-tab--utility {
    width: 2.85rem;
    min-height: 3.65rem;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .mode-tab--utility svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .control-panel.is-active > .panel-heading,
  .control-panel.is-active > .field,
  .control-panel.is-active > .field-cluster,
  .control-panel.is-active > .range-control,
  .control-panel.is-active > .live-summary,
  .control-panel.is-active > .preset-row,
  .control-panel.is-active > .space-presets,
  .control-panel.is-active > .panel-primary-actions,
  .control-panel.is-active > .button,
  .control-panel.is-active > .advanced-options,
  .control-panel.is-active > .compare-inputs,
  .control-panel.is-active > .preset-comparisons,
  .control-panel.is-active > .comparison-note,
  .control-error,
  .rail-actions {
    margin-inline: 0.8rem;
  }

  .panel-heading {
    margin-bottom: 0.45rem;
  }

  .panel-heading__step {
    color: #595d57;
  }

  .field__help {
    color: #5c605a;
  }

  .live-summary dt {
    color: #555a54;
  }

  .panel-heading h2 {
    font-size: 1.32rem;
  }

  .number-input--stepper {
    min-height: 3.8rem;
  }

  .number-input--stepper input {
    min-height: 3.7rem;
    font-size: 2.4rem;
  }

  .number-step {
    min-height: 3.75rem;
  }

  .live-summary {
    margin-bottom: 0.35rem;
  }

  .output-heading--studio {
    min-height: 4.25rem;
    flex-wrap: wrap;
    padding: 0.52rem 0.75rem;
  }

  .output-heading--studio h2 {
    max-width: 15rem;
    font-size: 0.96rem;
  }

  .output-heading__label,
  .output-heading--studio .output-heading__note {
    font-size: 0.57rem;
  }

  .stage-toolbar {
    width: 100%;
    justify-content: space-between;
    gap: 0.3rem;
  }

  .stage-toggle {
    gap: 0.1rem;
    padding: 0.14rem;
  }

  .stage-toggle button {
    min-height: 1.85rem;
    padding: 0 0.48rem;
    font-size: 0.56rem;
  }

  .stage-reset {
    width: 2.1rem;
    min-height: 2.1rem;
  }

  .stage-reference-control {
    padding-left: 0.38rem;
  }

  .stage-reference-control > span {
    display: none;
  }

  .stage-reference-control select {
    min-width: 7.2rem;
    padding-left: 0.42rem;
    font-size: 0.6rem;
  }

  .visual-stage {
    height: 23rem;
  }

  .stage-hud {
    top: 0.55rem;
    left: 0.55rem;
    max-width: calc(100% - 1.1rem);
    padding: 0.48rem 0.58rem;
  }

  .stage-hud strong {
    font-size: 1.02rem;
  }

  .stage-hud small {
    font-size: 0.53rem;
  }

  .stage-hud__reference {
    max-width: 15rem;
  }

  .stage-state-banner {
    top: 5.25rem;
    right: 0.65rem;
    left: 0.65rem;
    max-width: none;
  }

  .stage-gesture-hint {
    left: 0.7rem;
    bottom: 0.65rem;
    font-size: 0.55rem;
  }

  .fit-badge {
    top: auto;
    right: 0.65rem;
    bottom: 0.65rem;
    left: auto;
    max-width: 64%;
    min-height: 2.45rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.62rem;
  }

  .fit-gap-readout {
    display: none;
  }

  .tv-resize-handle {
    right: -1rem;
    bottom: -1rem;
    width: 2.35rem;
    height: 2.35rem;
  }

  .result-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-strip > div {
    min-height: 4.6rem;
    border-bottom: 1px solid var(--studio-line);
  }

  .output-footnote {
    padding: 0.55rem 0.75rem;
  }

  .room-wall {
    inset: 6% 2% 12%;
  }

  .visual-stage::after {
    display: none;
  }
}

@media (max-width: 430px) {
  .header-actions .button span {
    display: none;
  }

  .header-actions .button {
    width: 2.65rem;
    padding: 0;
  }

  .fit-opening-control {
    padding: 0.72rem;
  }

  .field-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visual-stage {
    height: 21.5rem;
  }

  .scale-reference__label {
    display: none;
  }

  .stage-hud {
    max-width: calc(100% - 1.1rem);
  }
}

@media (max-width: 760px) {
  .stage-toggle button,
  .stage-reference-control select,
  .stage-reset {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-scene,
  .tv-visual,
  .space-frame,
  .scale-reference {
    transition: none !important;
  }
}

@media print {
  .stage-toolbar,
  .stage-gesture-hint,
  .stage-state-banner,
  .scale-reference,
  .tv-resize-handle,
  .mode-tab--utility,
  .panel-primary-actions,
  .fit-maximum-action {
    display: none !important;
  }

  .visual-stage {
    background: white !important;
  }

  .stage-hud {
    color: black;
    background: white;
  }
}
