/* ==========================================================================
   QuickFileTools – Shared Components
   Spec: docs/strategy-audit.md §4 Revision 2 ("the desk")
   Prefix: shell- (avoids class collisions with existing page styles)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Skip Link (First focusable element)
   -------------------------------------------------------------------------- */
.shell-skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--action);
  color: var(--on-action);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  border-radius: var(--radius-control);
  box-shadow: 0 4px 12px rgb(24 33 43 / 0.15);
  transition: top 0.15s ease-out;
}

.shell-skip-link:focus,
.shell-skip-link:focus-visible {
  top: 12px;
  outline: 3px solid var(--action);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.shell-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--sheet);
  border-bottom: 1px solid var(--hairline);
  width: 100%;
}

.shell-header-inner {
  max-width: var(--max-content);
  margin-inline: auto;
  padding: 0 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand / Logo */
.shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: var(--font-weight-heading);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.shell-brand:hover {
  color: var(--action);
}

.shell-brand:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 4px;
  border-radius: var(--radius-control);
}

.shell-logo-mark {
  flex-shrink: 0;
  display: block;
}

.shell-brand-text {
  display: inline;
}

/* Navigation Container */
.shell-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dropdown / Disclosure Groups */
.shell-menu-group {
  position: relative;
}

.shell-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.shell-menu-trigger:hover {
  background: var(--paper);
  color: var(--action);
}

.shell-menu-trigger:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.shell-chevron {
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.shell-menu-trigger[aria-expanded="true"] .shell-chevron {
  transform: rotate(180deg);
}

/* Dropdown Panel (AG-056: Grouped columns desktop) */
.shell-dropdown {
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: auto;
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 12px;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  box-shadow: 0 4px 20px rgb(24 33 43 / 0.1);
  display: none;
  gap: 16px;
  z-index: 1010;
  overflow: visible;
}

.shell-menu-trigger[aria-expanded="true"] + .shell-dropdown,
.shell-dropdown.is-open {
  display: grid;
}

#shellPdfTools {
  grid-template-columns: repeat(4, minmax(150px, auto));
}

@media (max-width: 1100px) {
  #shellPdfTools {
    grid-template-columns: repeat(2, minmax(150px, auto));
  }
}

#shellExamTools {
  grid-template-columns: repeat(2, minmax(150px, auto));
}

#shellImageTools {
  grid-template-columns: repeat(3, minmax(150px, auto));
}

.shell-menu-col {
  display: flex;
  flex-direction: column;
}

.shell-menu-heading {
  margin: 0;
  padding: 6px 12px 4px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--ink-muted);
  line-height: 1.3;
}

.shell-menu-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shell-menu-col li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shell-dropdown a {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  min-height: 32px;
  box-sizing: border-box;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.shell-dropdown a:hover {
  background: var(--paper);
  color: var(--action);
}

.shell-dropdown a[aria-current="page"] {
  background: var(--paper);
  color: var(--action);
  font-weight: var(--font-weight-semibold);
}

.shell-dropdown a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: -2px;
}

@media (hover: none) {
  .shell-dropdown a {
    min-height: 44px;
  }
}

.shell-menu-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
  margin-top: 4px;
}

.shell-menu-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--action);
  font-weight: var(--font-weight-semibold);
}

.shell-menu-all:hover {
  text-decoration: underline;
}

/* Top-level Nav Link (Guides, etc.) */
.shell-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.shell-nav-link:hover {
  background: var(--paper);
  color: var(--action);
}

.shell-nav-link[aria-current="page"] {
  background: var(--paper);
  color: var(--action);
}

.shell-nav-link:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

/* Screen Reader Only Utility */
.shell-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Theme Control (AG-021, AG-053 compact dropdown, AG-056 hint) */
.shell-theme-wrapper {
  position: relative;
}

.shell-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.shell-theme-btn:hover {
  background: var(--paper);
  color: var(--action);
}

.shell-theme-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.shell-theme-icon {
  display: block;
}

.shell-theme-icon[hidden] {
  display: none !important;
}

.shell-theme-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1020;
  padding: 4px;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  box-shadow: 0 4px 20px rgb(24 33 43 / 0.12);
}

