:root{
  /* ===== Light, clean palette ===== */
  --bg:#f5f7fb;               /* page background */
  --surface:#ffffff;          /* cards, header, modal */
  --surface-2:#eef1f7;        /* inputs, segmented, subtle fills */
  --surface-3:#e6eaf3;        /* hover fills */
  --line:#e2e7f0;             /* borders */
  --line-strong:#cfd6e4;      /* stronger borders */

  --ink:#131a2b;              /* headings / primary text */
  --text:#2b3346;            /* body text */
  --muted:#5f6b83;            /* secondary text */
  --muted-dim:#8b95ab;        /* tertiary text */

  --gold:#c19338;             /* brand accent (readable on light) */
  --gold-bright:#e3c878;      /* gradients / highlights */
  --gold-deep:#96721f;        /* gold text where AA contrast needed */
  --gold-soft:rgba(193,147,56,.10);
  --navy:#0f1e38;             /* dark accent, button text, big numbers */
  --green:#1f9d63;            /* positive result */
  --red:#d1495b;              /* negative result */

  --readout:var(--navy);     /* big result number */
  --header-bg:rgba(255,255,255,.82);
  --overlay-bg:rgba(15,23,40,.42);

  --radius:14px;
  --shadow-sm:0 2px 8px rgba(20,30,60,.05);
  --shadow-md:0 10px 26px rgba(20,30,60,.08);
  --shadow-lg:0 20px 50px rgba(20,30,60,.14);
}

/* ===== Dark theme overrides ===== */
:root[data-theme="dark"]{
  --bg:#070f1f;
  --surface:#0f1e38;
  --surface-2:#0a1628;
  --surface-3:#16294a;
  --line:#1f3358;
  --line-strong:#294066;

  --ink:#f5f2ea;
  --text:#dfe4ee;
  --muted:#8294b0;
  --muted-dim:#566480;

  --gold:#c9a14a;
  --gold-bright:#e3c878;
  --gold-deep:#e3c878;        /* bright gold for text on dark */
  --gold-soft:rgba(201,161,74,.12);
  --navy:#0f1e38;            /* keeps dark text on gold buttons */
  --green:#6fcf97;
  --red:#e88a97;

  --readout:var(--gold-bright);
  --header-bg:rgba(7,15,31,.80);
  --overlay-bg:rgba(3,7,15,.66);

  --shadow-sm:0 2px 8px rgba(0,0,0,.30);
  --shadow-md:0 12px 30px rgba(0,0,0,.40);
  --shadow-lg:0 26px 60px rgba(0,0,0,.55);
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(193,147,56,.10), transparent 60%),
    radial-gradient(900px 520px at -5% -5%, rgba(15,30,56,.06), transparent 55%),
    var(--bg);
  background-attachment:fixed;
  color:var(--text);
  font-family:'Heebo',system-ui,sans-serif;
  line-height:1.6;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeSpeed;
  transition:background-color .3s ease,color .3s ease;
}
.wrap{max-width:1180px;margin:0 auto;padding:0 24px}

/* ===== Theme toggle ===== */
.theme-toggle{
  width:42px;height:42px;border-radius:11px;flex-shrink:0;
  background:var(--surface-2);border:1px solid var(--line-strong);
  color:var(--gold-deep);cursor:pointer;display:grid;place-items:center;
  transition:.2s;
}
.bar-actions{display:flex;align-items:center;gap:10px}
.theme-toggle:hover{border-color:var(--gold);color:var(--gold);transform:translateY(-1px)}
.theme-toggle svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .i-sun{display:none}
.theme-toggle .i-moon{display:block}
:root[data-theme="dark"] .theme-toggle .i-sun{display:block}
:root[data-theme="dark"] .theme-toggle .i-moon{display:none}

/* entrance animation — applied to stable containers only, so search/filter never re-trigger it */
@keyframes fadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.hero{animation:fadeUp .5s ease both}
.search-wrap{animation:fadeUp .5s ease .06s both}
.cats{animation:fadeUp .5s ease .12s both}
.grid{animation:fadeUp .5s ease .18s both}

