/* MeroKalam.com official compound-interest-calculator styles. Unauthorized copying or republication is not permitted. */
/* ═══════════════════════════════════════════════════
   Compound Interest Calculator -tool-specific CSS only
   Base tokens, nav, footer, share-bar handled by main.css + mk-shared.css
═══════════════════════════════════════════════════ */

:root {
  --ci-blue:  #2563eb;
  --ci-green: #16a34a;
  --ci-amber: #d97706;
  --ci-surf:  #fff;
  --ci-bg:    #f5f3ef;
  --ci-bord:  #e2ddd6;
  --ci-muted: #64748b;
}

body { background: linear-gradient(160deg, #faf8f4 0%, #f3efe8 100%) !important; min-height: 100vh; }
.page { max-width: 1080px !important; padding-top: .1rem !important; }

/* ── Header ── */
.header {
  position: relative; overflow: hidden; max-width: 1060px;
  text-align: center; margin: .38rem auto .38rem; padding: .75rem 2rem 1.35rem;
  background: #f8fafc; border: 1px solid rgba(191,219,254,.95);
  border-radius: 1.25rem; box-shadow: 0 18px 45px rgba(15,23,42,.08), 0 3px 10px rgba(37,99,235,.06);
}
.header h1 {
  display: block; width: 100%; max-width: none;
  font-size: clamp(2.25rem, 4.4vw, 2.7rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.02;
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin: 0 0 .8rem;
}
.header p { display: block !important; width: 100% !important; max-width: none !important; font-size: 1rem; color: #1e293b; margin: 0 !important; line-height: 1.82; text-align: center !important; }
.header .ne { display: none !important; }
.ne { font-family: 'Noto Sans Devanagari', sans-serif; }
[data-theme="dark"] .header { background: #0f172a; border-color: rgba(59,130,246,.42); box-shadow: 0 18px 45px rgba(0,0,0,.28); }
[data-theme="dark"] .header p { color: #dbeafe; }

/* ── Rate context badge ── */
.rate-ctx {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
  margin-bottom: 1.25rem;
}
.rate-pill {
  background: #fff; border: 1px solid var(--ci-bord); border-radius: 20px;
  padding: .22rem .7rem; font-size: .72rem; font-weight: 600; color: var(--ci-muted);
}
.rate-pill strong { color: var(--ci-blue); }

/* ── Calculator grid ── */
.ci-grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr);
  gap: 1.25rem; align-items: start; margin-bottom: 1.75rem;
}
@media(max-width:760px) { .ci-grid { grid-template-columns: 1fr; } }
@media(max-width:768px) {
  .header { margin-top: .38rem; padding: 1.35rem 1.15rem 1.25rem; border-radius: 1rem; }
  .header h1 { font-size: clamp(1.85rem,9vw,2.35rem); }
  .header p { font-size: .95rem; line-height: 1.72; }
}

/* ── Card ── */
.ci-card {
  background: var(--ci-surf); border: 1px solid var(--ci-bord); border-radius: 14px;
  overflow: hidden;
}
.ci-card-head {
  padding: .9rem 1.1rem; background: linear-gradient(135deg,#f8f9ff,#f0f4ff);
  border-bottom: 1px solid var(--ci-bord);
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ci-blue); display: flex; align-items: center; gap: .5rem;
}
.ci-card-body { padding: 1.1rem; }

/* ── Field ── */
.ci-field { margin-bottom: 1rem; }
.ci-field:last-child { margin-bottom: 0; }
.ci-label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ci-muted); margin-bottom: .4rem;
}
.ci-label .ne-sub { font-family: 'Noto Sans Devanagari', sans-serif; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .8; margin-left: .3rem; }
.ci-input-wrap { position: relative; }
.ci-prefix {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: .8rem; font-weight: 700; color: var(--ci-blue); pointer-events: none;
  font-family: 'DM Mono', monospace;
}
.ci-suffix {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-size: .75rem; color: var(--ci-muted); pointer-events: none;
}
.ci-inp {
  width: 100%; background: #f8fafc; border: 1.5px solid var(--ci-bord); border-radius: 8px;
  color: #1e293b; font-family: 'DM Mono', monospace; font-size: .9rem;
  padding: .5rem .65rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
  -moz-appearance: textfield;
}
.ci-inp::-webkit-outer-spin-button, .ci-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.ci-inp:focus { border-color: var(--ci-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); background: #fff; }
.ci-inp.has-prefix { padding-left: 2.4rem; }
.ci-inp.has-suffix { padding-right: 2.6rem; }

select.ci-inp {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 2.2rem; background-color: #f8fafc;
}
select.ci-inp option { background: #fff; }

/* Range slider */
.ci-range {
  width: 100%; margin-top: .4rem; height: 4px; border-radius: 99px;
  outline: none; border: none; padding: 0; cursor: pointer;
  accent-color: var(--ci-blue); background: var(--ci-bord);
}
.ci-range-labels {
  display: flex; justify-content: space-between;
  font-size: .66rem; color: var(--ci-muted); margin-top: .25rem;
  font-family: 'DM Mono', monospace;
}

/* Show button */
.ci-calc-btn {
  width: 100%; padding: .7rem 1rem; background: var(--ci-blue); color: #fff;
  border: none; border-radius: 8px; font-family: inherit; font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: filter .15s, transform .15s; letter-spacing: .01em; margin-top: .75rem;
}
.ci-calc-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.ci-calc-btn:active { transform: none; }

/* ── Results card ── */
.ci-result-main {
  padding: 1.1rem;
  background: linear-gradient(135deg,#f0fdf4,#ecfdf5);
  border-bottom: 1px solid #bbf7d0;
}
.ci-result-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ci-green); margin-bottom: .35rem;
}
.ci-result-value {
  font-family: 'DM Mono', monospace; font-size: clamp(1.6rem,4vw,2.4rem); font-weight: 600;
  color: #15803d; line-height: 1.1;
}
.ci-result-value .ci-rv-curr { font-size: .5em; opacity: .7; margin-right: .2rem; }
.ci-result-sub { font-size: .78rem; color: var(--ci-green); margin-top: .3rem; font-weight: 600; }

/* Stats strip */
.ci-stats { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ci-bord); }
.ci-stat { padding: .75rem 1rem; }
.ci-stat:first-child { border-right: 1px solid var(--ci-bord); }
.ci-stat-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ci-muted); margin-bottom: .25rem; }
.ci-stat-value { font-family: 'DM Mono', monospace; font-size: 1.05rem; font-weight: 600; }
.ci-stat-value.principal { color: var(--ci-blue); }
.ci-stat-value.interest  { color: var(--ci-amber); }

