/* ============================================================
   금니시세몰 — 금시세 / 계산프로그램 페이지 전용
   (about.css 의 레이아웃 .about-layout / .side 재사용)
   ============================================================ */

/* block header with date on the right */
.block-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px; flex-wrap: wrap; margin-bottom: 20px;
}
.block-head .block-title { margin-bottom: 0; flex-shrink: 0; white-space: nowrap; }
.date-tag {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13.5px; font-weight: 700; color: var(--gold-l);
  background: var(--bg-2); border: 1px solid var(--line-2);
  padding: 7px 14px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.date-tag .ic { color: var(--orange); display: grid; place-items: center; }
.note-line { font-size: 13px; color: var(--mute); margin-top: 14px; }

/* ---- TODAY PRICE TABLE ---- */
.price-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow-card);
}
.price-scroll { overflow-x: auto; }
.gp-table { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 0; }
.gp-table th, .gp-table td {
  padding: 15px 22px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.gp-table th:first-child, .gp-table td:first-child {
  text-align: left; position: sticky; left: 0; z-index: 1; background: var(--bg-2);
}
.gp-table thead th {
  background: #2a2521; color: #f3ede1; font-size: 13px; font-weight: 700;
  letter-spacing: .03em; border-bottom: 1px solid var(--line);
}
.gp-table thead th:first-child { background: #2a2521; z-index: 2; }
.gp-table tbody td { border-bottom: 1px solid var(--line); transition: background .15s; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-table tbody tr:hover td { background: rgba(255,95,0,.04); }
.gp-table tbody tr:hover td:first-child { background: #fff4ec; }
.gp-table tbody tr.group-sep td { border-top: 2px solid var(--line-2); }
.gp-table .kind { font-weight: 700; font-size: 15.5px; }
.gp-table .kind .k-badge {
  display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 5px; margin-right: 8px;
  background: rgba(196,154,60,.18); color: var(--gold-l); font-weight: 700; vertical-align: 1px;
}
.gp-table .unit { color: var(--dim); }
.gp-table .base { font-weight: 800; font-size: 16px; }
.gp-table .base .won { font-size: 12px; color: var(--mute); font-weight: 600; margin-left: 2px; }
.chg { font-weight: 700; font-size: 14px; white-space: nowrap; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); } .chg.flat { color: var(--mute); }
.chg .arw { font-size: 11px; margin-right: 3px; }

/* ---- HISTORY (날짜별) TABLE ---- */
.history-wrap {
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-card); background: var(--bg-2);
}
.history-scroll { overflow-x: auto; }
.history-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.history-table th, .history-table td {
  padding: 13px 16px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.history-table th:first-child, .history-table td:first-child {
  text-align: left; position: sticky; left: 0; background: var(--bg-2);
}
.history-table thead th {
  background: #2a2521; color: #f3ede1; font-weight: 700; font-size: 13px;
}
.history-table thead th:first-child { background: #2a2521; color: #f3ede1; }
.history-table tbody tr { border-bottom: 1px solid var(--line); }
.history-table tbody tr:last-child { border-bottom: 0; }
.history-table tbody tr:hover td { background: rgba(255,95,0,.04); }
.history-table tbody tr:hover td:first-child { background: #fff4ec; }
.history-table .date { font-weight: 700; color: var(--text); }
.history-table .pcell { color: var(--dim); }
.history-table .pcell.k24 { color: var(--text); font-weight: 700; }

/* ============================================================
   CALCULATOR
   ============================================================ */
/* summary bar */
.calc-summary {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 22px 26px; border-radius: 16px; margin-bottom: 22px;
  background: linear-gradient(100deg, rgba(255,95,0,.10), rgba(196,154,60,.12));
  border: 1px solid rgba(255,95,0,.28);
}
.calc-summary .cs-label { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.calc-summary .cs-label .ic { color: var(--orange); display: grid; place-items: center; }
.calc-summary .cs-amount { font-size: clamp(26px, 4vw, 34px); font-weight: 900; color: var(--orange-d); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.calc-summary .cs-amount .won { font-size: 16px; color: var(--gold-l); margin-left: 4px; }

/* tabs */
.calc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.calc-tab {
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--dim); font-size: 14.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; cursor: default;
}
.calc-tab .t-price { font-size: 12px; color: var(--mute); font-weight: 600; margin-left: 6px; }

/* calc table */
.calc-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card); }
.calc-table { width: 100%; border-collapse: collapse; }
.calc-table thead th {
  background: #f4f0e8; color: var(--dim); font-size: 13px; font-weight: 700;
  padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line);
}
.calc-table thead th.right { text-align: right; }
.calc-table tbody td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.calc-table tbody tr:last-child td { border-bottom: 0; }
.calc-w { width: 150px; }
td.calc-w { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.calc-w input {
  flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 9px;
  color: var(--text); font-size: 15px; padding: 10px 12px; font-variant-numeric: tabular-nums; text-align: right;
}
.calc-w input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,95,0,.18); }
.calc-w .u { font-size: 13px; color: var(--mute); flex: none; }
.calc-item { position: relative; }
.calc-name {
  display: inline-block; font-size: 15px; font-weight: 700; color: var(--text);
  cursor: default; border-bottom: 1px dashed var(--line-2); padding-bottom: 1px;
  white-space: nowrap;
}
/* hover image preview */
.calc-item .preview {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 20;
  width: 150px; height: 110px; border-radius: 10px; opacity: 0; pointer-events: none;
  transform: translateY(-6px); transition: opacity .16s, transform .16s;
  box-shadow: var(--shadow);
}
.calc-item .preview img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block;
  border: 1px solid var(--line);
}
.calc-item:hover .preview { opacity: 1; transform: translateY(0); }
/* 마지막 행은 카드 하단(overflow:hidden)에 가려지므로 미리보기를 위쪽으로 표시 */
.calc-table tbody tr:last-child .calc-item .preview {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(6px);
}
.calc-table tbody tr:last-child .calc-item:hover .preview {
  transform: translateY(0);
}
.calc-amount { text-align: right; font-weight: 800; font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-amount .won { font-size: 12px; color: var(--mute); font-weight: 600; margin-left: 2px; }
.calc-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; background: #faf7f1; }
.calc-foot-note { font-size: 13px; color: var(--mute); }
.calc-reset { font-size: 13.5px; color: var(--mute); background: transparent; border: 0; font-weight: 600; white-space: nowrap; }
.calc-reset:hover { color: var(--orange-d); }
.calc-hint { font-size: 12.5px; color: var(--mute); margin-top: 14px; }
@media (max-width: 620px){
  .calc-w { width: 110px; }
  /* 모바일: 표를 가로 스크롤 → 품목명 한 줄 유지, 행 높이 동일 */
  .calc-scroll { overflow-x: auto; overflow-y: hidden; }
  .calc-table { min-width: 500px; }
}
