/* =========================================================
   Loan Interest Calculator - Stylesheet
   100% CSS visuals & animation, no raster images.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --site-width: 1080px;
  --primary: #0B1F3A;
  --primary-2: #132C4F;
  --accent: #00C2A8;
  --accent-dark: #00A38F;
  --accent-soft: #E6FBF7;
  --accent-rgb: 0, 194, 168;
  --gold: #FFB020;
  --coral: #FF6B6B;
  --paper: #F4F6FB;
  --card: #ffffff;
  --text: #16213E;
  --muted: #6B7280;
  --border: #E4E8F1;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(11,31,58,.06);
  --shadow-md: 0 12px 32px rgba(11,31,58,.12);
  --shadow-lg: 0 24px 64px rgba(11,31,58,.18);
  --font-head: 'Poppins', 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans Arabic', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Noto Sans JP',
               'Noto Sans SC', 'Noto Sans TC', 'Noto Sans Arabic', 'Noto Sans Devanagari', 'Noto Sans Thai',
               'Noto Sans Tamil', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Hiragino Sans', 'Meiryo', sans-serif;
}

/* Per-page accent themes (calc keeps default teal) */
body.theme-finder {
  --accent: #E85D04;
  --accent-dark: #C2410C;
  --accent-soft: #FFF4EB;
  --accent-rgb: 232, 93, 4;
}
body.theme-deposit {
  --accent: #1D4ED8;
  --accent-dark: #1E40AF;
  --accent-soft: #EEF2FF;
  --accent-rgb: 29, 78, 216;
}
body.theme-stock {
  --accent: #DB2777;
  --accent-dark: #BE185D;
  --accent-soft: #FDF2F8;
  --accent-rgb: 219, 39, 119;
}
body.theme-multicalc {
  --accent: #7C3AED;
  --accent-dark: #6D28D9;
  --accent-soft: #F3EEFF;
  --accent-rgb: 124, 58, 237;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.is-rtl { direction: rtl; }

img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
h1, h2, h3 { font-family: var(--font-head); }
/* ---------- Legal pages ---------- */
.legal-card {
font-size:.8em;
  padding: 34px 34px 30px;
}
.legal-card h1 {

  margin-bottom: 8px;
}
.legal-updated {
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 24px;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  padding: 11px 18px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.legal-back:hover,
.legal-back:focus-visible {
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}
.footer-legal-link {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  transition: color .18s ease, opacity .18s ease;
}
.footer-legal-link:hover,
.footer-legal-link:focus-visible {
  color: #fff;
  text-decoration: underline;
}
.footer-links-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.22);
}
@media (max-width: 560px) {
  .legal-card { padding: 26px 20px 24px; }
  .footer-links { flex-wrap: wrap; gap: 10px 14px; }
  .footer-links-divider { display: none; }
}


/* ---------- Header ---------- */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 12px 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.site-logo:hover, .site-logo:focus, .site-logo:visited { text-decoration: none; color: #fff; }
.logo-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.logo-bar {
  width: 5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  animation: logoGrow 1.8s ease-in-out infinite;
}
.logo-bar.b1 { height: 10px; animation-delay: 0s; }
.logo-bar.b2 { height: 18px; animation-delay: .2s; }
.logo-bar.b3 { height: 14px; animation-delay: .4s; }
@keyframes logoGrow {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.4); }
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions > * { height: 34px; box-sizing: border-box; }

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13.6px; /* 고정 px: 상단 폰트 크기 설정을 바꿔도 커지지 않음 */
  font-weight: 600;
  transition: background .2s, transform .15s;
}
.lang-trigger:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
.lang-trigger .flag { font-size: 16.8px; line-height: 1; }
.lang-trigger .lang-code { letter-spacing: .01em; }

.font-switch {
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  overflow: hidden;
}
.font-switch button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0 10px;
  font-size: 13.1px; /* 고정 px: 상단 폰트 크기 설정을 바꿔도 커지지 않음 */
  opacity: .75;
  transition: background .2s, opacity .2s;
}
.font-switch button.active { background: #00C2A8; opacity: 1; color: #052e28; font-weight: 700; }
.font-switch button:hover { opacity: 1; }

/* ---------- Language modal ---------- */
.lang-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(11,31,58,.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease;
  padding: 20px;
}
.lang-overlay.show { opacity: 1; visibility: visible; }
.lang-modal {
  background: var(--card);
  border-radius: var(--radius);
  width: min(560px, 100%);
  max-height: 82vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.97);
  transition: transform .28s cubic-bezier(.2,.8,.3,1.15);
  display: flex; flex-direction: column;
}
.lang-overlay.show .lang-modal { transform: translateY(0) scale(1); }
.lang-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.lang-modal-head h3 { font-size: 1.05rem; }
.lang-modal-close {
  background: var(--paper); border: none; width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.2rem; color: var(--muted); transition: background .2s, transform .2s;
}
.lang-modal-close:hover { background: var(--border); transform: rotate(90deg); }
.lang-grid {
  padding: 16px 20px 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  overflow-y: auto;
}
.lang-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 500;
  text-align: left;
  transition: border-color .15s, background .15s, transform .12s;
}
.lang-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.lang-item.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.lang-item-flag { font-size: 1.25rem; }

/* ---------- Layout ---------- */
.main-wrap { flex: 1; }

