/* ═══════════════════════════════════════════════════════════
   AI API Doctor — website stylesheet v2
   Single-card tool page layout
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─── */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --soft: #f1f5f9;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --accent: #0f172a;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', Consolas, 'Liberation Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 18px 50px rgba(15,23,42,0.08), 0 8px 16px rgba(15,23,42,0.04);
}

/* ── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-logo__icon {
  width: 32px; height: 32px;
  background: var(--info);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.site-logo__icon svg { width: 18px; height: 18px; color: #fff; }

.site-nav {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--soft); text-decoration: none; }
.site-nav a.active { color: var(--info); }

.lang-switcher {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; white-space: nowrap; flex-shrink: 0; margin-left: 4px;
}
.lang-switcher__current { font-weight: 700; color: var(--text); cursor: default; }
.lang-switcher__sep { color: var(--border); margin: 0 2px; }
.lang-switcher__link { color: var(--info); font-weight: 500; }
.lang-switcher__link:hover { text-decoration: underline; }

.nav-toggle {
  display: none; background: none; border: none; padding: 8px;
  color: var(--text); border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--soft); }

/* ── Hero (tool page) — compact for first-screen CTA ─── */
.tool-hero {
  max-width: 720px;
  margin: 0 auto 10px;
  text-align: center;
}
.tool-hero h1 {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 2px;
  color: var(--text);
  line-height: 1.2;
}
.tool-hero__tagline {
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: var(--info);
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}
.tool-hero__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 10px;
}

/* ── Single Tool Page ─── */
.single-tool-page {
  min-height: calc(100vh - 60px);
  padding: 16px 16px 40px;
  background: var(--bg);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.hero-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.hero-badge--green { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }
.hero-badge--neutral { color: var(--muted); }

.center-tool-shell {
  max-width: 760px;
  margin: 0 auto;
}

/* ── Doctor Card ─── */
.doctor-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
}
.doctor-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.doctor-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ── Mode Selector ─── */
.mode-selector {
  display: flex;
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}
.mode-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px; border: none; background: none;
  font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-family: var(--font);
  text-align: center;
}
.mode-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.mode-btn:hover:not(.active) { color: var(--text); }

