/* Studio Lighting Simulator. Scoped to the new sheet and the mode switch.
   Does not change the site nav, viewport-fit, or other pages. */

.studio-segment {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.studio-segment .pill {
  min-height: 44px;
  min-width: 44px;
}

.sim {
  display: grid;
  gap: 12px;
}

.sim-disclaimer {
  margin: 0;
  line-height: 1.5;
}

.sim-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.sim-plan,
.sim-graph {
  position: relative;
  min-width: 0;
  background: #141f2c;
  border: 1px solid #2a3b4e;
  border-radius: 20px;
  padding: 14px;
}

.sim-badge {
  display: inline-block;
  border: 1px solid #426374;
  border-radius: 99px;
  padding: 4px 9px;
  color: #72d9c0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sim-canvas {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  background: #0c1823;
  touch-action: none;
}

.sim-canvas:focus-visible,
.sim-step:focus-visible,
.sim-distance:focus-visible,
.sim-choice:focus-visible {
  outline: 2px solid #72d9c0;
  outline-offset: 3px;
}

#simPlan {
  height: 280px;
}

#simGraph {
  height: 168px;
}

.sim-note,
.sim-graph-text,
.sim-status,
.sim-keys {
  margin: 8px 0 0;
  line-height: 1.45;
}

.sim-chip {
  display: grid;
  gap: 4px;
}

.sim-chip strong {
  font-size: 30px;
  line-height: 1.15;
  color: #72d9c0;
}

.sim-sheet {
  background: #141f2c;
  border: 1px solid #2a3b4e;
  border-radius: 20px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

.sim-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sim-step,
.sim-choice {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid #304358;
  background: #192738;
  color: #dceaf5;
  font: inherit;
}

.sim-choice[aria-pressed="true"],
.sim-step:active {
  background: #65d4b9;
  color: #071b1a;
  border-color: #65d4b9;
  font-weight: 800;
}

.sim-power-label {
  min-width: 4.5rem;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #eaf0f6;
}

.sim-distance {
  width: 6.5rem;
  min-height: 44px;
  font-size: 16px;
  background: #0b1520;
  color: #fff;
  border: 1px solid #40566a;
  border-radius: 10px;
  padding: 10px 12px;
}

.sim-unit {
  color: #a0b3c6;
}

.sim-details {
  background: #141f2c;
  border: 1px solid #2a3b4e;
  border-radius: 16px;
  padding: 12px 14px;
}

.sim-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #dceaf5;
}

.sim-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 900px) {
  .sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 380px);
    align-items: start;
  }

  .sim-graph {
    grid-column: 1;
  }

  .sim-sheet {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  #simPlan {
    height: 420px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .studio-segment {
    margin-bottom: 6px;
  }

  .sim {
    gap: 6px;
  }

  .sim-disclaimer {
    font-size: 13px;
    line-height: 1.35;
  }

  .sim-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    align-items: start;
    gap: 8px;
  }

  .sim-plan,
  .sim-graph,
  .sim-sheet {
    padding: 8px;
  }

  .sim-sheet {
    grid-column: 2;
    grid-row: 1 / span 2;
    max-height: calc(100vh - 16px);
    overflow: auto;
  }

  .sim-chip strong {
    font-size: 24px;
  }

  #simPlan {
    height: 148px;
  }

  #simGraph {
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sim-canvas {
    scroll-behavior: auto;
  }
}
