/* ============================================================
   CalComet — Design system v2 (premium + friendly)
   ============================================================ */
:root {
  --brand: #E8465D;
  --brand-2: #F0682E;
  --brand-grad: linear-gradient(135deg, #E8465D 0%, #F0682E 100%);
  --ink: #14161F;
  --ink-soft: #3C4150;
  --muted: #6B7180;
  --faint: #9AA0AD;
  --line: #ECEDF1;
  --line-strong: #E0E2E8;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --bg-warm: #FBFAF8;
  --card: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(20,22,31,.06);
  --shadow-sm: 0 2px 8px rgba(20,22,31,.06), 0 1px 2px rgba(20,22,31,.04);
  --shadow-md: 0 10px 30px rgba(20,22,31,.09);
  --shadow-lg: 0 24px 60px rgba(20,22,31,.14);
  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1340px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.55;
  letter-spacing: -.01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; height: 72px; min-height: 72px; flex-wrap: nowrap; }
.logo { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 21px; letter-spacing: -.6px; }
.logo .mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(232,70,93,.35);
}
.logo .mark-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.logo .brand { color: var(--ink); }
.logo .brand span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-search { flex: 1; max-width: 440px; margin: 0 auto; position: relative; }
.nav-search input {
  width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0 46px 0 44px; font-size: 15px; background: var(--bg-soft);
  outline: none; transition: box-shadow .2s, border-color .2s, background .2s; font-family: inherit;
}
.nav-search input:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(232,70,93,.1); }
.nav-search .mag { position: absolute; left: 16px; top: 13px; color: var(--faint); pointer-events: none; }
.nav-search .go {
  position: absolute; right: 5px; top: 5px; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: var(--brand-grad); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.nav-links { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.nav-links a { padding: 9px 11px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-soft); white-space: nowrap; transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }

.search-results {
  position: absolute; top: 54px; left: 0; right: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  overflow: hidden; display: none; max-height: 400px; overflow-y: auto; padding: 6px;
}
.search-results.open { display: block; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; font-size: 14px; border-radius: 12px; }
.search-results a:hover { background: var(--bg-soft); }
.search-results .r-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: none; }
.search-results .r-name { font-weight: 600; }
.search-results .r-cat { color: var(--faint); font-size: 12px; margin-left: auto; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 44px 0 35px; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(760px 380px at 78% -8%, rgba(240,104,46,.16), transparent 62%),
    radial-gradient(680px 420px at 12% 6%, rgba(91,87,199,.13), transparent 60%),
    radial-gradient(700px 400px at 50% 120%, rgba(14,158,143,.10), transparent 60%),
    var(--bg-warm);
}
/* Animated comet — top-right of hero, subtle */
.hero .comet {
  position: absolute; top: 34px; right: 10%; width: 150px; height: 2px; z-index: 0;
  pointer-events: none; opacity: 0; transform: rotate(32deg);
  animation: cometFly 11s ease-in-out infinite;
}
.hero .comet::after {
  content: ""; position: absolute; right: 6px; top: 0; width: 150px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(250,204,21,0), rgba(250,204,21,.75));
}
.hero .comet::before {
  content: ""; position: absolute; right: -2px; top: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #FDE68A 45%, rgba(253,224,138,0) 75%);
  box-shadow: 0 0 14px 4px rgba(253,224,138,.65);
}
@keyframes cometFly {
  0%   { opacity: 0; transform: translate(70px, -46px) rotate(32deg); }
  6%   { opacity: .85; }
  18%  { opacity: 0; transform: translate(-200px, 110px) rotate(32deg); }
  100% { opacity: 0; transform: translate(-200px, 110px) rotate(32deg); }
}
@media (prefers-reduced-motion: reduce) { .hero .comet { display: none; } }
@media (max-width: 640px) { .hero .comet { display: none; } }

