/* Shared look for every tool page. Tools add their own CSS in static/css/tools/<slug>.css. Tokens come from brand.css / site.css. */
.tool-wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 24px 90px; }
.tool-crumb { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 12px; } .tool-crumb a { color: var(--muted); } .tool-crumb a:hover { color: var(--accent); } .tool-crumb i { font-style: normal; margin: 0 4px; }
.tool-wrap h1 { margin: 4px 0 8px; } .tool-wrap .lead { max-width: 75ch; margin-bottom: 20px; }
.tool-grp { font-size: var(--fs-lg); margin-top: 26px; }
/* building blocks for tool interfaces */
.tool-panel { border: 1px solid var(--line); border-radius: var(--radius, 14px); background: var(--surface); padding: 18px 20px; }
.tool-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; } @media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }
.tool-field { display: grid; gap: 4px; margin-bottom: 12px; } .tool-field > label, .tool-field > .tool-lbl { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tool-field input, .tool-field select, .tool-field textarea, .tool-input { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-strong, var(--line)); background: var(--surface-2, var(--bg)); color: var(--ink); font: inherit; font-size: var(--fs-sm); width: 100%; }
.tool-field textarea { font-family: var(--mono, monospace); min-height: 160px; resize: vertical; }
.tool-field input:focus, .tool-field select:focus, .tool-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring, rgba(79,139,255,.25)); }
.tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; } .tool-btn:hover { border-color: var(--accent); } .tool-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-tabs { display: inline-flex; border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; overflow: hidden; margin-bottom: 10px; } .tool-tabs button { background: var(--surface); color: var(--ink); border: 0; padding: 7px 14px; font: inherit; font-size: var(--fs-sm); cursor: pointer; } .tool-tabs button + button { border-left: 1px solid var(--line-strong, var(--line)); } .tool-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.tool-out { position: relative; background: var(--code-bg, #0b1020); color: var(--code-ink, #e6edf7); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font: 0.82rem/1.55 var(--mono, monospace); overflow: auto; white-space: pre; max-height: 560px; }
.tool-out .tool-copy, [data-copy-btn] { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.1); color: inherit; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 3px 9px; font-size: .72rem; cursor: pointer; }
.tool-msg { font-size: var(--fs-sm); color: var(--muted); min-height: 1.3em; } .tool-msg.bad { color: #ef4444; } .tool-msg.good { color: #10b981; }
.tool-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; max-width: 80ch; }
.tool-more { margin-top: 30px; font-size: var(--fs-xs); color: var(--muted); } .tool-more a { color: var(--muted); } .tool-more a:hover { color: var(--accent); }
.tool-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); } .tool-table th, .tool-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; } .tool-table th { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; }

/* grid children may shrink below their content width, so wide code boxes scroll inside their panel instead of widening the page */
.tool-grid > *, .tool-panel, .tool-out { min-width: 0; max-width: 100%; }

