/* attempt_runner_html, root .ar-wrap.
   Rules whose first compound is the root itself stay bare; every other rule is scoped
   :where(.ar-wrap), which adds zero specificity and so cannot change which rule wins.
   The slot parents hold Anvil's <anvil-dropzone> (display: contents), so an empty slot is
   :not(:has(> anvil-dropzone > *)). */

/* Greenwood × PX attempt-runner — runner shell.
   Wireframe ref: training_wireframes.html lines 1602-1611.
   Moss-tone "focus surface" timer bar at the top of the
   question panel (timer-bar wireframe rule), brand progress
   fill underneath, paper question slot.

   Light Greenwood treatment — the runner stays calm so
   question content holds the eye. */

.ar-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--ch-space-lg);
  font-family: var(--gw-font);
  color: var(--gw-ink);
}
:where(.ar-wrap) .ar-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--ch-space-md);
}
/* Was .ar-banner-stack:empty: its margin-bottom must not show with no banner. */
:where(.ar-wrap) .ar-banner-stack:not(:has(> anvil-dropzone > *)) { display: none; }

/* Header chrome — wireframe `.timer-bar` moss strap. */
:where(.ar-wrap) .ar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--gw-moss-d);
  color: #F1F5F9;
  border-radius: var(--gw-r-lg) var(--gw-r-lg) 0 0;
  margin-bottom: 0;
}
:where(.ar-wrap) .ar-header-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
:where(.ar-wrap) .ar-counter {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  flex-shrink: 0;
  font-family: var(--gw-font-mono);
}
:where(.ar-wrap) .ar-timer-slot { flex-shrink: 0; }

/* Progress bar — sits flush under the moss header. */
:where(.ar-wrap) .ar-progress {
  height: 6px;
  background: var(--gw-paper-2);
  margin-bottom: var(--ch-space-lg);
  overflow: hidden;
}
:where(.ar-wrap) .ar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gw-brand-d), var(--gw-brand));
  width: 0%;
  transition: width 0.3s;
}

/* Question panel slot — paper card. */
:where(.ar-wrap) .ar-question-slot {
  background: var(--gw-paper);
  border: 1px solid var(--gw-bd);
  border-top: none;
  padding: 22px;
  min-height: 280px;
  margin-bottom: var(--ch-space-lg);
}

/* Nav row (Prev/Next/Finish). */
:where(.ar-wrap) .ar-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
:where(.ar-wrap) .ar-nav-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--gw-font);
  background: var(--gw-paper);
  color: var(--gw-ink-2);
  border: 1px solid var(--gw-bd);
  border-radius: var(--gw-r-md);
  cursor: pointer;
  min-height: 44px;
  transition: background var(--gw-t), color var(--gw-t),
              border-color var(--gw-t);
}
:where(.ar-wrap) .ar-nav-btn:hover:not(:disabled) {
  background: var(--gw-paper-2);
  color: var(--gw-ink);
  border-color: var(--gw-bd-2);
}
:where(.ar-wrap) .ar-nav-btn:focus-visible {
  outline: 2px solid var(--gw-brand);
  outline-offset: 2px;
}
:where(.ar-wrap) .ar-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
:where(.ar-wrap) .ar-nav-btn-finish {
  background: var(--gw-brand);
  color: #fff;
  border-color: var(--gw-brand);
}
:where(.ar-wrap) .ar-nav-btn-finish:hover:not(:disabled) {
  background: var(--gw-brand-d);
  border-color: var(--gw-brand-d);
  color: #fff;
}

/* Was .ar-submit-dialog-slot:empty. */
:where(.ar-wrap) .ar-submit-dialog-slot:not(:has(> anvil-dropzone > *)) { display: none; }

@media (max-width: 600px) {
  :where(.ar-wrap) .ar-header { flex-wrap: wrap; }
  :where(.ar-wrap) .ar-counter {
    order: 3;
    width: 100%;
    text-align: right;
  }
}
