/* ═══════════════════════════════════════════════════════════
   MIN15X — TOOLS STYLESHEET
   Extends style.css design tokens. No new visual language.
   Pill geometry, hairline borders, no shadows, no gradients.
╔═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   TOOL LAYOUT
───────────────────────────────────────── */
.tool-wrap {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 var(--sp6);
}

.tool-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp8);
  align-items: start;
}
@media (min-width: 768px) {
  .tool-two-col { grid-template-columns: 1fr 1fr; }
}

.tool-section {
  margin-bottom: var(--sp8);
}

/* ─────────────────────────────────────────
   TOOL CARDS (result panels, input areas)
───────────────────────────────────────── */
.tool-card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp8) var(--sp6);
  transition: border-color var(--t2);
}
.tool-card--result {
  border-color: var(--hairline-strong);
  background: var(--surface-soft);
}
.tool-card--result .tool-stat {
  font-family: var(--ff-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 2px;
}
.tool-card--result .tool-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: var(--sp4);
}
.tool-card--result .tool-stat:last-of-type { margin-bottom: 0; }

.tool-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp3) 0;
  border-bottom: 1px solid var(--hairline);
}
.tool-stat-row:last-child { border-bottom: none; }
.tool-stat-row .tool-stat-label { font-size: 13px; color: var(--body); }
.tool-stat-row .tool-stat-value {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}

/* ─────────────────────────────────────────
   FORM INPUTS (tool-specific overrides)
───────────────────────────────────────── */
.tool-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: var(--sp2);
}

.tool-range-wrap {
  margin-bottom: var(--sp5);
}
.tool-range-wrap .tool-label { margin-bottom: var(--sp2); }

.tool-range-row {
  display: flex;
  align-items: center;
  gap: var(--sp4);
}
.tool-range-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--hairline-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tool-range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
}
.tool-range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
}
.tool-range-val {
  min-width: 48px;
  text-align: right;
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}

.tool-input {
  width: 100%;
  padding: 11px var(--sp5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  transition: border-color var(--t1);
}
.tool-input:focus { border-color: var(--ink); }
.tool-input::placeholder { color: var(--mute); }

/* ─────────────────────────────────────────
   QUIZ
───────────────────────────────────────── */
.quiz-progress {
  height: 3px;
  background: var(--hairline);
  border-radius: 2px;
  margin-bottom: var(--sp8);
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width var(--t3);
}

.quiz-question {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: var(--sp6);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
  margin-bottom: var(--sp8);
}

.quiz-option {
  display: block;
  padding: var(--sp4) var(--sp5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t2);
  font-size: 14px;
  color: var(--body);
  background: var(--canvas);
}
.quiz-option:hover { border-color: var(--hairline-strong); color: var(--charcoal); }
.quiz-option.selected {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-soft);
}
.quiz-option input { display: none; }

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp4);
}
.quiz-counter {
  font-size: 12px;
  color: var(--mute);
}

.quiz-result-card {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.quiz-score {
  font-family: var(--ff-display);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: var(--sp2);
}
.quiz-category {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: var(--sp6);
}
.quiz-rec {
  font-size: 15px;
  color: var(--body);
  line-height: 1.7;
  margin-bottom: var(--sp6);
}

/* ─────────────────────────────────────────
   SCORE BADGES (health grader)
───────────────────────────────────────── */
.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp4);
  margin-bottom: var(--sp6);
}
.score-badge {
  text-align: center;
  padding: var(--sp4) var(--sp3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--canvas);
}
.score-badge-num {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 2px;
}
.score-badge-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.score-overall {
  text-align: center;
  padding: var(--sp6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp6);
}
.score-overall-num {
  font-family: var(--ff-display);
  font-size: 2.8rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: var(--sp2);
}
.score-overall-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.score-issues {
  margin-top: var(--sp4);
}
.score-issue {
  display: flex;
  align-items: flex-start;
  gap: var(--sp3);
  padding: var(--sp2) 0;
  font-size: 13px;
  color: var(--charcoal);
  line-height: 1.5;
  border-bottom: 1px solid var(--hairline);
}
.score-issue:last-child { border-bottom: none; }
.score-issue-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--mute); margin-top: 2px; }

/* ─────────────────────────────────────────
   COMPARISON (cost comparison)
───────────────────────────────────────── */
.compare-side {
  padding: var(--sp6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: border-color var(--t2);
}
.compare-side:hover { border-color: var(--hairline-strong); }
.compare-side-title {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: var(--sp6);
  text-align: center;
}

.compare-result-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp4);
  margin-top: var(--sp6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
}

/* ─────────────────────────────────────────
   CHAT
───────────────────────────────────────── */
.chat-window {
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--canvas);
}
.chat-header {
  padding: var(--sp4) var(--sp6);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--ff-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.chat-body {
  padding: var(--sp6);
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
}
.chat-msg {
  margin-bottom: var(--sp4);
  padding: var(--sp3) var(--sp5);
  border-radius: var(--r-full);
  font-size: 14px;
  line-height: 1.5;
  max-width: 85%;
}
.chat-msg--bot {
  background: var(--surface-soft);
  color: var(--charcoal);
  border-bottom-left-radius: 4px;
}
.chat-msg--user {
  background: var(--primary);
  color: var(--on-primary);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp3);
  margin-top: var(--sp4);
  margin-bottom: var(--sp6);
}
.chat-btn {
  padding: 8px 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--charcoal);
  background: var(--canvas);
  cursor: pointer;
  transition: all var(--t2);
}
.chat-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface-soft);
}