a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

/* ===== Header ===== */
header{
  position:sticky;top:0;z-index:50;
  background:var(--header-bg);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
  box-shadow:0 1px 0 rgba(20,30,60,.02);
}
header::before{content:"";display:block;height:3px;background:linear-gradient(90deg,transparent,var(--gold-bright),var(--gold),var(--gold-bright),transparent)}
.bar{display:flex;align-items:center;justify-content:space-between;height:72px}
.brand{display:flex;align-items:center;gap:12px}
.mark{
  width:42px;height:42px;border-radius:11px;
  background:linear-gradient(145deg,var(--gold-bright),var(--gold));
  display:grid;place-items:center;
  font-family:'Frank Ruhl Libre',serif;font-weight:900;font-size:24px;
  color:var(--navy);
  box-shadow:0 6px 18px rgba(193,147,56,.30);
}
.brand h1{font-family:'Frank Ruhl Libre',serif;font-size:23px;font-weight:700;letter-spacing:.3px;color:var(--ink)}
.brand span{color:var(--gold-deep)}
.brand small{display:block;font-family:'Heebo';font-size:11px;color:var(--muted);font-weight:400;letter-spacing:1.5px;margin-top:-2px}

/* ===== Hero ===== */
.hero{padding:74px 0 30px;text-align:center;position:relative}
.eyebrow{
  display:inline-block;font-size:12px;letter-spacing:4px;color:var(--gold-deep);
  font-weight:600;margin-bottom:18px;
  border:1px solid rgba(193,147,56,.35);border-radius:40px;padding:6px 18px;
  background:var(--gold-soft);
}
.hero h2{font-family:'Frank Ruhl Libre',serif;font-weight:900;font-size:clamp(38px,6vw,62px);line-height:1.08;margin-bottom:18px;color:var(--ink)}
.hero h2 em{font-style:normal;color:var(--gold-deep);position:relative}
.hero h2 em::after{content:"";position:absolute;right:0;left:0;bottom:6px;height:10px;background:rgba(193,147,56,.22);z-index:-1;border-radius:3px}
.hero p{color:var(--muted);font-size:18px;max-width:560px;margin:0 auto 8px;font-weight:400}
.stats{display:flex;gap:48px;justify-content:center;margin-top:34px;flex-wrap:wrap}
.stat b{display:block;font-family:'JetBrains Mono',monospace;font-size:30px;color:var(--gold-deep)}
.stat span{font-size:13px;color:var(--muted-dim);letter-spacing:1px}

/* ===== Search ===== */
.search-wrap{position:relative;max-width:520px;margin:38px auto 0}
.search-wrap input{
  width:100%;background:var(--surface);border:1px solid var(--line-strong);
  border-radius:40px;padding:15px 52px;color:var(--ink);font-family:'Heebo';
  font-size:16px;transition:border-color .2s,box-shadow .2s,background .2s;
  box-shadow:var(--shadow-sm);
}
.search-wrap input::placeholder{color:var(--muted-dim)}
.search-wrap input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 4px rgba(193,147,56,.14)}
.search-wrap .s-ic{position:absolute;top:50%;right:20px;transform:translateY(-50%);width:19px;height:19px;stroke:var(--muted);fill:none;stroke-width:2;pointer-events:none;transition:stroke .2s}
.search-wrap input:focus~.s-ic{stroke:var(--gold-deep)}
.s-clear{position:absolute;top:50%;left:14px;transform:translateY(-50%);width:26px;height:26px;border-radius:50%;border:none;background:var(--surface-3);color:var(--muted);font-size:16px;line-height:1;cursor:pointer;display:none;place-items:center;transition:.2s}
.s-clear:hover{background:var(--gold);color:#fff}

/* ===== Category tabs ===== */
.cats{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:30px 0}
.cat{border:1px solid var(--line-strong);background:var(--surface);color:var(--muted);padding:11px 22px;border-radius:40px;cursor:pointer;font-family:'Heebo';font-size:15px;font-weight:500;transition:.25s;display:flex;align-items:center;gap:9px;box-shadow:var(--shadow-sm)}
.cat svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.8}
.cat:hover{border-color:var(--gold);color:var(--ink)}
.cat.on{background:linear-gradient(145deg,var(--gold-bright),var(--gold));color:var(--navy);border-color:transparent;font-weight:700;box-shadow:0 8px 20px rgba(193,147,56,.28)}