/* ---- Shared page extras: facts row, KPI tiles, charts, steps, notes layout ---- */
.tool-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 14px; }
.tool-facts li { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; background: var(--surface); }
.tool-facts .tf-lang { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.tool-facts .tf-dax { color: var(--tf-dax); border-color: color-mix(in srgb, var(--tf-dax) 45%, var(--line)); background: color-mix(in srgb, var(--tf-dax) 12%, var(--surface)); }
.tool-facts .tf-m { color: var(--tf-m); border-color: color-mix(in srgb, var(--tf-m) 45%, var(--line)); background: color-mix(in srgb, var(--tf-m) 12%, var(--surface)); }
.tool-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 20px; }
.tool-kpis:empty { display: none; }
.kpi { display: flex; flex-direction: column; gap: 1px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); }
.kpi b { font-size: 1.55rem; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
.kpi span { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.kpi small { font-size: var(--fs-xs); color: var(--muted); }

.tool-viz { display: grid; gap: 16px; margin: 26px 0 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.tool-viz[hidden] { display: none; }
.tv-card { margin: 0; padding: 16px 18px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.tv-card figcaption { display: grid; gap: 2px; margin-bottom: 8px; } .tv-card figcaption b { font-size: var(--fs-base); } .tv-card figcaption span { font-size: var(--fs-xs); color: var(--muted); }
.tv-chart { min-width: 0; }

.tool-steps { margin: 34px 0 0; }
.tool-steps h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.tool-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; counter-reset: s; }
.tool-steps li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tool-steps li + li::before { content: ""; position: absolute; left: -15px; top: 30px; width: 14px; height: 2px; background: var(--line-strong, var(--line)); }
.ts-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); background: var(--accent); color: #fff; }
.tool-steps h3 { font-size: var(--fs-base); margin: 2px 0 4px; } .tool-steps p { margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

.tn-on.tn-on { max-width: none; margin-top: 34px; }
.tn { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
.tn-toc { position: sticky; top: 78px; display: grid; gap: 2px; font-size: var(--fs-sm); padding-left: 14px; border-left: 2px solid var(--line); }
.tn-toc b { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.tn-toc a { color: var(--muted); text-decoration: none; padding: 4px 0; line-height: 1.35; } .tn-toc a:hover { color: var(--accent); }
.tn-body { display: grid; gap: 18px; min-width: 0; }
.tn-cards { columns: 2 430px; column-gap: 16px; } .tn-cards > .tn-sec { break-inside: avoid; margin-bottom: 16px; }
.tn-sec { padding: 20px 22px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; scroll-margin-top: 84px; }
.tn-on .tn-sec h2 { display: flex; gap: 10px; align-items: center; font-size: var(--fs-lg); margin: 0 0 10px; }
.tn-i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.tn-on .tn-sec p { margin: 0 0 12px; line-height: 1.62; max-width: 80ch; }
.tn-faq { padding-bottom: 14px; }
.tn-q { border-top: 1px solid var(--line); } .tn-q:first-of-type { margin-top: 4px; }
.tn-q summary { cursor: pointer; font-weight: 700; padding: 12px 4px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.tn-q summary::-webkit-details-marker { display: none; }
.tn-q summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.tn-q[open] summary::after { content: "\2212"; }
.tn-on .tn-q p { margin: 0 0 14px; padding: 0 4px; }
@media (max-width: 1000px) { .tn { grid-template-columns: 1fr; gap: 14px; } .tn-toc { display: none; } .tool-steps li + li::before { display: none; } }

.tool-diagram { margin: 34px 0 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tool-diagram h2 { font-size: var(--fs-lg); margin: 0 0 4px; } .td-sub, .td-note { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 14px; max-width: 90ch; } .td-note { margin: 14px 0 0; }
.td-flow { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; counter-reset: f; }
.td-flow li { counter-increment: f; position: relative; flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg, var(--surface-2)); }
.td-flow li::before { content: counter(f); position: absolute; left: 10px; top: 11px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.td-flow b { font-family: var(--mono, monospace); font-size: var(--fs-sm); } .td-flow span { font-size: var(--fs-xs); color: var(--muted); }
.td-flow .td-hot { border-color: var(--accent); background: var(--accent-soft); }
.td-venns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.td-venn { margin: 0; display: flex; gap: 14px; align-items: center; } .td-venn svg { flex: none; width: 130px; height: auto; }
.td-venn figcaption { font-size: var(--fs-sm); display: grid; gap: 2px; } .td-venn figcaption span { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }
.v-ring { fill: none; stroke: var(--muted); stroke-width: 1.5; } .v-fill { fill: var(--accent); fill-opacity: .55; } .v-bg { fill: var(--surface); } .v-t { fill: var(--ink); font-size: 12px; font-weight: 700; text-anchor: middle; }



/* ---- Tools hub leftovers (the cards, chips and KPI tiles are the shared components in components.css) ---- */
.hub-bar { margin: 18px 0 14px; }
.hub-cards { margin-top: 0; }
.hub-cards .c-card[hidden] { display: none; }
.tc-g { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-right: auto; }
.tc-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; counter-reset: c; }
.tc-steps li { counter-increment: c; font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 8px; }
.tc-steps li::before { content: counter(c); flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.tool-viz.tv-2 { margin-top: 12px; }
