/* PaisaRank v2 — shadcn/ui design language (new-york, zinc base, blue accent)
   implemented as zero-dependency CSS. Same tokens, no React tax. */

:root {
  --background: #fafafa;
  --card: #ffffff;
  --foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717b;
  --border: #e4e4e7;
  --input: #d4d4d8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-foreground: #ffffff;
  --ring: rgba(37, 99, 235, 0.4);
  --track: #dbeafe;
  --success: #16a34a;
  --wash: rgba(37, 99, 235, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.14);
  --radius: 0.625rem;
  --glow: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(37, 99, 235, 0.10), transparent);
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --card: #131316;
    --foreground: #fafafa;
    --muted: #1c1c1f;
    --muted-foreground: #a1a1aa;
    --border: #26262a;
    --input: #303036;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-foreground: #ffffff;
    --ring: rgba(59, 130, 246, 0.5);
    --track: #172554;
    --success: #4ade80;
    --wash: rgba(59, 130, 246, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --glow: radial-gradient(ellipse 60% 50% at 50% -10%, rgba(59, 130, 246, 0.14), transparent);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  background-image: var(--glow);
  background-repeat: no-repeat;
  color: var(--foreground);
  line-height: 1.6;
  font-size: 16px;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--primary); text-decoration: none; transition: color 150ms; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--primary); color: var(--primary-foreground); }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ---- header: sticky, blurred, hairline ---- */
header.site {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 75%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { font-weight: 650; font-size: 18px; color: var(--foreground); letter-spacing: -0.02em; }
.logo .paisa { color: var(--primary); }
nav.tools { display: flex; gap: 4px; font-size: 13.5px; font-weight: 500; }
nav.tools a {
  color: var(--muted-foreground); padding: 6px 10px; border-radius: calc(var(--radius) * 0.75);
  transition: color 150ms, background 150ms;
}
nav.tools a:hover { color: var(--foreground); background: var(--muted); text-decoration: none; }

/* ---- hero ---- */
.hero { padding: 52px 0 8px; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--muted-foreground);
  border: 1px solid var(--border); background: var(--card);
  padding: 4px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
h1 {
  font-size: clamp(30px, 6vw, 44px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700;
}
.sub { color: var(--muted-foreground); margin-top: 14px; font-size: 16.5px; max-width: 58ch; }
.sub b { color: var(--foreground); font-weight: 600; }

/* ---- card ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.6);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

/* ---- form ---- */
.field-label {
  font-size: 13px; font-weight: 500; color: var(--foreground);
  margin-bottom: 8px; display: block;
}
.amount-row { display: flex; gap: 10px; flex-wrap: wrap; }
.amount-box { position: relative; flex: 1 1 220px; }
.amount-box .rupee {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted-foreground); font-size: 18px; pointer-events: none;
}
input[type="text"], input[type="number"] {
  width: 100%;
  font-size: 18px;
  font-family: inherit;
  font-weight: 500;
  padding: 11px 14px 11px 34px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms, box-shadow 150ms;
}
input.plain { padding-left: 14px; font-size: 15px; }
input::placeholder { color: var(--muted-foreground); opacity: 0.7; font-weight: 400; }
input:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.amount-hint { font-size: 13px; color: var(--muted-foreground); margin-top: 8px; min-height: 18px; }

/* segmented control — shadcn Tabs look */
.seg {
  display: inline-flex; gap: 3px; padding: 3px;
  border-radius: var(--radius);
  background: var(--muted);
  border: 1px solid var(--border);
}
.seg button {
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  padding: 8px 14px; border: 0; border-radius: calc(var(--radius) * 0.75);
  background: transparent; color: var(--muted-foreground); cursor: pointer; white-space: nowrap;
  transition: color 150ms, background 150ms, box-shadow 150ms;
}
.seg button:hover { color: var(--foreground); }
.seg button.on { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* ---- buttons — shadcn spec ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 550; font-size: 15px; letter-spacing: -0.01em;
  background: var(--primary); color: var(--primary-foreground);
  border: 0; border-radius: var(--radius);
  padding: 12px 22px; cursor: pointer; margin-top: 18px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 150ms, transform 100ms, box-shadow 150ms;
}
.btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn.ghost {
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { background: var(--muted); }
.btn.small { font-size: 13.5px; padding: 9px 15px; margin-top: 0; }
.btn.wa { background: #16a34a; }
.btn.wa:hover { background: #15803d; }

.compare-row { margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-row .field-label { margin: 0; }

/* ---- result ---- */
#result { display: none; }
#result.show {
  display: block;
  animation: rise 500ms cubic-bezier(0.16, 1, 0.3, 1);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
  box-shadow: var(--shadow-lg), 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-figure {
  font-size: clamp(56px, 14vw, 92px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  background: linear-gradient(135deg, var(--foreground) 30%, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-caption { color: var(--muted-foreground); font-size: 16px; margin-top: 6px; }

.meter { margin: 28px 0 8px; }
.meter .bar {
  position: relative; height: 12px; border-radius: 6px; background: var(--track);
}
.meter .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 70%, var(--track)), var(--primary));
  border-radius: 6px;
  transition: width 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}
.meter .you {
  position: absolute; top: 50%;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent), var(--shadow-md);
  transform: translate(-50%, -50%);
  transition: left 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}
.meter .ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-foreground); margin-top: 10px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 24px; }
.tile {
  background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: transform 150ms, box-shadow 150ms;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile .t-label { font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); }
.tile .t-value { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; margin-top: 4px; }
.tile .t-note { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }

.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.share-row .btn { margin-top: 0; }

/* ---- monetization slots ---- */
.slot {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  background: var(--wash);
  border-radius: calc(var(--radius) * 1.6);
  padding: 18px 20px; margin: 24px 0;
}
.slot h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.slot p { font-size: 14px; color: var(--muted-foreground); }
.slot a.cta { font-weight: 600; font-size: 14px; display: inline-block; margin-top: 10px; }
.tiny { font-size: 11.5px; color: var(--muted-foreground); }

/* ---- calculators ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
details.assumptions { margin-top: 18px; font-size: 14px; }
details.assumptions summary {
  cursor: pointer; color: var(--muted-foreground); font-weight: 500;
  padding: 6px 0; transition: color 150ms; list-style-position: inside;
}
details.assumptions summary:hover { color: var(--foreground); }
details.assumptions .grid2 { margin-top: 14px; }

table.breakdown { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 10px; }
table.breakdown td { padding: 11px 4px; border-bottom: 1px solid var(--border); }
table.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
table.breakdown tr.total td { font-weight: 700; border-bottom: none; padding-top: 14px; }
table.breakdown td.neg { color: var(--muted-foreground); }

.note {
  font-size: 13.5px; color: var(--muted-foreground);
  background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; margin-top: 14px;
}
.note b { color: var(--foreground); font-weight: 600; }

/* ---- prose & footer ---- */
h2.section { font-size: 21px; font-weight: 650; letter-spacing: -0.025em; margin: 40px 0 6px; }
.prose p { margin: 12px 0; color: var(--muted-foreground); font-size: 15px; }
.prose b { color: var(--foreground); font-weight: 600; }
.prose ul { margin: 12px 0 12px 22px; color: var(--muted-foreground); font-size: 15px; }
.prose li { margin: 6px 0; }
.prose h3 { margin-top: 24px; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--foreground); }

footer.site {
  margin-top: 64px; padding: 28px 0 48px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted-foreground);
}
footer.site a { color: var(--muted-foreground); font-weight: 500; }
footer.site a:hover { color: var(--foreground); }
footer.site .links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