.page-grid {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 20px 15px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
.page-side {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
.page-main { min-width: 0; }

.ad-slot {
  max-width: var(--site-width);
  margin: 18px auto;
  padding: 0 20px;
  text-align: center;
  overflow: hidden;
}
.ad-bottom {
  margin-top: 4px;
}
.ad-slot:empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  background: repeating-linear-gradient(
    -45deg,
    #f1f5f9,
    #f1f5f9 8px,
    #e8edf3 8px,
    #e8edf3 16px
  );
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  color: #94a3b8;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.ad-slot:empty::before {
  content: attr(data-empty-label);
}
.page-side .ad-slot {
  padding: 0;
  margin: 0 0 16px;
  width: 100%;
}
.page-side .ad-slot:empty {
  min-height: 250px;
}
.ad-bottom:empty {
  min-height: 90px;
  margin-left: auto;
  margin-right: auto;
  max-width: var(--site-width);
}
.ad-hero:empty {
  min-height: 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border-color: rgba(255,255,255,.25);
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,.06),
    rgba(255,255,255,.06) 8px,
    rgba(255,255,255,.1) 8px,
    rgba(255,255,255,.1) 16px
  );
  color: rgba(255,255,255,.55);
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(120% 140% at 100% 0%, var(--primary-2) 0%, var(--primary) 55%, #081527 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 15% 110%, rgba(0,194,168,.28), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 28px 20px 56px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  align-items: center;
  position: relative;
}
.hero-inner--no-ad {
  grid-template-columns: 1fr;
}
.hero-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--gold);
  background: rgba(255,176,32,.14);
  border: 1px solid rgba(255,176,32,.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  animation: fadeUp .6s ease both;
}
.hero-text h1 {
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
  animation: fadeUp .7s ease .05s both;
}
.hero-sub {
  color: rgba(255,255,255,.78);
  font-size: .92rem;
  max-width: 46ch;
  margin-bottom: 4px;
  line-height: 1.5;
  animation: fadeUp .7s ease .1s both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-visual {
  position: relative;
  height: clamp(110px, 18vw, 168px);
  overflow: hidden;
  transition: height .3s ease;
  z-index: 1;
}
.hero-visual.hero-ad {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual.hero-ad .ad-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* ---------- Mode tabs ---------- */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-md);
  padding: 14px 14px 10px;
  margin-top: -40px;
  position: relative;
  z-index: 6;
  animation: cardRise .6s cubic-bezier(.2,.8,.3,1.1) both;
}
.mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1.5px solid transparent;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active {
  color: #fff;
  border-color: transparent;
  background: #2d3748;
  box-shadow: none;
}
.mode-tab.active:hover { color: #fff; }
.mode-tab-icon { width: 18px; height: 18px; position: relative; flex: none; box-sizing: border-box; }
.mode-tab-icon::before, .mode-tab-icon::after { content: ''; position: absolute; background: currentColor; border-radius: 2px; }
.icon-mode-calc::before { width: 16px; height: 3px; top: 3px; left: 1px; box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor; }
.icon-mode-calc::after { display: none; }
.icon-mode-finder { border: 2px solid currentColor; border-radius: 50%; }
.icon-mode-finder::before { width: 2px; height: 6px; left: 7px; top: 3px; }
.icon-mode-finder::after { width: 2px; height: 2px; left: 7px; top: 10px; border-radius: 50%; }
.icon-mode-deposit::before { width: 14px; height: 10px; left: 2px; top: 6px; border-radius: 2px; box-shadow: 0 -4px 0 currentColor; }
.icon-mode-deposit::after { width: 6px; height: 3px; left: 6px; top: 2px; border-radius: 1px 1px 0 0; }
svg.mode-tab-icon { display: block; }

/* ---------- Floating all-menu button (mobile) ---------- */
.all-menu-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(23,32,51,.32);
  align-items: center;
  justify-content: center;
  z-index: 400;
  border: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.all-menu-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23,32,51,.38); }
.all-menu-fab-icon { display: flex; flex-direction: column; gap: 4px; }
.all-menu-fab-icon span { display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------- All-menu overlay (mobile) ---------- */
.all-menu-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(11,31,58,.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease;
}
.all-menu-overlay.show { opacity: 1; visibility: visible; }
.all-menu-panel {
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 82vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform .28s cubic-bezier(.2,.8,.3,1.15);
  display: flex; flex-direction: column;
}
.all-menu-overlay.show .all-menu-panel { transform: translateY(0); }
.all-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.all-menu-head h3 { font-size: 1.05rem; }
.all-menu-close {
  background: var(--paper); border: none; width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.2rem; color: var(--muted); transition: background .2s, transform .2s;
}
.all-menu-close:hover { background: var(--border); transform: rotate(90deg); }
.all-menu-list {
  padding: 10px 12px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.all-menu-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  justify-content: flex-start;
  transition: border-color .15s, background .15s;
}
.all-menu-item:hover { border-color: var(--accent); }
.all-menu-item.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 700; }
.all-menu-item .mode-tab-icon { color: var(--muted); }
.all-menu-item.active .mode-tab-icon { color: var(--accent); }

.mode-panel { animation: fadeUp .4s ease both; }

/* ---------- Calculator card ---------- */
.calc-card {
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  padding: 26px;
  position: relative;
  z-index: 5;
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.type-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.type-pill {
  border: 1.5px solid var(--border);
  background: var(--paper);
  border-radius: 12px;
  padding: 12px 8px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: border-color .18s, color .18s, background .18s, transform .12s;
}
.type-pill:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.type-pill.active {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), #F4F6FB);
  color: var(--primary);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), .18);
}
.pill-icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  overflow: hidden;
}
.pill-icon::before, .pill-icon::after { content: ''; position: absolute; background: rgba(255,255,255,.85); }
.icon-pi::before { width: 4px; left: 6px; bottom: 5px; height: 12px; border-radius: 2px; }
.icon-pi::after { width: 4px; left: 15px; bottom: 5px; height: 16px; border-radius: 2px; }
.icon-ep::before { width: 16px; height: 4px; left: 5px; top: 8px; border-radius: 2px; }
.icon-ep::after { width: 16px; height: 4px; left: 5px; bottom: 8px; border-radius: 2px; }
.icon-grace::before { width: 10px; height: 4px; left: 4px; bottom: 6px; border-radius: 2px; }
.icon-grace::after { width: 4px; height: 14px; right: 6px; bottom: 6px; border-radius: 2px; }
.icon-bullet::before { width: 18px; height: 4px; left: 4px; bottom: 6px; border-radius: 2px; }
.icon-bullet::after { width: 4px; height: 4px; right: 5px; top: 5px; border-radius: 50%; }

