/* 전체 기본 스타일 */
body {
  background-color: #f5f5f5;
  font-family: 'Noto Sans', sans-serif;
}

/* 그리드 카드 레이아웃 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* 카드 스타일 */
.card {
  width: 100%;
  max-width: 240px;
  height: 240px;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 10px;
  text-align: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
}

.card img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.card-name {
  font-weight: bold;
  font-size: 16px;
  color: #000;
  padding-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card a {
  text-decoration: none;
  color: inherit;
}

/* 푸터 스타일 */
.footer-bottom,
.footer-policy {
  max-width: 1100px;
  margin: 0 auto;
  padding: 15px 20px;
  font-size: 12px;
  text-align: center;
  color: #aaa;
}

.footer-bottom a {
  color: #aaa;
  text-decoration: none;
  margin: 0 5px;
  font-weight: normal;
}

.footer-bottom a:hover {
  text-decoration: underline;
}

.footer-policy a {
  color: #888;
  text-decoration: underline;
}

/* 표(table) 전체 기본 스타일 */
table {
  width: auto;
  max-width: 800px;
  border-collapse: collapse;
  margin: 0 0 20px 0;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: initial;
}

thead {
  background-color: #f2f2f2;
  color: #000;
}

th, td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

tbody tr:hover {
  background-color: #f1f1f1;
}

.building-table {
  width: auto;
  max-width: 800px;
  margin: 0 0 20px 0;
  border-collapse: collapse;
}

.building-table th,
.building-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
}

.building-table th {
  background-color: #f2f2f2;
}

/* 반응형 모바일 대응 */
@media screen and (max-width: 768px) {
  table,
  .building-table {
    font-size: 12px;
  }

  th, td {
    padding: 6px;
  }
}

/* ===== Kingshot Calculator – scoped styles ===== */
#calc-form {
  max-width: 760px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Apple SD Gothic Neo, "Noto Sans KR", sans-serif;
}

#calc-form label {
  display: block;
  font-weight: 600;
  margin: 14px 0 6px;
  color: #111827;
}

#calc-form input[type="text"],
#calc-form input[type="number"],
#calc-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.3;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#calc-form input[type="number"]::-webkit-outer-spin-button,
#calc-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#calc-form input:focus,
#calc-form select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

#calc-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

#calc-form .checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#calc-form .btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform .03s ease, background .15s ease, opacity .15s ease;
  text-align: center;
}

#calc-form .btn-primary { background: #0f67b1; color: #fff; }
#calc-form .btn-secondary { background: #0b7dda; color: #fff; }
#calc-form .btn-ghost { background: #f3f4f6; color: #111827; }

#calc-form .btn:hover { opacity: .95; }
#calc-form .btn:active { transform: translateY(1px); }

#calc-form + .calc-result,
.calc-result {
  max-width: 760px;
  margin: 16px auto 0;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 10px;
  padding: 16px;
  color: #111827;
}

/* 작은 화면 대응 */
@media (max-width: 520px) {
  #calc-form { padding: 0 10px; }
  #calc-form .btn { padding: 11px 12px; }
}

/* === SIZE OVERRIDE (임시로 크게 보기) === */
html { font-size: 16px; }
body { font-size: 16px; }

.wrap { max-width: 1100px; }
h1 { font-size: 32px; }

input { height: 48px; font-size: 16px; }
.btn { height: 48px; font-size: 16px; }

table { font-size: 14px; }
th, td { padding: 12px 10px; }

/* 결과값 문단 간격 완전히 없애기 */
#result p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.1 !important;
}

/* 노란 배경 검정 텍스트 카카오 오픈채팅 버튼 스타일 */
.kakao-openchat-btn {
  background-color: #ffdd00;
  color: #000000 !important; /* 기본 상태 글자색도 꼭 넣기 */
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.kakao-openchat-btn * {
  color: inherit !important; /* 내부 요소도 부모 색상 상속 강제 */
}

.kakao-openchat-btn:hover {
  background-color: #e6cc00;
  color: #000000 !important;
}

.kakao-openchat-btn:active {
  background-color: #cbb300;
  color: #000000 !important;
}
/* === Responsive Base === */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }

/* 카드 그리드: 화면폭에 따라 자동 개수 조정 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }

/* 카드 텍스트가 세로로 찢어지지 않게 */
.card-name { white-space: normal; word-break: keep-all; text-align: center; }

/* 표 가로 스크롤 래퍼 */
.table-wrap { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 표 기본 스타일 */
table { width: 100%; border-collapse: collapse; table-layout: auto; }
table th, table td { padding: 8px; border-bottom: 1px solid #e5e5e5; text-align: center; vertical-align: middle; }

/* 모바일 축소 */
@media (max-width: 768px) {
  body { font-size: 14px; }
  header { padding: 12px 16px; }
  main { padding: 24px 16px; }
  table th, table td { font-size: 12px; padding: 6px 4px; }
  .card { max-width: 100%; height: auto; }
}
.table-wrap {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

