/* 큰 수 계산기 스타일 — in_history.php 계열(블루 팔레트)과 톤 일치, 모바일 우선 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
  background: #f5f5f5; color: #333; line-height: 1.55;
  /* 하단 AdFit 고정 배너(모바일 320x100 + 패딩)와 겹치지 않도록 여백 확보 */
  padding-bottom: 130px;
}

.site-header {
  background: linear-gradient(135deg, #2C3E50, #3498DB);
  color: #fff; padding: 22px 16px 26px; text-align: center;
}
.site-header h1 { font-size: 24px; margin-bottom: 6px; }
.site-header .subtitle { font-size: 14px; opacity: 0.9; }
.site-header nav { margin-top: 12px; font-size: 13px; }
.site-header nav a { color: #cfe7fa; text-decoration: none; margin: 0 8px; }
.site-header nav a:hover { text-decoration: underline; }

.container { max-width: 760px; margin: 0 auto; padding: 20px 14px; }

.section-title {
  font-size: 17px; font-weight: bold; color: #2C3E50;
  border-left: 4px solid #3498DB; padding-left: 12px; margin: 28px 0 12px;
}

/* ---- 계산기 앱 ---- */
.calc-app {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08); margin-top: -34px;
}
.calc-options {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
  font-size: 13px; color: #555; margin-bottom: 10px;
}
.calc-options label { display: inline-flex; align-items: center; gap: 6px; }
.calc-options select {
  font-size: 13px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 6px; background: #fff;
}
#calc-input {
  width: 100%; font-size: 20px; padding: 12px 14px;
  border: 2px solid #3498DB; border-radius: 10px; outline: none;
  font-family: Consolas, 'Courier New', monospace; direction: ltr;
}
#calc-input:focus { border-color: #2C3E50; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.example-chip {
  border: 1px solid #BDE0F5; background: #EBF5FB; color: #2980B9;
  border-radius: 16px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  font-family: Consolas, 'Courier New', monospace;
}
.example-chip:hover { background: #D6EAF8; }

.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.keypad button {
  font-size: 18px; padding: 12px 0; border: 1px solid #d8dde2; border-radius: 10px;
  background: #fafbfc; cursor: pointer; color: #2C3E50; touch-action: manipulation;
}
.keypad button:active { background: #D6EAF8; }
.keypad .op { background: #EBF5FB; color: #2980B9; font-weight: bold; }
.keypad .danger { background: #FDEDEC; color: #C0392B; }
.keypad .eq { grid-column: span 4; background: #3498DB; color: #fff; font-weight: bold; font-size: 20px; }
.keypad .eq:active { background: #2C81BA; }

.calc-status { min-height: 20px; font-size: 13px; margin-top: 10px; }
.calc-status.ok { color: #1E8449; }
.calc-status.error { color: #C0392B; font-weight: bold; }

.result-wrap { position: relative; margin-top: 6px; }
#calc-result {
  width: 100%; min-height: 56px; max-height: 300px; overflow: auto;
  background: #F8FAFB; border: 1px solid #e0e6ea; border-radius: 10px;
  padding: 12px 14px; font-family: Consolas, 'Courier New', monospace;
  font-size: 17px; word-break: break-all; white-space: pre-wrap;
}
.result-tools { display: flex; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; }
#calc-copy, #calc-download {
  border: 1px solid #3498DB; background: #fff; color: #2980B9;
  border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
#calc-copy:hover, #calc-download:hover { background: #EBF5FB; }

/* ---- 기록 ---- */
#calc-history { list-style: none; }
#calc-history li { margin-bottom: 6px; }
#calc-history .empty { color: #999; font-size: 13px; }
.hist-item {
  width: 100%; text-align: left; background: #fff; border: 1px solid #e0e6ea;
  border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-family: Consolas, 'Courier New', monospace;
}
.hist-item:hover { border-color: #3498DB; }
.hist-expr { color: #2C3E50; font-weight: bold; word-break: break-all; }
.hist-res { color: #777; word-break: break-all; }

/* ---- 설명/FAQ ---- */
.info-card {
  background: #fff; border-radius: 10px; padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 12px; font-size: 14px;
}
.info-card h3 { font-size: 15px; color: #2C3E50; margin-bottom: 6px; }
.info-card p + p { margin-top: 8px; }
.info-card code {
  background: #EBF5FB; color: #2980B9; border-radius: 4px; padding: 1px 5px;
  font-family: Consolas, 'Courier New', monospace; font-size: 13px;
}
.info-card ul { padding-left: 20px; }
.info-card li { margin: 4px 0; }

.site-footer {
  text-align: center; font-size: 12px; color: #888; padding: 24px 16px 8px;
}
.site-footer a { color: #2980B9; text-decoration: none; }

@media (min-width: 768px) {
  body { padding-bottom: 120px; } /* PC 728x90 배너 기준 */
  .keypad button { font-size: 19px; padding: 14px 0; }
}
