.txpc-root{
    --txpc-bg:#ffffff; --txpc-card:#f8f9fb; --txpc-border:#e2e5ea;
    --txpc-text:#181a1f; --txpc-text-mute:#5b616e;
    --txpc-primary:#0b5d5d; --txpc-primary-dark:#083f3f; --txpc-primary-contrast:#ffffff;
    --txpc-accent:#c2760c;
    --txpc-federal:#3a6fd8; --txpc-fica:#7b5ce0; --txpc-pretax:#c2760c;
    --txpc-posttax:#d1495b; --txpc-nettake:#1f9e6d;
    --txpc-focus:#0b5d5d;
    --txpc-radius:14px; --txpc-radius-sm:9px;
    --txpc-shadow:0 1px 3px rgba(20,20,30,.06), 0 8px 24px rgba(20,20,30,.05);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    color:var(--txpc-text); max-width:1120px; margin:0 auto; box-sizing:border-box;
  }
  .txpc-root[data-theme="dark"]{
    --txpc-bg:#14161a; --txpc-card:#1c1f26; --txpc-border:#2c313b;
    --txpc-text:#eef0f3; --txpc-text-mute:#a2a9b5;
    --txpc-primary:#3ecfcf; --txpc-primary-dark:#2ba8a8; --txpc-primary-contrast:#08201f;
    --txpc-accent:#e8a13d;
    --txpc-focus:#3ecfcf;
    --txpc-shadow:0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
  .txpc-root *{box-sizing:border-box;}
  .txpc-root .txpc-topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap;}
  .txpc-root h2.txpc-title{font-size:1.5rem; font-weight:700; margin:0; letter-spacing:-.01em;}
  .txpc-root .txpc-subtitle{color:var(--txpc-text-mute); font-size:.92rem; margin:2px 0 0;}
  .txpc-root .txpc-theme-toggle{
    background:var(--txpc-card); border:1px solid var(--txpc-border); color:var(--txpc-text);
    border-radius:999px; padding:6px 14px; font-size:.82rem; cursor:pointer; display:flex; align-items:center; gap:6px;
  }
  .txpc-root .txpc-grid{display:grid; grid-template-columns:1fr; gap:20px;}
  @media (min-width:860px){
    .txpc-root .txpc-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); align-items:start;}
    .txpc-root .txpc-results{position:sticky; top:16px;}
  }
  .txpc-root .txpc-card{
    background:var(--txpc-card); border:1px solid var(--txpc-border); border-radius:var(--txpc-radius);
    padding:18px 18px 20px; margin-bottom:14px; box-shadow:var(--txpc-shadow);
  }
  .txpc-root .txpc-card h3{margin:0 0 12px; font-size:1.02rem; font-weight:700; display:flex; align-items:center; gap:8px;}
  .txpc-root label{display:block; font-size:.82rem; font-weight:600; color:var(--txpc-text-mute); margin:12px 0 5px;}
  .txpc-root label:first-of-type{margin-top:0;}
  .txpc-root input[type="text"],
  .txpc-root input[type="number"],
  .txpc-root select{
    width:100%; padding:10px 12px; font-size:.98rem; border-radius:var(--txpc-radius-sm);
    border:1.5px solid var(--txpc-border); background:var(--txpc-bg); color:var(--txpc-text);
    outline:none; transition:border-color .15s;
  }
  .txpc-root input:focus, .txpc-root select:focus{border-color:var(--txpc-focus); box-shadow:0 0 0 3px color-mix(in srgb, var(--txpc-focus) 20%, transparent);}
  .txpc-root .txpc-row2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
  .txpc-root .txpc-inline-check{display:flex; align-items:center; gap:8px; font-size:.88rem; font-weight:500; color:var(--txpc-text); margin:12px 0 0; cursor:pointer;}
  .txpc-root .txpc-inline-check input{width:16px; height:16px; margin:0;}
  .txpc-root .txpc-segmented{display:flex; background:var(--txpc-bg); border:1.5px solid var(--txpc-border); border-radius:999px; padding:3px; gap:2px;}
  .txpc-root .txpc-segmented button{
    flex:1; border:none; background:transparent; padding:8px 10px; border-radius:999px; font-size:.88rem; font-weight:600;
    color:var(--txpc-text-mute); cursor:pointer; transition:.15s;
  }
  .txpc-root .txpc-segmented button.active{background:var(--txpc-primary); color:var(--txpc-primary-contrast);}
  .txpc-root .txpc-help{font-size:.78rem; color:var(--txpc-text-mute); margin:5px 0 0; line-height:1.4;}
  .txpc-root details.txpc-card summary{cursor:pointer; font-weight:700; font-size:1.02rem; list-style:none; display:flex; align-items:center; justify-content:space-between;}
  .txpc-root details.txpc-card summary::-webkit-details-marker{display:none;}
  .txpc-root details.txpc-card summary::after{content:"+"; font-size:1.3rem; color:var(--txpc-text-mute); font-weight:400;}
  .txpc-root details.txpc-card[open] summary::after{content:"–";}
  .txpc-root details.txpc-card .txpc-details-body{margin-top:14px;}
  .txpc-root .txpc-ded-row{display:grid; grid-template-columns:1fr auto 92px; gap:8px; align-items:center; margin-bottom:10px;}
  .txpc-root .txpc-ded-row label{margin:0; grid-column:1/2;}
  .txpc-root .txpc-unit-toggle{display:flex; border:1.5px solid var(--txpc-border); border-radius:8px; overflow:hidden; height:38px;}
  .txpc-root .txpc-unit-toggle button{border:none; background:var(--txpc-bg); color:var(--txpc-text-mute); font-size:.78rem; font-weight:700; padding:0 9px; cursor:pointer;}
  .txpc-root .txpc-unit-toggle button.active{background:var(--txpc-primary); color:var(--txpc-primary-contrast);}
  .txpc-root .txpc-ded-row input{grid-column:3/4;}

  /* Results */
  .txpc-root .txpc-hero{background:linear-gradient(135deg, var(--txpc-primary), var(--txpc-primary-dark)); color:var(--txpc-primary-contrast); text-align:center; padding:26px 18px;}
  .txpc-root .txpc-hero-label{font-size:.86rem; opacity:.85; font-weight:600; text-transform:uppercase; letter-spacing:.04em;}
  .txpc-root .txpc-hero-value{font-size:2.6rem; font-weight:800; margin:6px 0 2px; letter-spacing:-.02em; font-variant-numeric:tabular-nums;}
  .txpc-root .txpc-hero-sub{font-size:.86rem; opacity:.9;}
  .txpc-root .txpc-zero-state-badge{display:inline-block; margin-top:10px; font-size:.76rem; background:rgba(255,255,255,.16); padding:4px 10px; border-radius:999px;}

  .txpc-root .txpc-donut-wrap{display:flex; gap:18px; align-items:center; flex-wrap:wrap; justify-content:center;}
  .txpc-root .txpc-donut-wrap svg{flex:0 0 auto;}
  .txpc-root .txpc-legend{list-style:none; margin:0; padding:0; font-size:.85rem; flex:1; min-width:170px;}
  .txpc-root .txpc-legend li{display:flex; justify-content:space-between; gap:10px; padding:5px 0; border-bottom:1px dashed var(--txpc-border);}
  .txpc-root .txpc-legend li:last-child{border-bottom:none;}
  .txpc-root .txpc-legend .txpc-dot{display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:7px;}
  .txpc-root .txpc-legend .txpc-lname{display:flex; align-items:center; color:var(--txpc-text-mute);}
  .txpc-root .txpc-legend .txpc-lval{font-weight:700; font-variant-numeric:tabular-nums;}

  .txpc-root .txpc-breakdown dl{margin:0; font-size:.92rem;}
  .txpc-root .txpc-breakdown .txpc-brow{display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--txpc-border);}
  .txpc-root .txpc-breakdown .txpc-brow:last-child{border-bottom:none; padding-top:12px; font-weight:800; font-size:1.02rem;}
  .txpc-root .txpc-breakdown dt{color:var(--txpc-text-mute); font-weight:500; display:flex; align-items:center; gap:6px;}
  .txpc-root .txpc-breakdown dd{margin:0; font-weight:700; font-variant-numeric:tabular-nums;}
  .txpc-root .txpc-badge-zero{font-size:.68rem; font-weight:700; background:color-mix(in srgb, var(--txpc-nettake) 18%, transparent); color:var(--txpc-nettake); padding:2px 7px; border-radius:999px;}

  .txpc-root .txpc-calc-based-on{font-size:.84rem; color:var(--txpc-text-mute);}
  .txpc-root .txpc-calc-based-on .txpc-cbo-row{display:flex; justify-content:space-between; padding:4px 0;}
  .txpc-root .txpc-warning{background:color-mix(in srgb, var(--txpc-accent) 14%, transparent); border:1px solid color-mix(in srgb, var(--txpc-accent) 45%, transparent); color:var(--txpc-text); padding:9px 12px; border-radius:9px; font-size:.82rem; margin-bottom:10px;}

  .txpc-root .txpc-actions{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px;}
  .txpc-root .txpc-btn{border-radius:999px; padding:10px 18px; font-size:.88rem; font-weight:700; cursor:pointer; border:1.5px solid var(--txpc-border); background:var(--txpc-card); color:var(--txpc-text); display:inline-flex; align-items:center; gap:6px;}
  .txpc-root .txpc-btn.txpc-btn-primary{background:var(--txpc-accent); border-color:var(--txpc-accent); color:#fff;}
  .txpc-root .txpc-btn:hover{filter:brightness(1.05);}

  .txpc-root .txpc-compare{border:1.5px dashed color-mix(in srgb, var(--txpc-accent) 60%, var(--txpc-border));}
  .txpc-root .txpc-compare-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:10px;}
  .txpc-root .txpc-compare-col h4{margin:0 0 6px; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; color:var(--txpc-text-mute);}
  .txpc-root .txpc-compare-col .txpc-compare-val{font-size:1.3rem; font-weight:800; font-variant-numeric:tabular-nums;}
  .txpc-root .txpc-compare-delta{margin-top:12px; text-align:center; font-weight:700; padding:10px; border-radius:9px; font-size:.95rem;}
  .txpc-root .txpc-compare-delta.txpc-up{background:color-mix(in srgb, var(--txpc-nettake) 16%, transparent); color:var(--txpc-nettake);}
  .txpc-root .txpc-compare-delta.txpc-down{background:color-mix(in srgb, var(--txpc-posttax) 16%, transparent); color:var(--txpc-posttax);}
  .txpc-root .txpc-compare-hint{font-size:.78rem; color:var(--txpc-text-mute); margin-top:8px;}

  .txpc-root .txpc-disclaimer{font-size:.74rem; color:var(--txpc-text-mute); line-height:1.5; margin-top:6px; padding-top:14px; border-top:1px solid var(--txpc-border);}

  @media print{
    .txpc-root .txpc-inputs, .txpc-root .txpc-actions, .txpc-root .txpc-theme-toggle, .txpc-root .txpc-compare{display:none !important;}
    .txpc-root .txpc-grid{display:block;}
    .txpc-root .txpc-hero{background:#fff !important; color:#000 !important; border:2px solid #000;}
  }
