/* "See how it works" card and walkthrough (AI visibility Phase G6; js/geo-walkthrough.js). Loaded only on ai-visibility-check.html.
   The report parts inside the dialog use the free check's own .avc-* classes from site.css. No inline styles: the CSP allows none, so bar heights and widths are classes. */

.gw-card { position: relative; display: grid; gap: 1.25rem; align-items: center; padding-right: 3.5rem; }
@media (min-width: 40rem) { .gw-card { grid-template-columns: 13rem 1fr; } }
.avc .prose .gw-card h2 { margin: 0 0 0.35rem; font-size: 1.375rem; }
.gw-card-body p { margin: 0 0 0.75rem; }
.gw-card-body p:last-child { margin-bottom: 0; }
.gw-card-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.gw-card-actions .button-secondary { margin-left: 0; }

/* The sample verdict tile: a count, never a percentage (D7). */
.gw-tile { padding: 0.85rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.avc .gw-tile-tag { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.75rem; font-weight: var(--weight-bold); letter-spacing: 0.08em; text-transform: uppercase; }
.avc .gw-tile-count { margin: 0 0 0.6rem; color: var(--text); font-weight: var(--weight-bold); }
.gw-tile-bars { display: flex; align-items: flex-end; gap: 0.3rem; height: 2.5rem; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--border-strong); }
.gw-tile-bars li { flex: 1; border-radius: 3px 3px 0 0; background: var(--brand); }
.gw-tile-bars .gw-w-0 { height: 3px; background: var(--border-strong); }
.gw-tile-bars .gw-w-1 { height: 17%; }
.gw-tile-bars .gw-w-2 { height: 33%; }
.gw-tile-bars .gw-w-3 { height: 50%; }
.gw-tile-bars .gw-w-4 { height: 67%; }
.gw-tile-bars .gw-w-5 { height: 83%; }
.gw-tile-bars .gw-w-6 { height: 100%; }

/* The close (×) control on the card and the dialog. 44px tap target. */
.gw-x { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; border-radius: var(--radius-sm); color: var(--muted); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.gw-x:hover { color: var(--text); background: var(--surface-2); }
.gw-card > .gw-x { position: absolute; top: 0.5rem; right: 0.5rem; }

.gw-inline-button { color: var(--brand-action); text-decoration: underline; text-underline-offset: 0.2em; }

/* The dialog: centered, never wider than the screen, its body scrolls while the head and the buttons stay put. */
.gw {
  width: min(46rem, calc(100vw - 1rem)); max-width: none; max-height: calc(100dvh - 1rem); margin: auto; padding: 0;
  display: none; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 50px rgb(2 12 27 / 35%);
}
.gw[open] { display: flex; }
.gw::backdrop { background: rgb(6 18 33 / 60%); }
.gw-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.75rem 0.75rem 1.25rem; border-bottom: 1px solid var(--border); }
.avc .gw-sample-tag { flex: none; margin: 0; padding: 0.2rem 0.65rem; border-radius: 999px; background: #fef0c7; color: #7a2e0e; font-size: 0.8125rem; font-weight: var(--weight-bold); white-space: nowrap; }
.gw-dialog-title { flex: 1; min-width: 0; margin: 0; font-size: 1.0625rem; font-weight: var(--weight-bold); }
.gw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1.25rem 1.25rem; overflow-wrap: anywhere; }
.avc .gw-count { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.875rem; font-weight: var(--weight-medium); }
.gw-step-title { margin: 0 0 0.5rem; font-size: 1.375rem; font-weight: var(--weight-bold); line-height: 1.25; }
.gw-step-title:focus { outline: none; }
.gw-step-title:focus-visible { outline: 3px solid var(--focus); }
.gw-step-text { margin: 0 0 1rem; color: var(--muted); }
.gw-stage > :first-child { margin-top: 0; }
.gw-stage h4 { margin: 1.25rem 0 0.35rem; font-size: 1rem; }
.gw-stage .avc-verdict { margin: 0; }
.gw-foot { padding: 0.75rem 1.25rem 0.9rem; border-top: 1px solid var(--border); }
.gw-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gw-nav .button { margin: 0; }
.gw-nav .button:disabled { opacity: 0.45; cursor: default; }
/* The end actions join the Back button's row, so a phone fits Back and "Run the free check" side by side. */
.gw-end { display: contents; }
.gw-end .button-secondary { margin-left: 0; }
@media (max-width: 40rem) {
  .gw-foot { padding-block: 0.6rem; }
  .gw-dots { margin-bottom: 0.5rem; }
  .gw-nav .button { padding-inline: 1rem; }
  .avc .gw-keys { display: none; } /* arrow keys are for a keyboard; a phone has the buttons */
}
.avc .gw-keys { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.8125rem; }
.gw-dots { display: flex; gap: 0.4rem; margin: 0 0 0.75rem; padding: 0; list-style: none; }
.gw-dots li { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--border-strong); transition: background-color 0.2s ease, transform 0.2s ease; }
.gw-dots li.gw-dot-done { background: var(--brand); opacity: 0.55; }
.gw-dots li.gw-dot-current { background: var(--brand); transform: scale(1.3); }
.gw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Step 1: the form, as read-only values. */
.gw-form { display: grid; gap: 0.15rem; margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.gw-form dt { font-weight: var(--weight-bold); font-size: 0.9375rem; }
.gw-form dd { margin: 0 0 0.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.gw-form dd:last-child { margin-bottom: 0; }

/* Step 2: the questions and the rule. */
.gw-questions { margin: 0 0 1rem; padding-left: 1.25rem; }
.gw-questions li { margin-bottom: 0.4rem; }
.gw-rule { margin: 0; padding: 0.75rem 1rem; border-left: 4px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand-soft); font-weight: var(--weight-medium); }
.gw-question { margin: 0 0 0.35rem; font-weight: var(--weight-bold); }

/* Step 4: names marked in the answer. */
.gw-mark { padding: 0 0.15em; border-radius: 3px; background: #fef0c7; color: #4a1d06; }
.gw-mark-you { background: #dcfae6; color: #085d3a; }

/* Step 6: the weekly trend, a table first, the bars only decoration. */
.gw-trend-wrap { margin: 0; }
.gw-trend { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.gw-trend caption { padding: 0.6rem 0.9rem; text-align: left; color: var(--muted); font-size: 0.875rem; }
.gw-trend th, .gw-trend td { padding: 0.45rem 0.9rem; text-align: left; border-top: 1px solid var(--border); }
.gw-trend thead th { background: var(--surface-2); }
.gw-trend tbody th { white-space: nowrap; }
.gw-trend td { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; }
.gw-trend-count { min-width: 8.5rem; }
.gw-bar { flex: 1 1 6rem; max-width: 12rem; height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gw-bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.4s ease; }
.gw-bar .gw-w-0 { width: 0; }
.gw-bar .gw-w-1 { width: 17%; }
.gw-bar .gw-w-2 { width: 33%; }
.gw-bar .gw-w-3 { width: 50%; }
.gw-bar .gw-w-4 { width: 67%; }
.gw-bar .gw-w-5 { width: 83%; }
.gw-bar .gw-w-6 { width: 100%; }

/* A short fade as a step comes in; none at all when the viewer asks for reduced motion. */
.gw-stage.gw-enter { animation: gw-in 0.25s ease; }
@keyframes gw-in { from { opacity: 0; transform: translateY(0.4rem); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gw-stage.gw-enter { animation: none; }
  .gw-dots li, .gw-bar span { transition: none; }
}

@media print { .gw, .gw-card, .gw-inline { display: none !important; } }
