/* Small free tools (docs/SMALL_TOOLS.md): page skeleton, form rows, result block, table, tabs and the search-engine article.
   Classes carry the sm- prefix (docs/LAYOUT.md). Colours: theme.css tokens only. Shared .btn / .card are used as they are. */
body.sm-body{overflow-y:auto}                       /* facet.css locks the body for the workbench; these pages scroll (also Plot, whose article follows the workbench) */
.sm-page{max-width:1120px;margin:0 auto;padding:28px 16px 72px;min-width:0}
.sm-head h1{margin:0;font-size:26px;line-height:1.25;letter-spacing:-.02em;font-weight:600}
.sm-lead{margin:8px 0 0;max-width:72ch;color:var(--ink2);font-size:14.5px;line-height:1.55}
.sm-fine{margin:10px 0 0;color:var(--muted);font-size:13px;line-height:1.5}
.sm-wait{color:var(--muted);font-size:13px}
.sm-pill{display:inline-block;padding:1px 8px;border:1px solid var(--line2);border-radius:99px;font-size:11.5px;line-height:18px;color:var(--ink2);white-space:nowrap}

/* the tool card and its form */
.sm-tool{margin:20px 0 0;padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:var(--panel);min-width:0}
.sm-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 14px;margin:0 0 12px;min-width:0}
.sm-row:last-child{margin-bottom:0}
.sm-field{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1 1 160px}
.sm-field>label,.sm-field>.sm-lab{font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.sm-tool input[type=text],.sm-tool input[type=number],.sm-tool select,.sm-tool textarea{width:100%;min-width:0;padding:6px 9px;border:1px solid var(--line2);border-radius:7px;background:var(--bg2);color:var(--ink);font:inherit;font-size:13.5px}
/* facet.css fixes text, number and select controls at 26 px, which clips the 13.5 px text under the padding above (and a select's text under its arrow):
   give them a height that fits. A tool that needs another size sets it in its own css, which is loaded after this file */
.sm-page input[type=text],.sm-page input[type=number],.sm-page select{height:34px}
.sm-page select{padding-right:26px}
.sm-tool textarea{min-height:96px;resize:vertical;font-family:"JetBrains Mono",ui-monospace,monospace;font-size:13px;line-height:1.5}
.sm-tool input:focus-visible,.sm-tool select:focus-visible,.sm-tool textarea:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.sm-hint{font-size:12.5px;color:var(--muted);line-height:1.45}
.sm-err{margin:0 0 12px;padding:8px 12px;border:1px solid color-mix(in srgb, var(--danger) 40%, transparent);border-radius:8px;background:color-mix(in srgb, var(--danger) 8%, transparent);color:var(--ink);font-size:13px}

/* a result: monospace block with a copy button in its corner */
.sm-out{position:relative;margin:12px 0 0;padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);font-family:"JetBrains Mono",ui-monospace,monospace;font-size:13.5px;line-height:1.55;color:var(--ink);overflow-wrap:anywhere;white-space:pre-wrap;min-width:0}
.sm-out.sm-big{font-size:20px;font-weight:600;letter-spacing:-.01em}
.sm-out .sm-copy{position:absolute;top:8px;right:8px}
.sm-copy{display:inline-flex;align-items:center;height:24px;padding:0 9px;border:1px solid var(--line2);border-radius:6px;background:var(--panel);color:var(--ink2);font-size:12.5px;font-weight:500;white-space:nowrap}
.sm-copy:hover{background:var(--panel3);color:var(--ink)}
.sm-bar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0 0}

/* a simple data table, scrolls sideways inside its own box on a phone */
.sm-tblwrap{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:9px}
.sm-table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
/* facet.css styles every table as a sticky, mono, right-aligned data grid: these rules undo that for a plain table */
.sm-table th,.sm-table td,.sm-table th:nth-child(2),.sm-table td:nth-child(2){position:static;padding:6px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;cursor:default;font-family:inherit;font-size:13px;color:var(--ink2)}
.sm-table th,.sm-table th:nth-child(2){font-size:12px;font-weight:600;letter-spacing:.03em;color:var(--muted);background:var(--panel2);white-space:nowrap}
.sm-table tr:hover td{background:none}
.sm-table tr:last-child td{border-bottom:0}
.sm-table td.sm-num,.sm-table th.sm-num{text-align:right}
.sm-table td.sm-mono{font-family:"JetBrains Mono",ui-monospace,monospace}