/* ===== Calculator grid ===== */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px;padding-bottom:80px}
.card{
  background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);
  padding:24px;cursor:pointer;position:relative;overflow:hidden;
  transition:transform .25s,border-color .25s,box-shadow .25s;
  box-shadow:var(--shadow-sm);
  content-visibility:auto;contain-intrinsic-size:auto 160px;
}
.card::before{content:"";position:absolute;inset:0;border-radius:var(--radius);background:linear-gradient(160deg,rgba(193,147,56,.08),transparent 45%);opacity:0;transition:opacity .25s}
.card:hover{transform:translateY(-4px);border-color:var(--gold);box-shadow:var(--shadow-md)}
.card:hover::before{opacity:1}
.card .ic{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:var(--gold-soft);border:1px solid rgba(193,147,56,.3);margin-bottom:16px;transition:transform .25s,background .25s}
.card:hover .ic{transform:scale(1.08) rotate(-3deg);background:rgba(193,147,56,.18)}
.card .ic svg{width:23px;height:23px;stroke:var(--gold-deep);fill:none;stroke-width:1.7}
.card h3{font-family:'Frank Ruhl Libre',serif;font-size:20px;font-weight:700;margin-bottom:6px;color:var(--ink)}
.card p{color:var(--muted);font-size:14px;font-weight:400}
.card.hide{display:none}

/* favorite star on cards */
.card .fav{position:absolute;top:14px;left:14px;width:32px;height:32px;border-radius:9px;background:var(--surface-2);border:1px solid var(--line);color:var(--muted-dim);display:grid;place-items:center;cursor:pointer;padding:0;z-index:2;transition:.2s}
.card .fav svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6}
.card .fav:hover{color:var(--gold);border-color:var(--gold)}
.card .fav.on{color:var(--gold-deep);border-color:var(--gold);background:var(--gold-soft)}
.card .fav.on svg{fill:var(--gold);stroke:var(--gold)}

/* favorites count badge on the category chip */
.cat-badge{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:10px;background:var(--gold-soft);color:var(--gold-deep);font-size:11px;font-weight:700;line-height:1}
.cat.on .cat-badge{background:rgba(15,30,56,.16);color:var(--navy)}

/* favorite + share pills inside the calculator modal */
.modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:22px}
.modal-fav,.modal-share{display:inline-flex;align-items:center;gap:7px;background:var(--surface-2);border:1px solid var(--line-strong);color:var(--muted);padding:8px 15px;border-radius:40px;cursor:pointer;font-family:'Heebo';font-size:13px;font-weight:600;transition:.2s;width:auto;height:auto}
.modal-fav svg,.modal-share svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6}
.modal-fav:hover,.modal-share:hover{border-color:var(--gold);color:var(--ink)}
.modal-fav.on{background:var(--gold-soft);border-color:var(--gold);color:var(--gold-deep)}
.modal-fav.on svg{fill:var(--gold);stroke:var(--gold)}
.modal-share.done{border-color:var(--green);color:var(--green)}

/* result action buttons (copy / print) */
.result-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.copy-btn{display:inline-flex;align-items:center;gap:7px;background:var(--surface);border:1px solid var(--line-strong);color:var(--muted);padding:9px 15px;border-radius:10px;cursor:pointer;font-family:'Heebo';font-size:13px;font-weight:600;transition:.2s}
.copy-btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7}
.copy-btn:hover{border-color:var(--gold);color:var(--gold-deep)}
.copy-btn.done{border-color:var(--green);color:var(--green)}

