/* ho1 — 생활 계산기(공학용·퍼센트·BMI·날짜·단위변환) 전용 스타일
 *
 * calc.css 의 카드·탭·하단 설명 스타일을 그대로 쓰고,
 * 이 파일은 도구별 화면만 담당합니다.
 * 문구는 각 언어 페이지, 로직은 basic-calc.js 에 있습니다.
 */

/* ── 상단 가로 배너 ──
 * 헤더 바로 아래 전체 폭. 대출·연봉 계산기의 .ad-top 과 같은 규격입니다.
 * 모바일에서는 AdSense 가 가로 배너 자리에 세로로 긴 광고를 채워 계산기를
 * 화면 밖으로 밀어내는 일이 있어 높이를 60px 로 묶습니다.
 * 나중에 삽입되는 iframe 까지는 CSS 로 못 잡아서 basic-calc.js 가 한 번 더 누릅니다. */
.calc-ad-top {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.calc-ad-top .adsbygoogle {
  width: 728px;
  max-width: 100%;
  height: 90px;
}
@media (max-width: 900px) {
  .calc-ad-top {
    padding: 0;
    height: 60px !important;
    max-height: 60px !important;
    min-height: unset !important;
    overflow: hidden !important;
  }
  .calc-ad-top .adsbygoogle {
    height: 60px !important;
    max-height: 60px !important;
    width: 100% !important;
  }
}

/* ── 3단 레이아웃 (좌우 사이드 광고) ──
 * 대출·연봉 계산기의 .layout 과 같은 규격입니다. calc.css 의 .calc-layout 은
 * 단일 컬럼이라 사이드 자리가 없어서, 이 페이지들만 쓰는 껍데기를 따로 둡니다.
 *
 * max-width 1244px 은 가운데 칸이 정확히 860px 이 되도록 역산한 값입니다.
 * (1244 − 좌우 padding 24 = 1220, 1220 − 160 − 160 − gap 40 = 860)
 * 아래 .calc-info 도 860px 이라 카드와 폭이 딱 맞습니다. */
.calc-shell {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 12px;
  gap: 20px;
  align-items: start;
  box-sizing: border-box;
}
.calc-ad-side {
  position: sticky;
  top: 20px;
}
.calc-ad-side .adsbygoogle {
  display: block;
  width: 160px;
  height: 600px;
}

/* 좁은 화면에서는 사이드를 걷어내고 본문만 남깁니다.
 * 해당 광고 자리는 basic-calc.js 가 DOM 에서 아예 제거하므로
 * 보이지 않는 자리에 광고를 요청하는 일은 없습니다. */
@media (max-width: 900px) {
  .calc-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 1200px;
    padding: 16px 12px;
    gap: 0;
  }
}

/* ── 도구 패널 전환 ── */
.bc-panel { display: none; padding: 26px 32px 30px; }
.bc-panel.is-active { display: block; }

.bc-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.7;
}

