/* ============================================================================
   대출 이자 계산기 (/loan/) — 전용 스타일
   ----------------------------------------------------------------------------
   공용 다크 레이어(lib/theme.php)에서 제외돼 있어 여기 있는 것이 전부다(배경만 jjam_theme_backdrop_style()).
   2026-11-23 /salary/ 에서 나누며 같은 틀을 복사했다(이름표만 sl- → ln-). 값은 사이트 표준(/liar/ 키트) — 반경 카드 24 · 버튼 16 · 입력 15 · 줄 14 · 칩 알약, 입력칸·행동 버튼 높이 51.
   강조색만 금융 앱처럼 파랑(#60a5fa → #22d3ee). 큰 숫자는 #8ec5ff(카드 위 9:1), 공제·이자는 호박색 #ffc971.
   글자 대비: 본문 #ece9ff(15:1) · 보조 #b9b3d8(9:1) · 흐림 #9995b5(6.3:1).
   ========================================================================= */

:root {
    --ln-bg: #0a0a12;
    --ln-bg-2: #12101f;
    --ln-surface: #161425;
    --ln-surface-2: #1c1930;
    --ln-surface-3: #262041;
    --ln-ink: #ece9ff;
    --ln-ink-soft: #b9b3d8;
    --ln-ink-faint: #9995b5;
    --ln-line-ui: #7b7599;
    --ln-blue: #60a5fa;
    --ln-blue-ink: #8ec5ff;
    --ln-cyan: #22d3ee;
    --ln-amber: #ffc971;
    --ln-on-fill: #0a0a12;
    --ln-brand: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
    --ln-title: linear-gradient(90deg, #60a5fa 15%, #22d3ee 85%);
    --ln-panel: linear-gradient(180deg, var(--ln-surface) 0%, var(--ln-bg-2) 100%);
    --ln-ring: inset 0 0 0 1px rgba(236, 233, 255, .08), inset 0 1px 0 rgba(236, 233, 255, .10);
    --ln-shadow: 0 20px 44px -22px rgba(0, 0, 0, .9);
    --ln-glow: 0 12px 30px -14px rgba(59, 130, 246, .9);
    --ln-r-card: 24px;
    --ln-r-btn: 16px;
    --ln-r-field: 15px;
    --ln-r-row: 14px;
    --ln-font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', sans-serif;
    --ln-ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background-color: var(--ln-bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
    color: var(--ln-ink); font-family: var(--ln-font); -webkit-font-smoothing: antialiased;
    min-height: 100dvh; overflow-x: hidden; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
a { color: var(--ln-blue-ink); }

/* Fluent 3D 이모지 그림 — 글자 이모지 자리에 글자 크기만큼(lib/fluent_emoji.php) */
.fe { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; object-fit: contain; }

.ln-skip { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--ln-surface); color: var(--ln-ink); padding: 10px 16px; border-radius: 10px; }
.ln-skip:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--ln-cyan); outline-offset: 3px; border-radius: 6px; }

