.tool-header { margin-bottom: 1rem; }
.kicker { margin: 0 0 0.35rem; color: var(--primary); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tool-link { margin-top: 0.8rem; }
.lead { margin-top: 0.45rem; color: var(--muted); max-width: 70ch; }
.trust-line { margin-bottom: 1rem; padding: 0.8rem 0.95rem; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%); font-weight: 600; }

.layout-grid { display: grid; grid-template-columns: repeat(2, minmax(320px, 1fr)); gap: 1rem; align-items: stretch; }
.panel { padding: 1rem; display: flex; flex-direction: column; min-width: 0; }
.panel-span-2 { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.panel-head h2 { margin: 0; font-size: 1.06rem; }

.instruction summary { cursor: pointer; font-weight: 700; }
.instruction ul { margin: 0.6rem 0 0.35rem; padding-left: 1.1rem; color: var(--muted); }
.warning { color: #ffb347; font-weight: 700; margin: 0; }

.config-grid { display: grid; gap: 0.7rem; }
.row { display: grid; gap: 0.34rem; }
.distance-badge { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); padding: 0.5rem 0.7rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.86rem; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.7rem; }
.button-row .btn { min-width: 140px; flex: 1 1 140px; }
.status { margin-top: 0.6rem; font-weight: 700; }

.stage-wrap { position: relative; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 95%, var(--accent-soft) 5%), color-mix(in srgb, var(--surface) 90%, var(--accent-soft) 10%)); min-height: 220px; overflow: hidden; }
.stage-ruler { position: absolute; inset: 0; background-image:
  linear-gradient(to right, color-mix(in srgb, var(--border) 85%, var(--primary) 15%) 1px, transparent 1px),
  linear-gradient(to right, color-mix(in srgb, var(--border) 92%, var(--primary) 8%) 1px, transparent 1px);
  background-size: 96px 100%, 19.2px 100%;
}
.start-line, .end-guide { position: absolute; top: 0; bottom: 0; width: 2px; background: #13d3c6; }
.start-line { left: 18%; }
.end-guide { right: 18%; }
.crosshair { position: absolute; width: 28px; height: 28px; border: 2px solid #13d3c6; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px rgba(19, 211, 198, 0.25); }
.crosshair { z-index: 4; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: #13d3c6; }
.crosshair::before { width: 2px; height: 36px; left: 50%; top: -6px; transform: translateX(-50%); }
.crosshair::after { height: 2px; width: 36px; top: 50%; left: -6px; transform: translateY(-50%); }

.stats-grid { display: grid; gap: 0.55rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.65rem; background: var(--surface-muted); }
.stat-label { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.2rem; }
.stat-value { font-size: 1rem; font-weight: 700; font-family: "JetBrains Mono", "Fira Code", monospace; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.history-list { display: grid; gap: 0.48rem; max-height: 300px; overflow: auto; margin-bottom: 0.8rem; }
.history-item { border: 1px solid var(--border); border-radius: 10px; padding: 0.56rem 0.66rem; background: var(--surface-muted); }
.history-meta { color: var(--muted); margin-top: 0.22rem; font-size: 0.86rem; }
.compare-grid { display: grid; gap: 0.7rem; grid-template-columns: 1fr; margin-bottom: 0.75rem; }
.compare-result { border: 1px dashed var(--border); border-radius: 10px; min-height: 68px; padding: 0.7rem; }
.edu-list { margin: 0.5rem 0 0; padding-left: 1rem; color: var(--muted); }
.edu-list li { margin: 0.22rem 0; }

@media (max-width: 980px) {
  .layout-grid { grid-template-columns: 1fr; }
  .panel-span-2 { grid-column: auto; }
}

@media (max-width: 767px) {
  .tool-header h1 { font-size: 1.4rem; }
  .panel { padding: 0.82rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .button-row .btn, .actions .btn, .compare-grid .btn { width: 100%; min-width: 0; }
  .stage-wrap { min-height: 180px; }
}

@media (max-width: 479px) {
  .panel { padding: 0.74rem; }
  .distance-badge { font-size: 0.92rem; }
}
