:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#121826;
  --muted:#667085;
  --line:#e6e8ef;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --danger:#ef4444;
  --shadow: 0 10px 24px rgba(16,24,40,.08);
  --radius:16px;
}

.loan-wrap{ max-width:1120px; margin:0 auto; padding:22px 14px 40px; }
.loan-header{ padding:10px 4px 18px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.loan-title{ font-size:28px; margin:0 0 8px; letter-spacing:-0.4px; color:var(--text); }
.loan-desc{ margin:0; color:var(--muted); line-height:1.55; }
.result-actions{ display:flex; gap:8px; align-items:flex-start; }
.result-head{ align-items:flex-start; }

.loan-grid{ display:grid; gap:16px; }
.loan-grid.one{ grid-template-columns: 1fr; }

.loan-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card-head{ padding:16px 16px 0; }
.card-title{ margin:0; font-size:18px; letter-spacing:-0.2px; color:var(--text); }

.form{ padding:14px 16px 18px; }
.field{ margin-top:14px; }
.field label{ display:block; margin-bottom:8px; font-weight:700; color:var(--text); font-size:14px; }

.input-row{ display:flex; align-items:center; gap:8px; }
.input-row input{
  flex:1; height:44px; border:1px solid var(--line); border-radius:12px;
  padding:0 12px; outline:none; font-size:15px; background:#fff; color:var(--text);
}
.input-row input:focus{ border-color:rgba(37,99,235,.55); box-shadow:0 0 0 4px rgba(37,99,235,.12); }

.unit{ min-width:34px; text-align:right; color:var(--muted); font-weight:700; }
.help{ margin-top:6px; color:var(--muted); font-size:12px; }
.mt8{ margin-top:8px; }

.seg{ display:flex; gap:8px; }
.seg-btn{
  flex:1; height:40px; border-radius:12px; border:1px solid var(--line);
  background:#fff; color:var(--text); font-weight:800; cursor:pointer;
}
.seg-btn.is-active{ background:rgba(37,99,235,.10); border-color:rgba(37,99,235,.35); color:var(--primary2); }

.repay-list{ display:flex; flex-direction:column; gap:10px; }
.repay-item{ display:flex; align-items:stretch; gap:10px; cursor:pointer; }
.repay-item input{ margin-top:14px; }
.repay-box{
  flex:1; border:1px solid var(--line); border-radius:14px; padding:12px;
  display:flex; flex-direction:column; gap:4px; background:#fff;
}
.repay-box b{ font-size:14px; color:var(--text); }
.repay-box small{ font-size:12px; color:var(--muted); line-height:1.4; }
.repay-item input:checked + .repay-box{
  border-color:rgba(37,99,235,.45);
  box-shadow:0 0 0 4px rgba(37,99,235,.10);
  background:rgba(37,99,235,.04);
}

.actions{ display:flex; gap:10px; margin-top:16px; }
.btn-primary{
  flex:1; height:46px; border:none; border-radius:14px;
  background:var(--primary); color:#fff; font-weight:900; cursor:pointer;
}
.btn-primary:hover{ background:var(--primary2); }
.btn-ghost{
  width:120px; height:46px; border-radius:14px;
  border:1px solid var(--line); background:#fff; font-weight:900; cursor:pointer;
}
.btn-ghost:hover{ border-color:#cfd3df; }

.notice{ margin-top:12px; min-height:18px; font-size:13px; color:var(--danger); }

/* 고급옵션 */
.adv{ margin-top:16px; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; }
.adv-toggle{
  width:100%; display:flex; justify-content:space-between; align-items:center;
  padding:12px 12px; border:none; background:#fbfbfd; cursor:pointer;
  font-weight:900; color:var(--text);
}
.chev{ color:var(--muted); font-weight:900; }
.adv-body{ display:none; padding:12px; }
.adv-body.is-open{ display:block; }

.adv-group{ border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.adv-group:first-child{ border-top:none; padding-top:0; margin-top:0; }

.chk{ display:flex; gap:10px; align-items:center; font-weight:900; color:var(--text); cursor:pointer; }
.chk input{ width:16px; height:16px; }

.adv-grid{ margin-top:10px; display:none; gap:12px; grid-template-columns: repeat(2, 1fr); }
.field.compact label{ font-size:13px; }
.field.compact .input-row input{ height:42px; }

.adv-grid.is-on{ display:grid; }

.varrate-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.rate-list{ display:flex; flex-direction:column; gap:10px; }
.rate-row{
  display:grid; grid-template-columns: 1fr 1fr 42px; gap:10px;
  align-items:end; border:1px solid var(--line); border-radius:14px; padding:10px;
}
.icon-btn{
  height:42px; border-radius:12px; border:1px solid var(--line);
  background:#fff; cursor:pointer;
}
.icon-btn.del:hover{ border-color:#f2b8b5; }

.warn{
  margin-top:10px; padding:10px 12px; border-radius:12px;
  background:#fff7ed; border:1px solid #fed7aa; color:#9a3412;
  font-size:12px; line-height:1.45;
}

.btn-mini{
  border:1px solid var(--line); background:#fff; color:var(--text);
  border-radius:10px; padding:8px 10px; font-size:12px; cursor:pointer;
}
.btn-mini:hover{ border-color:#cfd3df; }

/* 결과 카드 */
.result-cards{
  padding: 14px 16px 10px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.result-item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.result-label{ font-size:12px; color:var(--muted); font-weight:800; }
.result-value{ margin-top:6px; font-size:18px; font-weight:1000; letter-spacing:-0.3px; color:var(--text); }
.result-value.accent{ color:#b42318; }
.mini-desc{ margin-top:6px; font-size:12px; color:var(--muted); }

/* 탭 */
.tabs{
  display:flex;
  gap:8px;
  padding: 0 16px 12px;
}
.tab{
  flex:1;
  height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:1000;
  cursor:pointer;
  color:var(--text);
}
.tab.is-active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.35);
  color: var(--primary2);
}

.tab-panel{ display:none; }
.tab-panel.is-active{ display:block; }

.table-head{
  padding: 0 16px 10px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
}
.sub-title{ margin:0; font-size:15px; color:var(--text); }
.table-meta{ font-size:12px; color:var(--muted); }

.table-wrap{ padding:0 16px 14px; overflow:auto; }
.schedule{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:760px;
}
.schedule thead th{
  position:sticky; top:0; z-index:1;
  background:#fbfbfd;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  font-size:12px; padding:10px;
  text-align:right; color:var(--muted);
}
.schedule thead th:first-child{ text-align:center; border-left:1px solid var(--line); border-top-left-radius:12px; }
.schedule thead th:last-child{ border-right:1px solid var(--line); border-top-right-radius:12px; }

.schedule tbody td{
  border-bottom:1px solid var(--line);
  font-size:13px;
  padding:10px;
  text-align:right;
  color:var(--text);
  background:#fff;
}
.schedule tbody tr td:first-child{
  text-align:center;
  border-left:1px solid var(--line);
  color:var(--muted);
  font-weight:900;
}
.schedule tbody tr td:last-child{ border-right:1px solid var(--line); }
.schedule tbody tr:last-child td:first-child{ border-bottom-left-radius:12px; }
.schedule tbody tr:last-child td:last-child{ border-bottom-right-radius:12px; }

.footnote{
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* 비교 */
.compare-wrap{
  padding: 12px 16px 6px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.compare-card{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fff;
}
.compare-card h4{
  margin:0 0 8px;
  font-size:14px;
  color:var(--text);
}
.cmp-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 0;
  border-top:1px dashed #eef0f6;
  font-size:13px;
}
.cmp-row:first-of-type{ border-top:none; }
.cmp-row span{ color:var(--muted); font-weight:800; }
.cmp-row b{ color:var(--text); font-weight:1000; }

@media (max-width: 980px){
  .result-cards{ grid-template-columns: 1fr; }
  .compare-wrap{ grid-template-columns: 1fr; }
  .btn-ghost{ width:110px; }
  .schedule{ min-width: 720px; }
}
.btn-blue{
  background: var(--primary);
  color:#fff;
  border-color: rgba(37,99,235,.45);
}
.btn-blue:hover{ background: var(--primary2); }

.btn-green{
  background:#16a34a;
  color:#fff;
  border-color: rgba(22,163,74,.35);
}
.btn-green:hover{ background:#15803d; }

.btn-orange{
  background:#f59e0b;
  color:#111827;
  border-color: rgba(245,158,11,.35);
}
.btn-orange:hover{ background:#d97706; color:#111827; }
.result-notes{
  padding: 4px 16px 16px;
}
.notes-title{
  margin: 8px 0 10px;
  font-size: 15px;
  color: var(--text);
}
.notes-box{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background:#fff;
  margin-top: 10px;
}
.notes-box h4{
  margin:0 0 8px;
  font-size: 13px;
  color: var(--text);
}
.notes-box ul{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.notes-box.warn{
  background:#fff7ed;
  border-color:#fed7aa;
}