/* ── 뼈대 ─────────────────────────────────────────────────────────── */
.ln-shell { width: 100%; max-width: 560px; margin: 0 auto; padding: calc(64px + env(safe-area-inset-top, 0px)) 16px 32px; outline: none; display: flex; flex-direction: column; gap: 14px; }
.ln-panel { display: flex; flex-direction: column; gap: 14px; }
.ln-results { display: flex; flex-direction: column; gap: 14px; }
.ln-results:empty { display: none; }
.ln-card { background: var(--ln-panel); border-radius: var(--ln-r-card); box-shadow: var(--ln-ring), var(--ln-shadow); padding: 22px 20px; }
.ln-h2 { margin: 0 0 14px; font-size: 1.08rem; font-weight: 800; letter-spacing: -.01em; display: flex; gap: 8px; align-items: center; }
.ln-h2 small { color: var(--ln-ink-faint); font-size: .8rem; font-weight: 700; }
.ln-fine { margin: 12px 0 0; color: var(--ln-ink-faint); font-size: .8rem; line-height: 1.55; }
.grad { background: var(--ln-title); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── 머리 · 탭 ────────────────────────────────────────────────────── */
.ln-hero {
    position: relative; text-align: center; overflow: hidden;
    background: var(--ln-panel); border-radius: var(--ln-r-card); box-shadow: var(--ln-ring), var(--ln-shadow); padding: 26px 20px 20px;
}
.ln-hero::before {
    content: ''; position: absolute; inset: -45% -25% auto; height: 75%; pointer-events: none;
    background: radial-gradient(closest-side, rgba(96, 165, 250, .26), transparent 70%);
}
.ln-kicker { position: relative; margin: 0 0 6px; color: var(--ln-cyan); font-size: .82rem; font-weight: 800; }
.ln-title { position: relative; margin: 0 0 10px; font-size: clamp(1.6rem, 7vw, 2.05rem); font-weight: 900; line-height: 1.25; letter-spacing: -.02em; }
.ln-lead { position: relative; margin: 0 auto 6px; max-width: 30em; color: var(--ln-ink-soft); font-size: .96rem; }

/* ── 입력 ─────────────────────────────────────────────────────────── */
.ln-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; min-width: 0; }
.ln-field label, .ln-label { font-size: .92rem; font-weight: 800; color: var(--ln-ink); padding: 0; }
.ln-field label small, .ln-label small { color: var(--ln-ink-faint); font-weight: 700; font-size: .8rem; margin-left: 4px; }
.ln-input { position: relative; }
.ln-input input {
    width: 100%; height: 51px; padding: 15px 52px 15px 16px; border: 1px solid var(--ln-line-ui); border-radius: var(--ln-r-field);
    background: rgba(10, 10, 18, .55); color: var(--ln-ink); font: inherit; font-size: 16px; font-weight: 800; letter-spacing: .01em;
    font-variant-numeric: tabular-nums; text-align: right; outline: none; transition: border-color .15s, box-shadow .15s;
}
.ln-input input:focus { border-color: var(--ln-blue); box-shadow: 0 0 0 3px rgba(96, 165, 250, .28); }
.ln-input .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--ln-ink-faint); font-size: .92rem; font-weight: 800; pointer-events: none; }
.ln-hint { margin: -2px 0 0; text-align: right; color: var(--ln-blue-ink); font-size: .84rem; font-weight: 700; min-height: 1.3em; }
.ln-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-card > .ln-quick { margin: -4px 0 16px; }
.ln-quick button {
    min-height: 33px; padding: 6px 12px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: .84rem; font-weight: 800;
    color: var(--ln-ink); background: rgba(96, 165, 250, .10); box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .28);
    transition: background-color .15s, transform .12s var(--ln-ease); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ln-quick button:hover { background: rgba(96, 165, 250, .2); }