/* history panel */
.hist-list{display:grid;gap:10px;margin-top:6px}
.hist-item{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:right;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:13px 16px;cursor:pointer;font-family:'Heebo';transition:.2s}
.hist-item:hover{border-color:var(--gold);background:var(--surface-3)}
.hist-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.hist-info b{font-family:'Frank Ruhl Libre',serif;font-size:16px;color:var(--ink)}
.hist-info small{color:var(--muted);font-size:12px}
.hist-val{font-family:'JetBrains Mono',monospace;font-weight:700;color:var(--readout);direction:ltr;white-space:nowrap;flex-shrink:0}
.hist-clear{margin-top:18px;background:none;border:1px solid var(--line-strong);color:var(--muted);padding:10px 16px;border-radius:10px;cursor:pointer;font-family:'Heebo';font-size:13px;font-weight:600;transition:.2s}
.hist-clear:hover{border-color:var(--red);color:var(--red)}
.hist-empty{color:var(--muted);line-height:1.8;padding:24px 4px}

.empty{display:none;text-align:center;padding:60px 20px;color:var(--muted)}
.empty svg{width:46px;height:46px;stroke:var(--muted-dim);fill:none;stroke-width:1.5;margin-bottom:14px}
.empty b{display:block;font-family:'Frank Ruhl Libre',serif;font-size:20px;color:var(--ink);margin-bottom:4px}

/* ===== Modal ===== */
.overlay{position:fixed;inset:0;z-index:100;background:var(--overlay-bg);backdrop-filter:blur(5px);display:none;align-items:flex-start;justify-content:center;padding:40px 18px;overflow-y:auto}
.overlay.open{display:flex}
.modal{background:var(--surface);border:1px solid var(--line);border-radius:20px;max-width:560px;width:100%;padding:34px;position:relative;box-shadow:var(--shadow-lg);animation:pop .3s ease}
@keyframes pop{from{opacity:0;transform:translateY(18px) scale(.97)}to{opacity:1;transform:none}}
.close{position:absolute;top:20px;left:20px;width:36px;height:36px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line);color:var(--muted);cursor:pointer;font-size:20px;line-height:1;display:grid;place-items:center;transition:.2s}
.close:hover{color:var(--ink);border-color:var(--gold);background:var(--surface-3)}
.modal .ic{width:52px;height:52px;border-radius:13px;display:grid;place-items:center;background:var(--gold-soft);border:1px solid rgba(193,147,56,.3);margin-bottom:16px}
.modal .ic svg{width:26px;height:26px;stroke:var(--gold-deep);fill:none;stroke-width:1.7}
.modal h3{font-family:'Frank Ruhl Libre',serif;font-size:27px;font-weight:700;margin-bottom:4px;color:var(--ink)}
.modal .sub{color:var(--muted);font-size:14px;margin-bottom:24px;font-weight:400}

.field{margin-bottom:18px}
.field label{display:block;font-size:14px;color:var(--ink);margin-bottom:7px;font-weight:600}
.field .row{display:flex;gap:10px}
input,select{width:100%;background:var(--surface-2);border:1px solid var(--line-strong);border-radius:10px;padding:13px 15px;color:var(--ink);font-family:'Heebo';font-size:16px;transition:border-color .2s,box-shadow .2s,background .2s}
input:focus,select:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(193,147,56,.16);background:var(--surface)}
input::placeholder{color:var(--muted-dim)}
input[type=number]{font-family:'JetBrains Mono',monospace}
select{cursor:pointer}
.seg{display:flex;gap:8px;flex-wrap:wrap}
.seg button{flex:1;min-width:fit-content;background:var(--surface-2);border:1px solid var(--line-strong);color:var(--muted);padding:11px;border-radius:9px;cursor:pointer;font-family:'Heebo';font-size:14px;transition:.2s}
.seg button:hover{border-color:var(--gold);color:var(--ink)}
.seg button.on{background:var(--gold-soft);border-color:var(--gold);color:var(--gold-deep);font-weight:700}

