/* Add-on for /tools/ pages. Loads after the site's own /styles.css and uses only its tokens
   (--bg --ink --muted --accent --accent-ink --accent-soft --tint --line --card), so each site keeps its look. */
.tw-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.tw-page .prose>h1{margin-bottom:.35em}
.tw-page .lede{margin-bottom:0}

/* fields */
.tw-tool .tw-f{min-width:0}
.tw-tool .tw-in{position:relative}
.tw-tool input:not([type=checkbox]){background-image:none}
.tw-tool .tw-in input{width:100%}
.tw-tool .tw-in.has-pre input{padding-left:30px}
.tw-tool .tw-in.has-unit input{padding-right:58px}
.tw-tool .tw-pre,.tw-tool .tw-unit{position:absolute;top:50%;transform:translateY(-50%);color:var(--muted);font-size:.95rem;pointer-events:none;font-variant-numeric:tabular-nums}
.tw-tool .tw-pre{left:14px}
.tw-tool .tw-unit{right:14px;max-width:52px;text-align:right;white-space:nowrap;overflow:hidden}
.tw-tool input,.tw-tool select,.tw-tool textarea{font-variant-numeric:tabular-nums}
.tw-tool textarea{min-height:8.5em;width:100%}
.tw-tool select{background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 20px) 50%,calc(100% - 15px) 50%;background-size:5px 5px;background-repeat:no-repeat;padding-right:36px}
.tw-tool [aria-invalid="true"]{border-color:#b3261e!important;box-shadow:0 0 0 3px color-mix(in srgb,#b3261e 18%,transparent)!important}
.tw-err{margin:.4rem 0 0;font-size:.85rem;line-height:1.35;color:#b3261e;font-weight:600}
@media (prefers-color-scheme:dark){.tw-err{color:#ff8a80}.tw-tool [aria-invalid="true"]{border-color:#ff8a80!important}}
.tw-tool input[type=checkbox]{width:22px;height:22px;min-height:0;padding:0;margin:2px 0 0;flex:none;accent-color:var(--accent);box-shadow:none;-webkit-appearance:auto;appearance:auto}
.tw-tool input[type=checkbox]:focus-visible{outline:3px solid var(--accent)!important;outline-offset:2px}
.tw-tool .grid>.tw-f::after{content:none!important} /* listingsperhour's theme labels every field "min" */
.tw-tool input[type=file]{height:auto;padding:12px;font-size:.95rem}
.tw-checks{border:0;margin:0;padding:0;min-width:0}
.tw-checks legend{font-weight:600;padding:0;margin-bottom:.5rem}
.tw-checks ul{list-style:none;margin:0;padding:0}
.tw-checks li{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-top:1px solid var(--line)}
.tw-checks li:last-child{border-bottom:1px solid var(--line)}
.tw-checks li label{margin:0;font-weight:500;cursor:pointer}
.tw-checks li label .hint{display:block}
.tw-one{display:flex;gap:12px;align-items:flex-start}
.tw-one label{margin:0}

/* inputs line up across a row even when only some labels carry a hint */
.tw-page:not([data-site="resellertaxes.com"]) .tw-tool .grid>.tw-f:not(.wide){display:flex;flex-direction:column}
.tw-page:not([data-site="resellertaxes.com"]) .tw-tool .grid>.tw-f:not(.wide)>label{flex:1 0 auto}
/* resellertaxes draws the form as numbered tax-form lines; keep its row grid, place our messages under the input */
[data-site="resellertaxes.com"] .tw-tool .grid>.tw-f>.tw-in,[data-site="resellertaxes.com"] .tw-tool .grid>.tw-f>.tw-err{grid-column:3}
@media (max-width:640px){[data-site="resellertaxes.com"] .tw-tool .grid>.tw-f>.tw-in,[data-site="resellertaxes.com"] .tw-tool .grid>.tw-f>.tw-err{grid-column:1/-1}}
.tw-tool .grid>.wide,.tw-tool .grid>.tw-checks{grid-column:1/-1!important}
.out .tw-table tbody th{text-transform:none;letter-spacing:0;font-size:inherit}
/* tools whose result is a table: inputs on top, result full width */
.tw-tool.is-stack{grid-template-columns:minmax(0,1fr)!important}
.tw-tool.is-stack .grid{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.tw-tool.is-stack .grid>.wide:has(textarea){grid-column:auto}
.tw-tool.is-stack .grid>.tw-f:not(.wide)>label{flex:0 0 auto}
@media (min-width:861px){.tw-tool.is-stack .tw-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.tw-tool.is-stack .tw-stats .stat{grid-column:auto}}
@media (max-width:760px){.tw-tool.is-stack .grid{grid-template-columns:minmax(0,1fr)}}

/* result panel */
.tw-tool .out{scroll-margin-top:90px}
.tw-tool .out:focus{outline:none}
.tw-empty{margin:0;font-size:.98rem;line-height:1.5;opacity:.85}
.tw-verdict{margin:0 0 1rem}
.tw-stats .stat[data-tone=bad] dd{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px;text-decoration-color:#d9534f}
.tw-stats dd{font-variant-numeric:tabular-nums;overflow-wrap:break-word}
/* thequitnumber's theme shrinks the first character of the first stat, meant for "$" only */
.tw-stats .stat:not([data-cur]) dd::first-letter{font-size:inherit;vertical-align:baseline;margin-right:0}
.tw-stats .stat[data-long] dd{font-size:clamp(1.15rem,1rem + .6vw,1.45rem);line-height:1.2}
.tw-table{overflow-x:auto;margin:1rem 0 0;-webkit-overflow-scrolling:touch}
.out .tw-table table,.out .tw-table caption,.out .tw-table th,.out .tw-table td,.out .tw-table tr{background:transparent!important;color:inherit!important;box-shadow:none!important}
.tw-table table{width:100%;border-collapse:collapse;font-size:.88rem;font-variant-numeric:tabular-nums}
.tw-table caption{text-align:left;font-weight:600;font-size:.8rem;padding:0 0 .5rem;opacity:.8}
.tw-table th,.tw-table td{padding:8px 10px 8px 0;border-bottom:1px solid color-mix(in srgb,currentColor 18%,transparent);text-align:left;vertical-align:top}
.tw-table td{min-width:4.5em}
.tw-table .n,.tw-table thead th{white-space:nowrap}
.tw-table thead th{font-size:.75rem;font-weight:600;opacity:.75;text-transform:none;letter-spacing:0}
.tw-table tbody th{font-weight:600;white-space:normal;min-width:7em}
.tw-table .n{text-align:right}
.tw-table tr.is-bad>*{opacity:.7}
.tw-table tr.is-bad>td:last-child{font-weight:700;opacity:1}
.out .tw-table tbody tr:last-child>*{border-top:0;font-size:inherit;font-weight:inherit;padding-top:8px;padding-bottom:8px}
.out .tw-table tbody tr:last-child>th{font-weight:600}
.out .tw-table tr.is-total>*{font-weight:700;border-top:2px solid color-mix(in srgb,currentColor 40%,transparent)}
.tw-math{margin-top:1rem;font-size:.88rem}
.tw-math summary{cursor:pointer;font-weight:600;min-height:44px;display:flex;align-items:center}
.tw-math ol{margin:.25rem 0 0;padding-left:1.25rem}
.tw-math li{margin:.2rem 0;font-variant-numeric:tabular-nums}

/* action bar */
.tw-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px;margin:-1.6rem 0 2.6rem}
.tw-actions{display:flex;flex-wrap:wrap;gap:10px}
.tw-actions .btn{min-height:44px;font-size:.92rem;padding-left:16px;padding-right:16px}
.tw-actions .btn.ghost{background:transparent;color:var(--ink);border:1.5px solid var(--line);opacity:1}
.tw-actions .btn.ghost:hover{border-color:var(--ink);background:var(--card)}
.tw-status{margin:0;font-size:.85rem;color:var(--muted)}

/* page furniture */
.tw-related{padding-left:1.2rem}
.tw-related li{margin-bottom:.5em}
.tw-sources{font-size:.9rem;color:var(--muted)}
.tw-cat{list-style:none;padding:0;margin:2rem 0;counter-reset:t;border-top:1px solid var(--line)}
.tw-page .tw-cat>li{counter-increment:t;position:relative;padding:1.6rem 0 1.7rem 3.2rem!important;margin:0!important;border-bottom:1px solid var(--line);list-style:none}
.tw-page .tw-cat>li::marker{content:none}
.tw-page .tw-cat>li{display:block!important;grid-template-columns:none!important}
.tw-page .tw-cat>li::after{content:none!important}
.tw-page .tw-cat>li .btn{width:auto!important;min-height:44px;height:auto}
.tw-page .tw-cat>li::before{content:counter(t)!important;position:absolute!important;left:0!important;top:1.75rem!important;width:2rem!important;height:2rem!important;border-radius:50%!important;border:1.5px solid var(--line)!important;background:transparent!important;display:grid!important;place-items:center;font:700 .9rem/1 inherit;color:var(--accent-ink)!important;transform:none!important;margin:0!important}
.tw-cat h2{margin:0 0 .35rem;font-size:clamp(1.25rem,1.1rem + .6vw,1.6rem)}
.tw-cat h2 a{color:var(--ink);text-decoration:none}
.tw-cat h2 a:hover{text-decoration:underline}
.tw-cat p{margin:0 0 .8rem;max-width:60ch}
.tw-ex{font-size:.92rem;color:var(--muted)}
.tw-ex span{display:inline-block;font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;margin-right:.3rem}
.tw-ex strong{color:var(--ink);font-variant-numeric:tabular-nums}

/* tool-specific blocks */
.tw-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:1rem}
.tw-photo{border:1px solid color-mix(in srgb,currentColor 20%,transparent);border-radius:10px;overflow:hidden;font-size:.8rem;line-height:1.35}
.tw-photo img{display:block;width:100%;aspect-ratio:1;object-fit:cover;background:color-mix(in srgb,currentColor 8%,transparent)}
.tw-photo div{padding:8px 10px}
.tw-photo b{display:block;overflow-wrap:anywhere}
.tw-photo .ok::before{content:"✓ "}
.tw-photo .no::before{content:"✕ "}
.tw-photo .no{font-weight:700}
.tw-clock{font-size:clamp(2.6rem,2rem + 3vw,4rem);font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-.02em;margin:0 0 .4rem}
.tw-run{display:flex;flex-wrap:wrap;gap:10px;margin:.6rem 0 1rem}
.tw-run .btn{min-height:44px}
.tw-run .btn.ghost{background:transparent;color:inherit;border:1.5px solid color-mix(in srgb,currentColor 35%,transparent)}
.tw-steps{list-style:none;padding:0;margin:.5rem 0 0}
.tw-steps li{display:flex;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid color-mix(in srgb,currentColor 15%,transparent)}
.tw-steps li.done{opacity:.6}
.tw-steps li.now{font-weight:700}

/* mobile result peek */
.tw-peek{position:fixed;left:12px;right:12px;bottom:12px;z-index:40;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-radius:12px;background:var(--ink);color:var(--bg);text-decoration:none;font-size:.9rem;box-shadow:0 6px 24px rgba(0,0,0,.25)}
.tw-peek[hidden]{display:none}
.tw-peek strong{font-size:1.05rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.tw-peek span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (min-width:861px){.tw-peek{display:none!important}}

@media (max-width:640px){
  .tw-bar{margin-top:-1.2rem}
  .tw-actions{width:100%}
  .tw-actions .btn{flex:1 1 calc(50% - 5px)}
  .tw-page .tw-cat>li{padding-left:2.7rem!important}
}
@media (prefers-reduced-motion:reduce){.tw-page *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
@media print{
  .tw-bar,.tw-peek,.tw-page .tool~*:not(.tw-keep),.crumbs,.mention{display:none!important}
  .tw-page .tool{display:block!important;border:1px solid #999!important;box-shadow:none!important}
  .tw-math{display:none}
}