.hero .wrap { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 17px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--shadow-xs);
  font-size: 15.5px; font-weight: 700; color: #0F6B45; margin-bottom: 22px;
}
.hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.hero h1 { font-size: clamp(36px, 5.4vw, 62px); line-height: 1.03; margin: 0 0 20px; letter-spacing: -2px; font-weight: 800; }
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: clamp(16px,2vw,20px); color: var(--muted); max-width: 600px; margin: 0 auto 32px; }
.hero-search { max-width: 640px; margin: 0 auto; position: relative; }
.hero-search input {
  width: 100%; height: 66px; border-radius: 999px; border: 1px solid var(--line-strong);
  padding: 0 74px 0 30px; font-size: 17px; box-shadow: var(--shadow-md); outline: none; font-family: inherit; background: var(--card);
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 5px rgba(232,70,93,.12), var(--shadow-md); }
.hero-search .go {
  position: absolute; right: 9px; top: 9px; width: 48px; height: 48px; border: none; border-radius: 50%;
  background: var(--brand-grad); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(232,70,93,.4);
}
.quick-pills { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.quick-pills span.lbl { color: var(--faint); font-size: 13px; align-self: center; margin-right: 2px; }
.quick-pills a {
  padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600;
  font-size: 13.5px; background: var(--card); box-shadow: var(--shadow-xs); transition: transform .12s, border-color .12s, color .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.quick-pills a:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.hero-stats { display: flex; gap: 46px; justify-content: center; margin-top: 46px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.hero-stats .stat span { color: var(--muted); font-size: 13.5px; }

/* ---------- Sections ---------- */
.section { padding: 56px 0 8px; scroll-margin-top: 90px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.section-head .title { display: flex; align-items: center; gap: 15px; }
.section-head .emoji { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 27px; box-shadow: var(--shadow-xs); }
.section-head h2 { margin: 0; font-size: 27px; letter-spacing: -.8px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 14.5px; max-width: 520px; }
.section-head .see-all {
  color: var(--ink); font-weight: 700; font-size: 14.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; transition: border-color .15s, transform .12s, background .15s;
}
.section-head .see-all:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.rank-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink-soft); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }

/* Category page header — icon inline with title (matches homepage section header) */
.cat-head { margin: 4px 0 26px; }
.cat-head .emoji { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; font-size: 33px; box-shadow: var(--shadow-xs); }
.cat-head h1 { margin: 0; font-size: 32px; letter-spacing: -1px; line-height: 1.1; display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.cat-head p { margin: 5px 0 0; color: var(--muted); font-size: 15.5px; }

/* ---------- Card grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.card-grid.grid-6 { grid-template-columns: repeat(6, 1fr); }
.card-grid.grid-5 { grid-template-columns: repeat(5, 1fr); }
.card-grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .card-grid.grid-6 { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1120px) { .card-grid.grid-6, .card-grid.grid-5 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .card-grid.grid-6, .card-grid.grid-5, .card-grid.grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .card-grid.grid-6, .card-grid.grid-5, .card-grid.grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .card-grid.grid-6, .card-grid.grid-5, .card-grid.grid-4 { grid-template-columns: 1fr; } }

/* Load more row */
.load-row { display: flex; align-items: stretch; justify-content: flex-start; gap: 22px; margin-top: 26px; }
.count-box {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap;
}
.count-box.done { opacity: .45; }
.view-all {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-family: inherit; font-weight: 800; font-size: 15px; color: #fff; white-space: nowrap;
  padding: 12px 26px; border-radius: 999px;
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 50%, #EC4899 100%);
  box-shadow: 0 8px 20px rgba(124,58,237,.30); transition: transform .1s, box-shadow .15s;
}
.view-all:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(236,72,153,.38); }
.load-more {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px; color: #14310E;
  padding: 12px 28px; border-radius: 999px; background: linear-gradient(135deg, #22C55E 0%, #A3E635 55%, #FACC15 100%);
  box-shadow: 0 8px 20px rgba(34,197,94,.28); transition: transform .1s, box-shadow .15s, opacity .15s;
}
.load-more:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(34,197,94,.34); }
.load-more:disabled { cursor: default; opacity: .4; box-shadow: none; transform: none; filter: grayscale(.5); }

/* Back button (on every tool page) */
.back-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink-soft);
  font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; margin-bottom: 16px;
  transition: border-color .12s, color .12s, transform .1s;
}
.back-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateX(-2px); }
.calc-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s, border-color .16s; overflow: hidden;
}
.calc-card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: var(--card-accent, var(--brand)); opacity: 0; transition: opacity .16s;
}
.calc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent; }
.calc-card:hover::after { opacity: 1; }
.calc-card .top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.calc-card .ic {
  width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 24px;
  background: var(--ic-bg, var(--bg-soft)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.03);
}
.calc-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.3px; line-height: 1.25; }
.calc-card .desc { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.calc-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.calc-card .open { font-size: 13px; font-weight: 700; color: var(--card-accent, var(--brand)); opacity: 0; transform: translateX(-4px); transition: opacity .16s, transform .16s; }
.calc-card:hover .open { opacity: 1; transform: none; }
.tag { font-size: 10.5px; font-weight: 700; padding: 4px 5px 4px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; max-width: 60%; line-height: 1.2; letter-spacing: .1px; margin-left: auto; }
.calc-card .top h3, .calc-card .top { min-width: 0; }
.tag.live { background: rgba(14,158,143,.12); color: #0B8578; }
.tag.new { background: rgba(232,70,93,.12); color: var(--brand); }
.tag.soon { background: var(--bg-soft); color: var(--faint); }

/* ---------- Sidebar layout ---------- */
.page { padding: 30px 0 60px; }
/* Extra breathing room on individual tool pages */
.tool-page { padding-left: 40px; padding-right: 40px; }
@media (max-width: 760px) { .tool-page { padding-left: 18px; padding-right: 18px; } }

/* Back-to-top floating button */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  width: 52px; height: 52px; border: none; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%); color: #fff;
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(22,163,74,.4);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s, transform .25s, visibility .25s, box-shadow .15s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { box-shadow: 0 14px 30px rgba(22,163,74,.5); transform: translateY(-2px); }
@media (max-width: 640px) { .to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; } }
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb a:hover { color: var(--brand); }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 316px; gap: 34px; align-items: start; }
.page-title { font-size: 34px; letter-spacing: -1px; margin: 0 0 8px; line-height: 1.1; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 16px; max-width: 640px; }

