:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #17203a;
  --muted: #5b6478;
  --line: #e6e9f2;
  --accent: #3b5bfd;
  --accent-dark: #2a45c9;
  --green: #0e9f6e;
  --green-bg: #e7f7f0;
  --amber: #c77414;
  --amber-bg: #fdf3e3;
  --red: #d64545;
  --red-bg: #fdecec;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(23, 32, 58, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.nav-cta {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.nav-cta:hover { background: var(--accent-dark); }

/* Hero */
.hero { padding: 56px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.03em; margin: 0 0 12px; line-height: 1.12; }
.hero h1 .hl { color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; max-width: 640px; margin: 0 auto 22px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 10px; padding: 13px 24px; font-size: 15px;
  font-weight: 700; cursor: pointer; background: var(--accent); color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* Layout */
.tool-grid {
  display: grid; grid-template-columns: 380px 1fr; gap: 20px;
  align-items: start; margin: 26px 0 40px;
}
@media (max-width: 940px) { .tool-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.01em; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.field-group { margin-bottom: 18px; }
.field-group > h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field label .hint { font-weight: 400; color: var(--muted); }
.field input[type="number"], .field input[type="text"] {
  width: 100%; padding: 9px 11px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfbfe;
}
.field input:focus { outline: 2px solid rgba(59,91,253,0.25); border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 6px 0 10px; }
.check-row input { width: 16px; height: 16px; }
.fin-disabled { opacity: 0.45; pointer-events: none; }

/* Verdict */
.verdict { border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; border: 1px solid; position: relative; }
.verdict .v-score { position: absolute; right: 18px; top: 14px; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.verdict .v-score small { font-size: 14px; font-weight: 600; color: var(--muted); }
.verdict .v-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; margin-bottom: 2px; }
.verdict .v-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.verdict .v-desc { font-size: 14px; margin-top: 4px; }
.verdict.strong { background: var(--green-bg); border-color: #bfe8d4; }
.verdict.strong .v-label, .verdict.strong .v-title { color: var(--green); }
.verdict.review { background: var(--amber-bg); border-color: #f3ddb8; }
.verdict.review .v-label, .verdict.review .v-title { color: var(--amber); }
.verdict.weak { background: var(--red-bg); border-color: #f5c6c6; }
.verdict.weak .v-label, .verdict.weak .v-title { color: var(--red); }

.checks { list-style: none; padding: 0; margin: 12px 0 0; }
.checks li { font-size: 13.5px; padding: 7px 0 7px 28px; position: relative; border-top: 1px dashed var(--line); }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  background-repeat: no-repeat; background-position: center; background-size: 10px;
}
.checks li.pass::before { background-color: var(--green); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 11.5l-3-3 1.4-1.4 1.6 1.6 4.6-4.6 1.4 1.4z' fill='white'/%3E%3C/svg%3E"); }
.checks li.fail::before { background-color: var(--red); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 6.6L5.4 4 4 5.4 6.6 8 4 10.6 5.4 12 8 9.4l2.6 2.6 1.4-1.4-2.6-2.6 2.6-2.6L10.6 4z' fill='white'/%3E%3C/svg%3E"); }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric { background: #fbfbfe; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.metric .m-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.metric .m-value { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.metric .m-value.neg { color: var(--red); }
.metric .m-value.pos { color: var(--green); }
.metric .m-sub { font-size: 12px; color: var(--muted); }

/* Expense breakdown */
.expense-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.expense-row .bar { grid-column: 1 / -1; height: 6px; background: #eef0f7; border-radius: 4px; overflow: hidden; }
.expense-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.expense-row .e-val { font-weight: 700; }

/* Actions */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Scenarios */
.scenario-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.scenario-btns .btn { padding: 9px 16px; font-size: 13px; }
table.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.compare th, table.compare td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.compare th:first-child, table.compare td:first-child { text-align: left; font-weight: 600; }
table.compare th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 0; }
.empty-note { color: var(--muted); font-size: 13.5px; }

/* Pricing + FAQ */
.pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 10px 0 40px; }
@media (max-width: 700px) { .pricing { grid-template-columns: 1fr; } }
.price-card { text-align: center; padding: 28px 22px; }
.price-card.featured { border: 2px solid var(--accent); }
.price-card .p-name { font-weight: 800; font-size: 16px; }
.price-card .p-price { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0; }
.price-card .p-price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.price-card ul li { padding: 4px 0; }

.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 15px; }
.faq p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

footer { border-top: 1px solid var(--line); margin-top: 50px; padding: 26px 0 40px; color: var(--muted); font-size: 12.5px; }
footer .disclaimer { max-width: 760px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(23,32,58,0.5);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 28px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal h3 { margin: 0 0 6px; font-size: 20px; }
.modal p { color: var(--muted); font-size: 14px; }
.modal input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; margin: 8px 0; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 12px; }
.modal .msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.modal .msg.err { color: var(--red); }
.modal .msg.ok { color: var(--green); }

/* AdSense placements — professional: max two units, clearly labeled, never
   above the fold, no popups / interstitials / sticky bars. */
.ad-slot {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; margin: 0 0 20px;
  min-height: 110px;
}
.ad-slot .ad-label {
  display: block; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px;
}

/* Paywall tiers */
.tier {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.tier strong { font-size: 15px; }

/* Saved deals */
.saved-deal {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-top: 1px dashed var(--line); font-size: 14px;
}
.saved-deal .d-name { font-weight: 700; }
.saved-deal .d-meta { color: var(--muted); font-size: 12.5px; }

/* Mode tabs */
.tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.tab-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 10px; padding: 10px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tab-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
#panelFlip .tool-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { #panelFlip .tool-grid { grid-template-columns: 1fr; } }

/* Result rows for long-term / flip cards */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; }
.kv .v.pos { color: var(--green); }
.kv .v.neg { color: var(--red); }
.sect-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 14px 0 4px; }
.fine { font-size: 12px; color: var(--muted); margin-top: 10px; }
.inline-msg { font-size: 13px; color: var(--red); margin-top: 8px; min-height: 18px; }
