/* Hamrammr visual workspace. Presentation only; no planning or cart rules. */
@media screen {
  main { max-width: 1720px; padding-left: clamp(16px, 2vw, 32px); padding-right: clamp(16px, 2vw, 32px); }
  body > header { padding-left: max(24px, calc((100vw - 1656px) / 2)); padding-right: max(24px, calc((100vw - 1656px) / 2)); }
  .workspace { grid-template-columns: 292px minmax(0, 1fr); gap: 24px; }
  #room-preview { min-width: 0; }
  #room-preview .visual-head { flex-wrap: wrap; gap: 12px; }
  .room-preview-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
  #room-expand { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid #cfd3da; border-radius: 7px; background: #fff; color: #20252d; font-size: 13px; font-weight: 750; white-space: nowrap; }
  #room-expand:hover { background: #f1f3f6; border-color: #888f9a; }
  #room-expand:focus-visible { outline: 3px solid #bf1825; outline-offset: 3px; }
  #room-expand svg { width: 17px; height: 17px; flex: 0 0 17px; }
  #room-preview .tabs { padding: 14px 20px 0; gap: 7px; }
  #room-preview .tab { min-height: 40px; padding: 9px 16px; font-size: 13px; }
  #room-preview .drawing { height: clamp(500px, 68vh, 780px); min-height: 0; padding: 18px 22px; overflow: hidden; }
  #room-preview .drawing > svg { display: block; width: 100%; height: 100%; max-width: none; max-height: none; }
  .room-view-captions { padding: 0 22px 10px; color: #535e6c; font-size: 12px; line-height: 1.5; }
  .room-view-captions:empty { display: none; }
  .room-view-captions p { margin: 3px 0; }
  .room-view-captions p:first-child { font-weight: 650; color: #303944; }
  .room-view-captions .room-view-caution { color: #a4142b; font-weight: 650; }
  #room-preview .legend { font-size: 12px; }
  body.room-preview-open { overflow: hidden; }
  #room-preview.is-room-expanded { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); border: 0; border-radius: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; background: #fff; }
  #room-preview.is-room-expanded::backdrop { background: #fff; }
  #room-preview.is-room-expanded .visual-head { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; background: #fff; }
  #room-preview.is-room-expanded .tabs,
  #room-preview.is-room-expanded .legend,
  #room-preview.is-room-expanded .smallprint,
  #room-preview.is-room-expanded .metrics,
  #room-preview.is-room-expanded .room-view-captions { flex: 0 0 auto; }
  #room-preview.is-room-expanded .drawing { flex: 1 1 auto; height: auto; max-height: none; aspect-ratio: auto; min-height: 180px; padding: 16px 28px; }
  #room-preview.is-room-expanded #fit-result { flex-shrink: 0; max-height: 5em; overflow-y: auto; }
  #room-preview.is-room-expanded .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #room-preview.is-room-expanded .metric { padding: 10px 18px; }
  @media (min-width: 901px) and (max-width: 1100px) {
    .workspace { grid-template-columns: 270px minmax(0, 1fr); gap: 18px; }
  }
  @media (max-width: 900px) {
    .workspace { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    #room-preview .drawing { height: auto; aspect-ratio: var(--room-view-ratio, 1.5); max-height: 600px; padding: 14px; }
  }
  @media (max-width: 600px) {
    #room-preview .visual-head { padding: 16px; }
    #room-preview .visual-head h2 { font-size: 19px; }
    .room-preview-tools { width: 100%; justify-content: space-between; }
    #room-preview .tabs { padding: 12px 14px 0; gap: 6px; }
    #room-preview .tab { padding: 9px 12px; }
    #room-preview .drawing { height: auto; max-height: 510px; padding: 12px 10px; }
    .room-view-captions { padding: 0 16px 12px; font-size: 12px; }
    #room-preview.is-room-expanded .visual-head { padding: 12px 16px; }
    #room-preview.is-room-expanded .visual-head h2 { font-size: 17px; }
    #room-preview.is-room-expanded .drawing { height: auto; padding: 12px 10px; }
    #room-preview.is-room-expanded .metric { padding: 10px 8px; }
    #room-preview.is-room-expanded .metric strong { font-size: 17px; }
    #room-preview.is-room-expanded .smallprint { padding-bottom: 8px; }
  }
}
@media print {
  #room-expand { display: none !important; }
  #room-preview.is-room-expanded { position: static !important; width: auto !important; height: auto !important; display: block !important; }
  #room-preview .drawing { height: 350px; padding: 10px; }
  #room-preview .drawing > svg { width: 100%; height: 100%; }
  .room-view-captions { font-size: 10px; padding: 0 15px 10px; }
}