/* ─────────────────────────────────────────
   LOADING SPINNER
───────────────────────────────────────── */
.tool-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--hairline);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: var(--sp2);
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp3);
  padding: var(--sp10);
  font-size: 14px;
  color: var(--body);
}

/* ─────────────────────────────────────────
   TOOL CTA (lead capture within tools)
───────────────────────────────────────── */
.tool-cta {
  text-align: center;
  padding: var(--sp6);
  margin-top: var(--sp8);
  border-top: 1px solid var(--hairline);
}
.tool-cta p {
  font-size: 14px;
  color: var(--body);
  margin-bottom: var(--sp4);
}

/* ─────────────────────────────────────────
   HIDDEN STATE
───────────────────────────────────────── */
.tool-hidden { display: none; }

/* ─────────────────────────────────────────
   TOOLS LISTING GRID (tools/index.html)
   Equal-height cards, 3-col desktop, 2-col tablet
───────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp4);
}
@media (min-width: 640px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .tool-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.tool-grid .svc-card {
  display: flex;
  flex-direction: column;
}

.tool-grid .svc-body {
  flex: 1;
  margin-bottom: var(--sp5);
}

.tool-grid .btn--sm {
  align-self: flex-start;
}

/* ─────────────────────────────────────────
   LEAD CAPTURE FORM (within tools)
───────────────────────────────────────── */
.lead-form {
  text-align: center;
  padding: var(--sp6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
  max-width: 420px;
  margin: var(--sp8) auto 0;
}
.lead-form-title {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--sp2);
}
.lead-form-sub {
  font-size: 13px;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: var(--sp6);
}
.lead-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
  margin-bottom: var(--sp4);
}
.lead-input.err {
  border-color: var(--ink);
}
.lead-form-note {
  font-size: 11px;
  color: var(--mute);
  margin-top: var(--sp3);
}
.lead-success {
  text-align: center;
  padding: var(--sp10) var(--sp6);
  max-width: 420px;
  margin: var(--sp8) auto 0;
}
.lead-success-icon {
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: var(--sp3);
}
.lead-success-title {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--sp2);
}
.lead-success-body {
  font-size: 14px;
  color: var(--body);
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   BOTTLENECK SCORE — SCORE RESULT CARD
───────────────────────────────────────── */
.bottleneck-result {
  text-align: center;
}
.bottleneck-score {
  font-family: var(--ff-display);
  font-size: 3.2rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  margin-bottom: var(--sp2);
}
.bottleneck-label {
  display: inline-block;
  padding: 5px 18px;
  border-radius: var(--r-full);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--charcoal);
  margin-bottom: var(--sp6);
}
.bottleneck-breakdown {
  text-align: left;
  margin-bottom: var(--sp6);
}
.bottleneck-dim {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--charcoal);
}
.bottleneck-dim:last-child { border-bottom: none; }
.bottleneck-dim-bar {
  width: 100px;
  height: 4px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 var(--sp3);
  flex-shrink: 0;
}
.bottleneck-dim-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: width var(--tl);
}
.bottleneck-dim-score {
  font-family: var(--ff-display);
  font-weight: 500;
  color: var(--ink);
  min-width: 28px;
  text-align: right;
}

/* ─────────────────────────────────────────
   TIME CALCULATOR — BREAKDOWN
───────────────────────────────────────── */
.time-breakdown {
  margin-top: var(--sp6);
  padding-top: var(--sp6);
  border-top: 1px solid var(--hairline);
}
.time-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp3) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.time-item:last-child { border-bottom: none; }
.time-item-label { color: var(--body); }
.time-item-value {
  font-family: var(--ff-display);
  font-weight: 500;
  color: var(--ink);
}
.time-total {
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  padding: var(--sp4);
  margin-top: var(--sp4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
}
.time-compare {
  font-size: 13px;
  color: var(--body);
  text-align: center;
  margin-top: var(--sp3);
  line-height: 1.5;
}
.time-compare strong { color: var(--ink); font-weight: 500; }

/* ─────────────────────────────────────────
   VENDOR TAX CALCULATOR
───────────────────────────────────────── */
.vendor-row {
  display: flex;
  gap: var(--sp3);
  align-items: center;
  margin-bottom: var(--sp3);
}
.vendor-row input[type="text"] {
  flex: 1;
}
.vendor-row input[type="number"] {
  width: 100px;
  padding: 9px var(--sp3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-full);
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  outline: none;
  text-align: right;
  transition: border-color var(--t1);
}
.vendor-row input[type="number"]:focus { border-color: var(--ink); }
.vendor-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--mute);
  cursor: pointer;
  transition: all var(--t1);
  flex-shrink: 0;
  background: var(--canvas);
}
.vendor-remove:hover { border-color: var(--ink); color: var(--ink); }
.vendor-add {
  margin-top: var(--sp3);
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 640px) {
  .tool-stat { font-size: 1.4rem; }
  .compare-side { padding: var(--sp4); }
  .chat-body { min-height: 260px; }
  .bottleneck-score { font-size: 2.4rem; }
  .time-total { font-size: 1.3rem; }
}
