:root {
  --maxw: 980px;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="light"] {
  --bg: #eef2f7; --card: #ffffff; --text: #0f172a; --muted: #64748b;
  --border: #e4e9f0; --row-hover: #f6f8fb; --best-bg: #ecfdf5; --best-border: #86efac;
  --accent: #15803d; --accent-strong: #16a34a;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 16px rgba(15,23,42,.04);
  --chip: #ffffff; --chip-border: #e4e9f0;
}
[data-theme="dark"] {
  --bg: #0a0f1c; --card: #121d33; --text: #e8eefb; --muted: #94a6c4;
  --border: #233248; --row-hover: #17243f; --best-bg: #0e2c20; --best-border: #1f7a52;
  --accent: #34d399; --accent-strong: #34d399;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 8px 28px rgba(0,0,0,.35);
  --chip: #ffffff; --chip-border: #cdd7e6;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding: clamp(16px, 4vw, 44px);
  transition: background .25s ease, color .25s ease;
}
.wrap { max-width: var(--maxw); margin: 0 auto; }
a { color: var(--accent-strong); }

/* ---- Top navigation ---- */
.nav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--border);
}
.brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em;
  text-decoration: none; color: var(--text); margin-right: auto;
}
.brand .arrow { color: var(--accent-strong); }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--row-hover); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--row-hover); }

.theme-toggle {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform .15s ease, background .25s ease, border-color .2s ease;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--accent-strong); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle svg { width: 19px; height: 19px; }
[data-theme="dark"] .ico-moon, [data-theme="light"] .ico-sun { display: none; }

/* ---- Page hero ---- */
.hero { margin-bottom: 22px; }
.hero h1 { font-size: clamp(1.45rem, 4vw, 2.1rem); margin: 0 0 6px; letter-spacing: -.02em; }
.hero h1 .arrow { color: var(--accent-strong); }
.hero .sub { margin: 0; color: var(--muted); font-size: .94rem; }
.hero .sub strong { color: var(--text); }

