/* 원본 데스크톱 스타일 */
body { margin: 0; font-family: "Malgun Gothic", sans-serif; font-size: 14px; }
#side { position: absolute; top: 0; bottom: 0; left: 0; width: 400px; overflow-y: auto; padding: 12px; box-sizing: border-box; background: #f7f7f7; }
#map { position: absolute; top: 0; bottom: 0; left: 400px; right: 0; }
select, button { width: 100%; padding: 6px; margin-top: 6px; font-size: 14px; box-sizing: border-box; }
button { background: #2b6cb0; color: white; border: 0; cursor: pointer; }
.box { background: white; border: 1px solid #ddd; padding: 8px 10px; margin-top: 10px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { border-bottom: 1px solid #eee; padding: 3px; text-align: left; }
.box td:first-child { min-width: 76px; }
.gray { color: #777; font-size: 12px; }
#bld { width: 100%; padding: 6px; margin-top: 6px; box-sizing: border-box; font-size: 14px; }
button:disabled { opacity: .6; cursor: default; }
#status:empty { display: none; }
.notes { padding-left: 18px; margin: 4px 0; }
.materials-link { position: fixed; top: 10px; right: 10px; z-index: 1100; padding: 8px 12px; background: #2b6cb0; color: white; text-decoration: none; border: 1px solid white; font: 14px "Malgun Gothic", sans-serif; min-height: 36px; box-sizing: border-box; }

/* 좁은 화면에서만 배치와 터치 크기를 조정하고 원본 색상과 표는 유지. */
@media (max-width: 800px) {
  body { display: grid; grid-template-areas: "controls" "map" "results"; grid-template-columns: minmax(0, 1fr); background: #f7f7f7; }
  #side { display: contents; }
  #controls { grid-area: controls; min-width: 0; padding: 12px; }
  #map { grid-area: map; position: relative; inset: auto; width: 100%; height: 45vh; height: 45svh; min-height: 280px; z-index: 0; }
  #out { grid-area: results; min-width: 0; padding: 0 12px 12px; scroll-margin-top: 8px; }
  #bld, select, button { font-size: 16px; min-height: 44px; padding: 10px; }
  button { touch-action: manipulation; }
  td, th { overflow-wrap: anywhere; }
  .materials-link { min-height: 44px; display: flex; align-items: center; top: 4px; right: 6px; }
  #controls > h3 + .gray { padding-right: 92px; }
}