.shell-theme-menu[hidden] {
  display: none !important;
}
.shell-nav-actions {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

#theme-slot {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
}

.shell-theme-control {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: var(--sheet);
  gap: 2px;
}

.shell-theme-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell-theme-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: calc(var(--radius-control) - 2px);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.shell-theme-label:hover {
  color: var(--ink);
}

.shell-theme-radio:checked + .shell-theme-label {
  background: var(--paper);
  color: var(--ink);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 2px rgb(24 33 43 / 0.08);
}

.shell-theme-radio:focus-visible + .shell-theme-label {
  outline: 2px solid var(--action);
  outline-offset: 1px;
}

/* System theme hint (AG-056) */
.shell-theme-hint {
  margin: 6px 4px 2px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: var(--font-weight-regular);
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

/* Mobile Menu Toggle Button */
.shell-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.shell-menu-btn:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.shell-menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.shell-menu-btn[aria-expanded="true"] .shell-menu-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.shell-menu-btn[aria-expanded="true"] .shell-menu-bar:nth-child(2) {
  opacity: 0;
}

.shell-menu-btn[aria-expanded="true"] .shell-menu-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Reduced Motion (AG-022, AG-056) */
@media (prefers-reduced-motion: reduce) {
  .shell-chevron,
  .shell-dropdown a,
  .shell-menu-trigger,
  .shell-menu-btn,
  .shell-menu-bar,
  .shell-menu-all {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.shell-footer {
  margin-top: auto;
  background: var(--sheet);
  border-top: 1px solid var(--hairline);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  padding: 48px 16px 28px;
}

.shell-footer-inner {
  max-width: var(--max-content);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.shell-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shell-footer-tagline {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
}

.shell-footer-col {
  display: flex;
  flex-direction: column;
}

.shell-footer-heading {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
}

.shell-footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shell-footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  padding: 3px 0;
  transition: color 0.15s ease;
}

.shell-footer-links a:hover {
  color: var(--action);
  text-decoration: underline;
}

.shell-footer-links a[aria-current="page"] {
  color: var(--action);
  font-weight: var(--font-weight-semibold);
}

.shell-footer-links a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: 2px;
}

.shell-footer-bottom {
  max-width: var(--max-content);
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.shell-footer-bottom p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Mobile & Responsive Adjustments (Phones < 900px, AG-056)
   -------------------------------------------------------------------------- */
@media (max-width: 899.98px) {
  .shell-menu-btn {
    display: inline-flex;
  }

  .shell-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--sheet);
    border-bottom: 1px solid var(--hairline);
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-shadow: 0 8px 24px rgb(24 33 43 / 0.12);
    /* The header is sticky, so a taller panel moves with it and its end can
       never be reached by scrolling the page: the panel scrolls by itself. */
    box-sizing: border-box;
    max-height: calc(100vh - 65px);
    max-height: calc(100dvh - 65px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .shell-nav.is-open {
    display: flex;
  }

  .shell-nav-link {
    width: 100%;
    background: var(--paper);
    padding: 10px 14px;
  }

  .shell-menu-trigger {
    width: 100%;
    justify-content: space-between;
    background: var(--paper);
    padding: 10px 14px;
  }

  .shell-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 4px 0 8px 12px;
    max-width: 100%;
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 8px;
  }

  .shell-menu-trigger[aria-expanded="true"] + .shell-dropdown,
  .shell-dropdown.is-open {
    display: flex;
  }

  #shellPdfTools,
  #shellImageTools,
  #shellExamTools {
    grid-template-columns: none;
  }

  .shell-menu-col {
    width: 100%;
  }

  .shell-menu-heading {
    padding: 8px 8px 4px 0;
  }

  .shell-menu-col ul {
    width: 100%;
  }

  .shell-dropdown a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    white-space: normal;
  }

  .shell-menu-footer {
    grid-column: auto;
    border-top: 1px solid var(--hairline);
    padding-top: 8px;
    margin-top: 4px;
    width: 100%;
  }

  .shell-menu-all {
    min-height: 44px;
  }

  .shell-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }

  .shell-footer-brand {
    grid-column: 1 / -1;
  }

  .shell-nav-actions {
    width: 100%;
    margin-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
  }

  #theme-slot {
    width: 100%;
  }

  .shell-theme-wrapper {
    width: 100%;
  }

  .shell-theme-btn {
    width: 100%;
    min-height: 44px;
  }

  .shell-theme-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 8px 0 0;
    width: 100%;
  }

  .shell-theme-control {
    width: 100%;
    display: flex;
  }

  .shell-theme-label {
    flex: 1;
    min-height: 44px;
  }

  .shell-theme-hint {
    margin: 8px 4px 4px;
    text-align: center;
  }
}

