/* Ad Checker styles — single source of truth.
   Loaded by index.html, ad-checker.html and fix-plan.html.
   index.html cannot load verdyx.css (it is self-contained), so these live in
   their own sheet rather than being duplicated inline. */
/* ============================================================
   AD CHECKER
   Additive only. Everything is namespaced .ac-* so it cannot
   collide with existing report/dashboard styles. Reuses the
   shared tokens, 12px card radius and 999px pill buttons.
   ============================================================ */

.ac-grid {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.ac-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 25, 39, 0.9), rgba(9, 14, 23, 0.84));
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
  padding: 20px;
}
.ac-panel + .ac-panel { margin-top: 18px; }
.ac-panel h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ac-panel .ac-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ---- form ---- */
.ac-field { margin-bottom: 14px; }
.ac-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}
.ac-field input[type="text"],
.ac-field input[type="url"],
.ac-field textarea,
.ac-field select {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ac-field textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.ac-field input:focus,
.ac-field textarea:focus,
.ac-field select:focus {
  outline: none;
  border-color: rgba(61, 129, 227, 0.62);
  background: rgba(61, 129, 227, 0.07);
}
.ac-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ac-drop {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px 18px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.022);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ac-drop:hover, .ac-drop[data-drag="true"] {
  border-color: rgba(61, 129, 227, 0.6);
  background: rgba(61, 129, 227, 0.06);
}
.ac-drop svg { width: 26px; height: 26px; color: var(--subtle); }
.ac-drop strong { font-size: 0.9rem; font-weight: 650; }
.ac-drop span { font-size: 0.78rem; color: var(--subtle); }
.ac-preview { position: relative; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); }
.ac-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: rgba(0,0,0,.4); }
.ac-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(9, 14, 23, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.ac-context {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(53, 208, 127, 0.26);
  background: rgba(53, 208, 127, 0.08);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}
.ac-context strong { color: var(--text); font-weight: 650; }
.ac-context svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--green); margin-top: 1px; }

.ac-error {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 97, 88, 0.36);
  background: rgba(255, 97, 88, 0.09);
  color: #ffd6d3;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---- score header ---- */
.ac-score-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.ac-score-dial {
  position: relative;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
.ac-score-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ac-score-dial .track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 9; }
.ac-score-dial .value {
  fill: none;
  stroke: url(#acScoreGradient);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.ac-score-num {
  position: relative;
  font-size: 2.05rem;
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.ac-score-num small { display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.09em; color: var(--subtle); text-transform: uppercase; }
.ac-score-meta { flex: 1 1 240px; min-width: 0; }
.ac-score-meta h2 { margin: 0 0 6px; font-size: 1.32rem; font-weight: 700; letter-spacing: -0.02em; }
.ac-score-meta p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }
.ac-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ac-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.ac-badge[data-tone="scale"] { border-color: rgba(53, 208, 127, 0.4); background: rgba(53, 208, 127, 0.12); color: #8ce9bb; }
.ac-badge[data-tone="fix"] { border-color: rgba(255, 177, 74, 0.4); background: rgba(255, 177, 74, 0.12); color: #ffd39a; }
.ac-badge[data-tone="rebuild"] { border-color: rgba(255, 97, 88, 0.4); background: rgba(255, 97, 88, 0.12); color: #ffb3ae; }

/* ---- dimensions ---- */
.ac-dims { display: flex; flex-direction: column; gap: 2px; }
.ac-dim {
  display: grid;
  grid-template-columns: minmax(0, 186px) minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  cursor: pointer;
}
.ac-dim:last-child { border-bottom: 0; }
.ac-dim-name { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; }
.ac-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--subtle); }
.ac-dot[data-sev="critical"] { background: var(--red); }
.ac-dot[data-sev="high"] { background: var(--orange); }
.ac-dot[data-sev="medium"] { background: var(--blue-2); }
.ac-dot[data-sev="low"] { background: var(--green); }
.ac-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.075); overflow: hidden; }
.ac-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3d81e3, #00d2ff);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.ac-fill[data-band="warn"] { background: linear-gradient(90deg, #d9922b, #ffb14a); }
.ac-fill[data-band="bad"] { background: linear-gradient(90deg, #d2453c, #ff6158); }
.ac-dim-score { text-align: right; font-size: 0.88rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ac-dim-detail {
  grid-column: 1 / -1;
  display: none;
  gap: 10px;
  padding: 2px 0 12px;
}
.ac-dim[aria-expanded="true"] .ac-dim-detail { display: grid; }
.ac-dim-detail dl { margin: 0; display: grid; gap: 9px; }
.ac-dim-detail dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 2px;
}
.ac-dim-detail dd { margin: 0; font-size: 0.87rem; line-height: 1.6; color: var(--muted); }

/* ---- findings / recommendations ---- */
.ac-list { display: flex; flex-direction: column; gap: 10px; }
.ac-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.ac-item-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ac-item h4 { margin: 0 0 5px; font-size: 0.93rem; font-weight: 650; line-height: 1.4; }
.ac-item p { margin: 0; font-size: 0.87rem; line-height: 1.6; color: var(--muted); }
.ac-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ac-tag {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--subtle);
}
.ac-tag[data-sev="critical"] { border-color: rgba(255, 97, 88, 0.38); color: #ffb3ae; }
.ac-tag[data-sev="high"] { border-color: rgba(255, 177, 74, 0.38); color: #ffd39a; }

.ac-strengths { display: flex; flex-direction: column; gap: 8px; }
.ac-strength {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
}
.ac-strength svg { width: 16px; height: 16px; color: var(--green); margin-top: 3px; }

.ac-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---- loading + empty ---- */
.ac-skeleton { display: flex; flex-direction: column; gap: 12px; }
.ac-sk {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255,255,255,.045) 25%, rgba(255,255,255,.085) 37%, rgba(255,255,255,.045) 63%);
  background-size: 400% 100%;
  animation: acShimmer 1.5s ease-in-out infinite;
}
.ac-sk.tall { height: 92px; }
.ac-sk.w60 { width: 60%; }
.ac-sk.w40 { width: 40%; }
@keyframes acShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
  .ac-sk { animation: none; }
  .ac-fill, .ac-score-dial .value { transition: none; }
}