/* ── 공통 액션 버튼 ── */
.bc-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  margin-top: 22px;
}
.bc-btn {
  padding: 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, background 0.2s;
}
.bc-btn:active { transform: scale(0.99); }
.bc-btn-reset {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
}
.bc-btn-reset:hover { background: #f8fafc; border-color: #cbd5e1; }
.bc-btn-run {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  color: #fff;
}
.bc-btn-run:hover { opacity: 0.92; }

/* ─────────────────────────────
   1. 공학용 계산기
───────────────────────────── */
.bc-display {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  text-align: right;
  overflow: hidden;
}
.bc-expr {
  min-height: 20px;
  font-size: 14px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  line-height: 1.5;
}
.bc-out {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  line-height: 1.2;
}
.bc-out.is-error { font-size: 17px; color: #dc2626; }

.bc-pad {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}
.bc-key {
  padding: 15px 4px;
  border: none;
  border-radius: 10px;
  background: #eef2f7;
  color: #334155;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.bc-key:hover { background: #e2e8f0; }
.bc-key:active { transform: scale(0.95); }
.bc-key.is-num { background: #f8fafc; color: #1e293b; font-size: 16px; }
.bc-key.is-num:hover { background: #eef2f7; }
.bc-key.is-fn { font-size: 13px; color: #475569; }
.bc-key.is-op { color: #6366f1; font-size: 16px; }
.bc-key.is-clear { color: #dc2626; }
.bc-key.is-eq {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 18px;
}
.bc-key.is-eq:hover { opacity: 0.92; background: linear-gradient(135deg, #3b82f6, #6366f1); }
.bc-key.is-toggle { font-size: 12.5px; }
.bc-key.is-on { background: #dbeafe; color: #2563eb; }

/* 각도 단위 표시 */
.bc-angle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

/* ─────────────────────────────
   2. 퍼센트 계산
───────────────────────────── */
.bc-pct-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.bc-pct-row:last-of-type { border-bottom: none; }
.bc-pct-row input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 14.5px;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bc-pct-row input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}
.bc-pct-row input::placeholder { color: #cbd5e1; font-size: 13px; }
.bc-pct-mid {
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.bc-pct-q {
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}
.bc-pct-out {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 14px;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  display: none;
  word-break: break-all;
}
.bc-pct-out.is-visible { display: block; }

/* ─────────────────────────────
   3. BMI
───────────────────────────── */
.bc-radios {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}
.bc-radio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.bc-radio input { accent-color: #3b82f6; width: 17px; height: 17px; cursor: pointer; }

.bc-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.bc-field { display: flex; flex-direction: column; gap: 6px; }
.bc-field label { font-size: 13px; font-weight: 600; color: #64748b; }
.bc-field-in { position: relative; display: flex; align-items: center; }
.bc-field-in input,
.bc-field-in select {
  width: 100%;
  padding: 11px 44px 11px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 15px;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.bc-field-in select { padding-right: 13px; }
.bc-field-in input:focus,
.bc-field-in select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}
.bc-field-in input::placeholder { color: #cbd5e1; }
.bc-field-unit {
  position: absolute;
  right: 12px;
  font-size: 12.5px;
  color: #94a3b8;
  pointer-events: none;
}

.bc-result {
  margin-top: 22px;
  display: none;
}
.bc-result.is-visible { display: block; }

.bc-bmi-head {
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px 22px;
  text-align: center;
}
.bc-bmi-num {
  font-size: 34px;
  font-weight: 800;
  color: #2563eb;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.bc-bmi-label { font-size: 12px; color: #6366f1; font-weight: 700; margin-bottom: 4px; }
.bc-bmi-verdict {
  margin-top: 8px;
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.bc-bmi-extra {
  margin-top: 14px;
  font-size: 13.5px;
  color: #475569;
  line-height: 1.75;
}

.bc-scale {
  margin-top: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.bc-scale-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid #f1f5f9;
}
.bc-scale-row:last-child { border-bottom: none; }
.bc-scale-row.is-hit { background: #eff6ff; font-weight: 700; color: #2563eb; }
.bc-scale-name { color: #334155; }
.bc-scale-row.is-hit .bc-scale-name { color: #2563eb; }
.bc-scale-range { color: #94a3b8; font-variant-numeric: tabular-nums; }
.bc-scale-row.is-hit .bc-scale-range { color: #3b82f6; }

/* ─────────────────────────────
   4. 날짜 계산
───────────────────────────── */
.bc-sub {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bc-chip {
  padding: 8px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.bc-chip:hover { border-color: #bfdbfe; color: #3b82f6; }
.bc-chip.is-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.bc-sub-panel { display: none; }
.bc-sub-panel.is-active { display: block; }

.bc-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.bc-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.bc-seg {
  display: flex;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  height: 45px;
}
.bc-seg button {
  padding: 0 18px;
  border: none;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bc-seg button.is-active { background: #3b82f6; color: #fff; }

.bc-out-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.bc-out-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px 17px;
}
.bc-out-card.is-key {
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border-color: #bfdbfe;
  grid-column: 1 / -1;
}
.bc-out-label { font-size: 12px; font-weight: 600; color: #94a3b8; margin-bottom: 5px; }
.bc-out-card.is-key .bc-out-label { color: #6366f1; }
.bc-out-value {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.bc-out-card.is-key .bc-out-value { font-size: 21px; color: #2563eb; }

/* ─────────────────────────────
   5. 단위 변환
───────────────────────────── */
.bc-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 18px;
}
.bc-cat {
  padding: 7px 13px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bc-cat:hover { background: #eff6ff; color: #3b82f6; }
.bc-cat.is-active { background: #3b82f6; color: #fff; }

.bc-conv {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.bc-conv select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 14px;
  color: #1e293b;
}
.bc-conv select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.bc-swap {
  width: 40px;
  height: 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.bc-swap:hover { background: #eff6ff; border-color: #bfdbfe; color: #3b82f6; }

.bc-conv-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.bc-conv-io input {
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bc-conv-io input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #fff;
}
.bc-conv-res {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 15px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  border: 1px solid #bfdbfe;
  font-size: 19px;
  font-weight: 700;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  text-align: right;
}

.bc-all {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px 16px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.bc-all-item {
  font-size: 13px;
  color: #64748b;
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}
.bc-all-num {
  font-weight: 700;
  color: #ea580c;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.bc-all-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────────────────────
   반응형
───────────────────────────── */
@media (max-width: 700px) {
  .bc-panel { padding: 20px; }
  .bc-pad { gap: 5px; }
  .bc-key { padding: 13px 2px; font-size: 13px; }
  .bc-key.is-num { font-size: 14.5px; }
  .bc-key.is-fn, .bc-key.is-toggle { font-size: 11.5px; }
  .bc-out { font-size: 25px; }

  .bc-pct-row {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }
  .bc-pct-q { grid-column: 1 / -1; color: #64748b; font-size: 12.5px; }

  .bc-fields { grid-template-columns: 1fr; }
  .bc-date-grid { grid-template-columns: 1fr; }
  .bc-out-grid { grid-template-columns: 1fr; }
  .bc-out-card.is-key { grid-column: 1; }

  .bc-conv { grid-template-columns: 1fr; }
  .bc-swap { width: 100%; height: 36px; }
  .bc-conv-io { grid-template-columns: 1fr; }
  .bc-all { grid-template-columns: repeat(2, 1fr); padding: 14px; }
  .bc-actions { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .bc-all { grid-template-columns: 1fr; }
}
