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

.codec-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);
  animation: caFadeIn 0.45s ease;
}
.codec-hero h1 { margin: 0 0 12px; font-size: clamp(1.4rem, 3.2vw, 2.05rem); letter-spacing: -0.02em; }
.codec-hero p { margin: 0; opacity: 0.93; max-width: 760px; line-height: 1.6; font-size: 15px; }

.free-badge-ca {
  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-ca {
  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);
  animation: caFadeIn 0.4s ease;
}
.tool-card-ca h2 { margin: 0 0 16px; font-size: 1.15rem; letter-spacing: -0.01em; }

.inp-ca {
  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);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.inp-ca:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.note-ca {
  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; }

#panelRun .run-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.run-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary, #64748b);
}
.run-step.active { color: #4338ca; font-weight: 600; }
.run-step.done { color: #16a34a; }
.run-step-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #cbd5e1; flex-shrink: 0;
}
.run-step.active .run-step-dot { background: #6366f1; animation: codecDotPulse 1s ease infinite; }
.run-step.done .run-step-dot { background: #22c55e; }

.run-bar {
  height: 9px; border-radius: 999px;
  background: #e2e8f0; overflow: hidden; margin-top: 14px;
}
.run-bar-fill {
  height: 100%; width: 30%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  animation: codecPulse 1.2s ease-in-out infinite alternate;
}

#probeVideoWrap {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none; left: -9999px;
}
#btnStartBrowser { margin-top: 14px; }

.results-wrap-ca { animation: caFadeIn 0.5s ease; }
.results-footer-ca { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Premium result card ── */
.ca-result {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.14);
  background: var(--card-bg, #fff);
}

.ca-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 26px 28px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  color: #fff;
  align-items: center;
}
@media (max-width: 640px) {
  .ca-summary { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

.ca-score-ring {
  position: relative;
  width: 96px; height: 96px;
  flex-shrink: 0;
}
.ca-score-ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ca-score-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 8; }
.ca-score-ring .ring-fg {
  fill: none; stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.ca-score-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ca-score-pct { font-size: 1.35rem; font-weight: 800; line-height: 1; }
.ca-score-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: 0.85; margin-top: 4px; letter-spacing: 0.05em; }

.ca-summary-main { min-width: 0; }
.ca-status-badge {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.ca-status-badge.st-green { background: rgba(34,197,94,0.25); color: #bbf7d0; border: 1px solid rgba(34,197,94,0.45); }
.ca-status-badge.st-orange { background: rgba(249,115,22,0.28); color: #fed7aa; border: 1px solid rgba(249,115,22,0.45); }
.ca-status-badge.st-yellow { background: rgba(234,179,8,0.28); color: #fef08a; border: 1px solid rgba(234,179,8,0.45); }
.ca-status-badge.st-red { background: rgba(239,68,68,0.28); color: #fecaca; border: 1px solid rgba(239,68,68,0.45); }

.ca-summary-host {
  margin: 0 0 6px;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}
.ca-summary-meta {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: 0.88;
  line-height: 1.5;
}
.ca-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ca-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e0e7ff;
}

.ca-body { padding: 28px; }

.ca-usage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f3ff, #eef2ff);
  border: 1px solid #ddd6fe;
  font-size: 14px;
  color: #3730a3;
  font-weight: 600;
}
.ca-usage-icon { font-size: 1.25rem; line-height: 1; }

.metrics-ca {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
}
.metric-ca {
  background: linear-gradient(160deg, #fafafa, #f1f5f9);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.metric-ca:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}
.metric-ca .mv {
  font-size: 1.08rem;
  font-weight: 800;
  color: #1e1b4b;
  line-height: 1.35;
  word-break: break-word;
}
.metric-ca .ml {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-top: 8px;
  letter-spacing: 0.05em;
}

.advice-ca {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f5f3ff, #faf5ff);
  border: 1px solid #ddd6fe;
  color: #3730a3;
  font-size: 14px;
  line-height: 1.6;
}
.advice-ca h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.advice-ca ul { margin: 0; padding-left: 20px; }
.advice-ca li { margin-bottom: 6px; }
.advice-ca li:last-child { margin-bottom: 0; }

.reports-ca {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.btn-ca {
  padding: 11px 18px;
  border-radius: 11px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: inherit;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-ca:hover {
  border-color: #6366f1;
  color: #4338ca;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.debug-ca {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed #94a3b8;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.debug-ca pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  max-height: 280px;
  overflow: auto;
}

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

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

@keyframes codecPulse { from { width: 22%; } to { width: 88%; } }
@keyframes codecDotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes caFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-color-scheme: dark) {
  .metric-ca {
    background: linear-gradient(160deg, #0f172a, #1e293b);
    border-color: #334155;
  }
  .metric-ca .mv { color: #c7d2fe; }
  .metric-ca .ml { color: #94a3b8; }
  .metric-ca:hover { box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2); }
  .advice-ca { background: linear-gradient(135deg, #312e81, #1e1b4b); border-color: #4338ca; color: #e0e7ff; }
  .ca-usage { background: linear-gradient(135deg, #312e81, #1e293b); border-color: #4338ca; color: #e0e7ff; }
  .btn-ca { background: #1e293b; border-color: #334155; }
  .run-bar { background: #334155; }
  .ca-result { border-color: #334155; }
}
