/* Tool pages: walk test, heatmap, calculators. Loaded only on those pages, after site.css.
   Shared pieces first (head, step strip, dock, frames, scale, rows), then one block per tool. */

/* ---------- page head ---------- */
.tool-head { padding: 22px 0 4px; }
.tool-head h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 6px; }
.tool-head .lead { font-size: 17px; margin: 0; }
.tool-intro { padding-top: 6px; }
.tool-h { margin: 22px 0 14px; font-size: clamp(24px, 3.4vw, 32px); }
.crumbs { font-size: 14px; color: var(--text-2); padding: 16px 0 0; }
.crumbs a { color: var(--text-2); }
.crumbs span { margin: 0 4px; }

/* ---------- numbered step strip ---------- */
.step-strip { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.step-card { display: grid; gap: 3px; align-content: start; padding: 14px 16px 16px; }
.step-top { display: flex; align-items: center; justify-content: space-between; color: var(--accent); margin-bottom: 6px; }
.step-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 14px/1 var(--sans); }
.step-card b { font-size: 16px; letter-spacing: -0.01em; }
.step-card > span:last-child { font-size: 14px; line-height: 1.4; color: var(--text-2); }
@media (max-width: 760px) {
  .step-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 16px -20px; padding: 2px 20px 8px; scroll-padding-inline: 20px; -webkit-overflow-scrolling: touch; }
  .step-strip::-webkit-scrollbar { display: none; }
  .step-card { flex: 0 0 68%; scroll-snap-align: start; }
}

/* ---------- details cards (settings) ---------- */
.settings { padding: 0; margin: 12px 0; }
.settings summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 18px; font-weight: 700; cursor: pointer; list-style: none; border-radius: var(--radius); }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.25s var(--ease); }
.settings[open] summary::after { transform: rotate(-135deg); }
.settings > :not(summary) { margin-left: 18px; margin-right: 18px; }
.settings > :last-child { margin-bottom: 18px; }
.fine-print { margin: 6px 4px 0; }

/* ---------- sticky action dock ---------- */
.dock { position: sticky; z-index: 20; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)); display: flex; gap: 8px; margin-top: 16px; padding: 8px; border-radius: 26px; box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.dock .btn { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.dock .btn.primary { flex: 2 1 0; }
@media (min-width: 861px) {
  .dock { bottom: 20px; width: fit-content; max-width: 100%; margin: 20px auto 0; }
  .dock .btn { flex: none; padding-left: 26px; padding-right: 26px; }
}
@media (max-width: 400px) { .dock .btn.big { font-size: 15px; padding-left: 6px; padding-right: 6px; } .dock .btn .ico { display: none; } }

/* ---------- canvases in frosted frames ---------- */
.frame { padding: 12px; display: grid; gap: 12px; }
.frame-h { margin: 2px 4px 0; font-size: 14px; font-weight: 700; color: var(--text-2); letter-spacing: 0; }
.canvas-box { position: relative; background: var(--surface-solid); border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; touch-action: manipulation; }
.canvas-box canvas { display: block; width: 100%; height: 100%; }
.trail-box { height: clamp(280px, 80vw, 440px); }
.chart-box { height: 170px; }
.hm-box { aspect-ratio: 4 / 3; cursor: crosshair; }
.overlay-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(255, 255, 255, 0.86); color: var(--text); font-weight: 700; padding: 20px; }
.empty-hint { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; pointer-events: none; color: var(--text-2); font-weight: 600; font-size: 16px; }
.empty-hint svg { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-hint span { max-width: 260px; }

/* Color scale: five flat segments */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.scale span { display: grid; gap: 5px; justify-items: center; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--text-2); }
.scale i { display: block; width: 100%; height: 10px; }
.scale span:first-child i { border-radius: 5px 0 0 5px; }
.scale span:last-child i { border-radius: 0 5px 5px 0; }