/* Quick metrics */
.ci-metrics { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1rem; border-bottom: 1px solid var(--ci-bord); }
.ci-metric-pill {
  background: #f8fafc; border: 1px solid var(--ci-bord); border-radius: 20px;
  padding: .25rem .7rem; font-size: .72rem; color: #374151;
}
.ci-metric-pill strong { color: var(--ci-blue); }

/* Chart */
.ci-chart-section { padding: .85rem 1rem; border-bottom: 1px solid var(--ci-bord); }
.ci-chart-title {
  font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ci-muted); margin-bottom: .6rem; display: flex; align-items: center; gap: .75rem;
}
.ci-legend { display: flex; gap: .75rem; flex-wrap: wrap; }
.ci-legend-item { display: flex; align-items: center; gap: .3rem; font-size: .68rem; color: var(--ci-muted); }
.ci-legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.ci-svg-wrap { position: relative; width: 100%; }
.ci-svg-wrap svg { width: 100%; height: 160px; overflow: visible; }
.ci-tooltip {
  position: absolute; background: #1e293b; color: #f1f5f9; border-radius: 8px;
  padding: 7px 11px; font-family: 'DM Mono', monospace; font-size: .68rem;
  pointer-events: none; opacity: 0; transition: opacity .12s; white-space: nowrap;
  z-index: 10; transform: translate(-50%, -110%);
}
.ci-tooltip.vis { opacity: 1; }
.ci-tt-row { display: flex; align-items: center; gap: .35rem; margin-top: .15rem; }
.ci-tt-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.ci-tt-yr { font-size: .6rem; color: #94a3b8; margin-bottom: .2rem; }

/* Breakdown table */
.ci-breakdown { padding: .85rem 1rem; }
.ci-breakdown-title {
  font-size: .65rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ci-muted); margin-bottom: .6rem;
}
.ci-table-scroll { max-height: 210px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ci-bord) transparent; }
.ci-table { width: 100%; border-collapse: collapse; font-family: 'DM Mono', monospace; font-size: .75rem; }
.ci-table th {
  text-align: left; color: var(--ci-muted); font-weight: 600;
  padding: .35rem .5rem .5rem; border-bottom: 1.5px solid var(--ci-bord);
  font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; position: sticky; top: 0; background: #fff;
}
.ci-table td { padding: .45rem .5rem; border-bottom: 1px solid #f1f5f9; color: #374151; }
.ci-table tr:hover td { background: #f8fafc; }
.ci-table tr:last-child td { border-bottom: none; }
.ci-table td.td-int  { color: var(--ci-amber); }
.ci-table td.td-tot  { color: var(--ci-green); font-weight: 600; }

/* ── Article / SEO section ── */
.article { line-height: 1.8; color: #374151; }
.article h2 { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin: 1.75rem 0 .65rem; line-height: 1.3; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 1.25rem 0 .4rem; }
.article p  { margin-bottom: .9rem; font-size: .93rem; }
.article ul, .article ol { padding-left: 1.4rem; margin-bottom: .9rem; }
.article li { font-size: .93rem; margin-bottom: .35rem; }
.article strong { color: #1e293b; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap: .75rem; margin: 1.25rem 0;
}
.stat-box {
  background: #fff; border: 1px solid var(--ci-bord); border-radius: 10px;
  padding: .85rem 1rem; display: flex; flex-direction: column; gap: .2rem;
}
.stat-box .sn { font-family: 'DM Mono', monospace; font-size: 1.35rem; font-weight: 600; color: var(--ci-blue); }
.stat-box .sl { font-size: .72rem; color: var(--ci-muted); line-height: 1.4; }

.callout {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: .9rem 1.1rem; margin: 1rem 0; font-size: .9rem;
}
.callout.amber { background: #fffbeb; border-color: #fde68a; }
.callout.green { background: #f0fdf4; border-color: #bbf7d0; }
.callout strong { color: var(--ci-blue); }
.callout.amber strong { color: var(--ci-amber); }
.callout.green strong { color: var(--ci-green); }

.rule72-box {
  background: #f0fdf4; border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 12px; padding: 1.1rem 1.25rem; margin: 1.25rem 0;
}
.rule72-box h3 { color: #15803d; margin-top: 0; font-size: 1rem; }
.rule72-box p  { font-size: .88rem; color: #374151; margin-bottom: .5rem; }
.rule72-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: .5rem; margin-top: .75rem; }
.rule72-item { background: #fff; border: 1px solid #bbf7d0; border-radius: 8px; padding: .5rem .75rem; text-align: center; }
.rule72-item .ri-rate { font-family: 'DM Mono', monospace; font-size: 1.1rem; font-weight: 600; color: #15803d; }
.rule72-item .ri-yrs  { font-size: .72rem; color: #6b7280; }

.ci-comparison-table {
  width: 100%; border-collapse: collapse; font-size: .85rem; margin: 1rem 0;
}
.ci-comparison-table th {
  background: #f8fafc; border: 1px solid var(--ci-bord); padding: .55rem .75rem;
  text-align: left; font-weight: 700; color: #1e293b; font-size: .78rem;
}
.ci-comparison-table td {
  border: 1px solid var(--ci-bord); padding: .5rem .75rem; color: #374151;
}
.ci-comparison-table tr:nth-child(even) td { background: #f8fafc; }
.ci-comparison-table td.hi { font-weight: 700; color: var(--ci-green); }
.ci-comparison-table td.low { color: var(--ci-muted); }

/* Related links */
.rel-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.rel-link {
  background: #fff; border: 1px solid var(--ci-bord); border-radius: 8px;
  padding: .4rem .85rem; font-size: .82rem; font-weight: 600; color: var(--ci-blue);
  text-decoration: none; transition: border-color .15s, background .15s;
}
.rel-link:hover { border-color: var(--ci-blue); background: #eff6ff; }

.divider { height: 1px; background: var(--ci-bord); margin: 2rem 0; }
