/* ---- tool pages (loaded after styles.css and styles-v2.css) ---- */
input[type="number"] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.tool-layout { display: grid; gap: 20px; padding: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .tool-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
.tool-form { display: grid; gap: 14px; align-content: start; }
.tool-form label { display: grid; gap: 6px; font-weight: 700; font-size: .85rem; }
.tool-form .row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-preview .viewer-wrap { min-height: 260px; }
.tool-preview .viewer-wrap:has(canvas) .viewer-msg { display: none; }
.mesh-report { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: .84rem; background: var(--surface-2); color: var(--ink-soft); }
.mesh-report[data-closed="true"] { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.mesh-report[data-closed="false"] { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.tool-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .tool-cards { grid-template-columns: repeat(2, 1fr); } }
.tool-card-link { display: block; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-card-link:hover { border-color: var(--accent); }
.tool-card-link h3 { margin-bottom: 6px; font-size: 1.1rem; }
main#tool > .container > .hero { max-width: none; margin-inline: 0; padding: 48px 0 20px; }
#tools { padding-top: 8px; }
.tool-actions .btn { width: auto; }
.tool-form label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.tool-actions .btn[aria-disabled="true"] { opacity: .5; cursor: progress; }
/* Shared 3D viewer: Reset view button (44 px touch target) and a visible focus ring on the keyboard-operable canvas */
.viewer-reset { position: absolute; top: 8px; right: 8px; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.viewer-reset:hover { border-color: var(--accent); }
.viewer-reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.viewer-wrap canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* An error message in the report line (e.g. a photo that cannot be used): error colours with AA contrast and a sign, not colour only */
.mesh-report[data-error="true"] { background: var(--danger-tint); color: #b42318; font-weight: 600; }
.mesh-report[data-error="true"]::before { content: "\26A0\FE0E\00A0"; }
@media (prefers-color-scheme: dark) { .mesh-report[data-error="true"] { color: #ffb4a9; } }

/* Tools portal: header pills, illustrated tool cards, final QR box */
.tp-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent-600); }
.tp-pills { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 18px 0 0; padding: 0; }
.tp-pills li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13px; font-weight: 600; }
.tp-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.tp-card { flex: 1 1 320px; box-sizing: border-box; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 22px; padding: 16px; color: #0f172a; }
.tp-art { height: 220px; border-radius: 14px; border: 1px solid #e2e8f0; background-color: #f8fafc; background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px); background-size: 20px 20px; display: grid; place-items: center; overflow: hidden; }
.tp-art svg { width: 100%; height: 100%; display: block; }
.tp-head { display: flex; align-items: center; gap: 12px; margin: 20px 4px 0; }
.tp-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--t-bg); color: var(--t-fg); display: grid; place-items: center; }
.tp-card h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; color: #0f172a; }
.tp-card h2 a { color: inherit; text-decoration: none; }
.tp-card h2 a:hover { text-decoration: underline; }
.tp-card p { margin: 12px 4px 0; font-size: 15px; line-height: 1.6; color: #475569; flex: 1; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 4px 0; padding: 0; }
.tp-chips li { padding: 3px 10px; border-radius: 999px; background: var(--t-cbg); color: var(--t-cfg); font-size: 12px; font-weight: 600; line-height: 1.5; }
.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; min-height: 44px; margin-top: 20px; padding: 0 20px; border-radius: 12px; background: #2563eb; color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; transition: background 150ms ease; }
.tp-card .tp-btn { align-self: flex-start; margin-left: 4px; margin-bottom: 4px; }
.tp-btn:hover { background: #1d4ed8; }
.tp-btn:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.tp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 24px; padding: 28px 32px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 22px; color: #0f172a; }
.tp-cta-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; background: #2563eb; display: grid; place-items: center; }
.tp-cta-text { flex: 1 1 280px; min-width: 0; }
.tp-cta h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: #0f172a; }
.tp-cta p { margin: 0; font-size: 16px; color: #475569; }
.tp-cta .tp-btn { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .tp-btn { transition: none; } }