/* Phones: sections stacked with a divider, links in two columns (the one-column
   list was ~1300 px tall), each link a comfortable tap target. */
@media (max-width: 480px) {
  .shell-footer {
    padding-top: 32px;
  }

  .shell-footer-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .shell-footer-brand {
    padding-bottom: 20px;
  }

  .shell-footer-col {
    padding: 18px 0 14px;
    border-top: 1px solid var(--hairline);
  }

  .shell-footer-heading {
    margin-bottom: 6px;
  }

  .shell-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }

  .shell-footer-links a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 4px 0;
  }

  .shell-footer-bottom {
    margin-top: 8px;
  }
}

/* --------------------------------------------------------------------------
   Isolation & Anti-leak Resets
   Prevents bare tags (nav, nav a, footer, etc.) from leaking into shell
   -------------------------------------------------------------------------- */
.shell-header nav,
.shell-header .shell-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell-header a,
.shell-header .shell-nav a,
.shell-footer a,
.shell-footer .shell-footer-links a {
  box-sizing: border-box;
}

/* "Processed on your device" note: one per tool page, under the H1 and the
   one-line description, before the tool (§4: the marker's only static use). */
.device-note {
  margin: var(--space-3) 0 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--ink-muted);
}

.device-note-mark {
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--marker);
  color: var(--on-marker);
  font-weight: var(--font-weight-semibold);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* --------------------------------------------------------------------------
   UI Icons (AG-030: SVG icons replacing emoji)
   Style matches .tool-icon from home: 24x24 viewBox, stroke 1.5, currentColor.
   -------------------------------------------------------------------------- */
.ui-icon {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Feature cards: 24–28px as specified in AG-030 */
.feature-icon .ui-icon {
  width: 28px;
  height: 28px;
  color: var(--ink-muted);
}

/* Upload and drop zones */
.drop-icon .ui-icon,
.upload-icon .ui-icon,
.ic-upload-icon .ui-icon,
.drop .icon .ui-icon {
  width: 44px;
  height: 44px;
  color: var(--ink-muted);
}

/* Output card icons */
.output-icon .ui-icon {
  width: 32px;
  height: 32px;
  color: var(--ink-muted);
}

/* Related tools grid */
.ic-related-icon .ui-icon {
  width: 24px;
  height: 24px;
  color: var(--ink-muted);
}

/* Success status badges */
.success-icon .ui-icon,
.ic-success-icon .ui-icon,
.result-icon .ui-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

/* Step icon */
.step-icon .ui-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

/* Inline badges, privacy notes, and trust strips */
.privacy-note .ui-icon,
.ic-tool-trust .ui-icon,
.ic-trust-strip .ui-icon,
.trust .ui-icon,
.trust-strip .ui-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
  margin-right: 2px;
}

/* --------------------------------------------------------------------------
   AG-040: "Check it yourself" card on every tool page, and plain guide text
   (Image to PDF). Tokens only; same look in both themes.
   -------------------------------------------------------------------------- */
.qft-check,
.qft-guide {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--max-measure);
  margin: var(--space-6) auto;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--ink);
  text-align: left;
}

.qft-check {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
  background: var(--sheet);
}

.qft-check h2,
.qft-guide h2 {
  margin: 0 0 var(--space-3);
  font-size: 1.2rem;
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  color: var(--ink);
}

.qft-guide h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 1.05rem;
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.qft-check ol,
.qft-guide ol,
.qft-guide ul {
  margin: 0 0 var(--space-3);
  padding-left: 1.4em;
}