/* the notice that replaces a tool switched off on the admin page (FacetSmall.gate) */
.sm-off .sm-off-t{margin:0;font-size:15px;font-weight:600;color:var(--ink)}
.sm-off .sm-fine{margin-top:8px}
.sm-off a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}

/* tabs */
.sm-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 14px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);width:fit-content;max-width:100%}
.sm-tabs button{padding:5px 12px;border-radius:6px;font-size:13px;font-weight:500;color:var(--ink2)}
.sm-tabs button:hover{color:var(--ink)}
.sm-tabs button[aria-selected=true]{background:var(--panel);color:var(--ink);box-shadow:0 0 0 1px var(--line2)}

/* the article below the tool: what search engines read. Full-width band, text at a readable measure. */
.sm-art{margin:0;padding:40px max(16px, calc((100% - 1120px) / 2)) 72px;border-top:1px solid var(--line);background:var(--bg2);color:var(--ink2);font-size:15px;line-height:1.65;min-width:0}
.sm-art>*{max-width:72ch}
.sm-art>.sm-tblwrap{max-width:min(100%,72ch)}
.sm-art h1{margin:0 0 12px;font-size:26px;line-height:1.25;letter-spacing:-.02em;font-weight:600;color:var(--ink)}
.sm-art h2{margin:34px 0 10px;font-size:20px;line-height:1.3;letter-spacing:-.01em;font-weight:600;color:var(--ink)}
.sm-art h3{margin:22px 0 6px;font-size:16px;line-height:1.35;font-weight:600;color:var(--ink)}
.sm-art p{margin:0 0 12px}
.sm-art ul,.sm-art ol{margin:0 0 12px;padding-left:22px}
.sm-art li{margin:0 0 5px}
.sm-art a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
.sm-art strong{color:var(--ink);font-weight:600}
.sm-art code{padding:1px 5px;border:1px solid var(--line);border-radius:4px;background:var(--panel);font-family:"JetBrains Mono",ui-monospace,monospace;font-size:.88em;color:var(--ink);overflow-wrap:anywhere}
.sm-art pre{margin:0 0 14px;padding:10px 14px;overflow-x:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel);font-size:13px;line-height:1.5}
.sm-art pre code{padding:0;border:0;background:none}
.sm-art .sm-tblwrap{margin:0 0 16px}
.sm-art details{margin:0 0 8px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.sm-art summary{padding:10px 14px;cursor:pointer;font-weight:600;color:var(--ink);list-style-position:inside}
.sm-art details[open] summary{border-bottom:1px solid var(--line)}
.sm-art details p{margin:0;padding:10px 14px 12px}

/* "Next step" under a free tool: 3 to 5 links to what usually comes next, free tools and analyses (scripts/gen_static_blocks.py from
   scripts/data/next_steps.json; also on Convert, and at the end of Plot's article). The whole card is the link. */
.sm-next{margin:28px 0 0;min-width:0}
.sm-next .sm-next-h{margin:0 0 10px;font-size:12px;font-weight:600;letter-spacing:.06em;line-height:1.4;text-transform:uppercase;color:var(--muted)}
.sm-next .sm-next-l{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:8px;margin:0;padding:0;list-style:none}
.sm-next .sm-next-l li{position:relative;display:flex;flex-direction:column;gap:2px;min-width:0;margin:0;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--panel);transition:border-color .12s,background .12s}
.sm-next .sm-next-l li:hover{border-color:var(--line3);background:var(--panel2)}
.sm-next .sm-next-l li:focus-within{outline:2px solid var(--accent);outline-offset:1px}
.sm-next .sm-next-l a{color:var(--ink);font-size:14px;font-weight:500;line-height:1.4;text-decoration:none;overflow-wrap:anywhere;outline:none}
.sm-next .sm-next-l a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.sm-next-t{font-size:12px;line-height:1.4;color:var(--muted)}
.sm-next-t-an{color:var(--accent)}

@media (max-width:560px){
  .sm-page{padding:20px 12px 56px}
  .sm-tool{padding:14px 12px}
  .sm-art{padding-top:28px;padding-bottom:56px}
  .sm-field{flex-basis:100%}
}