/* ---------- rows (spots, rooms) ---------- */
.tag-list { display: grid; gap: 8px; margin-top: 12px; }
.tag-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; background: var(--surface-solid); border: 1px solid var(--hairline); border-radius: 14px; font-size: 15px; }
.tag-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border); background: var(--surface-solid); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-name { display: grid; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tag-name small { font-weight: 400; font-size: 13px; color: var(--text-2); }
.tag-label { font-weight: 700; font-size: 14px; }
.tag-list > p { margin: 0; }
.status { margin: 14px 2px 10px; font-weight: 600; color: var(--text-2); font-size: 15px; }
.field.sm { width: 120px; }

/* ---------- walk test ---------- */
.live { display: grid; gap: 12px; grid-template-columns: 1fr; }
.live-side, .live-main { display: contents; }
.o-score { order: 1; } .o-stats { order: 2; } .o-trail { order: 3; } .o-info { order: 4; } .o-chart { order: 5; } .o-mark { order: 6; }
@media (min-width: 900px) {
  .live { grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
  .live-side, .live-main { display: grid; gap: 12px; align-content: start; }
  .o-score, .o-stats, .o-trail, .o-info, .o-chart, .o-mark { order: 0; }
}
.score-card.glass { padding: 22px 20px 20px; border-radius: var(--radius-lg); }
.score-card .score { font-size: clamp(60px, 14vw, 80px); transition: color 0.4s; }
.score-card .meter { max-width: 260px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-row .metric b { font-size: 18px; }
.stat-row .metric .k { font-size: 12px; }
@media (max-width: 340px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 899px) { .score-card.glass { padding: 14px 18px 16px; } .score-card .score { font-size: 56px; } .stat-row .metric { padding: 8px 4px; } }
.walked { margin: 0 4px; }
.o-info .notice { margin-top: 8px; }
.o-mark .field { margin-bottom: 2px; }
.report-hero { display: grid; gap: 14px; padding: 20px; border-radius: var(--radius-lg); margin-bottom: 16px; }
.rh-score { display: grid; justify-items: start; gap: 2px; }
.rh-score .k { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; }
.rh-score .score { font-size: 72px; }
.rh-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); align-content: center; }
.metric.txt b { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
@media (min-width: 900px) { .report-hero { grid-template-columns: 220px 1fr; align-items: center; } .rh-stats { grid-template-columns: repeat(4, 1fr); } }
.report-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .report-grid { grid-template-columns: 1fr 1fr; } }
.report-grid h3 { font-size: 17px; margin: 18px 0 4px; }
.report-grid ul { margin: 8px 0 0; padding-left: 20px; }
.report-grid li { margin: 6px 0; font-size: 16px; }

/* ---------- heatmap ---------- */
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.plan-bar select { flex: 1 1 160px; width: auto; min-width: 0; }
.hm-layout { display: grid; gap: 16px; }
@media (min-width: 940px) { .hm-layout { grid-template-columns: 1fr 320px; align-items: start; } }
.hm-main, .hm-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.hm-main .seg { max-width: 100%; }
.hm-main .seg button { padding: 8px 14px; }
@media (max-width: 400px) { .hm-main .seg button { padding: 8px 10px; font-size: 13px; } }
#hint { margin: 0 2px; min-height: 22px; }
.panel { padding: 18px 20px; border-radius: var(--radius-lg); }
.panel .h3, .hm-side .card .h3 { margin: 0 0 8px; font-size: 18px; }
.panel p:last-child { margin-bottom: 0; }
.size-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.upload { position: relative; }

/* ---------- calculators (signal strength, internet speed) ---------- */
.calc-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; margin-top: 18px; }
@media (min-width: 860px) { .calc-grid { grid-template-columns: 1fr 1.15fr; gap: 20px; } }
.calc-note { margin: 12px 4px 0; }
.calc-inputs { display: grid; gap: 12px; }
.calc-inputs .h3 { margin: 0; }
.calc-mode { max-width: 100%; }
.calc-mode button { padding: 8px 12px; }
.calc-inputs input[type="number"] { font-size: 22px; font-weight: 700; min-height: 54px; font-variant-numeric: tabular-nums; }
.calc-inputs input[type="range"] { width: 100%; min-height: 0; height: 40px; padding: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: -6px; }
.calc-result { display: grid; gap: 16px; padding: 22px 22px 20px; border-radius: var(--radius-lg); }
.result-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.calc-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.calc-main .k { flex-basis: 100%; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; }
.calc-main .score { font-size: clamp(56px, 12vw, 72px); transition: color 0.3s; }
.calc-unit { font-size: 24px; font-weight: 700; color: var(--text-2); }
.calc-main .grade { margin-left: 8px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 44px; flex: none; }
.bars span { display: block; width: 14px; border-radius: 4px; background: var(--surface-2); }
.bars span:nth-child(1) { height: 13px; } .bars span:nth-child(2) { height: 23px; }
.bars span:nth-child(3) { height: 33px; } .bars span:nth-child(4) { height: 44px; }
.bars span.on { background: currentColor; }
.calc-facts { margin: 0; display: grid; gap: 0; }
.calc-facts div { display: grid; grid-template-columns: 80px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--hairline); }
.calc-facts dt { color: var(--text-2); font-size: 14px; font-weight: 600; }
.calc-facts dd { margin: 0; }