.calc-btn{width:100%;background:linear-gradient(145deg,var(--gold-bright),var(--gold));color:var(--navy);border:none;border-radius:11px;padding:15px;font-family:'Heebo';font-size:17px;font-weight:700;cursor:pointer;margin-top:6px;transition:transform .2s,box-shadow .2s;box-shadow:0 8px 20px rgba(193,147,56,.26)}
.calc-btn:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(193,147,56,.34)}

/* result readout — signature element */
.result{margin-top:24px;border:1px solid rgba(193,147,56,.35);border-radius:14px;background:linear-gradient(165deg,var(--gold-soft),transparent),var(--surface);padding:24px;display:none;position:relative;overflow:hidden;box-shadow:var(--shadow-sm)}
.result.show{display:block;animation:pop .35s ease}
.result::before{content:"";position:absolute;top:0;right:0;left:0;height:2px;background:linear-gradient(90deg,transparent,var(--gold),transparent)}
.result .rlabel{font-size:13px;color:var(--gold-deep);letter-spacing:2px;margin-bottom:6px;font-weight:600}
.result .rmain{font-family:'JetBrains Mono',monospace;font-size:42px;font-weight:700;color:var(--readout);line-height:1.1;direction:ltr;text-align:right}
.result .rmain .cur{font-size:24px;color:var(--gold-deep)}
.result .rnote{color:var(--muted);font-size:14px;margin-top:8px;font-weight:400}
.breakdown{margin-top:18px;border-top:1px solid var(--line);padding-top:16px;display:grid;gap:10px}
.brow{display:flex;justify-content:space-between;font-size:14px}
.brow span{color:var(--muted)}
.brow b{font-family:'JetBrains Mono',monospace;color:var(--ink);direction:ltr}

/* guide accordion */
.guide{margin-top:20px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface-2)}
.guide-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;cursor:pointer;user-select:none;transition:.2s}
.guide-head:hover{background:var(--surface-3)}
.guide-head .gt{display:flex;align-items:center;gap:10px;font-weight:600;font-size:15px;color:var(--ink)}
.guide-head .gt svg{width:18px;height:18px;stroke:var(--gold-deep);fill:none;stroke-width:1.8}
.guide-head .chev{color:var(--gold-deep);transition:transform .25s;font-size:18px}
.guide.open .chev{transform:rotate(180deg)}
.guide-body{max-height:0;overflow:hidden;transition:max-height .3s ease}
.guide.open .guide-body{max-height:900px}
.guide-body .inner{padding:4px 18px 18px;color:var(--muted);font-size:14px;font-weight:400;line-height:1.75}
.guide-body h4{color:var(--gold-deep);font-family:'Frank Ruhl Libre',serif;font-size:16px;font-weight:700;margin:14px 0 4px}
.guide-body h4:first-child{margin-top:0}
.guide-body .ex{background:var(--gold-soft);border-right:3px solid var(--gold);border-radius:0 8px 8px 0;padding:10px 14px;margin:8px 0;color:var(--text)}
.guide-body .ex b{color:var(--gold-deep);font-family:'JetBrains Mono',monospace}
.guide-body .tip{display:flex;gap:8px;margin-top:10px;color:var(--text)}
.guide-body .tip span{color:var(--gold-deep);flex-shrink:0}