.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 20px; }
/* On category pages, drop the ad down so it lines up with the category icon/title row (past the Back button) */
.cat-page .sidebar { margin-top: 56px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--card); box-shadow: var(--shadow-xs); }
.side-card h4 { margin: 0 0 14px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); font-weight: 700; }
.share-btns { display: flex; gap: 11px; flex-wrap: nowrap; }
.share-btns a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .12s, filter .12s, box-shadow .12s; box-shadow: 0 3px 10px rgba(2,6,23,.10); flex: 0 0 auto; }
.share-btns a:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 8px 18px rgba(2,6,23,.18); }
.share-btns a svg { width: 20px; height: 20px; }
.share-btns a.fb { background: #1877F2; }
.share-btns a.tw { background: #000; }
.share-btns a.in { background: #0A66C2; }
.share-btns a.wa { background: #25D366; }
.share-btns a.em { background: #6B7280; }

.socials { display: flex; gap: 9px; flex-wrap: wrap; }
.socials a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); transition: transform .12s, background .12s, color .12s, border-color .12s; }
.socials a:hover { transform: translateY(-3px); color: #fff; border-color: transparent; }
/* original brand colors */
.socials a.tw { color: #000; }        .socials a.tw:hover { background: #000; }
.socials a.fb { color: #1877F2; }     .socials a.fb:hover { background: #1877F2; }
.socials a.ig { color: #E4405F; }     .socials a.ig:hover { background: #E4405F; }
.socials a.in { color: #0A66C2; }     .socials a.in:hover { background: #0A66C2; }
.socials a.pin { color: #E60023; }    .socials a.pin:hover { background: #E60023; }

.ad-slot {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background:
    repeating-linear-gradient(45deg, #fafbfc, #fafbfc 11px, #f3f4f6 11px, #f3f4f6 22px);
  min-height: 600px; display: grid; place-items: center; text-align: center; color: #c2c6cf; font-size: 13px;
}
.ad-slot.small { min-height: 250px; }
.ad-bottom { margin-top: 40px; }
.ad-slot.leaderboard { min-height: 120px; width: 100%; }
.ad-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 6px; text-align: center; }

/* ---------- Calculator tool ---------- */
.tool { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); background: var(--card); }
.tool-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 15px; flex-wrap: wrap; background: linear-gradient(180deg,#fff, var(--bg-warm)); }
.tool-head .ic { width: 52px; height: 52px; border-radius: 14px; display:grid; place-items:center; font-size:26px; box-shadow: var(--shadow-xs); flex: 0 0 auto; }
.tool-head h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
.tool-head .sub { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.tool-body { padding: 26px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.field .hint { color: var(--faint); font-weight: 400; font-size: 12.5px; }
.field input, .field select, .field textarea {
  width: 100%; height: 50px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px;
  font-size: 16px; font-family: inherit; outline: none; transition: border-color .15s, box-shadow .15s; background: var(--card); color: var(--ink);
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(232,70,93,.1); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.input-group { display: flex; }
.input-group .prefix, .input-group .suffix { display: grid; place-items: center; padding: 0 14px; background: var(--bg-soft); border: 1px solid var(--line-strong); color: var(--muted); font-size: 15px; white-space: nowrap; }
.input-group .prefix { border-right: none; border-radius: 12px 0 0 12px; }
.input-group .suffix { border-left: none; border-radius: 0 12px 12px 0; }
.input-group input { border-radius: 0; }
.input-group .prefix + input { border-radius: 0 12px 12px 0; }
.input-group input.left { border-radius: 12px 0 0 12px; }
.input-group input.mid { border-radius: 0; }

.seg { display: inline-flex; background: var(--bg-soft); border-radius: 12px; padding: 4px; gap: 4px; border: 1px solid var(--line); }
.seg button { border: none; background: transparent; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); font-family: inherit; transition: color .15s; }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-xs); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 26px;
  border: none; border-radius: 13px; cursor: pointer; font-weight: 700; font-size: 16px; font-family: inherit;
  background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(232,70,93,.28); transition: transform .1s, box-shadow .15s; width: 100%;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(232,70,93,.34); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); box-shadow: none; }

.result { margin-top: 22px; border-radius: 18px; padding: 24px; background: linear-gradient(135deg,#FFF4F1,#FBF0F5); border: 1px solid #FBE0DE; display: none; }
.result.show { display: block; animation: pop .28s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px);} to {opacity:1; transform:none;} }
.result .big { font-size: 42px; font-weight: 800; letter-spacing: -1.4px; background: var(--brand-grad); -webkit-background-clip:text; background-clip:text; color: transparent; line-height: 1.1; }
.result .big-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.result-rows { margin-top: 18px; display: grid; gap: 2px; }
.result-rows .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #F1D9D8; font-size: 15px; }
.result-rows .row:last-child { border-bottom: none; }
.result-rows .row span { color: var(--ink-soft); }
.result-rows .row b { font-weight: 700; text-align: right; }

/* Enhanced result layout: value card + chart + recommendations */
.rx-grid { display: flex; gap: 24px; align-items: center; }
.rx-main { flex: 1 1 auto; min-width: 0; }
.rx-viz { flex: 0 0 auto; width: 236px; max-width: 46%; }
.rx-viz svg { width: 100%; height: auto; display: block; }
.rx-recs { margin-top: 20px; padding-top: 18px; border-top: 1px dashed #F1D9D8; }
.rx-recs ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.rx-recs li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink); line-height: 1.45; }
.rx-recs li svg { flex: 0 0 auto; margin-top: 1px; }
@media (max-width: 640px) {
  .rx-grid { flex-direction: column-reverse; align-items: stretch; gap: 14px; }
  .rx-viz { width: 100%; max-width: 320px; margin: 0 auto; }
}

/* prose / explanations */
.about {
  margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; background: var(--bg-warm);
}
.about h3 { font-size: 18px; letter-spacing: -.3px; margin: 0 0 10px; display: flex; align-items: center; gap: 9px; }
.about h3:not(:first-child) { margin-top: 22px; }
.about p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; text-align: justify; }
.about p:last-child { margin-bottom: 0; }
.about ul { margin: 0 0 6px; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
.about ul li { margin-bottom: 6px; }
.table-wrap { overflow-x: auto; margin: 4px 0 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: var(--bg-soft); }
.data-table td:last-child, .data-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }

/* soon banner */
.soon-banner { padding: 44px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-soft); }
.soon-banner .em { font-size: 46px; }
.soon-banner h3 { margin: 14px 0 6px; font-size: 22px; }
.soon-banner p { color: var(--muted); margin: 0 auto 20px; max-width: 420px; }

/* related */
.related { margin-top: 36px; }
.related h3 { font-size: 18px; margin-bottom: 15px; letter-spacing: -.3px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-list a { padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; font-weight: 600; transition: border-color .12s, transform .12s, color .12s; display: inline-flex; gap: 7px; align-items: center; }
.chip-list a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

/* category hero */
.cat-hero { padding: 30px 0 12px; }
.cat-hero .emoji { width: 68px; height: 68px; border-radius: 19px; display:grid; place-items:center; font-size: 35px; box-shadow: var(--shadow-xs); margin-bottom: 16px; }
.cat-count { display:inline-flex; gap:7px; align-items:center; font-size:13px; font-weight:700; color: var(--ink-soft); background: var(--card); border:1px solid var(--line-strong); border-radius:999px; padding:6px 13px; margin-bottom: 16px; }

/* ---------- Blog index (ComeTool style) ---------- */
.blog-hero {
  text-align: center; padding: 56px 0 44px; position: relative; overflow: hidden;
  background:
    radial-gradient(700px 320px at 80% -10%, rgba(240,104,46,.12), transparent 60%),
    radial-gradient(620px 340px at 12% 0%, rgba(91,87,199,.10), transparent 60%),
    var(--bg-warm);
  border-bottom: 1px solid var(--line);
}
.blog-hero h1 { font-size: clamp(32px, 5vw, 50px); letter-spacing: -1.4px; margin: 0 0 14px; font-weight: 800; }
.blog-hero p { color: var(--muted); font-size: 18px; max-width: 600px; margin: 0 auto 24px; }
.blog-hero .hero-btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--brand-grad); color: #fff;
  font-weight: 700; font-size: 15px; padding: 13px 26px; border-radius: 999px; box-shadow: 0 8px 20px rgba(232,70,93,.28);
}
.blog-hero .hero-btn:hover { transform: translateY(-1px); }

/* full-width blog page — no centered max-width / side gutters */
.blog-wide { max-width: 100%; padding-left: 26px; padding-right: 26px; }
@media (max-width: 600px) { .blog-wide { padding-left: 14px; padding-right: 14px; } }
.blog-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 34px; align-items: start; padding-top: 34px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }

.blog-card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); overflow: hidden; transition: transform .16s cubic-bezier(.2,.7,.3,1), box-shadow .16s, border-color .16s;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent; }
.blog-card .thumb { height: 172px; display: block; overflow: hidden; }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.blog-card:hover .thumb img { transform: scale(1.05); }
.blog-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.blog-card .chip { align-self: flex-start; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 9px; }
.blog-card h3 { margin: 0 0 9px; font-size: 19px; line-height: 1.3; letter-spacing: -.4px; }
.blog-card h3 a:hover { color: var(--brand); }
.blog-card p { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; }
.blog-card .author { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.blog-card .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; flex: none; }
.blog-card .author .who { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.blog-card .author .when { font-size: 12px; color: var(--faint); }
.blog-card .read-more { font-size: 13.5px; font-weight: 700; color: var(--brand); }

/* blog sidebar widgets */
.blog-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 22px; }
.widget { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--card); }
.widget h4 { margin: 0 0 14px; font-size: 15px; letter-spacing: -.2px; }
.widget .w-search { position: relative; }
.widget .w-search input { width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; font-size: 14px; font-family: inherit; outline: none; background: var(--bg-soft); }
.widget .w-search input:focus { background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 4px rgba(232,70,93,.1); }
.recent-item { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: none; }
.recent-item .r-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.recent-item .r-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.recent-item:hover .r-title { color: var(--brand); }
.cat-list a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.cat-list a:last-child { border-bottom: none; }
.cat-list a:hover { color: var(--brand); }
.cat-list .cnt { color: var(--faint); font-weight: 700; font-size: 12.5px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.tag-cloud a:hover { border-color: var(--brand); color: var(--brand); }

@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-side { position: static; order: 2; flex-direction: row; flex-wrap: wrap; }
  .blog-side .widget { flex: 1; min-width: 240px; }
}

