/* The working tools of the content pages (markup: tools/pages/tools.py, behaviour: tools.js). Loaded only on pages that have one. Monochrome, like the rest of the site:
   a verdict is told by a mark and a line style, never by colour alone. */
.tool { max-width: 46rem; margin: 1.4rem auto 1.2rem; padding: clamp(18px, 3.4vw, 30px); border: 1px solid var(--line-2); border-radius: 2px; background: var(--card); color: var(--ink); text-align: left; font-size: 1rem; line-height: 1.5; }
.tool .tool-main { display: grid; gap: 1rem; margin: 0 0 1rem; }
.tool .tool-big { display: block; padding: .95rem 1.05rem; border: 1px solid var(--line); background: #000; font-size: clamp(1.15rem, .75rem + 1.7vw, 1.75rem); font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; word-break: break-all; min-height: 3.4rem; }
.tool .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; letter-spacing: .02em; font-stretch: 100%; }
.tool .tool-big:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.tool .tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.tool button[disabled] { opacity: .5; pointer-events: none; }
.tool .tool-status { margin: 0 0 1rem; color: var(--soft); font-size: .98rem; }
.tool .tool-status[hidden] { display: none; }
.tool .tool-main > .tool-status { margin: 0; }
.tool .tool-verdict { padding: .8rem 1rem; border: 1px solid var(--line); border-left: 2px solid var(--line-2); background: rgb(255 255 255 / .03); }
.tool[data-verdict="ok"] .tool-verdict { border-left-color: var(--paper); color: var(--ink); }
.tool[data-verdict="ok"] .tool-verdict::before { content: "✔ "; }
.tool[data-verdict="warn"] .tool-verdict, .tool[data-verdict="check"] .tool-verdict { border-left-style: dashed; border-left-color: var(--paper); color: var(--ink); }
.tool[data-verdict="warn"] .tool-verdict::before { content: "⚠ "; }
.tool[data-verdict="check"] .tool-verdict::before { content: "ⓘ "; }
.tool .tool-note { margin: 1.1rem 0 0; color: var(--dim); font-size: .86rem; line-height: 1.5; }
.tool .tool-nojs { margin: 1rem 0 0; color: var(--soft); }

/* password */
.tool .meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 1.15rem 0 .6rem; }
.tool .meter i { height: 8px; background: var(--line); transition: background .2s; }
.tool .meter i.on { background: var(--paper); }
.tool .tool-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1rem; }
.tool .tool-tabs label { position: relative; flex: 1 1 0; min-width: 0; }
.tool .tool-tabs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tool .tool-tabs span { display: block; padding: .62em 1em; border: 1px solid var(--line-2); text-align: center; font-stretch: 90%; font-weight: 450; cursor: pointer; }
.tool .tool-tabs label + label span { border-left-width: 0; }
.tool .tool-tabs input:checked + span { background: var(--paper); color: var(--on-paper); border-color: var(--paper); }
.tool .tool-tabs input:focus-visible + span { outline: 2px solid var(--paper); outline-offset: 3px; }
.tool .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1.4rem; }
.tool .opts[hidden] { display: none; }
.tool .opts .range, .tool .opts .sel { grid-column: 1 / -1; }
.tool .opts label { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.tool .opts .range { flex-direction: column; align-items: stretch; gap: .35rem; }
.tool .opts .sel { justify-content: space-between; }
.tool .opts input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: #fff; flex: none; }
.tool .opts input[type="range"] { width: 100%; accent-color: #fff; }
.tool .opts select { padding: .45em .7em; border: 1px solid var(--line-2); border-radius: 2px; background: #000; color: var(--ink); font: inherit; }
.tool .opts b { font-weight: 600; color: #fff; }

/* ip, webrtc, dns */
.tool .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.tool .kv div { padding: .7rem .9rem; background: var(--bg); min-width: 0; }
.tool .kv dt { color: var(--dim); font-size: .8rem; }
.tool .kv dd { margin: .15rem 0 0; color: var(--ink); overflow-wrap: anywhere; }
.tool .rows { display: grid; gap: .5rem; margin: 0 0 .4rem; padding: 0; list-style: none; }
.tool .rows[hidden] { display: none; }
.tool .rows li { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; gap: .1rem 1rem; padding: .7rem .9rem; border: 1px solid var(--line); }
.tool .rows li.warn { border-style: dashed; border-color: var(--paper); }
.tool .rows li.ok { border-left: 2px solid var(--paper); }
.tool .rows b { grid-column: 1; font-weight: 500; color: var(--ink); }
.tool .rows code { grid-column: 2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #fff; overflow-wrap: anywhere; }
.tool .rows span { grid-column: 1 / -1; color: var(--dim); font-size: .88rem; }
.tool .tbl-wrap { margin: 0 0 .4rem; overflow-x: auto; }
.tool .tbl-wrap[hidden] { display: none; }
.tool .tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tool .tbl th, .tool .tbl td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tool .tbl th { color: var(--dim); font-weight: 450; font-size: .8rem; white-space: nowrap; }
.tool .tbl td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* speed */
.tool .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 1.1rem; border: 1px solid var(--line); background: var(--line); }
.tool .metrics div { display: grid; gap: .1rem; padding: .85rem .9rem; background: var(--bg); min-width: 0; }
.tool .metrics span { font-size: .78rem; color: var(--dim); }
.tool .metrics b { font-stretch: 118%; font-weight: 320; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem); line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.tool .metrics small { font-size: .78rem; color: var(--dim); }
.tool[data-running] .metrics { border-color: var(--line-2); }

@media (max-width: 560px) {
  .tool .opts { grid-template-columns: minmax(0, 1fr); }
  .tool .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool .tool-tabs span { padding: .62em .5em; font-size: .94rem; }
  .tool .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool .rows li { grid-template-columns: minmax(0, 1fr); }
  .tool .rows code { grid-column: 1; }
  .tool .tool-actions .btn { flex: 1 1 auto; }
}
