/* ============================================================
   계산기 공통 UI — loan-switch.html / costco-break-even.html
   모든 선택자는 .calc 안으로 한정합니다.
   ============================================================ */
.calc{
  --c-ink:#111827; --c-sub:#5b6577; --c-line:#e5e9f2; --c-brand:#2f6bff; --c-brand-d:#1d4ed8;
  --c-soft:#eef3ff; --c-good:#0b8a4f; --c-good-bg:#e9f7f0; --c-warn:#a15c00; --c-warn-bg:#fff6e6;
  --c-red:#d92d20; --c-red-bg:#fdecea; --c-navy:#12305f; --c-r:16px;
  max-width:820px; margin:26px auto 0;
  color:var(--c-ink); font-size:15px; line-height:1.6; letter-spacing:-0.01em;
}
.calc *{box-sizing:border-box;}
.calc h2,.calc h3,.calc p,.calc ul,.calc li,.calc dl,.calc dt,.calc dd,.calc span,.calc em,.calc b,.calc small{margin:0; padding:0;}
.calc ul{list-style:none;}
.calc button{font-family:inherit; cursor:pointer;}
.calc input,.calc select{-webkit-appearance:none; appearance:none;}
.calc [hidden]{display:none !important;}

.calc-hero{
  background:linear-gradient(135deg,#12305f 0%,#1f4f9e 62%,#2f6bff 100%);
  border-radius:20px; padding:22px 20px 20px; color:#fff;
  box-shadow:0 12px 26px rgba(18,48,95,.20); margin-bottom:14px;
}
.calc-badge{
  display:inline-block; font-size:11.5px; font-weight:700; letter-spacing:.02em;
  background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.28);
  padding:4px 10px; border-radius:999px; margin-bottom:10px;
}
.calc-title{font-size:22px; font-weight:800; line-height:1.32; letter-spacing:-0.025em;}
.calc-lead{margin-top:8px; font-size:13.5px; line-height:1.62; color:rgba(255,255,255,.88);}
.calc-lead b{color:#fff;}

.calc-card{
  background:#fff; border:1px solid var(--c-line); border-radius:var(--c-r);
  padding:18px 16px; margin-bottom:12px; box-shadow:0 6px 18px rgba(23,43,99,.05);
}
.calc-step{display:flex; align-items:center; gap:9px; margin-bottom:14px;}
.calc-num{
  flex:0 0 auto; width:24px; height:24px; border-radius:8px; background:var(--c-soft); color:var(--c-brand);
  font-size:13px; font-weight:800; display:flex; align-items:center; justify-content:center;
}
.calc-step h2{font-size:16px; font-weight:800; letter-spacing:-0.02em;}
.calc-h2{font-size:16px; font-weight:800; margin-bottom:10px; letter-spacing:-0.02em;}

.calc-grid2{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.calc-grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
.calc-field{margin-bottom:14px;}
.calc-field:last-child{margin-bottom:0;}
.calc-label{display:block; font-size:13px; font-weight:700; color:#333d52; margin-bottom:6px;}
.calc-input{
  display:flex; align-items:center; gap:8px; height:50px; padding:0 12px;
  background:#f8fafe; border:1px solid #dfe5f1; border-radius:12px;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.calc-input:focus-within{border-color:var(--c-brand); background:#fff; box-shadow:0 0 0 3px rgba(47,107,255,.13);}
.calc-input input, .calc-input select{
  flex:1 1 auto; min-width:0; width:100%; height:100%; border:0; background:transparent; outline:none;
  font-family:inherit; font-size:17px; font-weight:800; color:var(--c-ink); text-align:right;
  font-variant-numeric:tabular-nums;
}
.calc-input select{text-align:left; font-size:14.5px; font-weight:700; cursor:pointer; padding-right:2px;}
.calc-input input::placeholder{color:#aeb6c6; font-weight:600;}
.calc-input input::-webkit-outer-spin-button,
.calc-input input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.calc-unit{flex:0 0 auto; font-size:12.5px; font-weight:700; color:var(--c-sub);}
.calc-input-sm{height:42px; padding:0 10px;}
.calc-input-sm input{font-size:15px;}
.calc-input-sm select{font-size:13.5px;}
.calc-tip{margin-top:6px; font-size:11.5px; line-height:1.55; color:#8a93a6;}
.calc-tip b{color:#6a7387;}
.calc-mt{margin-top:4px;}

/* 세그먼트 (라디오) */
.calc-seg{display:flex; gap:5px; background:#eef1f8; padding:4px; border-radius:12px;}
.calc-seg label{flex:1 1 0; position:relative; display:block; min-width:0;}
.calc-seg input{position:absolute; opacity:0; width:1px; height:1px; pointer-events:none;}
.calc-seg span{
  display:flex; align-items:center; justify-content:center; height:38px; padding:0 4px;
  font-size:12.5px; font-weight:700; color:#616b80; border-radius:9px; white-space:nowrap; transition:.15s;
  text-align:center; line-height:1.25;
}
.calc-seg input:checked + span{background:#fff; color:var(--c-brand); box-shadow:0 1px 4px rgba(23,43,99,.14);}
.calc-seg input:focus-visible + span{outline:2px solid var(--c-brand); outline-offset:2px;}

/* 체크박스 행 */
.calc-row{display:flex; align-items:flex-start; gap:10px; padding:11px 0; border-bottom:1px solid #f0f3fa;}
.calc-row:last-child{border-bottom:0;}
.calc-check{flex:1 1 auto; min-width:0; display:flex; align-items:flex-start; gap:9px; cursor:pointer;}
.calc-check input{position:absolute; opacity:0; width:1px; height:1px; pointer-events:none;}
.calc-box{
  flex:0 0 auto; width:19px; height:19px; margin-top:2px; border-radius:6px; border:1.5px solid #c3ccdf; background:#fff;
  position:relative; transition:.15s;
}
.calc-check input:checked + .calc-box{background:var(--c-brand); border-color:var(--c-brand);}
.calc-check input:checked + .calc-box::after{
  content:""; position:absolute; left:5px; top:1.5px; width:5px; height:9px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(42deg);
}
.calc-check input:focus-visible + .calc-box{outline:2px solid var(--c-brand); outline-offset:2px;}
.calc-rowtext b{display:block; font-size:13.5px; font-weight:800; color:#2b3550; line-height:1.45;}
.calc-rowtext em{display:block; font-style:normal; font-size:11.5px; font-weight:600; color:#8a93a6; margin-top:2px; line-height:1.5;}
.calc-inline-amt{flex:0 0 128px;}
.calc-row.is-off{opacity:.55;}

/* 접이식 */
.calc-adv{border:1px dashed #ccd5e8; background:#fbfcff; border-radius:14px; padding:0 14px; margin-top:6px;}
.calc-adv summary{
  list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 0; font-size:13.5px; font-weight:800; color:#2b3550;
}
.calc-adv summary::-webkit-details-marker{display:none;}
.calc-adv summary em{display:block; font-style:normal; font-size:11.5px; font-weight:600; color:#8a93a6; margin-top:2px;}
.calc-adv summary::after{content:'+'; flex:0 0 auto; font-size:18px; font-weight:600; color:#8a93a6; line-height:1;}
.calc-adv[open] summary::after{content:'−';}
.calc-adv-body{padding:4px 0 14px; border-top:1px solid #e9eef8;}

/* 결과 */
.calc-card-result{border-color:#d7e2f7; background:linear-gradient(180deg,#fbfdff,#fff 42%);}
.calc-verdict{
  border-radius:14px; padding:16px 16px 15px; margin-bottom:14px;
  border:1px solid; font-size:14px; line-height:1.7;
}
.calc-verdict .v-tag{
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:800;
  padding:3px 9px; border-radius:999px; margin-bottom:8px;
}
.calc-verdict .v-title{display:block; font-size:17px; font-weight:800; letter-spacing:-0.02em; margin-bottom:4px;}
.calc-verdict .v-desc{display:block; font-size:13px; line-height:1.65;}
.calc-verdict.is-good{background:var(--c-good-bg); border-color:#c9e9d8; color:#0a5c37;}
.calc-verdict.is-good .v-tag{background:#0b8a4f; color:#fff;}
.calc-verdict.is-tight{background:var(--c-warn-bg); border-color:#f0dfbb; color:#6d4a06;}
.calc-verdict.is-tight .v-tag{background:#a15c00; color:#fff;}
.calc-verdict.is-bad{background:var(--c-red-bg); border-color:#f6cfcb; color:#8f2018;}
.calc-verdict.is-bad .v-tag{background:#d92d20; color:#fff;}
.calc-verdict.is-empty{background:#f4f6fa; border-color:#e3e8f1; color:#5b6577;}
.calc-verdict.is-empty .v-tag{background:#8a93a6; color:#fff;}

.calc-res-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.calc-res{
  background:#fff; border:1px solid var(--c-line); border-radius:13px; padding:14px 14px 13px;
}
.calc-res .r-head{font-size:12px; font-weight:800; color:#6a7387; margin-bottom:9px; letter-spacing:.01em;}
.calc-res dl{display:grid; gap:7px;}
.calc-res dl > div{display:flex; justify-content:space-between; gap:8px; align-items:baseline;}
.calc-res dt{font-size:12.5px; color:#7b8598; font-weight:600;}
.calc-res dd{font-size:14.5px; font-weight:800; color:var(--c-ink); font-variant-numeric:tabular-nums; text-align:right;}
.calc-res dd.big{font-size:17px; color:var(--c-navy);}
.calc-res dd.pos{color:var(--c-good);}
.calc-res dd.neg{color:var(--c-red);}
.calc-res dd small{font-size:11px; font-weight:700; color:#8a93a6; margin-left:2px;}

.calc-summary{
  margin-top:10px; display:grid; gap:0; background:#fff; border:1px solid var(--c-line);
  border-radius:13px; overflow:hidden;
}
.calc-summary > div{display:flex; justify-content:space-between; gap:10px; padding:11px 14px; border-bottom:1px solid #f0f3fa; align-items:baseline;}
.calc-summary > div:last-child{border-bottom:0;}
.calc-summary dt{font-size:13px; color:#6a7387; font-weight:700;}
.calc-summary dd{font-size:14.5px; font-weight:800; font-variant-numeric:tabular-nums;}
.calc-summary > div.total{background:#f7faff;}
.calc-summary > div.total dt{color:var(--c-navy); font-weight:800;}
.calc-summary > div.total dd{font-size:16px; color:var(--c-navy);}
.calc-summary dd.pos{color:var(--c-good);}
.calc-summary dd.neg{color:var(--c-red);}

.calc-break{border:1px solid var(--c-line); border-radius:13px; background:#fff; margin-top:10px; overflow:hidden;}
.calc-break summary{
  list-style:none; cursor:pointer; padding:13px 14px; font-size:13px; font-weight:800; color:#2b3550;
  display:flex; align-items:center; justify-content:space-between;
}
.calc-break summary::-webkit-details-marker{display:none;}
.calc-break summary::after{content:'▾'; color:#9aa5ba; transition:transform .15s;}
.calc-break[open] summary::after{transform:rotate(180deg);}
.calc-tablewrap{overflow-x:auto; border-top:1px solid #f0f3fa;}
.calc-table{border-collapse:collapse; width:100%; min-width:420px; font-size:12.8px;}
.calc-table th,.calc-table td{padding:9px 12px; border-bottom:1px solid #f2f5fb; text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap;}
.calc-table thead th{background:#f7f9fe; font-weight:800; color:var(--c-navy); font-size:12px;}
.calc-table th:first-child, .calc-table td:first-child{text-align:left; white-space:normal;}
.calc-table tbody tr:last-child td{border-bottom:0;}

.calc-actions{display:flex; gap:8px; margin-top:14px; flex-wrap:wrap;}
.calc-btn{
  flex:1 1 0; min-width:110px; height:46px; border-radius:12px; border:1px solid #dfe5f1;
  background:#fff; color:#4a5670; font-size:13.5px; font-weight:800; transition:.15s;
}
.calc-btn:hover{background:#f7f9fe;}
.calc-btn-primary{background:var(--c-brand); border-color:var(--c-brand); color:#fff;}
.calc-btn-primary:hover{background:var(--c-brand-d);}
.calc-toast{
  margin-top:10px; text-align:center; font-size:12.5px; font-weight:700; color:#0a5c37;
  opacity:0; transition:opacity .2s; height:0; overflow:hidden;
}
.calc-toast.show{opacity:1; height:auto;}

.calc-notes{margin-top:2px; display:grid; gap:9px;}
.calc-notes li{
  display:flex; gap:10px; font-size:13px; line-height:1.7; color:#4a5670;
  background:#fafbfe; border-radius:11px; padding:11px 13px;
}
.calc-notes li b{flex:0 0 auto; color:var(--c-brand); font-weight:800;}
.calc-disclaimer{
  margin-top:14px; font-size:11.8px; line-height:1.7; color:#8a93a6; text-align:center;
  padding:0 4px;
}
.calc-basis{font-size:12.5px; line-height:1.75; color:#6a7387;}
.calc-basis p + p{margin-top:8px;}
.calc-basis b{color:#3c4a66;}

@media (max-width:560px){
  .calc{font-size:14.5px; padding:0;}
  .calc-grid2{grid-template-columns:1fr;}
  .calc-grid3{grid-template-columns:1fr;}
  .calc-res-grid{grid-template-columns:1fr;}
  .calc-inline-amt{flex:0 0 104px;}
  .calc-title{font-size:20px;}
  .calc-seg span{font-size:11.5px;}
  .calc-actions .calc-btn{flex:1 1 40%;}
}