/* ---------- Blog post hero banner + author + related ---------- */
img.post-banner { width: 100%; height: 300px; object-fit: cover; border-radius: var(--radius-lg); display: block; margin: 8px 0 28px; border: 1px solid var(--line); }
@media (max-width: 620px) { img.post-banner { height: 200px; } }
.author-bio { display: flex; align-items: center; gap: 14px; margin: 34px 0 8px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-warm); }
.author-bio .avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 800; color: #fff; flex: none; }
.author-bio .who { font-size: 16px; font-weight: 700; margin: 0; }
.author-bio .role { font-size: 13.5px; color: var(--muted); margin: 2px 0 0; }
.related-posts { margin: 34px 0 8px; }
.related-posts h2 { font-size: 22px; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 620px) { .related-grid { grid-template-columns: 1fr; } }
.related-card { display: flex; gap: 13px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--card); transition: transform .14s, box-shadow .14s, border-color .14s; }
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: transparent; }
.related-card .r-thumb { width: 60px; height: 60px; border-radius: 11px; object-fit: cover; flex: none; }
.related-card .r-chip { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.related-card .r-title { font-size: 14px; font-weight: 700; line-height: 1.3; margin-top: 3px; color: var(--ink); }
.related-card:hover .r-title { color: var(--brand); }

/* ---------- Article / legal pages ---------- */
.article .post-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.article .post-back:hover { color: var(--brand); }
.article .post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 20px; font-size: 13.5px; color: var(--faint); font-weight: 600; }
.article .post-meta .chip { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.article .post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.article h3 { font-size: 17px; margin: 24px 0 8px; letter-spacing: -.2px; }
.article blockquote {
  margin: 18px 0; padding: 14px 20px; border-left: 4px solid var(--brand);
  background: var(--bg-warm); border-radius: 0 12px 12px 0; color: var(--ink-soft); font-size: 16px;
}
.article .keytakeaway {
  margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: var(--bg-soft);
}
.article .keytakeaway h3 { margin: 0 0 10px; }
.article .cta-box {
  margin: 32px 0 8px; border-radius: var(--radius-lg); padding: 26px 28px; color: #fff;
  background: var(--brand-grad); box-shadow: var(--shadow-sm);
}
.article .cta-box h2 { margin: 0 0 8px; color: #fff; font-size: 22px; }
.article .cta-box p { color: rgba(255,255,255,.92); margin: 0 0 16px; }
.article .cta-box .cta-btn {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--brand);
  font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 999px;
}
.article .cta-box .cta-btn:hover { transform: translateY(-1px); }
/* inline text backlinks to tools — ComeTool style */
.article .tool-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.article .tool-link:hover { text-decoration: underline; color: var(--brand-dark); }
.article .faq-q { font-weight: 700; font-size: 16.5px; margin: 20px 0 6px; color: var(--ink); }


.article-wrap { max-width: 1160px; margin: 0 auto; padding: 40px 16px 72px; }
.article h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -1px; margin: 0 0 6px; line-height: 1.1; }
.article .updated { color: var(--faint); font-size: 13.5px; margin: 0 0 26px; }
.article .lead { font-size: 18px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
.article h2 { font-size: 20px; letter-spacing: -.3px; margin: 32px 0 10px; }
.article p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.75; margin: 0 0 12px; text-align: justify; }
.article .lead, .article .faq-q { text-align: left; }
@media (max-width: 560px) { .article p { text-align: left; } }
.article ul { padding-left: 22px; margin: 0 0 14px; }
.article li { color: var(--ink-soft); font-size: 15.5px; line-height: 1.7; margin-bottom: 7px; }
.article a { color: var(--brand); font-weight: 600; }
.article a:hover { text-decoration: underline; }
.article .contact-card {
  margin-top: 30px; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; background: var(--bg-warm);
}
.article .contact-card h2 { margin-top: 0; }
.article .pill-row { display: flex; flex-wrap: wrap; gap: 22px; margin: 22px 0 4px; }
.article .pill-stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.article .pill-stat span { color: var(--muted); font-size: 13.5px; }

