/* Tooladoo — plain, classic web page styling. Responsive, no external fonts or frameworks. */

:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #555555;
  --link: #0033aa;
  --visited: #5c2d91;
  --hover: #cc2200;
  --navy: #1f3a68;
  --navy-2: #2b4d85;
  --band: #e4eaf3;
  --line: #c9d3e1;
  --rule: #d6d6d6;
  --soft: #f6f7f9;
  --field-line: #8f8f8f;
  --good: #1d7a1d;
  --warn-bg: #fff8d6;
  --warn-line: #e2c35a;
  --warn-ink: #4a3b00;
  --bad: #9d1f17;
  --bad-bg: #fdecea;
  --bad-line: #e3a29c;
  /* chart tokens (dataviz reference palette, light) */
  --chart-surface: #ffffff;
  --chart-grid: #e1e0d9;
  --chart-axis: #808080;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --ui: Verdana, Geneva, "DejaVu Sans", Tahoma, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: "Courier New", Courier, "Liberation Mono", monospace;
  --wrap: 980px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #ffffff; color: var(--ink); font: 14px/1.55 var(--ui); }
img, svg { max-width: 100%; }
a { color: var(--link); }
a:visited { color: var(--visited); }
a:hover { color: var(--hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font: bold clamp(1.5rem, 1.2rem + 1.4vw, 2rem)/1.2 var(--serif); color: var(--navy); }
h2 { font: bold 1.3rem/1.25 var(--serif); color: var(--navy); }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5em 0; }
code, pre, kbd { font-family: var(--mono); font-size: 0.95em; }
:focus-visible { outline: 2px solid #6d8fc7; outline-offset: 1px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 6px 10px; z-index: 20; border: 1px solid var(--ink); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.lead { font-size: 1.05rem; }
.status { font: italic normal 0.8rem var(--ui); color: var(--muted); vertical-align: middle; }

/* ---------- header & footer ---------- */
.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid #b8c7de; }
.site-header .wrap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding-top: 12px; padding-bottom: 12px; }
.brand { font: bold 1.6rem/1.1 var(--serif); color: #fff !important; text-decoration: none; }
.brand:hover { text-decoration: underline; }
.brand-tagline { color: #cfd9ea; font-size: 0.85rem; font-style: italic; }
.site-nav { margin-left: auto; display: flex; gap: 16px; font-size: 0.9rem; font-weight: bold; }
.site-nav a, .site-nav a:visited { color: #fff; }
.site-nav a:hover { color: #ffe08a; }
@media (max-width: 640px) {
  .brand-tagline { flex-basis: 100%; order: 3; }
  .site-nav { margin-left: auto; }
}

main { padding: 18px 0 8px; }
.site-footer { margin-top: 40px; border-top: 1px solid var(--rule); padding: 14px 0 30px; color: var(--muted); font-size: 0.82rem; text-align: center; }
.site-footer p { margin: 6px auto 0; max-width: 680px; }

/* ---------- buttons & form fields ---------- */
.btn {
  display: inline-block; font: inherit; line-height: 1.3; color: var(--ink) !important; text-decoration: none;
  background: #f0f0f0; border: 1px solid #8a8a8a; border-radius: 3px; padding: 5px 14px; cursor: pointer;
  box-shadow: inset 0 1px 0 #ffffff;
}
.btn:hover { background: #e3e3e3; }
.btn:active:not(:disabled) { background: #d6d6d6; box-shadow: none; }
.btn.primary { background: var(--navy); border-color: #14284a; color: #fff !important; font-weight: bold; box-shadow: none; }
.btn.primary:hover { background: var(--navy-2); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.small { padding: 2px 9px; font-size: 0.85rem; }
select, input[type=text], input[type=number], input[type=search], input[type=password] {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--field-line); border-radius: 2px;
  padding: 5px 7px; width: 100%; min-height: 30px;
}
select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.field { margin-bottom: 14px; min-width: 0; }
.field > label, .field .label { display: block; font-weight: bold; margin-bottom: 4px; }
.help { color: var(--muted); font-size: 0.85rem; margin: 4px 0 0; }
.check, .field > label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; cursor: pointer; }
.check input { margin: 3px 0 0; width: 14px; height: 14px; flex: none; accent-color: var(--navy); }
fieldset.group { border: 1px solid var(--rule); padding: 10px 12px 2px; margin: 6px 0 14px; min-width: 0; }
fieldset.picker { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
fieldset.picker > legend { font-weight: bold; margin-bottom: 4px; padding: 0; }
.pick { display: block; border: 1px solid var(--rule); background: #fff; padding: 4px; cursor: pointer; text-align: center; font-size: 0.9rem; }
.pick img, .pick video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.pick span { display: block; padding: 4px 2px 2px; }
.pick:has(input:checked) { border: 2px solid #1f3a68; padding: 3px; background: #eef1f6; }
.pick:focus-within { outline: 2px solid #1f3a68; outline-offset: 1px; }
fieldset.toggle { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; }
fieldset.toggle > legend { font-weight: bold; margin-bottom: 4px; padding: 0; }
.toggle-btn { position: relative; }
.toggle-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-btn span { display: block; padding: 6px 18px; border: 1px solid #8a93a3; background: linear-gradient(#fff, #e6e9ee); cursor: pointer; }
.toggle-btn + .toggle-btn span { border-left: 0; }
.toggle-btn input:checked + span { background: #1f3a68; border-color: #1f3a68; color: #fff; }
.toggle-btn input:focus-visible + span { outline: 2px solid #1f3a68; outline-offset: 2px; }
fieldset.group > legend { font-weight: bold; padding: 0 4px; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 16px; }
.options > .field-wide { grid-column: 1 / -1; }
details.advanced { margin: 0 0 12px; }
details.advanced summary { cursor: pointer; color: var(--link); text-decoration: underline; margin-bottom: 10px; width: max-content; max-width: 100%; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.field-error { color: var(--bad); font-weight: bold; font-size: 0.9rem; margin: 6px 0 0; }

/* file picker */
.drop { border: 2px dashed #a7b6cc; background: #fafbfd; padding: 16px 14px; text-align: center; cursor: pointer; }
.drop:hover, .drop.dragover { border-color: var(--navy); }
.drop.dragover, .file-list li.dragover { background: #fffbe0; }
.drop-text { font-size: 0.98rem; }
.drop-text .linklike { color: var(--link); text-decoration: underline; font-weight: bold; }
.drop-hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; overflow-wrap: anywhere; }
.drop.has-files { padding: 8px 10px; text-align: left; border-style: solid; border-width: 1px; }
.drop.has-files .drop-text, .drop.has-files .drop-hint { display: none; }
.drop.has-files .add-more { display: inline-block; }
.add-more { display: none; margin-top: 6px; font-size: 0.85rem; color: var(--link); text-decoration: underline; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px solid #eceff4; }
.file-list .name { font-weight: bold; overflow-wrap: anywhere; }
.file-list .size { color: var(--muted); font-size: 0.82rem; margin-left: auto; white-space: nowrap; }
.file-list button { font: bold 0.9rem/1 var(--ui); background: #fff; border: 1px solid #aaa; border-radius: 2px; width: 22px; height: 20px; padding: 0; cursor: pointer; flex: none; }
.file-list button:hover { border-color: var(--bad); color: var(--bad); }
.file-list li[draggable=true] { cursor: move; }
.file-list button.move:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.file-list button:disabled { opacity: 0.35; cursor: default; border-color: #aaa; color: inherit; }

/* progress */
.progress { margin-top: 14px; }
.progress-bar { height: 14px; border: 1px solid var(--field-line); background: #fff; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .25s ease; }
.progress-bar.indeterminate span { width: 30% !important; animation: slide 1.4s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: 0; } to { margin-left: 70%; } }
@media (prefers-reduced-motion: reduce) { .progress-bar.indeterminate span { animation: none; width: 100% !important; opacity: .4; } }
.progress-text { margin-top: 6px; font-size: 0.88rem; }

/* ---------- boxes (form, result) and sidebar ---------- */
.box { border: 1px solid var(--line); margin-bottom: 18px; min-width: 0; }
.box-title { margin: 0; padding: 6px 12px; background: var(--band); border-bottom: 1px solid var(--line); font: bold 0.95rem/1.4 var(--ui); color: var(--navy); }
.box-body { padding: 14px 14px 12px; }
.box-body:focus { outline: none; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px; align-items: start; margin-top: 14px; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.sidebar { background: var(--soft); border: 1px solid #e0e3e8; padding: 10px 14px; font-size: 0.85rem; }
.sidebar h3 { font-size: 0.88rem; margin: 8px 0 4px; color: var(--navy); }
.sidebar ol, .sidebar ul { padding-left: 18px; margin: 0 0 10px; }
.sidebar li { margin-bottom: 3px; }
.price-list { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.price-list td { padding: 2px 0; border-bottom: 1px dotted #ccc; }
.price-list td.num { text-align: right; font-weight: bold; white-space: nowrap; padding-left: 8px; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.formats { font-size: 0.85rem; color: var(--muted); margin: -4px 0 0; }

/* ---------- home ---------- */
.intro { margin-bottom: 16px; }
.intro h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.2rem); }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 14px 0 4px; }
.search label { font-weight: bold; }
.search input { flex: 1 1 240px; max-width: 420px; }
.search-empty { margin: 10px 0 0; font-weight: bold; }
.cat-index { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 0; }
.category { margin-top: 22px; }
.category h2, .related h2 { border-bottom: 1px solid var(--rule); padding-bottom: 3px; margin-bottom: 6px; }
.cat-desc { color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 4px 28px; }
.tool-entry { margin: 0 0 12px; }
.tool-entry a.name { font-weight: bold; font-size: 1rem; }
.tool-entry p { margin: 2px 0 0; font-size: 0.9rem; }
.tool-entry .formats { margin: 2px 0 0; font-size: 0.8rem; }

/* ---------- results ---------- */
.result-head { display: flex; gap: 10px; align-items: flex-start; }
.result-head .icon { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.result-head h2 { margin: 0 0 3px; font: bold 1.05rem/1.4 var(--ui); color: var(--ink); }
.result-head p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin: 12px 0 0; }
.stat { border: 1px solid #dde2ea; background: var(--soft); padding: 5px 9px; min-width: 0; }
.stat .label { font-size: 0.75rem; color: var(--muted); }
.stat .value { font-weight: bold; overflow-wrap: anywhere; }
.notice { display: flex; gap: 8px; padding: 8px 10px; margin: 12px 0 0; border: 1px solid; font-size: 0.9rem; }
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.notice ul { margin: 0; padding-left: 18px; }
.downloads { margin-top: 16px; }
.downloads h3 { margin-bottom: 6px; }
.dl-list { list-style: none; padding: 0; margin: 0; border: 1px solid #dde2ea; }
.dl { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid #e8ebf0; flex-wrap: wrap; }
.dl:last-child { border-bottom: 0; }
.dl.primary { background: #fffbe6; }
.dl .meta { flex: 1; min-width: 160px; }
.dl .meta strong { display: block; overflow-wrap: anywhere; }
.dl .meta span { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.dl .price { font-weight: bold; }
.quote { margin-top: 16px; }
.quote h3 { margin-bottom: 6px; }
.quote table.data { width: auto; min-width: min(100%, 520px); }
.quote tfoot th, .quote tfoot td { position: static; background: #eef1f6; }
.quote tfoot tr.total th { font-size: 0.95rem; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.result-foot { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 14px; font-size: 0.85rem; }
.result-foot .spacer { flex: 1; }

/* preview tabs */
.previews { margin-top: 18px; }
.tabs { display: flex; flex-wrap: wrap; gap: 3px; position: relative; z-index: 1; }
.tabs button { font: inherit; font-size: 0.85rem; padding: 4px 10px; background: #eef1f6; color: var(--link); border: 1px solid #bcc6d6; border-bottom: 0; border-radius: 3px 3px 0 0; cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); font-weight: bold; padding-bottom: 5px; }
.tab-panels { border: 1px solid #bcc6d6; padding: 12px; background: #fff; min-width: 0; }
.panel h4 { margin: 0 0 8px; font-size: 0.92rem; }
.table-wrap { overflow: auto; max-height: 520px; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.84rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 3px 7px; border: 1px solid #dde2ea; text-align: left; vertical-align: top; max-width: 420px; overflow-wrap: break-word; }
table.data th { position: sticky; top: 0; background: #eef1f6; font-weight: bold; white-space: nowrap; z-index: 1; }
table.data tbody tr:nth-child(even) td { background: #fafbfc; }
table.data tbody tr:hover td { background: #fff8d6; }
table.data td.num { text-align: right; white-space: nowrap; }
table.data td.nowrap { white-space: nowrap; }
.table-note { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
pre.text { border: 1px solid #dde2ea; background: #fafbfc; padding: 10px; overflow: auto; max-height: 520px; font-size: 0.82rem; line-height: 1.4; margin: 0; white-space: pre; }
dl.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 3px 16px; margin: 0; font-size: 0.9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.report-frame { width: 100%; border: 1px solid #dde2ea; background: #fff; display: block; }
.preview-video, .preview-image {
  background-color: #fff;
  background-image: linear-gradient(45deg, #e3e6ea 25%, transparent 25%, transparent 75%, #e3e6ea 75%),
    linear-gradient(45deg, #e3e6ea 25%, transparent 25%, transparent 75%, #e3e6ea 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.preview-video { display: block; max-width: 100%; max-height: 70vh; }
.preview-image { max-width: 100%; border: 1px solid #dde2ea; display: block; }
.locked-preview { padding: 22px; text-align: center; border: 1px dashed #bbb; background: var(--soft); }
.issues { list-style: none; margin: 0; padding: 0; border: 1px solid #dde2ea; }
.issues li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 6px 8px; font-size: 0.88rem; border-bottom: 1px solid #eceff4; }
.issues li:last-child { border-bottom: 0; }
.issues .sev { display: inline-flex; align-items: center; gap: 5px; font-weight: bold; font-size: 0.78rem; white-space: nowrap; }
.issues .sev svg { width: 14px; height: 14px; }
.issues .sev.error { color: var(--bad); }
.issues .sev.warning { color: var(--warn-ink); }
.issues .sev.info { color: var(--navy); }
.issues .code { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); margin-left: 6px; }
.issues .loc, .issues .hint { grid-column: 2; color: #333; font-size: 0.82rem; overflow-wrap: anywhere; }
.issues-filter { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.issues-filter .btn[aria-pressed=true] { background: var(--navy); border-color: #14284a; color: #fff !important; }

/* ---------- charts ---------- */
.chart { position: relative; background: var(--chart-surface); border: 1px solid #dde2ea; padding: 10px 10px 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .title { font-weight: bold; font-size: 0.9rem; margin: 0 0 2px 4px; }
.chart .note { color: var(--muted); font-size: 0.8rem; margin: 0 0 4px 4px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 4px 4px 6px; font-size: 0.8rem; list-style: none; padding: 0; }
.chart-legend li { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .key { width: 14px; height: 2px; }
.chart-legend .key.box { width: 10px; height: 10px; }
.chart-tip { position: absolute; pointer-events: none; background: #ffffe1; border: 1px solid #777; padding: 4px 7px; font-size: 0.78rem; min-width: 110px; z-index: 3; }
.chart-tip .x { color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.chart-tip .row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.chart-tip .row .k { width: 12px; height: 2px; flex: none; }
.chart-tip .row strong { font-variant-numeric: tabular-nums; }
.chart-tools { display: flex; justify-content: flex-end; margin-top: 2px; }
.chart-tools button, .file-tools button { font: inherit; font-size: 0.8rem; background: none; border: 0; color: var(--link); cursor: pointer; text-decoration: underline; padding: 2px 4px; }
.chart .table-wrap { margin-top: 6px; max-height: 300px; }
.chart .axis text { fill: #444; font-size: 11px; font-family: var(--ui); font-variant-numeric: tabular-nums; }
.chart .axis-label { fill: #222; font-size: 11.5px; font-family: var(--ui); }

/* ---------- long-form content ---------- */
.content { margin-top: 28px; max-width: 760px; }
.content h1 { margin-bottom: 0.4em; }
.content h2 { border-bottom: 1px solid var(--rule); padding-bottom: 3px; margin-top: 1.5em; }
.content h3 { margin-top: 1.3em; }
.content > h2:first-child, .content > h3:first-child { margin-top: 0; }
.content table { border-collapse: collapse; margin: 1em 0; font-size: 0.88rem; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid #c9d0db; padding: 4px 8px; text-align: left; vertical-align: top; }
.content th { background: #eef1f6; }
.content code { background: #f1f3f6; padding: 0 3px; }
.content pre { background: #f6f7f9; padding: 10px; overflow-x: auto; border: 1px solid #dde2ea; }
.content pre code { background: none; padding: 0; }
.content li { margin-bottom: 4px; }
.faq details { padding: 7px 0; border-bottom: 1px dotted #bbb; }
.faq summary { cursor: pointer; font-weight: bold; color: var(--link); }
.faq details[open] summary { color: var(--ink); }
.faq details p { margin: 6px 0 4px 16px; }
.related { margin-top: 28px; }

.custom-ui { width: 100%; border: 1px solid #dde2ea; display: block; min-height: 320px; background: #fff; }

/* ---------- admin ---------- */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.admin-bar h1 { margin: 0; font-size: 1.4rem; }
.admin-bar .spacer { flex: 1; }
.range { display: inline-flex; gap: 4px; flex-wrap: wrap; font-size: 0.85rem; }
.range a { padding: 1px 8px; border: 1px solid #bcc6d6; border-radius: 3px; text-decoration: none; }
.range a[aria-current=true] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: bold; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 18px; }
.tile { border: 1px solid var(--line); padding: 8px 10px; background: #fff; }
.tile .label { font-size: 0.78rem; color: var(--muted); }
.tile .value { font: bold 1.5rem/1.3 var(--serif); color: var(--navy); overflow-wrap: anywhere; }
.tile .sub { font-size: 0.78rem; margin-top: 2px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0 16px; }
.pill { display: inline-block; padding: 0 6px; font-size: 0.78rem; font-weight: bold; border: 1px solid; border-radius: 3px; }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.good { background: #e6f4e6; color: var(--good); }
.log { white-space: pre-wrap; max-height: 260px; overflow: auto; background: #f6f7f9; border: 1px solid #dde2ea; padding: 8px; font: 0.78rem/1.4 var(--mono); margin: 4px 0 8px; }
.login { max-width: 380px; margin: 30px auto; }
.inline-form { display: inline; margin: 0; }
.admin details summary { cursor: pointer; padding: 4px 0; }
.panel-card { border: 1px solid var(--line); padding: 0 0 10px; margin-bottom: 18px; min-width: 0; }
.panel-card > h2:first-child { margin: 0 0 10px; padding: 6px 12px; background: var(--band); border-bottom: 1px solid var(--line); font: bold 0.95rem/1.4 var(--ui); color: var(--navy); }
.panel-card > h2:not(:first-child) { font: bold 0.92rem var(--ui); margin: 14px 12px 6px; }
.panel-card > *:not(h2:first-child) { margin-left: 12px; margin-right: 12px; }
.panel-card > .chart:first-child, .panel-card > div:first-child { margin-top: 12px; }
.panel-card > table.data { width: calc(100% - 24px); }
.admin table.data td:first-child { min-width: 11em; }

/* category pages and link lists */
.category h2 a, .category h2 a:visited { color: var(--navy); text-decoration: none; }
.category h2 a:hover { text-decoration: underline; color: var(--hover); }
.tool-list-wide { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
.tool-list-wide .tool-entry { padding-bottom: 12px; border-bottom: 1px solid #eceff4; }
h2.tool-name { font-size: 1.1rem; margin: 0 0 2px; }
.link-list { columns: 2 260px; column-gap: 28px; margin: 0; padding-left: 18px; }
.link-list li { margin-bottom: 4px; break-inside: avoid; }

/* Crop area editor (region options) */
fieldset.region { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.region > legend { font-weight: bold; margin-bottom: 4px; padding: 0; }
.region-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.region-bar .btn[aria-pressed="true"] { background: var(--navy); border-color: #14284a; color: #fff !important; box-shadow: none; }
.region-stage { position: relative; display: inline-block; max-width: 100%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #eee; border: 1px solid var(--rule); line-height: 0; cursor: crosshair; vertical-align: top; }
.region-stage img, .region-stage video { display: block; max-width: 100%; max-height: 60vh; pointer-events: none; }
.region-stage.empty, .region-stage.no-preview { display: flex; width: 100%; aspect-ratio: 16 / 9; align-items: center; justify-content: center; line-height: normal; }
.region-stage.empty { cursor: default; }
.region-stage.empty .region-box { display: none; }
.region-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 0.9rem; text-align: center; pointer-events: none; }
.region-box { position: absolute; box-sizing: border-box; border: 1px solid #fff; outline: 1px solid rgba(0, 0, 0, 0.6); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); cursor: move; }
.region-box:focus-visible { outline: 2px solid #f5c400; }
/* Handles sit inside the area, so they can be grabbed even when it fills the whole picture. */
.region-handle { position: absolute; width: 12px; height: 12px; box-sizing: border-box; background: #fff; border: 1px solid #333; }
.region-handle.nw { left: 0; top: 0; cursor: nwse-resize; }
.region-handle.ne { right: 0; top: 0; cursor: nesw-resize; }
.region-handle.sw { left: 0; bottom: 0; cursor: nesw-resize; }
.region-handle.se { right: 0; bottom: 0; cursor: nwse-resize; }
.region-handle.n { left: calc(50% - 6px); top: 0; cursor: ns-resize; }
.region-handle.s { left: calc(50% - 6px); bottom: 0; cursor: ns-resize; }
.region-handle.w { top: calc(50% - 6px); left: 0; cursor: ew-resize; }
.region-handle.e { top: calc(50% - 6px); right: 0; cursor: ew-resize; }
@media (pointer: coarse) { .region-handle { width: 22px; height: 22px; } .region-handle.n, .region-handle.s { left: calc(50% - 11px); } .region-handle.w, .region-handle.e { top: calc(50% - 11px); } }
.region-box.locked .region-handle.n, .region-box.locked .region-handle.s, .region-box.locked .region-handle.e, .region-box.locked .region-handle.w { display: none; }
/* Small areas: only the corners, so the handles don't pile up. */
.region-box.narrow .region-handle.n, .region-box.narrow .region-handle.s, .region-box.short .region-handle.e, .region-box.short .region-handle.w { display: none; }
.region-readout { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 0.9rem; }
.region-readout input { width: 5.5em; }
.region-readout .unit { color: var(--muted); }

/* Earlier results passed on to another tool */
.file-list .from, .file-list .pos { color: var(--muted); font-size: 0.82rem; }
.dl .next { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dl .next-label { color: var(--muted); font-size: 0.82rem; margin-right: 2px; }