/* Deposit option pills: dtype row (2) + method row (3), stacked */
.deposit-pills-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.deposit-pills-wrap .type-pills {
  margin-bottom: 0;
}
.deposit-pills-wrap .type-pill {
  min-width: 0;
}
#deposit-type-pills { grid-template-columns: repeat(2, 1fr); }
#deposit-method-pills { grid-template-columns: repeat(3, 1fr); }

/* 예금(일시예치): stacked coins */
.icon-deposit-lump::before {
  width: 14px; height: 5px; left: 6px; bottom: 5px; border-radius: 2px;
  box-shadow: 0 -5px 0 rgba(255,255,255,.85), 0 -10px 0 rgba(255,255,255,.7);
}
.icon-deposit-lump::after { display: none; }

/* 적금(매월 납입): rising monthly bars + top line */
.icon-deposit-monthly::before {
  width: 4px; height: 8px; left: 6px; bottom: 5px; border-radius: 1px;
  box-shadow: 5px 0 0 rgba(255,255,255,.85), 10px -3px 0 rgba(255,255,255,.85);
}
.icon-deposit-monthly::after {
  width: 16px; height: 2px; left: 5px; top: 5px; border-radius: 1px;
}

/* 단리: flat horizontal line */
.icon-interest-simple::before {
  width: 16px; height: 3px; left: 5px; top: 11px; border-radius: 2px;
}
.icon-interest-simple::after {
  width: 3px; height: 3px; left: 5px; top: 8px; border-radius: 50%;
  box-shadow: 13px 0 0 rgba(255,255,255,.85);
}

/* 월복리: three narrow rising bars (frequent, small steps) */
.icon-interest-compound-monthly::before {
  width: 4px; height: 6px; left: 5px; bottom: 5px; border-radius: 1px;
  box-shadow: 6px -4px 0 0 rgba(255,255,255,.85), 12px -8px 0 0 rgba(255,255,255,.85);
}
.icon-interest-compound-monthly::after { display: none; }

/* 연복리: two wide bars (infrequent, big steps) */
.icon-interest-compound-annual::before {
  width: 7px; height: 7px; left: 4px; bottom: 5px; border-radius: 1px;
  box-shadow: 11px -9px 0 0 rgba(255,255,255,.85);
}
.icon-interest-compound-annual::after { display: none; }

.loan-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: .84rem; font-weight: 600; color: var(--muted); }
.field-input {
  display: flex; align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
  transition: border-color .18s, box-shadow .18s;
}
.field-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.field-input input {
  flex: 1; border: none; background: transparent; padding: 13px 14px;
  font-size: 1.05rem; font-weight: 700; color: var(--text); text-align: right;
  min-width: 0;
}
.field-input input:focus { outline: none; }
.field-unit { padding: 0 14px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.field-range-wrap { padding: 0 9px; margin: 0 -9px; }
.field-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--border) 0);
  outline: none;
}
.field-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer;
  transition: transform .15s;
}
.field-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.field-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff; cursor: pointer;
}

.field-grace {
  position: relative;
}
.field-grace label,
.field-grace .field-input,
.field-grace .field-range-wrap {
  transition: opacity .2s ease;
}
.field-grace:not(.show) label,
.field-grace:not(.show) .field-input,
.field-grace:not(.show) .field-range-wrap {
  opacity: .3;
}
.field-grace-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 16px;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  pointer-events: none;
  z-index: 2;
}
.field-grace:not(.show) .field-grace-overlay {
  display: flex;
}

/* PC: loan-form(대출 이자 계산기), deposit-form(예금/적금 계산기) 필드를 한 줄에 2항목씩 배치.
   minmax(0,1fr)로 내용물(숫자/단위)이 길어도 컨테이너 밖으로 튀어나가지 않게 함.
   모바일(max-width:640px)은 기존 세로 1열 형태 그대로 유지. */
@media (min-width: 641px) {
  #loan-form, #deposit-form, #stock-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 20px;
    row-gap: 18px;
  }
  #loan-form .btn-calc,
  #deposit-form .btn-calc,
  #stock-form .btn-calc {
    grid-column: 1 / -1;
  }
}

.btn-calc {
  border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 700; font-size: 1.02rem;
  padding: 16px; margin-top: 6px;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), .4);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.btn-calc:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(var(--accent-rgb), .4); }
.btn-calc:active { transform: translateY(0); }
.btn-calc::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: translate(-50%,-50%);
  transition: width .5s ease, height .5s ease;
}
.btn-calc.ripple::after { width: 340px; height: 340px; }