.ln-quick button:active { transform: scale(.97); }
.ln-quick button.clear { color: var(--ln-ink-soft); background: transparent; box-shadow: inset 0 0 0 1px rgba(236, 233, 255, .14); }
.ln-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ln-methods { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ln-methods legend { margin-bottom: 8px; }
.ln-method { position: relative; display: block; cursor: pointer; }
.ln-method input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ln-method span {
    display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 10px; border-radius: var(--ln-r-row); text-align: center;
    background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(236, 233, 255, .12); transition: background-color .15s, box-shadow .15s;
}
.ln-method b { font-size: .92rem; font-weight: 900; }
.ln-method small { color: var(--ln-ink-soft); font-size: .76rem; line-height: 1.35; }
.ln-method input:checked + span { background: linear-gradient(135deg, rgba(96, 165, 250, .22), rgba(34, 211, 238, .14)); box-shadow: inset 0 0 0 2px var(--ln-blue); }
.ln-method input:focus-visible + span { outline: 2px solid var(--ln-cyan); outline-offset: 3px; }

/* ── 버튼 ─────────────────────────────────────────────────────────── */
.ln-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 51px;
    border: 0; border-radius: var(--ln-r-btn); padding: 16px 18px; font: inherit; font-size: .98rem; font-weight: 800; line-height: 1.2;
    cursor: pointer; color: var(--ln-ink); transition: transform .15s var(--ln-ease), box-shadow .2s, filter .2s, background-color .2s;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ln-btn:active { transform: translateY(1px) scale(.99); }
.ln-btn-primary { background: var(--ln-brand); color: var(--ln-on-fill); box-shadow: var(--ln-glow); }
.ln-btn-primary:hover { filter: brightness(1.05); }
.ln-btn-ghost { background: transparent; box-shadow: var(--ln-ring); }
.ln-btn-ghost:hover { background: rgba(96, 165, 250, .08); }
.ln-btn-wide { margin-top: 12px; }

/* ── 결과 ─────────────────────────────────────────────────────────── */
.ln-res { text-align: center; position: relative; overflow: hidden; }
.ln-res::before { content: ''; position: absolute; left: 50%; top: -40%; width: 120%; height: 80%; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(96, 165, 250, .22), transparent 72%); pointer-events: none; }
.ln-res-label { position: relative; margin: 0 0 4px; color: var(--ln-ink-soft); font-size: .92rem; font-weight: 800; outline: none; }
.ln-big { position: relative; margin: 0; line-height: 1.15; }
.ln-big b { font-size: clamp(2.1rem, 10vw, 2.8rem); font-weight: 900; letter-spacing: -.02em; color: var(--ln-blue-ink); font-variant-numeric: tabular-nums; }
.ln-big span { margin-left: 4px; font-size: 1.1rem; font-weight: 800; color: var(--ln-ink-soft); }
.ln-res-sub { position: relative; margin: 6px 0 16px; color: var(--ln-ink-soft); font-size: .9rem; }
.ln-kv { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ln-kv div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--ln-r-row); background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(236, 233, 255, .08); }
.ln-kv span { color: var(--ln-ink-faint); font-size: .8rem; font-weight: 800; }
.ln-kv b { font-size: 1.02rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ln-ratio { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .07); }
.ln-ratio i { display: block; height: 100%; }
.ln-ratio i.a { background: var(--ln-brand); }
.ln-ratio i.b { background: linear-gradient(90deg, #ffb547, #ffc971); }
.ln-legend { position: relative; display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: .82rem; font-weight: 800; flex-wrap: wrap; }
.ln-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.ln-legend .a { color: var(--ln-blue-ink); }
.ln-legend .a::before { background: var(--ln-blue); }
.ln-legend .b { color: var(--ln-amber); }
.ln-legend .b::before { background: var(--ln-amber); }
.ln-res .ln-fine { position: relative; text-align: left; }

.ln-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.ln-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.ln-table th, .ln-table td { padding: 10px 6px; text-align: left; border-bottom: 1px solid rgba(236, 233, 255, .07); white-space: nowrap; }
.ln-table thead th { color: var(--ln-ink-faint); font-size: .78rem; font-weight: 800; }
.ln-table tbody th { font-weight: 800; }
.ln-table .num { text-align: right; }
.ln-sched { min-width: 430px; font-size: .84rem; }
.ln-scroll-hint { display: none; margin: 8px 0 0; color: var(--ln-ink-faint); font-size: .78rem; text-align: right; }
@media (max-width: 470px) { .ln-scroll-hint { display: block; } }   /* 표(430px)가 카드보다 넓어지는 폭에서만 */
.ln-sched tbody th { color: var(--ln-ink-soft); }

/* 상환 방식 비교 — 지금 고른 방식 줄을 파랗게, 총 이자가 가장 적은 칸에 「최소」 */
/* 숫자는 줄바꿈하지 않는다(.ln-table 의 nowrap) — 320 폭에서 「135,000,000」이 쪼개졌다. 「최소」는 숫자 아래 줄로. */
.ln-cmp tbody tr.on th, .ln-cmp tbody tr.on td { color: var(--ln-blue-ink); }
.ln-cmp tbody tr.on th::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ln-blue); vertical-align: 2px; }
.ln-cmp .low { display: block; width: fit-content; margin: 3px 0 0 auto; padding: 1px 6px; border-radius: 999px; font-size: .7rem; font-weight: 900; color: var(--ln-on-fill); background: var(--ln-amber); }
.ln-cmp-pick { border: 0; padding: 0; margin: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: rgba(236, 233, 255, .25); text-underline-offset: 3px; }

/* ── 다른 계산기로 가는 카드 ──────────────────────────────────────── */
.ln-link { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--ln-ink); transition: transform .15s var(--ln-ease), background-color .2s; }
.ln-link:hover { transform: translateY(-1px); }
.ln-link-ico { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--ln-r-row); background: rgba(96, 165, 250, .12); font-size: 1.5rem; }
.ln-link-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ln-link-txt b { font-size: 1rem; font-weight: 900; }
.ln-link-txt small { color: var(--ln-ink-soft); font-size: .82rem; line-height: 1.4; }
.ln-link-go { flex: 0 0 auto; color: var(--ln-blue-ink); font-size: 1.2rem; font-weight: 900; }

/* ── 면책 ─────────────────────────────────────────────────────────── */
.ln-disclaimer { box-shadow: inset 0 0 0 1px rgba(255, 201, 113, .28), var(--ln-shadow); background: linear-gradient(180deg, rgba(255, 201, 113, .06), rgba(255, 201, 113, .02)), var(--ln-panel); }
.ln-disclaimer-main { margin: 0 0 10px; font-weight: 900; color: var(--ln-amber); }
.ln-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ln-ink-soft); font-size: .86rem; line-height: 1.55; }

/* ── 폰 폭 ────────────────────────────────────────────────────────── */
@media (max-width: 420px) {
    .ln-methods { grid-template-columns: 1fr; }
    .ln-method span { flex-direction: row; align-items: baseline; justify-content: space-between; text-align: left; padding: 12px 14px; }
}
@media (max-width: 360px) {
    .ln-shell { padding-left: 12px; padding-right: 12px; }
    body .jjseo { padding-left: 12px; padding-right: 12px; }
    .ln-card, .ln-hero { padding-left: 16px; padding-right: 16px; }
    .ln-grid2 { grid-template-columns: 1fr; gap: 0; }
    .ln-kv { grid-template-columns: 1fr; }
    .ln-cmp { font-size: .8rem; }
}