/* ---------- Footer (compact, with logo) ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 56px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; padding: 20px 0 12px; }
.footer-logo { font-size: 19px; }
.footer-logo .mark, .footer-logo .mark-img { width: 34px; height: 34px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: var(--ink-soft); font-size: 14px; font-weight: 600; padding: 3px 2px; transition: color .12s; }
.footer-nav a:hover { color: var(--brand); }
.footer-bottom { padding: 11px 0 16px; border-top: 1px solid var(--line); display: flex; justify-content: center; align-items: center; color: var(--faint); font-size: 12.5px; }
@media (max-width: 560px) { .footer-inner { justify-content: center; text-align: center; } }

/* ---------- Measurement-system selector ---------- */
.units-select { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.units-select .units-ico { font-size: 14px; opacity: .8; }
.units-select select {
  height: 34px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card);
  color: var(--ink-soft); font-family: inherit; font-weight: 600; font-size: 13px; padding: 0 10px;
  cursor: pointer; outline: none; transition: border-color .15s, box-shadow .15s;
}
.units-select select:hover { border-color: var(--brand); }
.units-select select:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232,70,93,.12); }
@media (max-width: 640px) { .units-select .units-ico { display: none; } .units-select select { font-size: 12px; padding: 0 7px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Theme toggle (sliding switch) ---------- */
.theme-toggle { flex: none; border: none; background: none; padding: 0; cursor: pointer; }
.tt-track {
  position: relative; display: inline-flex; align-items: center; justify-content: space-between;
  width: 60px; height: 30px; border-radius: 999px; padding: 0 8px; box-sizing: border-box;
  background: var(--bg-soft); border: 1px solid var(--line-strong);
  transition: background .25s, border-color .2s, box-shadow .2s;
}
.theme-toggle:hover .tt-track { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(232,70,93,.12); }
.tt-track svg { position: relative; z-index: 1; transition: color .25s, transform .25s; }
.tt-sun { color: #F5A623; }
.tt-moon { color: #8A91A0; }
.tt-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; z-index: 0;
  background: var(--card); box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .3s cubic-bezier(.34,1.4,.5,1), background .25s;
}
html[data-theme="dark"] .tt-knob { transform: translateX(30px); }
html[data-theme="dark"] .tt-sun { color: #6C7280; }
html[data-theme="dark"] .tt-moon { color: #FBD24B; transform: rotate(-12deg); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 2; flex-direction: row; flex-wrap: wrap; }
  .cat-page .sidebar { margin-top: 0; }
  .side-card { flex: 1; min-width: 240px; }
  .ad-slot { min-height: 250px; flex: 1; min-width: 240px; }
  .nav-search { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links a.hide-sm { display: none; }
  .hero { padding: 28px 0 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-stats { gap: 28px; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
html[data-theme="dark"] {
  --ink: #EEF0F4;
  --ink-soft: #CBD0DA;
  --muted: #9EA4B0;
  --faint: #7E8593;
  --line: #363B46;
  --line-strong: #464C59;
  --bg: #1D2027;
  --bg-soft: #262A33;
  --bg-warm: #23262E;
  --card: #2B2F39;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.28);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.24);
  --shadow-md: 0 10px 30px rgba(0,0,0,.38);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
}
html[data-theme="dark"] .site-header { background: rgba(29,32,39,.85); }
html[data-theme="dark"] .tool-head { background: var(--card); }
html[data-theme="dark"] .result { background: linear-gradient(135deg,#251b1f,#20191d); border-color:#3b2a31; }
html[data-theme="dark"] .result-rows .row { border-bottom-color:#33262b; }
html[data-theme="dark"] .hero .eyebrow { color:#34D399; }
html[data-theme="dark"] .ad-slot {
  background: repeating-linear-gradient(45deg,#23262e,#23262e 11px,#2a2e37 11px,#2a2e37 22px);
  border-color: var(--line-strong); color:#6a7180;
}
html[data-theme="dark"] .socials a { color: var(--ink-soft); }
html[data-theme="dark"] img.post-banner, html[data-theme="dark"] .blog-card .thumb img { opacity:.95; }
