:root{
  --ink:#14213D; --ink-2:#3A4A66; --paper:#FFFFFF; --ledger:#EDF1F5; --rule:#C9D2DC;
  --profit:#17754A; --fee:#B3261E; --marker:#FFD84D; --link:#1F4FB8;
  --sans:"Instrument Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --receipt:"Courier Prime","Courier New",Courier,monospace;
  --wrap:1180px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:var(--sans);font-size:1.0625rem;line-height:1.6;color:var(--ink);background:var(--ledger)}
img{max-width:100%;height:auto}
a{color:var(--link);text-underline-offset:.18em}
a:hover{color:var(--ink)}
:focus-visible{outline:3px solid var(--link);outline-offset:2px;border-radius:2px}
.skip{position:absolute;left:-9999px}.skip:focus{left:1rem;top:1rem;background:#fff;padding:.5rem 1rem;z-index:10}
.wrap{max-width:var(--wrap);margin:0 auto;padding:0 1.25rem}

/* header */
.site-head{background:var(--ink);color:#fff}
.head-inner{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:64px}
.logo{color:#fff;text-decoration:none;font-weight:700;font-size:1.15rem;letter-spacing:-.01em;display:flex;align-items:center;gap:.55rem}
.logo-mark{width:28px;height:28px;border-radius:5px;background:var(--marker);color:var(--ink);display:grid;place-items:center;font-size:.95rem;font-weight:700}
.head-links a{color:#DCE3EE;text-decoration:none;margin-left:1.25rem;font-size:.95rem}
.head-links a:hover,.head-links a[aria-current]{color:#fff;text-decoration:underline}
.nav-toggle{display:none;background:none;border:1px solid #5B6B88;color:#fff;border-radius:6px;padding:.4rem .7rem;font:inherit;font-size:.9rem}
.platform-strip{background:#1D2C4B;border-top:1px solid #2B3B5C}
.platform-strip ul{list-style:none;margin:0;padding:0;display:flex;gap:.25rem;overflow-x:auto;scrollbar-width:thin}
.platform-strip a{display:block;white-space:nowrap;padding:.6rem .8rem;color:#C7D1E0;text-decoration:none;font-size:.92rem;border-bottom:3px solid transparent}
.platform-strip a:hover{color:#fff}
.platform-strip a[aria-current]{color:#fff;border-bottom-color:var(--marker)}

/* type */
h1,h2,h3{line-height:1.15;letter-spacing:-.02em;margin:0 0 .6em}
h1{font-size:clamp(2rem,4.2vw,3.1rem);font-weight:700}
h2{font-size:clamp(1.45rem,2.4vw,1.85rem);font-weight:650;margin-top:1.8em}
h3{font-size:1.2rem;font-weight:650;margin-top:1.5em}
p{margin:0 0 1em}
.lede{font-size:1.2rem;color:var(--ink-2);max-width:62ch}
.crumbs{font-size:.88rem;color:var(--ink-2);padding:1rem 0 0}
.crumbs a{color:var(--ink-2)}
.crumbs span[aria-hidden]{margin:0 .4rem}

/* calculator layout */
.calc-top{padding:1.5rem 0 1rem}
.calc-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(300px,400px);gap:2rem;align-items:start;padding-bottom:3rem}
.calc-form{background:var(--paper);border:1px solid var(--rule);border-radius:10px;padding:1.5rem}
.calc-form fieldset{border:0;padding:0;margin:0 0 1.2rem}
.calc-form legend{font-weight:650;font-size:1.05rem;margin-bottom:.7rem;padding:0}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 1.1rem}
.field{display:flex;flex-direction:column;gap:.3rem}
.field.full{grid-column:1/-1}
.field label{font-size:.93rem;font-weight:600}
.field small{color:var(--ink-2);font-size:.82rem;line-height:1.4}
.money-in{position:relative}
.money-in::before{content:attr(data-unit);position:absolute;left:.75rem;top:50%;transform:translateY(-50%);color:var(--ink-2);font-size:.95rem;pointer-events:none}
.money-in.pct::before{left:auto;right:.75rem}
.money-in input[type=number]{padding-left:1.6rem}
.money-in.pct input[type=number]{padding-left:.75rem;padding-right:1.8rem}
input[type=number],select{width:100%;font:inherit;font-size:1rem;padding:.6rem .75rem;border:1px solid #AEB9C7;border-radius:7px;background:#fff;color:var(--ink);min-height:44px}
input[type=number]:focus,select:focus{border-color:var(--link);outline:2px solid rgba(31,79,184,.25)}
.check{display:flex;align-items:flex-start;gap:.55rem;font-size:.95rem;font-weight:500}
.check input{width:20px;height:20px;margin-top:.15rem;accent-color:var(--ink)}
details.adv{border-top:1px dashed var(--rule);padding-top:1rem;margin-top:.5rem}
details.adv summary{cursor:pointer;font-weight:600;margin-bottom:.8rem}
.form-actions{display:flex;gap:.75rem;margin-top:1rem}
.btn{font:inherit;font-weight:600;border-radius:7px;padding:.65rem 1.1rem;border:1px solid var(--ink);background:var(--ink);color:#fff;cursor:pointer;text-decoration:none;display:inline-block}
.btn.ghost{background:transparent;color:var(--ink)}

/* the receipt */
.receipt-wrap{position:sticky;top:1rem}
.receipt{background:#fff;font-family:var(--receipt);font-size:.95rem;color:#1c1c1c;padding:1.4rem 1.3rem 2rem;box-shadow:0 1px 0 var(--rule),0 12px 28px -18px rgba(20,33,61,.45);
  -webkit-mask:linear-gradient(#000 0 0) top/100% calc(100% - 12px) no-repeat,conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) bottom/16px 12px repeat-x;
  mask:linear-gradient(#000 0 0) top/100% calc(100% - 12px) no-repeat,conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) bottom/16px 12px repeat-x}
.receipt-head{text-align:center;border-bottom:1px dashed #999;padding-bottom:.7rem;margin-bottom:.7rem}
.receipt-head strong{display:block;font-size:1.1rem}
.receipt-head span{font-size:.82rem;color:#555}
.r-row{display:flex;justify-content:space-between;gap:1rem;padding:.18rem 0;font-variant-numeric:tabular-nums}
.r-row span:first-child{flex:1}
.r-row span:last-child{white-space:nowrap}
.r-strong{font-weight:700}
.r-muted{color:#555;font-size:.88rem}
.r-profit{font-weight:700;font-size:1.12rem;background:var(--marker);margin:.35rem -.4rem;padding:.35rem .4rem}
.r-profit.is-loss{background:#FBD5D2;color:var(--fee)}
.receipt hr{border:0;border-top:1px dashed #999;margin:.6rem 0}
.r-note{font-size:.88rem;margin:.6rem 0 0}
.receipt-foot{font-size:.8rem;color:var(--ink-2);margin-top:.9rem;line-height:1.45}

/* content */
.content{background:var(--paper);border-top:1px solid var(--rule)}
.prose{max-width:72ch;padding:2.5rem 0 3rem}
.prose ul,.prose ol{padding-left:1.3rem;margin:0 0 1em}
.prose li{margin:.3em 0}
.table-scroll{overflow-x:auto;margin:1rem 0 1.5rem;border:1px solid var(--rule);border-radius:8px}
table{border-collapse:collapse;width:100%;font-size:.95rem;font-variant-numeric:tabular-nums}
th,td{text-align:left;padding:.6rem .8rem;border-bottom:1px solid var(--rule);vertical-align:top}
th{background:var(--ledger);font-weight:650}
tr:last-child td{border-bottom:0}
td.num,th.num{text-align:right;white-space:nowrap}
.faq details{border-bottom:1px solid var(--rule);padding:.8rem 0}
.faq summary{cursor:pointer;font-weight:600}
.faq details p{margin:.6rem 0 0}
.updated{font-size:.88rem;color:var(--ink-2)}

/* guides list */
.guide-list{list-style:none;padding:0;margin:0;border-top:1px solid var(--rule)}
.guide-list li{border-bottom:1px solid var(--rule);padding:.9rem 0;margin:0}
.guide-list a{font-weight:600;text-decoration:none;font-size:1.05rem}
.guide-list a:hover{text-decoration:underline}
.guide-list p{margin:.25rem 0 0;color:var(--ink-2);font-size:.95rem}
.guide-list .tag{font-size:.82rem;color:var(--ink-2);display:block;margin-bottom:.15rem}
.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 2.5rem}

/* home */
.hero{padding-top:2.5rem;padding-bottom:1rem}
.hero h1{max-width:18ch}
.index-table td:first-child a{font-weight:650}
.section{padding:2.5rem 0}
.section.white{background:var(--paper);border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}

/* article */
.article-head{padding:1.5rem 0 1.5rem}
.article-head h1{max-width:24ch;font-size:clamp(1.9rem,3.6vw,2.7rem)}
.article-meta{color:var(--ink-2);font-size:.92rem}
.stub{border:1px dashed #8E9AAB;background:var(--ledger);border-radius:8px;padding:1rem 1.2rem;margin:1.5rem 0}
.stub p{margin:0 0 .6rem}
.stub .btn{font-size:.95rem}
.article-body{font-size:1.08rem;line-height:1.72}

/* footer */
.site-foot{background:var(--ink);color:#C7D1E0;padding:2.5rem 0;font-size:.93rem}
.site-foot a{color:#fff}
.foot-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:2rem}
.foot-grid ul{list-style:none;padding:0;margin:0}
.foot-grid li{margin:.3rem 0}
.foot-grid h2{font-size:1rem;margin:0 0 .6rem;color:#fff}
.fine{margin-top:2rem;border-top:1px solid #2B3B5C;padding-top:1rem;font-size:.85rem}

@media (max-width:900px){
  .calc-grid{grid-template-columns:1fr}
  .receipt-wrap{position:static}
  .two-col,.foot-grid{grid-template-columns:1fr}
}
@media (max-width:640px){
  .fields{grid-template-columns:1fr}
  .head-links{display:none}
  .nav-open .head-links{display:flex;flex-direction:column;position:absolute;top:64px;right:0;left:0;background:var(--ink);padding:.5rem 1.25rem 1rem;z-index:5}
  .nav-open .head-links a{margin:.4rem 0}
  .nav-toggle{display:block}
  .site-head{position:relative}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media print{.site-head,.platform-strip,.site-foot,.calc-form{display:none}.receipt{box-shadow:none}}