.qft-guide h4 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
}

.qft-check li,
.qft-guide li {
  margin-bottom: var(--space-2);
}

.qft-check p,
.qft-guide p {
  margin: 0 0 var(--space-3);
}

.qft-check p:last-child,
.qft-guide p:last-child {
  margin-bottom: 0;
}

.qft-check .qft-check-note {
  font-size: var(--font-size-sm);
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   Breadcrumb (AG-053: visible navigation breadcrumb for all tool pages)
   -------------------------------------------------------------------------- */
.qft-breadcrumb {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--ink-muted);
}

.qft-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.qft-breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.qft-breadcrumb li + li::before {
  content: "›";
  margin-right: var(--space-2);
  color: var(--ink-muted);
  speak: never;
}

.qft-breadcrumb a {
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.qft-breadcrumb a:hover {
  color: var(--ink);
}

.qft-breadcrumb a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.qft-breadcrumb [aria-current="page"] {
  color: var(--ink-muted);
  font-weight: var(--font-weight-regular);
}

/* Notice banner (AG-053) */
.notice-banner {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--action);
  border-radius: var(--radius-control);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--ink);
}

/* ==========================================================================
   Before you start – Tool Requirements Box (AG-054)
   ========================================================================== */
.qft-req {
  box-sizing: border-box;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--ink);
  text-align: left;
}

.qft-started .qft-req {
  display: none;
}

.qft-req .qft-req-title {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  line-height: var(--line-height-heading);
}

.qft-req-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Phones: "Files: PDF" on one line, so the box stays short and the picker stays close */
.qft-req-list > div {
  display: block;
  line-height: 1.4;
}

.qft-req-list > div > dt,
.qft-req-list > div > dd {
  display: inline;
}

.qft-req-list > div > dt::after {
  content: ": ";
}

@media (max-width: 699px) {
  .qft-req {
    padding: var(--space-2) var(--space-3);
  }

  .qft-req .qft-req-title {
    margin-bottom: var(--space-1);
  }
}

@media (min-width: 700px) {
  /* One grid for all rows, so every value starts in the same column */
  .qft-req-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: var(--space-4);
    row-gap: var(--space-1);
    align-items: baseline;
  }

  .qft-req-list > div {
    display: contents;
  }

  .qft-req-list > div > dt::after {
    content: none;
  }

  .qft-req-list > div > dt,
  .qft-req-list > div > dd {
    display: block;
    line-height: var(--line-height-body);
  }
}

.qft-req-list dt {
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
}

/* ==========================================================================
   Next Step Navigation (AG-059)
   Shown quietly after a result; offers 2–3 links to next browser tools.
   ========================================================================== */
.qft-next {
  box-sizing: border-box;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--ink);
  text-align: left;
}

.qft-next[hidden] {
  display: none;
}

.qft-next .qft-next-title {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  line-height: var(--line-height-heading);
}

.qft-next-note {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--ink-muted);
  line-height: var(--line-height-body);
}

.qft-next-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

.qft-next-list li {
  margin: 0;
  padding: 0;
}

.qft-next-list a {
  color: var(--action);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: var(--font-weight-medium, 500);
  font-size: var(--font-size-sm);
}

.qft-next-list a:hover {
  color: var(--action-hover, var(--action));
  text-decoration: none;
}

.qft-next-list a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

@media (max-width: 479px) {
  .qft-next {
    padding: var(--space-3);
  }

  .qft-next-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

.qft-req-list dd {
  font-weight: var(--font-weight-regular);
  color: var(--ink-muted);
  margin: 0;
}

/* FAQ question rows: a tap target of at least 24 px (WCAG 2.2, 2.5.8) on every page.
   :where() keeps this weaker than any page's own FAQ styles. */
:where(details.faq) > summary {
  padding-block: var(--space-3);
  cursor: pointer;
}

/* "Guides for this tool" links: keep stacked links at least 24 px apart (WCAG 2.2, 2.5.8)
   on pages without their own list styles. :where() keeps page styles stronger. */
:where(.related-list) {
  line-height: var(--line-height-body);
}
