.ibd-wrap { max-width: 1040px; margin: 0 auto; padding: 16px 16px 56px; }

.ibd-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 38%, #4338ca 100%);
  color: #fff;
  border-radius: 22px;
  padding: 32px 28px 36px;
  margin-bottom: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.38);
}
.ibd-hero h1 { margin: 0 0 12px; font-size: clamp(1.4rem, 3.2vw, 2.05rem); letter-spacing: -0.02em; }
.ibd-hero p { margin: 0; opacity: 0.93; max-width: 760px; line-height: 1.6; font-size: 15px; }

.free-badge-ibd {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.tool-card-ibd {
  background: var(--card-bg, #fff);
  border-radius: 18px;
  padding: 26px;
  margin-bottom: 20px;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}
.tool-card-ibd h2 { margin: 0 0 16px; font-size: 1.15rem; }

.inp-ibd {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 15px;
  background: var(--card-bg, #fff);
  color: var(--text-primary, inherit);
}
.inp-ibd:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-actions-ibd { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-analyze-ibd { min-width: 160px; }
.hint-lbl-ibd { font-size: 13px; color: var(--text-secondary, #64748b); }
.note-ibd { font-size: 13px; color: var(--text-secondary, #64748b); margin-top: 10px; line-height: 1.55; }

#panelInput.is-hidden, #panelRun.is-hidden, #btnStartBrowser.is-hidden { display: none !important; }

.run-steps-ibd { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.run-step-ibd { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary, #64748b); }
.run-step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #cbd5e1; flex-shrink: 0;
}
.run-step-ibd.active .run-step-dot { background: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); }
.run-step-ibd.done .run-step-dot { background: #22c55e; }
.run-step-ibd.active, .run-step-ibd.done { color: var(--text-primary, #0f172a); font-weight: 600; }

.run-bar-ibd {
  margin-top: 18px; height: 8px; border-radius: 999px;
  background: #e2e8f0; overflow: hidden;
}
.run-bar-fill-ibd {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.35s ease;
}

#probeVideoWrap {
  position: fixed; left: -9999px; top: 0;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

.results-wrap-ibd { margin-bottom: 20px; }

.ibd-result {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.ibd-result-head {
  padding: 22px 22px 18px;
  background: linear-gradient(135deg, #312e81 0%, #4338ca 55%, #6366f1 100%);
  color: #fff;
}
.ibd-result-head h2 { margin: 8px 0 4px; font-size: 1.2rem; color: #fff; }
.ibd-result-head p { margin: 0; opacity: 0.9; font-size: 14px; }

.ibd-status-badge {
  display: inline-flex; padding: 6px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.ibd-st-green { background: rgba(34,197,94,.25); color: #bbf7d0; border: 1px solid rgba(34,197,94,.45); }
.ibd-st-yellow { background: rgba(234,179,8,.25); color: #fef08a; border: 1px solid rgba(234,179,8,.45); }
.ibd-st-orange { background: rgba(249,115,22,.25); color: #fed7aa; border: 1px solid rgba(249,115,22,.45); }
.ibd-st-red { background: rgba(239,68,68,.25); color: #fecaca; border: 1px solid rgba(239,68,68,.45); }

.ibd-score-pill {
  display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255,255,255,.15); font-size: 12px; font-weight: 700;
}

.ibd-result-body { padding: 22px; }

.metrics-ibd {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric-ibd {
  background: linear-gradient(145deg, #f8fafc, #eef2ff);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}
.metric-ibd .mv { font-size: 1.05rem; font-weight: 800; color: #312e81; line-height: 1.2; }
.metric-ibd .ml { font-size: 11px; color: #64748b; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.04em; }

.risk-low { color: #16a34a; }
.risk-medium { color: #d97706; }
.risk-high { color: #dc2626; }

.advice-ibd {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 8px;
}
.advice-ibd h3 { margin: 0 0 10px; font-size: 14px; color: #334155; }
.advice-ibd ul { margin: 0; padding-left: 18px; color: #475569; font-size: 14px; line-height: 1.6; }

.details-ibd {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 14px;
}
.details-ibd summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  font-size: 14px;
  color: #475569;
}
.details-ibd pre {
  margin: 0 0 14px;
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  overflow-x: auto;
  max-height: 320px;
}

.results-footer-ibd {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}

.err-ibd {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
}
.err-ibd.visible { display: block; }

.related-tools { margin-top: 36px; }

@media (prefers-color-scheme: dark) {
  .metric-ibd { background: linear-gradient(145deg, #0f172a, #1e293b); border-color: #334155; }
  .metric-ibd .mv { color: #c7d2fe; }
  .advice-ibd { background: #0f172a; border-color: #334155; }
  .advice-ibd h3 { color: #e2e8f0; }
  .advice-ibd ul { color: #94a3b8; }
}

[data-theme="dark"] .tool-card-ibd,
[data-theme="dark"] .ibd-result { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .metric-ibd { background: linear-gradient(145deg, #0f172a, #1e293b); border-color: #334155; }
[data-theme="dark"] .metric-ibd .mv { color: #c7d2fe; }
[data-theme="dark"] .advice-ibd { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .inp-ibd { background: #0f172a; border-color: #334155; color: #e2e8f0; }

@media (max-width: 640px) {
  .results-footer-ibd .btn { flex: 1 1 100%; }
}
