/* Free tools (/tools/*): the result card and what the script (tools/main.ts) renders into it. Page layout is the <style> block on each page;
   tokens, buttons, FAQ and illustrations come from pearl.css. Card icons: site/scripts/tool-icons.py. */
:root{--bad:#B42318;--bad-bg:#FEF3F2}
[data-theme=dark]{--bad:#FDA29B;--bad-bg:#3A1512}

/* ---------- fields */
.tl-form input,.tl-ask :is(input,textarea,select){width:100%;min-width:0;height:52px;padding:0 18px;border:0;border-radius:999px;background:var(--surface);color:var(--ink);font:400 17px var(--f-b);box-shadow:inset 0 0 0 1px var(--line-2)}
.tl-ask :is(input,textarea,select){height:46px;border-radius:14px;padding:0 14px;font-size:16px}
.tl-ask textarea{height:auto;min-height:92px;padding:12px 14px;resize:vertical}
.tl-form input::placeholder,.tl-ask ::placeholder{color:var(--ink-2)}
.tl-form input:focus-visible,.tl-ask :focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tl-ask{display:grid;gap:14px;max-width:680px;margin:16px 0 0}
.tl-ask label{display:grid;gap:6px;font:600 14px var(--f-b);color:var(--ink)}
.tl-ask label span{font-weight:400;font-size:13px;color:var(--ink-2)}
.tl-ask .row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.tl-ask-end{align-items:end}
:is(.tl-form,.tl-ask)[hidden]{display:none}
#tool-status{min-height:22px;margin:12px 0 0;font:500 14px var(--f-b);color:var(--ink-2)}

/* ---------- the result card */
.tl-out{margin-top:20px;background:var(--surface);border-radius:28px;box-shadow:var(--sh-2),inset 0 0 0 1px var(--line)}
.tl-out[aria-busy=true] .tl-out-body{opacity:.45}
.tl-out-bar{position:sticky;top:84px;z-index:3;display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;padding:12px 14px 12px 24px;background:var(--surface);border-radius:28px 28px 0 0;box-shadow:inset 0 -1px 0 var(--line)}
.tl-out-k{flex:1 1 auto;min-width:0;margin:0;font:600 12px var(--f-b);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-2)}
.tl-tabs,.tl-acts{display:flex;gap:8px}
.tl-tabs{flex-wrap:nowrap;overflow-x:auto}
.tl-out-body{display:grid;align-content:start;gap:30px;min-height:680px;padding:30px 34px 32px;font-size:16px}
.tl-out-body>*{min-width:0;margin:0}
.tl-out-body h2{font-size:clamp(26px,3.2vw,38px);margin:6px 0 0}
.tl-k{font:600 12px var(--f-b);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-2);margin:0}
.tl-stats{display:grid;grid-template-columns:repeat(4,1fr);margin:22px 0 0;border-top:1px solid var(--line-2)}
.tl-stats div{padding:14px 14px 0 0}
.tl-stats dt{font:500 13px var(--f-b);color:var(--ink-2)}
.tl-stats dd{margin:4px 0 0;font:600 34px var(--f-d);color:var(--ink)}
.tl-score{display:grid;grid-template-columns:auto 1fr;gap:30px;align-items:center}
.tl-score p:last-child{margin:10px 0 0;color:var(--ink-2)}
.tl-score>.tl-warn{grid-column:1/-1}
.tl-ring{--p:0;width:140px;height:140px;border-radius:50%;display:grid;place-content:center;text-align:center;background:radial-gradient(closest-side,var(--surface) 82%,transparent 83%),conic-gradient(var(--accent) calc(var(--p)*1%),var(--line) 0)}
.tl-ring b{font:700 44px/1 var(--f-d)}
.tl-ring span{font:500 13px var(--f-b);color:var(--ink-2)}
.tl-h{font:600 clamp(20px,2.2vw,24px) var(--f-d);margin:0 0 10px}
.tl-sec h4{font:600 15px var(--f-b);margin:20px 0 8px}
.tl-sec>p{color:var(--ink-2);margin:0 0 14px;max-width:70ch}
.tl-list{list-style:none;margin:0;padding:0;border-top:1px solid var(--line-2)}
.tl-list>li{padding:20px 0;border-bottom:1px solid var(--line)}
.tl-list>li:last-child{border-bottom:0;padding-bottom:0}
.tl-list p{margin:0 0 6px;color:var(--ink-2)}
.tl-list h4{margin:8px 0 6px;font:600 17px var(--f-b)}
.tl-list h4 small{font:500 13px var(--f-b);color:var(--ink-2);margin-left:6px}
.tl-pair{display:grid;grid-template-columns:64px 1fr;gap:16px}
.tl-pair p:first-child{color:var(--ink)}
.tl-sample{width:64px;height:64px;display:grid;place-content:center;border-radius:14px;box-shadow:inset 0 0 0 1px var(--line-2);font:600 24px var(--f-b)}
.tl-sample::before{content:"Aa"} /* drawn, not text: it shows the failing pair on purpose */
.tl-fix{color:var(--ink)}
.tl-chip{display:inline-block;width:12px;height:12px;border-radius:3px;background:var(--c);box-shadow:inset 0 0 0 1px var(--line-2);vertical-align:-1px;margin-right:4px}
.tl-tag{display:inline-block;font:600 12px var(--f-b);padding:3px 8px;border-radius:6px;box-shadow:inset 0 0 0 1px var(--line-2);color:var(--ink)}
.tl-tag.fail{background:var(--bad-bg);color:var(--bad);box-shadow:none}
.tl-ex{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:6px}
.tl-ex li{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:14px;padding:8px 10px;background:var(--sunken);border-radius:8px;min-width:0}
.tl-ex span{color:var(--ink);overflow-wrap:anywhere}
.tl-ex code{color:var(--ink-2);font-size:12px;overflow-wrap:anywhere;background:none;padding:0}
.tl-sw{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:10px}
.tl-sw li{border-radius:12px;overflow:hidden;background:var(--surface);font-size:13px;box-shadow:inset 0 0 0 1px var(--line)}
.tl-sw i{display:block;height:44px;background:var(--c);box-shadow:inset 0 -1px 0 var(--line)}
.tl-sw code{display:block;padding:8px 10px 0;background:none;font-size:12px;color:var(--ink)}
.tl-sw span{display:block;padding:0 10px 8px;color:var(--ink-2)}
.tl-dupes{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.tl-dupes li{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--ink-2)}
.tl-dupes i{width:22px;height:22px;border-radius:5px;background:var(--c);box-shadow:inset 0 0 0 1px var(--line-2)}
.tl-dupes code{color:var(--ink)}
.tl-cols{display:grid;grid-template-columns:1fr 1fr;gap:40px}
.tl-cols h4:first-of-type{margin-top:0}
.tl-chips{list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:6px}
.tl-chips li{border-radius:8px;padding:4px 9px;font-size:13px;color:var(--ink-2);background:var(--surface);box-shadow:inset 0 0 0 1px var(--line)}
.tl-chips b{color:var(--ink);font-weight:600;margin-right:4px}
.tl-scroll{overflow-x:auto}
.tl-table{width:100%;border-collapse:collapse;font-size:15px}
.tl-table :is(th,td){text-align:left;vertical-align:top;padding:12px 12px 12px 0;border-bottom:1px solid var(--line)}
.tl-table thead th{font:600 12px var(--f-b);letter-spacing:.06em;text-transform:uppercase;color:var(--ink-2);border-bottom-color:var(--line-2)}
.tl-table td:nth-child(3){color:var(--ink-2)}
.tl-table td:last-child{white-space:nowrap;font-weight:600}
.tl-lock{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;border-radius:20px;box-shadow:inset 0 0 0 1px var(--line-2)}
.tl-lock p{margin:0;max-width:60ch;color:var(--ink-2)}
.tl-lock b{color:var(--ink)}
.tl-warn{border-left:3px solid var(--bad);background:var(--bad-bg);color:var(--ink);padding:12px 16px;border-radius:0 12px 12px 0;margin:14px 0 0}
.tl-next{padding-top:20px;box-shadow:inset 0 1px 0 var(--line);color:var(--ink-2)}
.tl-next a{color:var(--accent);font-weight:600}
.tl-from{color:var(--ink-2)}
.tl-from b{color:var(--ink)}
.tl-pre{max-height:620px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13.5px;line-height:1.6;padding:18px 20px;border-radius:16px;background:var(--sunken);color:var(--ink)}
.tl-pre code{font-size:inherit}