/* ===== Info / FAQ content section ===== */
.info{border-top:1px solid var(--line);background:linear-gradient(180deg,var(--surface-2),transparent 240px);padding:64px 0 70px}
.sec-title{font-family:'Frank Ruhl Libre',serif;font-weight:900;font-size:clamp(26px,4vw,36px);color:var(--ink);text-align:center;margin-bottom:12px}
.sec-title + .sec-title, .faq-list + .sec-title{margin-top:64px}
.sec-sub{color:var(--muted);font-size:17px;text-align:center;max-width:620px;margin:0 auto 40px}
.info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;margin-bottom:8px}
.info-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:28px;box-shadow:var(--shadow-sm);transition:transform .25s,border-color .25s,box-shadow .25s}
.info-card:hover{transform:translateY(-3px);border-color:var(--gold);box-shadow:var(--shadow-md)}
.info-ic{width:48px;height:48px;border-radius:12px;display:grid;place-items:center;background:var(--gold-soft);border:1px solid rgba(193,147,56,.3);margin-bottom:16px}
.info-ic svg{width:24px;height:24px;stroke:var(--gold-deep);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.info-card h3{font-family:'Frank Ruhl Libre',serif;font-size:21px;font-weight:700;color:var(--ink);margin-bottom:8px}
.info-card p{color:var(--muted);font-size:14.5px;line-height:1.75}
#faq{margin-top:64px}
.faq-list{max-width:720px;margin:32px auto 0;display:grid;gap:12px}
.faq{background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-sm);transition:border-color .2s}
.faq[open],.faq:hover{border-color:var(--gold)}
.faq summary{list-style:none;cursor:pointer;padding:17px 20px;font-weight:600;font-size:15.5px;color:var(--ink);display:flex;align-items:center;justify-content:space-between;gap:12px;user-select:none}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"⌄";color:var(--gold-deep);font-size:18px;transition:transform .25s;flex-shrink:0}
.faq[open] summary::after{transform:rotate(180deg)}
.faq p{padding:0 20px 18px;color:var(--muted);font-size:14.5px;line-height:1.8}

/* ===== Footer ===== */
footer{border-top:1px solid var(--line);background:var(--surface);padding:44px 0 0;color:var(--muted);font-size:14px;font-weight:400}
.foot-grid{display:grid;grid-template-columns:1.6fr 1fr 1fr;gap:36px;padding-bottom:34px}
.foot-brand p{margin-top:16px;color:var(--muted);font-size:13.5px;line-height:1.75;max-width:340px}
.foot-col{display:flex;flex-direction:column;gap:10px}
.foot-col b{color:var(--ink);font-size:14px;margin-bottom:4px}
.foot-col a{color:var(--muted);cursor:pointer;text-decoration:none;transition:.2s;width:fit-content}
.foot-col a:hover{color:var(--gold-deep)}
.foot-base{border-top:1px solid var(--line);padding-top:18px;padding-bottom:18px;text-align:center;color:var(--muted-dim);font-size:12.5px}
@media(max-width:680px){
  .foot-grid{grid-template-columns:1fr;gap:28px;text-align:center}
  .foot-brand .brand{justify-content:center}
  .foot-brand p{margin-left:auto;margin-right:auto}
  .foot-col a{width:auto}
}

/* ad slots */
.ad-slot{margin:0 auto 8px;max-width:970px;text-align:center}
.ad-slot.banner{margin-top:8px}
.ad-slot.grid-unit{grid-column:1/-1}
.ad-ph{border:1px dashed rgba(193,147,56,.4);border-radius:var(--radius);background:var(--gold-soft);color:var(--muted-dim);display:grid;place-items:center;min-height:100px;font-size:12px;letter-spacing:2px}
.ad-ph.tall{min-height:250px}
.ad-ph b{display:block;color:var(--gold-deep);font-size:11px;letter-spacing:3px;margin-bottom:2px}
.ad-label{font-size:10px;color:var(--muted-dim);letter-spacing:2px;margin-bottom:5px;text-align:center}

@media(max-width:520px){
  .modal{padding:24px}
  .result .rmain{font-size:34px}
  .stats{gap:28px}
}

/* respect reduced-motion */
@media (prefers-reduced-motion: reduce){
  *{animation:none !important;transition:none !important;scroll-behavior:auto !important}
}

/* print / save-as-PDF — show only the open calculator's result, cleanly */
@media print{
  header,.hero,.search-wrap,.cats,.grid,footer,.ad-slot,.empty,.info{display:none !important}
  .close,.modal-actions,.calc-btn,.guide,.result-actions,.result::before{display:none !important}
  .overlay{position:static !important;display:block !important;background:none !important;backdrop-filter:none !important;padding:0 !important;overflow:visible !important}
  .modal{box-shadow:none !important;border:none !important;max-width:100% !important;padding:0 !important;animation:none !important}
  .result{border-color:#ccc !important;box-shadow:none !important;background:none !important;margin-top:16px}
  body{overflow:visible !important;background:#fff !important}
}