/* ---- USD <-> INR converter ---- */
.converter {
  margin-top: 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; max-width: 540px;
}
.rate-line { margin: 12px 0 0; font-size: 1.05rem; }
.rate-line strong { font-weight: 700; }
.rate-line .muted { color: var(--muted); font-size: .82rem; font-weight: 400; }
.conv-fields { display: flex; align-items: center; gap: 10px; }
.conv-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
}
.conv-field:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.conv-field .ccy { color: var(--muted); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.conv-field input {
  border: none; background: transparent; color: var(--text); width: 100%; min-width: 0;
  font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.conv-field input:focus { outline: none; }
.conv-field input::-webkit-outer-spin-button,
.conv-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.conv-eq { color: var(--muted); font-weight: 700; font-size: 1.15rem; flex: none; }

@media (max-width: 460px) {
  .conv-fields { flex-direction: column; align-items: stretch; }
  .conv-eq { align-self: center; transform: rotate(90deg); }
}

.live-tag {
  display: inline-block; font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--accent-strong);
  padding: 1px 6px; border-radius: 999px; vertical-align: middle;
}

.status { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---- Rates table ---- */
table.rates {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.rates thead th {
  text-align: left; font-size: .71rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.rates th.num, .rates td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rates th.rank, .rates td.rank { width: 40px; text-align: center; color: var(--muted); font-weight: 600; }
.rates tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rates tbody tr:last-child td { border-bottom: none; }
.rates tbody tr:hover { background: var(--row-hover); }
.rates tbody tr.best { background: var(--best-bg); }
.rates tbody tr.best td:first-child { box-shadow: inset 3px 0 0 var(--accent-strong); }

.provider-cell { display: flex; align-items: center; gap: 12px; }
.pblock { display: flex; flex-direction: column; min-width: 0; }
.meta-sm { display: none; }
.logo-chip {
  flex: none; width: 48px; height: 30px; border-radius: 8px; background: var(--chip);
  border: 1px solid var(--chip-border); display: grid; place-items: center; padding: 4px;
}
.logo-chip img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-chip.empty { font-size: .8rem; font-weight: 700; color: #475569; }
.pname { font-weight: 600; }
.pill {
  display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: #fff; background: var(--accent-strong);
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}
.rcv { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.amt { font-weight: 700; }
tr.best .amt { color: var(--accent-strong); }
.delta { font-size: .76rem; color: var(--muted); font-weight: 500; }

/* ---- Article / prose content ---- */
.content { max-width: 760px; }
.content h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 12px; letter-spacing: -.02em; }
.content h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; letter-spacing: -.01em; }
.content h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.content p, .content li { color: var(--text); font-size: 1rem; }
.content p { margin: .7rem 0; }
.content ul, .content ol { padding-left: 1.3rem; margin: .6rem 0; }
.content li { margin: .35rem 0; }
.content .lead { font-size: 1.1rem; color: var(--muted); }
.content .updated { color: var(--muted); font-size: .85rem; margin-top: 0; }
.callout {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin: 1.2rem 0; box-shadow: var(--shadow);
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* details / FAQ */
.content details {
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  padding: 4px 16px; margin: 10px 0; box-shadow: var(--shadow);
}
.content details summary {
  cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none;
}
.content details summary::-webkit-details-marker { display: none; }
.content details summary::after { content: "+"; float: right; color: var(--muted); font-weight: 700; }
.content details[open] summary::after { content: "–"; }
.content details p { margin: 0 0 12px; color: var(--muted); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem;
}
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer .links a { color: var(--muted); text-decoration: none; }
.site-footer .links a:hover { color: var(--text); }
.site-footer .fine { font-size: .8rem; line-height: 1.5; }

/* ---- Article hub cards ---- */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.article-card {
  display: block; text-decoration: none; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .2s ease;
}
.article-card:hover { transform: translateY(-2px); border-color: var(--accent-strong); }
.article-card img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  background: #fff; border-bottom: 1px solid var(--border);
}
.article-card .body { padding: 14px 16px; }
.article-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.article-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }

/* ---- Article body: media + tables ---- */
.content img { max-width: 100%; height: auto; }
.content figure.hero-img { margin: 1.2rem 0; }
.content figure.hero-img img {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff; display: block;
}
.content figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; font-style: italic; }
.content .table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.content table { width: 100%; border-collapse: collapse; min-width: 460px; font-size: .95rem; }
.content th, .content td { border: 1px solid var(--border); padding: 8px 11px; text-align: left; }
.content thead th { background: var(--row-hover); font-weight: 600; }
.content hr { border: none; border-top: 1px solid var(--border); margin: 1.6rem 0; }

/* ---- Manual ad slots (filled by site.js once slot IDs are set) ---- */
.ad-slot { margin: 20px auto; text-align: center; max-width: 760px; }
.ad-slot:empty { display: none; margin: 0; }

/* ---- Responsive: compact provider cards ---- */
@media (max-width: 640px) {
  .rates, .rates tbody { display: block; }
  table.rates { border: none; background: transparent; box-shadow: none; overflow: visible; }
  .rates thead { display: none; }
  .rates tbody tr {
    display: grid; grid-template-columns: 1fr auto; column-gap: 12px;
    align-items: center; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 13px; margin-bottom: 8px; box-shadow: var(--shadow);
  }
  .rates tbody tr.best { border-color: var(--best-border); }
  .rates tbody tr:hover { background: var(--card); }
  .rates tbody td { display: block; padding: 0; border: none; text-align: left; }
  .rates tbody td::before { content: none; }
  /* rate + fee move into the .meta-sm sub-line under the name */
  .rates td.rank, .rates td.rate, .rates td.fee { display: none; }
  .rates td.provider { grid-column: 1; grid-row: 1; min-width: 0; }
  .rates td.receive  { grid-column: 2; grid-row: 1; text-align: right; }
  .meta-sm { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 1px; }
  .provider-cell { gap: 10px; }
  .logo-chip { width: 40px; height: 26px; }
  .pname { font-size: .98rem; }
  .rcv { align-items: flex-end; line-height: 1.2; }
  .amt { font-size: 1.05rem; }
  .delta { font-size: .72rem; }
}