/* ---------- Result card ---------- */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-top: 20px;
  animation: fadeUp .5s ease both;
}
.result-title { font-size: 1.15rem; margin-bottom: 18px; }
.stock-heading { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.stock-sub { color: var(--muted); font-size: .88rem; margin-bottom: 22px; }
.stock-pl-stats.result-stats { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.stat {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border);
}
.stat.accent { background: linear-gradient(160deg, #FFF6E7, #FFFDF8); border-color: #FFE4AD; }
.stat-label { font-size: .74rem; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--primary); }
.stat.accent .stat-value { color: #B9720A; }
.stat-subvalue { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: -0.01em; }
.stat.accent .stat-subvalue { color: #C08726; }
.stat-tax-hint {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}
.stat-value-tax {
  font-size: 1.05rem !important;
  opacity: .92;
}
.stat.accent .stat-value-tax { color: #9A5F08; }
.deposit-tax-note {
  margin-top: 12px;
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.5;
}
.deposit-schedule-title-tax {
  margin-top: 22px;
}

.ratio-bar-wrap { margin-bottom: 22px; }
.ratio-legend {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; color: var(--muted); margin-bottom: 10px; font-weight: 600;
}
.ratio-legend span[id] { color: var(--text); margin-inline-end: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.principal { background: var(--accent); }
.dot.interest { background: var(--gold); }
.ratio-bar {
  display: flex; height: 16px; border-radius: 999px; overflow: hidden;
  background: var(--border);
}
.ratio-fill { height: 100%; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.ratio-fill.principal { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.ratio-fill.interest { background: linear-gradient(90deg, var(--gold), #E39A12); }

.btn-schedule-toggle {
  width: 100%;
  border: 1.5px dashed var(--border);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 600;
  font-size: .88rem;
  color: var(--primary);
  transition: border-color .18s, background .18s;
}
.btn-schedule-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }

.schedule-wrap { margin-top: 20px; animation: fadeUp .35s ease both; }
.schedule-wrap h3 { font-size: 1rem; margin-bottom: 12px; }
.schedule-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 380px; overflow-y: auto; }
.schedule-table { width: 100%; border-collapse: collapse; font-size: .84rem; white-space: nowrap; }
.schedule-table th {
  position: sticky; top: 0;
  background: var(--primary); color: #fff;
  padding: 10px 12px; text-align: right; font-weight: 600;
  font-size: .78rem;
}
.schedule-table th:first-child, .schedule-table td:first-child { text-align: center; }
.schedule-table td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.schedule-table tbody tr:nth-child(even) { background: var(--paper); }
.schedule-table tbody tr:hover { background: var(--accent-soft); }
.schedule-table tr.gap-row td { text-align: center; padding: 6px; background: #fff; border-bottom: 1px solid var(--border); }
.schedule-reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  transition: background .15s ease, transform .15s ease;
}
.schedule-reveal-btn:hover { background: var(--accent-soft); transform: translateY(-1px); }
.schedule-reveal-btn::before { content: '\25BC'; font-size: .65em; }

/* ---------- Method Compare ---------- */
.method-compare-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 26px;
  margin-top: 20px;
  animation: fadeUp .5s ease both;
}
.method-compare-title { font-size: 1.05rem; margin-bottom: 14px; }
.method-compare-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.method-compare-table { width: 100%; border-collapse: collapse; font-size: .86rem; white-space: nowrap; }
.method-compare-table th {
  background: var(--paper); color: var(--text);
  padding: 10px 14px; text-align: right; font-weight: 700;
  font-size: .78rem; border-bottom: 2px solid var(--border);
}
.method-compare-table th:first-child, .method-compare-table td:first-child { text-align: left; }
.method-compare-table td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--border); }
.method-compare-table tbody tr:last-child td { border-bottom: none; }
.method-compare-table tbody tr.active-method { background: var(--accent-soft); }
.method-compare-table tbody tr.active-method td:first-child { color: var(--accent); font-weight: 700; }
.method-compare-table tbody tr:hover { background: #F7F9FA; }
.method-compare-table tbody tr.active-method:hover { background: #E4F7F2; }

/* ---------- Finder wizard ---------- */
.finder-card {
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  padding: 30px 26px;
  position: relative;
  z-index: 5;
}
.finder-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.finder-sub { color: var(--muted); font-size: .88rem; margin-bottom: 20px; }
.finder-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.fp-dot { flex: 1; height: 4px; border-radius: 3px; background: var(--border); transition: background .25s ease; }
.fp-dot.done { background: var(--accent); }
.fp-dot.active { background: var(--gold); }

.finder-step { display: none; animation: fadeUp .35s ease both; }
.finder-step.active { display: block; }
.finder-question {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 22px;
  margin-bottom: 20px;
  min-height: 90px;
  display: flex;
  align-items: center;
}
.finder-actions { display: flex; gap: 12px; }
.finder-btn {
  flex: 1;
  padding: 15px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: transform .15s, border-color .15s, background .15s, color .15s;
}
.finder-btn:hover { transform: translateY(-2px); }
.finder-btn.yes { border-color: var(--accent); }
.finder-btn.yes:hover { background: var(--accent); color: #fff; }
.finder-btn.no { border-color: var(--gold); }
.finder-btn.no:hover { background: var(--gold); color: #fff; }

.finder-result-lead { text-align: center; font-size: .84rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 10px; }
.finder-result-card {
  text-align: center;
  background: linear-gradient(160deg, var(--accent-soft), #FFF8EA);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  margin-bottom: 20px;
  animation: resultPop .5s cubic-bezier(.2,.8,.3,1.2) both;
}
@keyframes resultPop {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: scale(1); }
}
.finder-result-icon {
  display: inline-block;
  width: 52px; height: 52px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  position: relative;
}
.finder-result-icon::before {
  content: '\2713';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.4rem; font-weight: 900;
}
.finder-result-card h3 { font-size: 1.15rem; margin-bottom: 10px; color: var(--primary); }
.finder-result-card p { font-size: .88rem; color: var(--text); line-height: 1.6; max-width: 46ch; margin: 0 auto; }
.finder-btn-use {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: .96rem;
  box-shadow: 0 8px 20px rgba(0,194,168,.28);
  transition: transform .15s;
}
.finder-btn-use:hover { transform: translateY(-2px); }

.finder-nav { display: flex; justify-content: space-between; margin-top: 18px; }
.finder-back, .finder-restart {
  font-size: .84rem; font-weight: 600; color: var(--muted);
  padding: 8px 4px; transition: color .15s;
}
.finder-back:hover, .finder-restart:hover { color: var(--accent); }

/* ---------- Compare section (method info cards) ---------- */
.compare-section { margin-top: 24px; padding-left: 1em; padding-right: 1em; }
.compare-heading { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.compare-sub { color: var(--muted); font-size: .86rem; line-height: 1.6; max-width: 76ch; margin-bottom: 22px; }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.method-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.method-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.method-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 70px;
  margin-bottom: 12px;
}
.mc-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px;
  overflow: hidden;
  background: var(--border);
}
.mc-bar i { display: block; width: 100%; }
.mc-bar .mc-principal { height: var(--p); background: linear-gradient(180deg, var(--accent), var(--accent-dark)); }
.mc-bar .mc-interest { height: calc(100% - var(--p)); background: linear-gradient(180deg, var(--gold), #d98d0f); }
.mc-bar.grace-flat .mc-interest { background: var(--gold); }
.method-legend { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.method-legend .dot { width: 8px; height: 8px; }
.method-card h3 { font-size: .96rem; margin-bottom: 8px; line-height: 1.35; }
.method-desc { font-size: .8rem; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }
.method-pro, .method-con { font-size: .78rem; line-height: 1.55; padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; }
.method-pro { background: var(--accent-soft); }
.method-pro strong { color: var(--accent); display: block; margin-bottom: 3px; font-size: .74rem; }
.method-con { background: #FFF6E9; }
.method-con strong { color: #B9720A; display: block; margin-bottom: 3px; font-size: .74rem; }
.method-pro p, .method-con p { color: var(--text); }

/* ---------- History ---------- */
.history-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-top: 20px;
}
.page-side .history-card {
  margin-top: 0;
  padding: 18px 14px;
  border-radius: var(--radius-sm);
}
.page-side .history-head h2 { font-size: 1rem; }
.page-side .history-desc { font-size: .78rem; }
.page-side .history-hint { font-size: .72rem; margin-bottom: 10px; }
.page-side .history-info {
  grid-template-columns: 1fr;
  gap: 2px;
}
.page-side .history-item { padding: 10px 10px; gap: 8px; }
.page-side .history-empty { font-size: .82rem; padding: 14px 0; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.history-head h2 { font-size: 1.1rem; }
.history-clear {
  border: none; background: transparent; color: var(--coral);
  font-size: .8rem; font-weight: 600; padding: 4px 8px;
  border-radius: 6px; transition: background .15s;
}
.history-clear:hover { background: rgba(255,107,107,.1); }
.history-desc { font-size: .84rem; color: var(--muted); margin-bottom: 4px; }
.history-hint { font-size: .78rem; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.history-empty { color: var(--muted); font-size: .88rem; padding: 20px 0; text-align: center; }

.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  animation: slideIn .35s ease both;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.history-item:hover { border-color: var(--accent); }
.history-item.selected { border-color: var(--accent); background: var(--accent-soft); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.history-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.history-item.selected .history-check { border-color: var(--accent); background: var(--accent); }
.history-item.selected .history-check::after { content: '✓'; color: #fff; font-size: .7rem; font-weight: 700; }
.history-info { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 12px; }
.history-info .h-type { font-weight: 700; font-size: .86rem; color: var(--primary); grid-column: 1 / -1; }
.history-info .h-meta { font-size: .76rem; color: var(--muted); }
.history-info .h-meta b { color: var(--text); font-weight: 700; }
.history-del {
  border: none; background: transparent; color: var(--muted);
  width: 26px; height: 26px; border-radius: 50%; font-size: 1rem; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.history-del:hover { background: rgba(255,107,107,.12); color: var(--coral); }

.btn-compare {
  width: 100%; margin-top: 16px;
  border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  padding: 13px; font-weight: 700; font-size: .92rem;
  transition: transform .15s, background .15s;
}
.btn-compare:hover { transform: translateY(-2px); background: var(--primary-2); }

/* ---------- Compare modal ---------- */
.compare-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(11,31,58,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .25s ease; padding: 20px;
}
.compare-overlay.show { opacity: 1; visibility: visible; }
.compare-modal {
  background: var(--card); border-radius: var(--radius);
  width: min(640px, 100%); max-height: 84vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.97); transition: transform .28s cubic-bezier(.2,.8,.3,1.15);
}
.compare-overlay.show .compare-modal { transform: translateY(0) scale(1); }
.compare-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.compare-close { background: var(--paper); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; color: var(--muted); }
.compare-close:hover { background: var(--border); }
.compare-body { padding: 20px 22px 26px; overflow-y: auto; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table th, .compare-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.compare-table th { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; color: var(--muted); font-weight: 600; }
.compare-table td.better { color: var(--accent); font-weight: 700; }
.compare-table td.worse { color: var(--coral); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary); color: rgba(255,255,255,.85); margin-top: 40px; }
.footer-inner { max-width: var(--site-width); margin: 0 auto; padding: 30px 20px; text-align: center; }
.footer-brand { font-size: .95rem; margin-bottom: 8px; }
.footer-brand a { color: var(--accent); text-decoration: none; }
.footer-sep { margin: 0 8px; opacity: .5; }
.footer-disclaimer, .footer-rights { font-size: .76rem; color: rgba(255,255,255,.55); margin-top: 4px; max-width: 60ch; margin-left: auto; margin-right: auto; }
.footer-links { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; }
.cookie-settings-btn, .admin-link {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 7px 14px; border-radius: 999px; font-size: .78rem;
  text-decoration: none; transition: background .18s;
}
.cookie-settings-btn:hover, .admin-link:hover { background: rgba(255,255,255,.2); }

/* ---------- Cookie bar ---------- */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  transform: translateY(120%); transition: transform .4s cubic-bezier(.2,.8,.3,1.05);
  padding: 16px;
}
.cookie-bar.show { transform: translateY(0); }
.cookie-bar-inner {
  max-width: 860px; margin: 0 auto;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border);
}
.cookie-bar-icon { display: flex; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.cookie-bar-icon span {
  width: 8px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  animation: logoGrow 1.8s ease-in-out infinite;
}
.cookie-bar-icon span:nth-child(1) { height: 14px; }
.cookie-bar-icon span:nth-child(2) { height: 24px; animation-delay: .2s; }
.cookie-bar-icon span:nth-child(3) { height: 18px; animation-delay: .4s; }
.cookie-bar-text { flex: 1; min-width: 0; }
.cookie-bar-text strong { display: block; font-size: .92rem; margin-bottom: 3px; }
.cookie-bar-text p { font-size: .8rem; color: var(--muted); }
.cookie-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-accept, .btn-reject {
  border: none; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .84rem;
  transition: transform .15s;
}
.btn-accept { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.btn-reject { background: var(--paper); color: var(--muted); border: 1px solid var(--border); }
.btn-accept:hover, .btn-reject:hover { transform: translateY(-1px); }

/* =========================================================
   Multi Calculator (계산기X계산기)
   ========================================================= */
.mc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.mc-card-head .stock-heading, .mc-card-head .stock-sub { margin-bottom: 0; }
.mc-card-head .stock-sub { margin-top: 6px; }
.btn-mc-add {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s, transform .12s, box-shadow .18s;
}
.btn-mc-add:hover { background: var(--accent); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(var(--accent-rgb), .3); }
.btn-mc-add:active { transform: translateY(0); }

.btn-mc-reset {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--coral);
  background: #fff;
  color: var(--coral);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  margin-right: auto;
  transition: background .18s, transform .12s, box-shadow .18s, color .18s;
}
.btn-mc-reset:hover { background: var(--coral); color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(255,107,107,.3); }
.btn-mc-reset:active { transform: translateY(0); }

.mc-calculators { display: flex; flex-direction: column; gap: 10px; }
.mc-row { width: 100%; }
.mc-calc {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.mc-expression, .mc-display {
  border-radius: 10px;
  padding: 6px 13px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-head);
}
.mc-expression {
  min-height: 60px;
  background: var(--primary);
  color: rgba(255,255,255,.62);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.mc-display {
  min-height: 72px;
  background: var(--primary-2);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.mc-expression.small { font-size: 1.05rem; }
.mc-display.small { font-size: 1.3rem; }
.mc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.mc-key {
  height: 68px;
  border: none;
  border-radius: 9px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  touch-action: manipulation;
  transition: transform .1s, background .15s, border-color .15s;
}
.mc-key:active { transform: scale(.96); }
.mc-key.mc-op {
  background: #e6e8eb;
  color: #000;
  border-color: transparent;
}
.mc-key.mc-clear { background: var(--paper); color: var(--muted); }
.mc-key.mc-wide { grid-column: span 2; }

.mc-between {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.mc-between label {
  height: 57px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 9px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, border-color .15s, color .15s;
}
.mc-between input { position: absolute; opacity: 0; width: 0; height: 0; }
.mc-between label:has(input:checked) {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-color: transparent;
}
.mc-between-hidden { display: none; }

/* Add-calculator (and reset) buttons shown above/below the calculator list */
.mc-row-add-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  padding: 0 4px;
}
.mc-row-add-top { margin: 0 0 10px; }
.mc-row-add-bottom { margin: 10px 0 0; }

/* ---------- PC: 2 calculators per line, vertical operator between them ---------- */
@media (min-width: 981px) {
  .mc-calculators { display: flex; flex-flow: row wrap; gap: 14px; }
  .mc-row {
    display: flex;
    flex-flow: row wrap;
    align-items: stretch;
    gap: 10px;
    flex: 0 0 calc(50% - 7px);
    min-width: 0;
  }
  .mc-calc { flex: 1 1 0; min-width: 0; }
  /* PC: calculator display and keypad height reduced by 50% */
  .mc-expression { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
  .mc-display { min-height: 36px; padding-top: 3px; padding-bottom: 3px; }
  .mc-key { height: 34px; }
  .mc-between {
    width: 64px;
    flex: 0 0 64px;
    margin: 0;
    padding: 0;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    align-self: stretch;
  }
  .mc-between label { height: 100%; }
  /* Reserve the operator column's width even when hidden, so every
     calculator stays the same size whether or not it has an operator. */
  .mc-between-hidden { display: grid; visibility: hidden; }
}

.mc-full-expression {
  margin-bottom: 8px;
  padding: 0 4px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow-x: auto;
  color: var(--muted);
}

.mc-result-card { text-align: center; padding: 18px 26px; }
.mc-result { font-size: 1.15rem; font-weight: 800; color: var(--primary); }
.mc-result.error { color: #d22; font-size: .92rem; font-weight: 600; }
.mc-result-card .btn-mc-reset { margin-top: 14px; }

/* ---------- Count-up number pulse ---------- */
@keyframes numPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.stat-value.pop { animation: numPop .35s ease; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =========================================================
   Admin panel (shared minimal styles)
   ========================================================= */
.admin-body { background: var(--paper); min-height: 100vh; }
.admin-wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.admin-login-wrap { max-width: 380px; margin: 90px auto; padding: 0 20px; }
.admin-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 30px;
}
.admin-card h1 { font-size: 1.3rem; margin-bottom: 6px; color: var(--primary); }
.admin-card .sub { color: var(--muted); font-size: .86rem; margin-bottom: 22px; }
.admin-field { margin-bottom: 16px; }
.admin-field label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.admin-field input[type=text], .admin-field input[type=password], .admin-field input[type=number], .admin-field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: .95rem; background: var(--paper); transition: border-color .15s;
}
.admin-field textarea { min-height: 90px; resize: vertical; font-family: monospace; font-size: .82rem; }
.admin-field input:focus, .admin-field textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.admin-field .hint { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.admin-section-title { font-size: .95rem; font-weight: 700; color: var(--primary); margin: 26px 0 14px; padding-top: 18px; border-top: 1px solid var(--border); }
.admin-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.admin-btn {
  width: 100%; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff;
  padding: 14px; font-weight: 700; font-size: .95rem; margin-top: 8px;
  transition: transform .15s;
}
.admin-btn:hover { transform: translateY(-2px); }
.admin-btn.secondary { background: var(--paper); color: var(--muted); border: 1px solid var(--border); margin-top: 10px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.admin-top a { color: var(--primary); font-weight: 600; font-size: .86rem; text-decoration: none; }
.admin-msg { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 18px; font-weight: 600; }
.admin-msg.ok { background: var(--accent-soft); color: #027e6e; border: 1px solid #b7ecdf; }
.admin-msg.err { background: #FFECEC; color: #c0392b; border: 1px solid #ffc9c9; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-side { position: static; }
  .hero-inner { grid-template-columns: 1fr; padding-bottom: 52px; gap: 16px; }
  .hero-visual { order: -1; }
  .compare-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .header-inner { padding: 10px 14px; }
  .site-logo .logo-text { font-size: .95rem; }
  .lang-trigger .lang-code { display: none; }
  .lang-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 26px 16px 52px; }
  .hero-text h1 { font-size: 1.5rem; }
  .hero-visual { display: none; }
  .page-grid { padding: 0; }
  .calc-card, .result-card, .history-card, .finder-card, .method-compare-card, .finder-result-card, .method-card { padding: 18px; border-radius: 0; }
  .mode-tabs { display: none; }
  .all-menu-fab { display: flex; }
  .type-pills { grid-template-columns: repeat(2, 1fr); }
  #deposit-method-pills { grid-template-columns: repeat(3, 1fr); }
  .type-pill {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
  }
  #deposit-type-pills .type-pill,
  #deposit-method-pills .type-pill {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 5px;
    padding: 9px 3px;
    font-size: .68rem;
    white-space: nowrap;
  }
  #deposit-type-pills .pill-icon,
  #deposit-method-pills .pill-icon {
    width: 22px; height: 22px;
  }
  .pill-icon { flex: none; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  #result-card .result-stats { grid-template-columns: 1fr; }
  #stock-result-card .result-stats { grid-template-columns: 1fr; }
  #deposit-result-card .result-stats { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.02rem; }
  .cookie-bar-inner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-bar-icon { align-self: center; }
  .cookie-bar-actions { justify-content: center; }
  .history-info { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .field-input input { font-size: .95rem; }
  .compare-grid { grid-template-columns: 1fr; }
  .finder-question { font-size: .96rem; padding: 18px; min-height: 76px; }
  .finder-card { padding: 22px 18px; }
  .mc-card-head { flex-direction: column; }
  .btn-mc-add { align-self: flex-start; }
  /* Calculator height ~2/3 of the PC version: tighten display and button spacing */
  .mc-calc { padding: 4px 8px; }
  .mc-expression { min-height: 40px; padding: 3px 10px; margin-bottom: 3px; font-size: 1.05rem; }
  .mc-display { min-height: 48px; padding: 3px 10px; margin-bottom: 3px; font-size: 1.3rem; }
  .mc-pad { gap: 3px; }
  .mc-key { height: 44px; font-size: 1rem; }
  /* Operator area between calculators: twice as wide as the default 50% */
  .mc-between { width: 100%; }
  .mc-between label { height: 51px; font-size: 1.8rem; }
}

@media (max-width: 380px) {
  .type-pills { grid-template-columns: repeat(2, 1fr); }
  #deposit-method-pills { grid-template-columns: repeat(3, 1fr); }
  #deposit-type-pills .type-pill,
  #deposit-method-pills .type-pill {
    font-size: .62rem;
    padding: 8px 2px;
    gap: 4px;
  }
  #deposit-type-pills .pill-icon,
  #deposit-method-pills .pill-icon {
    width: 19px; height: 19px;
  }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .mode-tab .mode-tab-icon { display: none; }
  .finder-actions { flex-direction: column; }
}


/* =========================================================
   Refined UI redesign
   Visual-only overrides: calculator logic and page structure stay intact.
   ========================================================= */
:root {
  --primary: #172033;
  --primary-2: #24304a;
  --accent: #0f9f8f;
  --accent-dark: #087f73;
  --accent-soft: #eaf7f5;
  --accent-rgb: 15, 159, 143;
  --gold: #b58a3a;
  --coral: #c96a67;
  --paper: #f6f7f9;
  --card: #ffffff;
  --text: #172033;
  --muted: #687386;
  --border: #e2e6ec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(23,32,51,.04);
  --shadow-md: 0 4px 16px rgba(23,32,51,.06);
  --shadow-lg: 0 12px 32px rgba(23,32,51,.12);
}

body.theme-finder,
body.theme-deposit,
body.theme-stock,
body.theme-multicalc {
  --accent: #0f9f8f;
  --accent-dark: #087f73;
  --accent-soft: #eaf7f5;
  --accent-rgb: 15, 159, 143;
}

.site-header {
  box-shadow: 0 1px 8px rgba(0,0,0,.12);
}
.header-inner { min-height: 58px; padding-top: 10px; padding-bottom: 10px; }
.logo-bar { background: var(--accent); animation: none; }
.lang-trigger,
.font-switch {
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
.lang-trigger:hover { transform: none; background: rgba(255,255,255,.14); }
.font-switch button.active { background: var(--accent); color: #fff; }

.hero {
  background: var(--primary);
}
.hero::after { display: none; }
.hero-inner {
  padding: 30px 20px 44px;
  gap: 34px;
}
.hero-eyebrow {
  color: #a8e2db;
  background: rgba(15,159,143,.12);
  border-color: rgba(15,159,143,.28);
  border-radius: 6px;
  padding: 4px 9px;
  animation: none;
}
.hero-text h1,
.hero-sub { animation: none; }
.hero-text h1 { letter-spacing: -.035em; }
.hero-sub { color: rgba(255,255,255,.7); }
.hero-visual.hero-ad { width:750px;height:200px}

.page-grid { gap: 24px; }
.mode-tabs {
  margin-top: -24px;
  padding: 6px;
  gap: 3px;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 3px 14px rgba(23,32,51,.08);
  animation: none;
}
.mode-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 7px;
  font-size: .86rem;
  gap: 7px;
  font-weight: 600;
}
.mode-tab.active {
  background: var(--primary);
  color: #fff;
}
.mode-tab-icon { width: 16px; height: 16px; }

.calc-card,
.finder-card,
.method-card,
.history-card,
.method-compare-card,
.mc-card {
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
}
.calc-card { padding: 28px; }
.stock-heading,
.finder-title,
.method-compare-title { letter-spacing: -.025em; }
.stock-sub,
.finder-sub { margin-bottom: 20px; }

.type-pills { gap: 7px; margin-bottom: 24px; }
.type-pill {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 11px 8px;
  transition: border-color .15s, background .15s, color .15s;
}
.type-pill:hover { transform: none; border-color: #b8c1cc; color: var(--text); }
.type-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: none;
}
.pill-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--accent);
}
.pill-icon::before,
.pill-icon::after { background: rgba(255,255,255,.9); }

.field { gap: 7px; }
.field label { color: #596579; font-size: .8rem; }
.field-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(23,32,51,.02);
}
.field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .1);
}
.field-input input { padding: 12px 13px; }
.field-unit { padding: 0 13px; color: #7a8493; }
.field-range-wrap { padding: 0 8px; margin: 0 -8px; }
.field-range { height: 4px; }
.field-range::-webkit-slider-thumb {
  width: 16px; height: 16px;
  background: var(--accent);
  border-width: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.field-range::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--accent);
  border-width: 2px;
}

.btn-calc {
  border-radius: 8px;
  background: var(--accent);
  padding: 14px 16px;
  margin-top: 5px;
  box-shadow: none;
  transition: background .15s, transform .15s;
}
.btn-calc:hover {
  transform: none;
  background: var(--accent-dark);
  box-shadow: none;
}
.btn-calc::after { display: none; }

.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-top: 18px;
  animation: none;
}
.result-title { font-size: 1.08rem; letter-spacing: -.015em; }
.result-stats { gap: 8px; }
.stat {
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.stat.accent {
  background: var(--accent-soft);
  border-color: #c8e9e4;
}
.stat.accent .stat-value,
.stat.accent .stat-subvalue { color: var(--accent-dark); }
.stat-value { letter-spacing: -.02em; }
.ratio-bar { height: 10px; border-radius: 5px; }
.ratio-fill.principal { background: var(--accent); }
.ratio-fill.interest { background: #b58a3a; }
.dot.principal { background: var(--accent); }
.dot.interest { background: #b58a3a; }
.btn-schedule-toggle {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
}
.btn-schedule-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.schedule-scroll { border-radius: 8px; }

.ad-slot:empty {
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  background: #fafbfc;
  color: #a0a8b4;
  font-weight: 500;
}
.ad-hero:empty {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.025);
}

/* Common secondary cards/buttons */
.finder-btn,
.btn-schedule-toggle,
.btn-mc-add,
.btn-mc-reset,
.btn-mc-remove,
.btn-history-clear,
.mc-key,
.mc-between label {
  border-radius: 8px;
}

/* Keep mobile clean and edge-to-edge, while reducing visual noise. */
@media (max-width: 640px) {
.hero-visual.hero-ad { width:336px;height:280px}
  .hero-inner { padding: 24px 16px 20px; }
  .calc-card,
  .result-card,
  .history-card,
  .finder-card,
  .method-compare-card,
  .finder-result-card,
  .method-card { padding: 20px 16px; }
  .calc-card { border-radius: 0; box-shadow: none; }
  .result-card { border-left: 0; border-right: 0; }
  .type-pill { border-radius: 8px; }
  /* Stack reset button above the add-calculator button on mobile */
  .mc-row-add-wrap { flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
  .btn-mc-add,
  .btn-mc-reset { align-self: center; margin-right: 0; }
}
@media (max-width: 400px) {
.hero-visual.hero-ad { width:300px;height:250px}
}