.ac-progress { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.ac-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
  color: var(--subtle);
  transition: color 0.25s ease;
}
.ac-step[data-state="active"] { color: var(--text); }
.ac-step[data-state="done"] { color: var(--muted); }
.ac-step svg { width: 16px; height: 16px; }
.ac-step[data-state="done"] svg { color: var(--green); }
.ac-step[data-state="idle"] svg { opacity: 0.4; }

.ac-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 46px 22px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: var(--subtle);
}
.ac-empty svg { width: 30px; height: 30px; opacity: 0.55; }
.ac-empty strong { color: var(--text); font-size: 0.98rem; font-weight: 650; }
.ac-empty p { margin: 0; font-size: 0.87rem; line-height: 1.6; max-width: 380px; }

/* ---- post-audit callout (report page) ---- */
.ac-callout {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 88% 0%, rgba(61, 129, 227, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(18, 25, 39, 0.92), rgba(9, 14, 23, 0.88));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.ac-callout-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 330px); gap: 26px; padding: 24px; align-items: center; }
.ac-callout h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.ac-callout p { margin: 0 0 16px; color: var(--muted); font-size: 0.93rem; line-height: 1.65; max-width: 52ch; }

/* Miniature preview used in the callout and on the homepage. */
.ac-mini {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-mini-head { display: flex; align-items: center; gap: 11px; }
.ac-mini-score { font-size: 1.6rem; font-weight: 720; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ac-mini-score small { font-size: 0.72rem; color: var(--subtle); font-weight: 600; }
.ac-mini-rows { display: flex; flex-direction: column; gap: 7px; }
.ac-mini-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 26px; gap: 9px; align-items: center; font-size: 0.72rem; color: var(--subtle); }
.ac-mini-row b { text-align: right; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.ac-mini-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ac-mini-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3d81e3, #00d2ff); }
.ac-mini-fill[data-band="warn"] { background: linear-gradient(90deg, #d9922b, #ffb14a); }
.ac-mini-note { font-size: 0.74rem; line-height: 1.5; color: var(--subtle); border-top: 1px solid rgba(255,255,255,.07); padding-top: 9px; }

@media (max-width: 980px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr); }
  .ac-callout-inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ac-panel { padding: 16px; }
  .ac-field-row { grid-template-columns: 1fr; }
  .ac-dim { grid-template-columns: minmax(0, 1fr) 40px; }
  .ac-dim .ac-track { grid-column: 1 / -1; order: 3; }
  .ac-score-head { gap: 16px; }
  .ac-score-dial { width: 96px; height: 96px; }
  .ac-score-num { font-size: 1.7rem; }
}

/* Larger variant for the homepage, where the preview sits in a wide column.
   A modifier rather than a divergent copy of .ac-mini, so the two surfaces
   cannot drift apart. */
.ac-mini--lg { padding: 20px; gap: 14px; border-radius: 14px; }
.ac-mini--lg .ac-mini-score { font-size: 1.7rem; }
.ac-mini--lg .ac-mini-row { grid-template-columns: 82px minmax(0, 1fr) 26px; font-size: .76rem; gap: 10px; }
.ac-mini--lg .ac-mini-note { font-size: .78rem; line-height: 1.55; }