/* ---------- how to read this */
.tl-read{margin:0;border-top:1px solid var(--line-2)}
.tl-read div{display:grid;grid-template-columns:220px 1fr;gap:20px;padding:18px 0;border-bottom:1px solid var(--line)}
.tl-read dt{font:600 16px var(--f-b);color:var(--ink)}
.tl-read dd{margin:0;color:var(--ink-2)}
.tl-read dd b{color:var(--ink)}

/* ---------- tool cards: the big drawn icon (tool-icons.py inserts it) */
.tl-ic{display:grid;place-items:center;width:96px;height:96px;margin:18px 0 0 22px;border-radius:24px;background:var(--sunken);color:var(--ink)}
.tl-ic svg{width:72px;height:72px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.tl-ic .f{fill:var(--paper)}.tl-ic .w{fill:var(--surface)}.tl-ic .k{fill:currentColor;stroke:none}.tl-ic .w-s{stroke:var(--surface)}

@media (max-width:820px){
  .tl-cols,.tl-ask .row{grid-template-columns:1fr}
  .tl-stats{grid-template-columns:1fr 1fr}
  .tl-score{grid-template-columns:1fr}
  .tl-read div{grid-template-columns:1fr;gap:4px}
  .tl-out-body{padding:24px 20px}
}
@media (max-width:520px){
  .tl-out-bar{padding:10px 12px;top:76px}
  .tl-out-k{flex-basis:100%}
  .tl-out-body{padding:20px 16px;gap:26px}
  .tl-pair{grid-template-columns:48px 1fr;gap:12px}
  .tl-sample{width:48px;height:48px;font-size:18px}
  .tl-ring{width:120px;height:120px}
}