/* dBm scale infographic */
.b-dead { background: var(--dead); } .b-weak { background: var(--weak); } .b-fair { background: var(--fair); }
.b-good { background: var(--good); } .b-excellent { background: var(--excellent); }
.dbm-scale { position: relative; margin: 4px 18px 0; padding-top: 34px; }
.dbm-marker { position: absolute; left: 0; right: 0; top: 0; height: 40px; pointer-events: none; transform: translateX(calc(var(--p, 0) * 1% - 100%)); transition: transform 0.3s var(--ease); }
.dbm-marker .mk { position: absolute; right: 0; top: 0; transform: translateX(50%); display: grid; justify-items: center; }
.dbm-marker b { background: var(--text); color: #fff; font-size: 13px; line-height: 1; padding: 5px 9px; border-radius: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dbm-marker .mk::after { content: ""; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid var(--text); }
.dbm-track { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.dbm-track i { display: block; box-shadow: inset -2px 0 0 rgba(255, 255, 255, 0.75); }
.dbm-track i:last-child { box-shadow: none; }
.dbm-ticks { position: relative; height: 22px; margin-top: 6px; }
.dbm-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.band-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.band-key li { display: inline-flex; align-items: center; gap: 6px; }
.band-key i { width: 12px; height: 12px; border-radius: 4px; }

/* tables (reference charts) */
.calc-chart { margin-top: 8px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.calc-table { width: 100%; border-collapse: collapse; font-size: 16px; background: var(--surface); border-radius: 12px; }
.calc-table th, .calc-table td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.calc-table thead th { background: var(--surface-2); }
.calc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-table tfoot th, .calc-table tfoot td { background: var(--surface-2); font-weight: 700; }
.sc-result .calc-table { background: transparent; font-size: 15px; }

/* internet speed calculator */
.sc-layout { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; margin-top: 18px; }
@media (min-width: 900px) { .sc-layout { grid-template-columns: 1fr 1fr; gap: 20px; } }
.sc-inputs .h3 { margin: 0 0 2px; }
.stepper-list { display: grid; margin-top: 4px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.stepper:last-child { border-bottom: 0; }
.stepper label { display: grid; font-weight: 600; min-width: 0; line-height: 1.3; }
.stepper label small { font-weight: 400; font-size: 13px; color: var(--text-2); }
.stepper-ctl { display: flex; align-items: center; gap: 4px; flex: none; }
.stepper-ctl input { width: 46px; min-height: 48px; text-align: center; padding: 0; border: 0; background: transparent; font: 700 22px var(--sans); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper-ctl input::-webkit-outer-spin-button, .stepper-ctl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-solid); color: var(--accent); font: 500 28px/1 var(--sans); cursor: pointer; box-shadow: 0 1px 2px rgba(20, 30, 60, 0.06); transition: transform 0.15s var(--ease), background 0.2s; }
.step-btn:hover { background: var(--accent-soft); }
.step-btn:active { transform: scale(0.92); }
@media (max-width: 380px) { .stepper { gap: 8px; } .step-btn { width: 44px; height: 44px; } .stepper-ctl input { width: 38px; } }
.sc-result { display: grid; gap: 14px; padding: 22px; border-radius: var(--radius-lg); align-content: start; }
.sc-result .h3 { margin: 0; }
.sc-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-plan .metric { background: var(--surface-solid); padding: 12px; }
.sc-plan .metric b { font-size: 36px; line-height: 1.1; }
.sc-result p { margin: 0; }
.sc-result .btn { justify-self: start; }
.share-h { font-size: 13px !important; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px !important; }
.share-bar { display: flex; height: 24px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.share-bar i { display: block; height: 100%; box-shadow: inset -2px 0 0 var(--surface-solid); transition: width 0.3s var(--ease); }
.share-bar i.spare { background: transparent; box-shadow: none; }
.c0 { background: var(--accent); }
.c1 { background: color-mix(in srgb, var(--accent) 78%, transparent); }
.c2 { background: color-mix(in srgb, var(--accent) 58%, transparent); }
.c3 { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.c4 { background: color-mix(in srgb, var(--text) 62%, transparent); }
.c5 { background: color-mix(in srgb, var(--text) 40%, transparent); }
.c6 { background: color-mix(in srgb, var(--text) 22%, transparent); }
.share-key { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); font-size: 14px; }
.share-key li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.share-key i { width: 12px; height: 12px; border-radius: 4px; }
.share-key i.spare { background: var(--surface-2); border: 1px solid var(--border); }
.share-key b { font-variant-numeric: tabular-nums; }
.share-key span { color: var(--text-2); min-width: 0; }

/* Phones: the result is far below the inputs, so a small glass pill stays pinned under the top bar. */
.sc-mini { display: none; }
@media (max-width: 899px) {
  .sc-mini { display: flex; position: sticky; top: 78px; z-index: 6; justify-content: center; gap: 6px; width: fit-content; max-width: 100%; margin: 10px auto 4px; padding: 7px 16px; border-radius: 999px; font-size: 15px; background: var(--glass-strong); }
  .sc-mini b { font-variant-numeric: tabular-nums; color: var(--accent); }
}