/* ── Mode + Cost row ─── */
.mode-cost-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mode-cost-row .mode-selector { flex: 0 0 auto; }
.cost-hint {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Form ─── */
.form-field { margin-bottom: 10px; }
.form-field--compact { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-label-opt { font-weight: 400; color: var(--muted); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  color: var(--text); background: var(--surface);
  transition: border-color 0.15s;
  min-height: 40px; appearance: none;
}
.form-textarea { resize: vertical; min-height: 60px; max-height: 88px; line-height: 1.6; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: #94a3b8; }
.form-input--key { font-family: var(--mono); letter-spacing: 0.5px; }
.form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Input with button ─── */
.input-with-btn {
  display: flex; gap: 8px; align-items: center;
}
.input-with-btn .form-input { flex: 1; min-width: 0; }

/* ── Interface toggle ─── */
.interface-toggle {
  display: flex; background: var(--soft);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px;
}
.interface-btn {
  flex: 1; padding: 7px 6px; border-radius: 6px;
  border: none; background: none;
  font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-family: var(--font); text-align: center;
}
.interface-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.interface-btn:hover:not(.active) { color: var(--text); }

/* ── Tier toggle ─── */
.tier-toggle { display: flex; background: var(--soft); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.tier-btn { flex: 1; padding: 6px 6px; border-radius: 6px; border: none; background: none; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.15s; font-family: var(--font); text-align: center; }
.tier-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tier-btn:hover:not(.active) { color: var(--text); }

/* ── Collapse sections ─── */
.collapse-section {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.collapse-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.collapse-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; cursor: pointer; border: none; background: none;
  font-size: 12px; font-weight: 500; color: var(--muted); font-family: var(--font); width: 100%; text-align: left;
  border-radius: 4px;
}
.collapse-toggle:hover { color: var(--info); }
.collapse-toggle__icon, .collapse-icon { transition: transform 0.2s; width: 14px; height: 14px; flex-shrink: 0; }
.collapse-toggle.open .collapse-toggle__icon, .collapse-toggle.open .collapse-icon { transform: rotate(90deg); }
.collapse-panel { max-height: 0; overflow: hidden; transition: max-height 0.22s ease; }
.collapse-panel.open { max-height: 500px; }

/* ── Advanced panel (legacy alias) ─── */
.advanced-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; cursor: pointer; border: none; background: none;
  font-size: 13px; color: var(--muted); font-family: var(--font); width: 100%; text-align: left;
}
.advanced-toggle:hover { color: var(--text); }
.advanced-toggle__icon { transition: transform 0.2s; width: 16px; height: 16px; flex-shrink: 0; }
.advanced-panel { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.advanced-panel.open { max-height: 800px; }

.advanced-check-row { background: var(--soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.advanced-check { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.advanced-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; margin-top: 1px; }
.advanced-check > span:first-of-type { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Price row ─── */
.price-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* ── Cost estimate (hidden, replaced by inline cost-hint) ─── */
.cost-estimate-card { display: none !important; }

/* ── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: opacity 0.15s; text-decoration: none; min-height: 40px; font-family: var(--font);
}
.btn:hover { text-decoration: none; opacity: 0.85; }
.btn--primary { background: var(--info); color: #fff; }
.btn--secondary { background: var(--soft); color: var(--text); border: 1px solid var(--border); }
.btn--sm { padding: 6px 12px; font-size: 12px; min-height: 30px; }
.btn--link { background: none; color: var(--info); padding: 4px 0; min-height: auto; font-size: 12px; }
.btn--link:hover { text-decoration: underline; opacity: 1; }
.btn--run { background: var(--info); color: #fff; font-weight: 700; }
.btn--run:hover { background: #1d4ed8; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.run-check-button { width: 100%; height: 48px; font-size: 15px; white-space: nowrap; writing-mode: horizontal-tb; }

.tool-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.tool-actions .btn--run { flex: 2; }
.tool-actions .btn--secondary { flex: 1; }

/* ── Bottom links ─── */
.tool-bottom-links {
  max-width: 760px; margin: 20px auto 0;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  justify-content: center; flex-wrap: wrap;
}
.tool-bottom-links a { color: var(--info); }
.tool-bottom-links a:hover { text-decoration: underline; }
.bottom-note { color: var(--muted); }

/* ── Result / Report ─── */
.result-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
  font-size: 13px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

/* ── Result Card (Short Card container) ─── */
#result-card {
  margin-top: 14px;
}
@media (min-width: 600px) {
  #result-card > div {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Legacy report-card classes — still used in loading/empty states */
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.report-card__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.report-card__title { font-size: 15px; font-weight: 700; color: var(--text); }
.report-card__meta { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.6; }
.report-card__status {
  padding: 16px 18px;
  text-align: center;
}
.report-card__status-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 4px;
}
.report-card__status-text { font-size: 18px; font-weight: 800; color: var(--text); }
.report-card__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border-top: 1px solid var(--border);
}
.report-cell {
  background: var(--surface);
  padding: 10px 12px;
}
.report-cell__label { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
.report-cell__value { font-size: 13px; font-weight: 600; color: var(--text); }
.report-cell__value.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.report-card__footer {
  padding: 10px 12px;
  font-size: 11px; color: #94a3b8; line-height: 1.5;
  background: var(--soft); border-top: 1px solid var(--border);
}

/* ── Scorecard Hero ─── */
.scorecard-hero {
  padding: 20px 18px;
  text-align: center;
}
.scorecard-hero__grade {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 4px;
}
.scorecard-hero__score {
  font-size: 56px; font-weight: 900; line-height: 1; margin-bottom: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.scorecard-hero__score-unit {
  font-size: 18px; font-weight: 600; opacity: 0.7; margin-left: 2px;
}
.scorecard-hero__label {
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px;
}
.scorecard-hero__finding {
  font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 420px; margin: 0 auto;
}

/* ── Risk Chips ─── */
.risk-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.risk-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  background: var(--soft); color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Evidence Grid ─── */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
}
.evidence-cell {
  background: var(--surface);
  padding: 10px 12px;
}
.evidence-cell--full {
  grid-column: 1 / -1;
}
.evidence-cell__label {
  font-size: 10px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px;
}
.evidence-cell__value {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.evidence-cell__value.mono {
  font-family: var(--mono); font-size: 11px; word-break: break-all;
}

/* ── Report Callout ─── */
.report-callout {
  margin: 12px 14px 0;
  padding: 10px 14px; border-radius: 6px;
  font-size: 13px; line-height: 1.6;
  border-left: 3px solid;
}
.report-callout--info {
  background: var(--info-bg); color: #1e40af;
  border-color: var(--info);
}

/* ── Visible Output Status Colors ─── */
.vos-success { color: var(--success); font-weight: 600; }
.vos-danger  { color: var(--danger);  font-weight: 600; }
.vos-warning { color: var(--warning); font-weight: 600; }

/* ── Response Shape Summary ─── */
.response-shape-section {
  margin: 12px 14px 0;
  padding: 10px 14px;
  background: var(--soft);
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.response-shape-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.response-shape-line {
  font-size: 12px;
  color: #475569;
  font-family: var(--mono);
  line-height: 1.7;
  word-break: break-all;
}

/* ── Report Footer Note ─── */
.report-footer-note {
  margin: 12px 14px 0;
  padding: 8px 12px; border-radius: 6px;
  font-size: 11px; color: #94a3b8; line-height: 1.5;
  background: var(--soft);
}

/* ── Report Actions ─── */
.report-actions {
  display: flex; gap: 8px;
  padding: 12px 14px 0;
}
.report-actions .btn { flex: 1; }

/* ── Report ID Line ─── */
.report-id-line {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 8px 14px 12px;
}

/* ── Status dot (loading) ─── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--info);
  animation: dot-pulse 1.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Toast ─── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 10px 20px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md); z-index: 9999;
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Footer ─── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 24px 0; margin-top: 0;
}
.site-footer__inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center; font-size: 13px; color: var(--muted);
}
.site-footer__links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.site-footer__links a { color: var(--muted); font-size: 13px; }
.site-footer__links a:hover { color: var(--text); }

/* ── Section headings ─── */
.section { padding: 48px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section__title { font-size: 22px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.section__desc { font-size: 15px; color: var(--muted); margin-bottom: 24px; line-height: 1.6; }
.section__title--center { text-align: center; }

/* ── Cards ─── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.card__title { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.card__desc { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ── Article (guide pages) ─── */
.article { max-width: 680px; margin: 0 auto; }
.article h2 { font-size: 20px; font-weight: 700; margin: 36px 0 12px; color: var(--text); }
.article p { margin-bottom: 14px; color: #374151; line-height: 1.8; }
.article ul, .article ol { margin: 0 0 14px 20px; color: #374151; line-height: 1.8; }
.article li { margin-bottom: 6px; }
.article code { background: var(--soft); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 13px; }
.article pre { background: #0f172a; color: #e2e8f0; padding: 16px 20px; border-radius: var(--radius); overflow-x: auto; margin-bottom: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.7; white-space: pre; }

/* ── Hero (guide pages) ─── */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 64px 0 56px; text-align: center; }
.hero__badge { display: inline-block; background: var(--info-bg); color: var(--info); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-bottom: 16px; letter-spacing: 0.3px; }
.hero__title { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; line-height: 1.2; }
.hero__sub { font-size: clamp(15px, 2.5vw, 17px); color: var(--muted); max-width: 520px; margin: 0 auto 28px; line-height: 1.6; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Action row ─── */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action-row--center { justify-content: center; }

/* ── Callout ─── */
.callout { background: var(--soft); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; display: flex; gap: 10px; }
.callout__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.callout--info { background: var(--info-bg); color: #1e40af; }
.callout--warn { background: var(--warning-bg); color: #92400e; }
.callout--danger { background: var(--danger-bg); color: #991b1b; }

/* ── Comparison table ─── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th { text-align: left; padding: 10px 14px; background: var(--soft); font-weight: 600; border-bottom: 2px solid var(--border); }
.compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { font-weight: 600; white-space: nowrap; }

/* ── Divider ─── */
.divider { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── Badge / Status ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--neutral { background: var(--soft); color: var(--muted); }

/* ── Mobile overrides ─── */
@media (max-width: 640px) {
  .single-tool-page { padding: 12px 12px 24px; }
  .tool-hero h1 { font-size: 20px; }
  .doctor-card { padding: 14px 14px; border-radius: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .price-row-4 { grid-template-columns: repeat(2, 1fr); }
  .tool-actions { flex-direction: column-reverse; }
  .tool-actions .btn { width: 100%; }
  .report-card__grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 36px 0; }
  .hero { padding: 48px 0 40px; }
  .hero__title { font-size: 26px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; }
  .article { padding: 0 4px; }
  .article h2 { font-size: 18px; }

  .site-nav {
    display: none; position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px; flex-direction: column; z-index: 99;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: flex; }
}

@media (max-width: 400px) {
  .hero-badges { gap: 6px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; }
  .report-card__grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   SECTION ONE: Icon & SVG Safety Constraints
   Prevent icons from ever becoming full-width or huge
   ══════════════════════════════════════════════════════════════ */
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.site-header svg,
.logo-mark svg,
.trust-badge svg,
.trust-badge__icon svg,
.badge svg,
.nav-icon svg,
.inline-icon svg,
.inline-icon--sm svg,
.doctor-trust-badge svg,
.hero-badge svg,
.doctor-trust-badge svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.feature-icon,
.card-icon,
.faq-icon,
.principle-icon,
.dim-card__icon,
.dim-icon,
.ext-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.feature-icon svg,
.card-icon svg,
.faq-icon svg,
.principle-icon svg,
.dim-card__icon svg,
.dim-icon svg,
.ext-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: block;
}

.floating-plugin svg,
.corner-plugin svg {
  width: 16px;
  height: 16px;
}

/* EN page dim-card icon override */
.dim-card__icon svg { width: 24px; height: 24px; }
.dim-icon svg { width: 24px; height: 24px; }

/* Extension page icon override */
.ext-icon svg { width: 24px; height: 24px; }

/* ══════════════════════════════════════════════════════════════
   SECTION TWO: EN Page — Missing Layout Classes
   These were referenced in en/index.html but undefined
   ══════════════════════════════════════════════════════════════ */

/* Hero section */
.hero-subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 600;
  color: var(--info);
  letter-spacing: -0.2px;
  margin-bottom: 12px;
}
.hero__subtitle { font-size: clamp(14px, 2.5vw, 18px); font-weight: 600; color: var(--info); margin-bottom: 12px; }
.hero__desc { font-size: clamp(13px, 2vw, 16px); color: var(--muted); max-width: 560px; margin: 0 auto 20px; line-height: 1.6; }
.btn--hero { padding: 11px 24px; font-size: 15px; min-height: 44px; }

/* Doctor section */
.doctor-section { padding: 0; }
.doctor-layout { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; }
.doctor-hero { text-align: center; margin-bottom: 20px; }
.doctor-hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--info-bg); color: var(--info);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 10px;
}
.doctor-hero__badge svg { width: 12px; height: 12px; }
.doctor-hero h1 {
  font-size: clamp(20px, 3.5vw, 28px); font-weight: 800;
  letter-spacing: -0.4px; margin-bottom: 6px; color: var(--text); line-height: 1.2;
}
.doctor-hero__sub { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 480px; margin: 0 auto 14px; }

/* Trust badges row */
.doctor-trust-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.doctor-trust-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--soft); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px;
  font-size: 11px; font-weight: 500; color: var(--muted);
}
.doctor-trust-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.doctor-trust-badge--green { color: var(--success); border-color: #bbf7d0; background: #f0fdf4; }
.doctor-trust-badge--neutral { color: var(--muted); }

/* Tool area: form left + report right */
.doctor-tool-area { display: flex; flex-direction: column; gap: 16px; }
.doctor-form-panel { width: 100%; }
.doctor-report-panel { width: 100%; }

/* Tool card (EN page style) */
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  margin-bottom: 10px; overflow: hidden;
}
.tool-card__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.tool-card__title { font-size: 15px; font-weight: 700; color: var(--text); }
.tool-card__body { padding: 16px; }

/* Tab switcher */
.tab-switcher {
  display: flex; background: var(--soft); border-radius: var(--radius-sm);
  padding: 3px; gap: 2px; margin-bottom: 12px;
}
.tab-btn {
  flex: 1; padding: 7px 8px; border-radius: 6px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-family: var(--font); text-align: center;
}
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tab-btn:hover:not(.active) { color: var(--text); }

/* Info strip */
.info-strip {
  display: flex; align-items: center; gap: 8px;
  background: var(--info-bg); color: #1e40af;
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; margin-bottom: 10px;
}
.info-strip svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Mode row */
.mode-row { display: flex; gap: 8px; }
.mode-row .mode-btn {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 6px; border: none; background: var(--soft);
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-family: var(--font); text-align: left;
}
.mode-row .mode-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.mode-row .mode-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.mode-row .mode-btn .mode-hint { font-size: 11px; font-weight: 400; color: var(--muted); display: block; }
.mode-row .mode-btn.active .mode-hint { color: var(--muted); }

/* Connection input */
.conn-input-wrap { margin-bottom: 6px; }
.conn-textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); color: var(--text); background: var(--surface); min-height: 60px; max-height: 88px; resize: vertical; line-height: 1.6; }
.conn-textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.conn-textarea::placeholder { color: #94a3b8; }
.conn-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.conn-hint code { background: var(--soft); padding: 1px 4px; border-radius: 3px; font-family: var(--mono); font-size: 12px; }

/* Input row */
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .form-input { flex: 1; }

/* Collapse toggle */

/* Advanced panel */
#advanced-panel { padding-top: 4px; }
.adv-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.adv-section { margin-bottom: 12px; }
.adv-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.adv-check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 6px; }
.adv-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.adv-check > span { font-size: 13px; font-weight: 600; color: var(--text); }
.adv-hint { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* Run row */
.run-row { display: flex; gap: 8px; margin-bottom: 10px; }
.run-row .btn--run { flex: 2; }
.run-row .btn--secondary { flex: 1; }

/* Progress */
.progress-bar-wrap { background: var(--soft); border-radius: var(--radius-sm); height: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; background: var(--info); transition: width 0.3s; }
.progress-text { font-size: 12px; color: var(--muted); text-align: center; }

/* Why / Dims section */
.why-section { padding: 48px 0; background: var(--bg); }
.why-section .container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.section-title { font-size: clamp(18px, 3vw, 24px); font-weight: 800; margin-bottom: 12px; color: var(--text); text-align: center; }
.section-subtitle { font-size: 15px; font-weight: 700; margin: 28px 0 12px; color: var(--text); }
.why-desc { font-size: 15px; color: var(--muted); line-height: 1.7; max-width: 600px; margin: 0 auto; }
.why-disclaimer { font-size: 13px; color: var(--muted); line-height: 1.6; margin-top: 16px; background: var(--soft); border-radius: var(--radius-sm); padding: 14px 16px; }

/* Dims grid */
.dims-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.dim-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.dim-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: var(--info-bg); border-radius: 8px; color: var(--info); flex-shrink: 0; }
.dim-icon svg { width: 24px; height: 24px; display: block; }
.dim-title { font-size: 14px; font-weight: 700; color: var(--text); }
.dim-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Share section */
.share-section { padding: 48px 0; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-section .container { max-width: 760px; margin: 0 auto; padding: 0 20px; text-align: center; }
.share-desc { font-size: 15px; color: var(--muted); line-height: 1.6; max-width: 480px; margin: 0 auto 20px; }
.share-example { background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; text-align: left; margin-bottom: 16px; }
.share-example__label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.share-example__text { font-size: 13px; color: var(--text); font-family: var(--mono); word-break: break-all; }

/* Extension section */
.ext-section { padding: 48px 0; background: var(--bg); }
.ext-section .container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.ext-inner { display: flex; gap: 20px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.ext-icon { width: 48px; height: 48px; background: var(--info-bg); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--info); }
.ext-icon svg { width: 32px; height: 32px; display: block; }
.ext-info { flex: 1; }
.ext-badge { display: inline-block; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.ext-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ext-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }

/* CTA section */
.cta-section { padding: 48px 0; background: var(--surface); border-top: 1px solid var(--border); }
.cta-section .container { max-width: 760px; margin: 0 auto; padding: 0 20px; text-align: center; }
.cta-title { font-size: clamp(18px, 3vw, 24px); font-weight: 800; margin-bottom: 12px; color: var(--text); }
.cta-desc { font-size: 15px; color: var(--muted); line-height: 1.6; max-width: 480px; margin: 0 auto 24px; }

/* Tool section */
.tool-section { padding: 32px 0; }

/* EN page run button: always horizontal */
.run-check-button,
#run-check,
#doctor-run-btn,
#run-btn,
button[data-action="run"],
button.primary,
.btn-primary,
.btn--run {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  writing-mode: horizontal-tb !important;
  flex-direction: row !important;
  text-orientation: mixed;
}

/* ══════════════════════════════════════════════════════════════
   SECTION THREE: Cleanup — Remove Old UI Legacy
   ══════════════════════════════════════════════════════════════ */

/* Hide legacy UI elements that should not appear in the new layout */
.legacy-cta,
.legacy-hero-icon,
.legacy-feature-icon { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   SECTION FOUR: Report / Result Cards — SVG within report
   ══════════════════════════════════════════════════════════════ */
.report-card svg { width: 20px; height: 20px; }
.result-card-new svg { width: 20px; height: 20px; }
.result-report svg { width: 20px; height: 20px; }

/* ══════════════════════════════════════════════════════════════
   SECTION FIVE: ZH index.html specific
   Five-dimensions grid
   ══════════════════════════════════════════════════════════════ */
.dimensions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.dim-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.dim-card__icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }
.dim-card__icon svg { width: 24px; height: 24px; display: block; }
.dim-card__icon--blue { background: #dbeafe; color: #2563eb; }
.dim-card__icon--green { background: #dcfce7; color: #16a34a; }
.dim-card__icon--purple { background: #f3e8ff; color: #9333ea; }
.dim-card__icon--orange { background: #fef3c7; color: #d97706; }
.dim-card__icon--red { background: #fee2e2; color: #dc2626; }
.dim-card__title { font-size: 14px; font-weight: 700; color: var(--text); }
.dim-card__desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   Final Section: Simplified Home Page
   ══════════════════════════════════════════════════════════════ */

/* Hero: compact for first screen */
.doctor-hero {
  text-align: center;
  margin-bottom: 18px;
}
.doctor-hero__h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.1;
}
.doctor-hero__tagline {
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 700;
  color: var(--info);
  letter-spacing: -0.2px;
  margin: 0 0 8px;
}
.doctor-hero__desc {
  font-size: clamp(13px, 2vw, 16px);
  color: var(--muted);
  line-height: 1.7;
  margin: 0 auto;
  max-width: 480px;
}

/* Doctor section: single column, compact */
.doctor-section {
  padding: 0;
}
.doctor-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* Form panel: no extra panels */
.doctor-tool-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doctor-form-panel { width: 100%; }
.doctor-report-panel { width: 100%; }

/* Tool card: compact */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tool-card__body {
  padding: 18px 20px;
}

/* Paste config link */
.paste-config-row {
  margin-bottom: 10px;
}
.paste-config-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.15s;
}
.paste-config-link:hover { color: var(--info); text-decoration: underline; }
.paste-config-link svg { transition: transform 0.2s; }
.paste-config-link.open svg { transform: rotate(45deg); }

/* Form groups */
.tool-form__group { margin-bottom: 12px; }
.tool-form__group:last-of-type { margin-bottom: 16px; }
.tool-form__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.tool-form__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  min-height: 44px;
  transition: border-color 0.15s;
}
.tool-form__input:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.tool-form__input::placeholder { color: #94a3b8; }
.tool-form__input--key { font-family: var(--mono); letter-spacing: 0.5px; }
.tool-form__textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  min-height: 60px;
  max-height: 88px;
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.tool-form__textarea:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.tool-form__textarea::placeholder { color: #94a3b8; }
.tool-form__hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* Primary run button: full width, horizontal */
.btn--primary-run {
  background: var(--info);
  color: #fff;
  font-weight: 700;
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  writing-mode: horizontal-tb;
  flex-direction: row;
  transition: background 0.15s;
}
.btn--primary-run:hover { background: #1d4ed8; opacity: 1; text-decoration: none; }
.btn--primary-run svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Cost hint below button */
.run-cost-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* Result empty state */
.result-empty {
  text-align: center;
  padding: 36px 20px;
  color: #94a3b8;
  font-size: 14px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Plugin corner entry */
.plugin-corner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 12px;
  color: var(--muted);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  box-shadow: var(--shadow);
}
.plugin-corner a { color: var(--info); font-weight: 500; }

/* Mobile overrides */
@media (max-width: 640px) {
  .doctor-layout { padding: 16px 12px 72px; }
  .tool-card__body { padding: 14px 14px; }
  .doctor-hero__h1 { font-size: 26px; }
  .plugin-corner { bottom: 12px; right: 12px; }
  .tool-form__group { margin-bottom: 10px; }
}

/* ══════════════════════════════════════════════════════════════
   SINGLE-TOOL-PAGE LAYOUT (matches index.html class names)
   ══════════════════════════════════════════════════════════════ */
.single-tool-page {
  min-height: calc(100vh - 60px);
  padding: 34px 16px 48px;
}

.tool-hero {
  max-width: 760px;
  margin: 0 auto 22px;
  text-align: center;
}

.tool-hero h1 {
  margin: 0 0 4px;
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.tool-hero h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.15;
  font-weight: 900;
  color: var(--info);
}

.tool-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.center-tool-shell {
  max-width: 720px;
  margin: 0 auto;
}

.doctor-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.form-group input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-group input::placeholder {
  color: #94a3b8;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Model ID row with inline auto-detect button */
.form-group--with-btn .form-group__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-group--with-btn label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

/* Ghost button for auxiliary actions */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
}
.btn-ghost {
  border: none;
  background: none;
  color: var(--info);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--soft); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* Doctor card layout */
.doctor-card > .form-group + .form-group--with-btn,
.doctor-card > .form-group--with-btn {
  margin-top: 0;
}

.config-paste {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.config-paste summary {
  cursor: pointer;
  color: var(--info);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  padding: 4px 0;
}

.config-paste summary::-webkit-details-marker {
  display: none;
}

.config-paste textarea {
  width: 100%;
  margin-top: 10px;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s;
}

.config-paste textarea:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.config-paste textarea::placeholder {
  color: #94a3b8;
}

.btn-secondary {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  border-radius: var(--radius);
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--border);
}

.run-check-button,
.btn-primary {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius);
  background: var(--info);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
  text-decoration: none;
  transition: background 0.15s;
}

.run-check-button:hover {
  background: #1d4ed8;
}

.cost-hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
}

.doctor-result {
  margin-top: 4px;
}

.result-empty-state {
  min-height: 56px;
  border-radius: var(--radius-lg);
  background: var(--soft);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  font-size: 14px;
}

.floating-plugin {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  text-decoration: none;
}

.floating-plugin:hover {
  text-decoration: none;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
}

.site-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--info);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .single-tool-page { padding: 24px 12px 40px; }
  .doctor-card { padding: 18px; border-radius: 18px; }
  .floating-plugin { display: none; }
  .tool-hero h1 { font-size: 28px; }
  .tool-hero h2 { font-size: 22px; }
}

/* ══════════════════════════════════════════════════════════════
   Missing: Progress UI (used by Doctor._refreshProgress)
   ══════════════════════════════════════════════════════════════ */
.progress-wrap { font-size: 13px; }
.progress-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.prog-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prog-row--done .prog-bar-wrap { opacity: 1; }
.prog-row--warn .prog-bar-wrap { opacity: 1; }
.prog-row--fail .prog-bar-wrap { opacity: 1; }
.prog-icon { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.prog-bar-wrap { flex: 1; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.prog-bar { display: block; height: 100%; transition: width 0.3s; border-radius: 3px; }
.prog-label { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.prog-detail { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 120px; text-align: right; }
.prog-row--running .prog-bar { animation: prog-pulse 1s ease-in-out infinite; }
@keyframes prog-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ══════════════════════════════════════════════════════════════
   Missing: Manual Report Card (report.js)
   ══════════════════════════════════════════════════════════════ */
.billing-report-card { font-size: 14px; }

/* Report header */
.report-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.report-header__brand { font-size: 13px; font-weight: 800; color: var(--text); }
.report-header__sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.report-header__meta { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.6; }

/* Verdict hero */
.verdict-hero { padding: 16px 14px; border-radius: var(--radius); margin-bottom: 12px; text-align: center; }
.verdict-hero.verdict--ok { background: var(--success-bg); }
.verdict-hero.verdict--warning { background: var(--warning-bg); }
.verdict-hero.verdict--danger { background: var(--danger-bg); }
.verdict-hero__status { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 4px; }
.verdict-hero.verdict--ok .verdict-hero__status { color: var(--success); }
.verdict-hero.verdict--warning .verdict-hero__status { color: var(--warning); }
.verdict-hero.verdict--danger .verdict-hero__status { color: var(--danger); }
.verdict-hero__title { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.verdict-hero__detail { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Delta section */
.delta-section { text-align: center; padding: 12px 14px; background: var(--soft); border-radius: var(--radius-sm); margin-bottom: 12px; }
.delta-section__label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.delta-section__value { font-size: 22px; font-weight: 900; font-family: var(--mono); }
.delta-section__unit { font-size: 13px; font-weight: 400; opacity: 0.7; margin-left: 2px; }
.delta-section__usd { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Score section (evidence completeness) */
.score-section { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.score-section__label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.score-section .progress-bar-wrap { flex: 1; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.score-section .progress-bar { height: 100%; border-radius: 4px; transition: width 0.3s; }
.score-section .progress-bar__fill--green { background: var(--success); }
.score-section .progress-bar__fill--orange { background: var(--warning); }
.score-section .progress-bar__fill--gray { background: var(--muted); }
.score-section__pct { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Evidence chain */
.evidence-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--soft); border-radius: var(--radius-sm); margin-bottom: 12px; }
.evidence-node { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; min-width: 60px; text-align: center; background: var(--surface); }
.evidence-node__label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.evidence-node__value { font-size: 13px; font-weight: 700; color: var(--text); font-family: var(--mono); margin-top: 2px; }
.evidence-arrow { font-size: 14px; color: var(--muted); flex-shrink: 0; }

/* Tech grid */
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tech-item { display: flex; flex-direction: column; gap: 2px; }
.tech-item__label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.tech-item__value { font-size: 13px; font-weight: 600; color: var(--text); }

/* Safety note */
.safety-note { font-size: 12px; color: var(--muted); line-height: 1.6; padding: 10px 14px; background: var(--soft); border-radius: var(--radius-sm); margin-bottom: 12px; border-left: 3px solid var(--border); }

/* Report footer */
.report-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════════
   Missing: container--narrow (support/index.html)
   ══════════════════════════════════════════════════════════════ */
.container--narrow { max-width: 680px; margin: 0 auto; }

/* ══════════════════════════════════════════════════════════════
   Missing: form-label--optional (report/index.html)
   ══════════════════════════════════════════════════════════════ */
.form-label--optional { font-weight: 400; color: var(--muted); }
