/* ── TaxMatics — Global Stylesheet ── */
:root {
  --green:     #065F46;
  --green-md:  #047857;
  --green-lt:  #ECFDF5;
  --green-mid: #D1FAE5;
  --gold:      #D97706;
  --gold-lt:   #FEF3C7;
  --gold-mid:  #FDE68A;
  --navy:      #1A2332;
  --slate:     #475569;
  --slate-lt:  #94A3B8;
  --off-wht:   #F8FAFC;
  --white:     #FFFFFF;
  --border:    #E2E8F0;
  --red:       #DC2626;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.6; color: var(--navy); background: var(--off-wht); min-height: 100vh; }

h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { color: var(--slate); }
a  { color: var(--green-md); text-decoration: none; }
a:hover { text-decoration: underline; }

.container    { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 780px;  margin: 0 auto; padding: 0 1rem; }

/* ── NAV ── */
.nav { background: var(--navy); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; max-width: 1100px; margin: 0 auto; }
.nav-logo { display: flex; align-items: center; gap: .5rem; text-decoration: none; }
.nav-logo-icon { width: 36px; height: 36px; background: var(--green-md); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .8rem; color: #fff; font-weight: 800; }
.nav-logo-text { color: #fff; font-weight: 700; font-size: 1.05rem; }
.nav-logo-text span { color: #6EE7B7; }
.nav-links { display: flex; gap: .25rem; list-style: none; flex-wrap: wrap; }
.nav-links a { color: rgba(255,255,255,.75); font-size: .85rem; padding: .4rem .7rem; border-radius: 6px; transition: all .15s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(255,255,255,.1); text-decoration: none; }
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; color: #fff; font-size: 1.5rem; padding: .25rem; }

/* ── HERO ── */
.hero { background: var(--navy); color: #fff; padding: 3.5rem 1rem 3rem; text-align: center; }
.hero h1 { color: #fff; margin-bottom: .75rem; }
.hero p  { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 580px; margin: 0 auto 1.5rem; }
.hero-badge { display: inline-block; background: rgba(6,95,70,.3); border: 1px solid rgba(110,231,183,.3); color: #6EE7B7; font-size: .8rem; font-weight: 600; padding: .25rem .85rem; border-radius: 999px; margin-bottom: 1rem; letter-spacing: .04em; }
.hero-stats { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid rgba(255,255,255,.1); }
.hero-stat .val { font-size: 1.5rem; font-weight: 800; color: #6EE7B7; }
.hero-stat .lbl { font-size: .78rem; color: rgba(255,255,255,.5); }

/* ── TOOL GRID ── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2rem 0; }
.tool-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; text-decoration: none; color: inherit; transition: all .18s; display: block; box-shadow: var(--shadow); }
.tool-card:hover { border-color: var(--green-md); box-shadow: 0 0 0 3px rgba(4,120,87,.1), var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.tool-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: .875rem; }
.tool-card h3 { font-size: 1rem; margin-bottom: .3rem; color: var(--navy); }
.tool-card p  { font-size: .85rem; color: var(--slate); line-height: 1.5; }
.tool-card .tag { display: inline-block; margin-top: .625rem; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--green-lt); color: var(--green); }

/* ── PAGE HEADER ── */
.page-header { background: var(--navy); padding: 2rem 1rem 1.75rem; color: #fff; }
.page-header h1 { color: #fff; font-size: clamp(1.4rem, 3.5vw, 2rem); }
.page-header p  { color: rgba(255,255,255,.7); margin-top: .375rem; font-size: .95rem; }
.breadcrumb { font-size: .8rem; color: rgba(255,255,255,.5); margin-bottom: .625rem; }
.breadcrumb a { color: rgba(255,255,255,.6); }
.breadcrumb span { color: #6EE7B7; }

/* ── CALC LAYOUT ── */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin: 1.5rem 0; }
@media (max-width: 720px) { .calc-layout { grid-template-columns: 1fr; } }
.calc-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.calc-card-head { background: var(--navy); padding: 1rem 1.25rem; color: #fff; }
.calc-card-head h3 { color: #fff; font-size: 1rem; }
.calc-card-head p  { color: rgba(255,255,255,.6); font-size: .8rem; margin-top: .2rem; }
.calc-body { padding: 1.25rem; }

/* ── FORMS ── */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.field .hint  { font-size: .75rem; color: var(--slate-lt); margin-top: .2rem; }
.input-wrap { position: relative; }
.input-prefix, .input-suffix { position: absolute; top: 50%; transform: translateY(-50%); font-size: .85rem; color: var(--slate); font-weight: 600; pointer-events: none; }
.input-prefix { left: .75rem; }
.input-suffix { right: .75rem; }
input[type=number], input[type=text], input[type=email], select, textarea { width: 100%; padding: .6rem .875rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .95rem; color: var(--navy); background: var(--white); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; font-family: inherit; }
input.has-prefix { padding-left: 2rem; }
input.has-suffix { padding-right: 2.5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-md); box-shadow: 0 0 0 3px rgba(4,120,87,.12); }
input[type=range] { width: 100%; height: 6px; -webkit-appearance: none; appearance: none; border: none; background: var(--border); border-radius: 3px; cursor: pointer; padding: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--green-md); border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--green-md); cursor: pointer; }
input[type=range]:focus { box-shadow: none; border: none; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.5rem; border-radius: 8px; font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--green-md); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--green); text-decoration: none; color: #fff; }
.btn-secondary { background: transparent; color: var(--green-md); border: 1.5px solid var(--green-md); width: auto; }
.btn-secondary:hover { background: var(--green-lt); text-decoration: none; }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); font-size: .85rem; padding: .5rem 1rem; }
.btn-ghost:hover { background: rgba(255,255,255,.2); text-decoration: none; color: #fff; }

/* ── RESULTS ── */
.results-panel { background: var(--navy); border-radius: var(--radius); padding: 1.25rem; color: #fff; margin-top: 1rem; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.result-row:last-child { border-bottom: none; }
.result-label { font-size: .82rem; color: rgba(255,255,255,.6); }
.result-value { font-size: 1rem; font-weight: 700; color: #fff; }
.result-value.highlight { font-size: 1.3rem; color: #6EE7B7; }
.result-value.gold  { color: #FCD34D; }
.result-value.warn  { color: #FCA5A5; }
.result-value.good  { color: #6EE7B7; }

/* ── TAX BRACKETS TABLE ── */
.data-wrap { overflow-x: auto; margin-top: 1rem; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { background: var(--navy); color: rgba(255,255,255,.85); padding: .6rem .75rem; text-align: right; font-weight: 600; white-space: nowrap; }
.data-table th:first-child { text-align: left; }
.data-table td { padding: .5rem .75rem; text-align: right; border-bottom: 1px solid var(--border); color: var(--slate); }
.data-table td:first-child { text-align: left; font-weight: 600; color: var(--navy); }
.data-table tr:nth-child(even) td { background: var(--off-wht); }
.data-table tr:hover td { background: var(--green-lt); }
.data-table tr.active-row td { background: var(--green-mid) !important; font-weight: 700; }

/* ── INFO BOXES ── */
.info-box { background: var(--gold-lt); border: 1px solid var(--gold-mid); border-radius: var(--radius); padding: .875rem 1rem; font-size: .85rem; color: #78350F; line-height: 1.6; margin-top: 1rem; }
.info-box strong { display: block; margin-bottom: .25rem; }
.tip-box  { background: var(--green-lt); border: 1px solid var(--green-mid); border-radius: var(--radius); padding: .875rem 1rem; font-size: .85rem; color: var(--green); margin-top: .75rem; }
.tip-box strong { display: block; margin-bottom: .25rem; }
.warn-box { background: #FEF2F2; border: 1px solid #FECACA; border-radius: var(--radius); padding: .875rem 1rem; font-size: .85rem; color: #991B1B; margin-top: .75rem; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.faq-q { font-weight: 600; font-size: .95rem; color: var(--navy); cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--green-md); transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; margin-top: .625rem; font-size: .88rem; color: var(--slate); line-height: 1.7; }
.faq-item.open .faq-a { display: block; }

/* ── AD SLOTS ── */
.ad-slot { text-align: center; overflow: hidden; min-height: 0; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-slot-leaderboard { margin: 1rem 0; }
.ad-slot-rectangle   { margin: 1rem 0; }
.ad-slot-banner      { margin: .75rem 0; }

/* ── FOOTER ── */
.footer { background: var(--navy); color: rgba(255,255,255,.6); padding: 2.5rem 1rem 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; max-width: 1100px; margin: 0 auto 2rem; }
.footer h4 { color: #fff; font-size: .9rem; margin-bottom: .75rem; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: .4rem; }
.footer ul a { color: rgba(255,255,255,.5); font-size: .85rem; }
.footer ul a:hover { color: #6EE7B7; text-decoration: none; }
.footer-brand p { font-size: .85rem; line-height: 1.6; margin-top: .75rem; }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: .78rem; }
.footer-bottom a { color: rgba(255,255,255,.4); }

/* ── SECTION ── */
.section { padding: 2.5rem 0; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: .375rem; }
.section-sub   { color: var(--slate); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── UTILS ── */
.text-center  { text-align: center; }
.text-green   { color: var(--green-md); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; gap: .5rem; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 580px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--navy); padding: .5rem 1rem 1rem; gap: 0; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 2rem 1rem; }
}
@media (max-width: 400px) { .tool-grid { grid-template-columns: 1fr; } }
@media print { .nav, .footer, .ad-slot, .btn { display: none !important; } }
