@import url("/design-system/tokens.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

.aq-skip-link {
  position: fixed;
  z-index: var(--aq-z_index-toast);
  top: var(--aq-spacing-2);
  left: var(--aq-spacing-2);
  padding: var(--aq-spacing-3) var(--aq-spacing-4);
  transform: translateY(-160%);
  border: 2px solid var(--aq-color-focus);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-surface);
  color: var(--aq-color-text-primary);
  font-weight: 700;
}

.aq-skip-link:focus,
.aq-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--aq-color-focus);
  outline-offset: 3px;
  box-shadow: var(--aq-elevation-focus-ring);
}

.aq-ds-pilot,
.aq-ds-reference {
  margin: 0;
  background: var(--aq-color-background-page);
  color: var(--aq-color-text-primary);
  font-family: var(--aq-typography-font-family-sans);
  font-size: var(--aq-typography-body-size);
  line-height: var(--aq-typography-body-line-height);
  letter-spacing: 0;
}

.aq-ds-pilot *,
.aq-ds-reference * {
  letter-spacing: 0;
}

.aq-ds-pilot a,
.aq-ds-reference a {
  color: var(--aq-color-action-primary);
}

.aq-ds-pilot a:hover,
.aq-ds-reference a:hover {
  color: var(--aq-color-action-hover);
}

.aq-ds-pilot :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.aq-ds-reference :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--aq-color-focus);
  outline-offset: 3px;
  box-shadow: var(--aq-elevation-focus-ring);
}

.aq-ds-pilot :is(button, .button, .language-switcher),
.aq-ds-reference :is(button, .button, .language-switcher) {
  min-height: var(--aq-geometry-control-default);
}

.aq-ds-pilot .shell,
.aq-ds-reference .aq-container {
  width: min(calc(100% - 32px), var(--aq-geometry-container-content));
  margin-inline: auto;
}

.aq-ds-pilot .topbar,
.aq-ds-pilot .nav,
.aq-reference-header {
  width: min(calc(100% - 32px), var(--aq-geometry-container-wide));
  min-height: 72px;
  margin: 0 auto;
  padding: var(--aq-spacing-4) 0;
  border: 0;
  border-bottom: 1px solid var(--aq-color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--aq-color-text-primary);
}

.aq-ds-pilot .topbar,
.aq-reference-header {
  display: flex;
  gap: var(--aq-spacing-6);
  align-items: center;
  justify-content: space-between;
}

.aq-ds-pilot .nav {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: var(--aq-spacing-4);
  align-items: center;
}

.aq-ds-pilot .aq-cabinet-navigation,
.aq-ds-pilot.aq-cabinet-shell .nav {
  grid-template-columns: auto auto minmax(260px, 1fr) minmax(220px, auto);
  min-height: calc(var(--aq-geometry-control-default) + var(--aq-spacing-16));
}

.aq-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  min-height: var(--aq-geometry-touch-target-min);
  gap: var(--aq-spacing-2);
  align-items: center;
  margin-bottom: var(--aq-spacing-5);
  color: var(--aq-color-text-secondary);
}

.aq-ds-pilot .brand,
.aq-reference-brand {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  gap: var(--aq-spacing-2);
  align-items: center;
  color: var(--aq-color-text-primary);
  font-weight: 800;
  text-decoration: none;
}

.aq-ds-pilot .brand::before {
  border-color: var(--aq-color-border-strong);
  background-color: var(--aq-color-surface-inverse);
}

.aq-public-application-shell .brand-logo {
  display: none;
}

.aq-public-application-shell .brand {
  min-width: 0;
  justify-content: flex-start;
}

.aq-public-application-shell .brand::after {
  content: "Aqteron";
}

.aq-ds-pilot .topnav,
.aq-ds-pilot .nav-links,
.aq-reference-nav,
.aq-ds-pilot .links,
.aq-ds-pilot .actions,
.aq-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aq-spacing-2);
  align-items: center;
}

.aq-ds-pilot :is(.hero-actions, .cta-row, .ready-actions, .aq-action-bar) {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--aq-spacing-3);
}

.aq-ds-pilot :is(.hero-actions, .cta-row, .ready-actions, .aq-action-bar) > :is(.button, .aq-button, button, a) {
  min-height: var(--aq-geometry-control-large);
  align-self: stretch;
}

.aq-ds-pilot .aq-action-bar {
  margin-top: var(--aq-spacing-5);
}

.aq-ds-pilot .cta-row {
  margin-top: var(--aq-spacing-6);
}

.aq-public-shell[data-page="standard-prompt"] .hero {
  display: grid;
  gap: var(--aq-spacing-8);
  padding-block: var(--aq-spacing-10);
}

.aq-public-shell[data-page="standard-prompt"] .hero-copy,
.aq-public-application-shell .hero-copy {
  display: grid;
  gap: var(--aq-spacing-4);
}

.aq-public-shell[data-page="standard-prompt"] .hero-copy > *,
.aq-public-application-shell .hero-copy > * {
  margin-block: 0;
}

.aq-public-shell[data-page="standard-prompt"] .prompt-block {
  min-height: 240px;
  padding: var(--aq-spacing-6);
}

.aq-public-application-shell .hero {
  display: grid;
  gap: var(--aq-spacing-6);
  padding-block: var(--aq-spacing-8);
}

.aq-public-application-shell .hero-panel {
  display: flex;
  padding: var(--aq-spacing-4);
  align-items: center;
  gap: var(--aq-spacing-3);
  flex-wrap: wrap;
}

.aq-public-application-shell .hero-panel code {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.aq-ds-pilot .topnav > a:not(.button),
.aq-ds-pilot .nav-links > a:not(.button),
.aq-reference-nav > a {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  align-items: center;
  padding-inline: var(--aq-spacing-2);
  color: var(--aq-color-text-secondary);
  text-decoration: none;
}

.aq-ds-pilot main,
.aq-main,
.aq-reference-main {
  width: min(calc(100% - 32px), var(--aq-geometry-container-content));
  margin-inline: auto;
  padding-block: var(--aq-spacing-12) var(--aq-spacing-16);
}

.aq-ds-pilot .shell > main {
  width: 100%;
  padding-top: var(--aq-spacing-8);
}

.aq-ds-pilot h1,
.aq-ds-reference h1 {
  margin: 0 0 var(--aq-spacing-4);
  color: var(--aq-color-text-primary);
  font-size: var(--aq-typography-h1-size);
  font-weight: var(--aq-typography-h1-weight);
  line-height: var(--aq-typography-h1-line-height);
}

.aq-ds-pilot h2,
.aq-ds-reference h2 {
  color: var(--aq-color-text-primary);
  font-size: var(--aq-typography-h2-size);
  line-height: var(--aq-typography-h2-line-height);
}

.aq-ds-pilot h3,
.aq-ds-reference h3 {
  color: var(--aq-color-text-primary);
  font-size: var(--aq-typography-h3-size);
  line-height: var(--aq-typography-h3-line-height);
}

.aq-type-h1,
.aq-type-h2,
.aq-type-h3 {
  margin: 0 0 var(--aq-spacing-4);
  color: var(--aq-color-text-primary);
  font-weight: 700;
}

.aq-type-h1 { font-size: var(--aq-typography-h1-size); line-height: var(--aq-typography-h1-line-height); }
.aq-type-h2 { font-size: var(--aq-typography-h2-size); line-height: var(--aq-typography-h2-line-height); }
.aq-type-h3 { font-size: var(--aq-typography-h3-size); line-height: var(--aq-typography-h3-line-height); }

.aq-ds-pilot p,
.aq-ds-pilot li,
.aq-ds-pilot small,
.aq-ds-reference p,
.aq-ds-reference li,
.aq-ds-reference small {
  color: var(--aq-color-text-secondary);
}

.aq-ds-pilot .eyebrow,
.aq-ds-pilot .label,
.aq-eyebrow {
  margin: 0 0 var(--aq-spacing-2);
  color: var(--aq-color-action-primary);
  font-size: var(--aq-typography-label-size);
  font-weight: var(--aq-typography-label-weight);
  line-height: var(--aq-typography-label-line-height);
  text-transform: none;
}

.aq-ds-pilot .button,
.aq-button,
.aq-ds-reference button {
  display: inline-flex;
  min-height: var(--aq-geometry-control-default);
  padding: var(--aq-spacing-3) var(--aq-spacing-4);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--aq-color-border-strong);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-surface);
  box-shadow: none;
  color: var(--aq-color-text-primary);
  font: inherit;
  font-size: var(--aq-typography-button-size);
  font-weight: var(--aq-typography-button-weight);
  line-height: var(--aq-typography-button-line-height);
  text-decoration: none;
  transform: none;
  transition: background var(--aq-motion-fast) var(--aq-motion-easing), border-color var(--aq-motion-fast) var(--aq-motion-easing);
}

.aq-ds-pilot .button:hover,
.aq-button:hover,
.aq-ds-reference button:hover {
  border-color: var(--aq-color-action-primary);
  background: var(--aq-color-action-secondary);
  box-shadow: none;
  color: var(--aq-color-action-active);
  transform: none;
}

.aq-ds-pilot .button.primary,
.aq-button--primary,
.aq-ds-reference button.primary {
  border-color: var(--aq-color-action-primary);
  background: var(--aq-color-action-primary);
  color: #FFFFFF;
}

.aq-ds-pilot .button.primary:hover,
.aq-button--primary:hover,
.aq-ds-reference button.primary:hover {
  border-color: var(--aq-color-action-hover);
  background: var(--aq-color-action-hover);
  color: #FFFFFF;
}

.aq-ds-pilot .button.danger,
.aq-button--destructive {
  border-color: var(--aq-color-error);
  background: var(--aq-color-error);
  color: #FFFFFF;
}

.aq-ds-pilot .button.danger:hover,
.aq-button--destructive:hover {
  border-color: var(--aq-color-error);
  background: var(--aq-color-error-surface);
  color: var(--aq-color-error);
}

.aq-ds-pilot :is(button, .button):disabled,
.aq-ds-reference button:disabled {
  border-color: var(--aq-color-border);
  background: var(--aq-color-background-alternate);
  color: var(--aq-color-text-muted);
  cursor: not-allowed;
  opacity: 1;
}

.aq-ds-pilot .input,
.aq-field,
.aq-ds-reference :is(input, select, textarea) {
  width: 100%;
  min-height: var(--aq-geometry-control-default);
  padding: var(--aq-spacing-3);
  border: 1px solid var(--aq-color-border-strong);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-surface);
  color: var(--aq-color-text-primary);
  font: inherit;
}

.aq-ds-pilot .input[aria-invalid="true"],
.aq-field[aria-invalid="true"] {
  border-color: var(--aq-color-error);
  box-shadow: 0 0 0 2px var(--aq-color-error-surface);
}

.aq-field-group,
.aq-ds-pilot .field-group {
  display: grid;
  gap: var(--aq-spacing-2);
}

.aq-field-help,
.aq-field-error {
  margin: 0;
  font-size: var(--aq-typography-body-small-size);
  line-height: var(--aq-typography-body-small-line-height);
}

.aq-field-error,
.aq-ds-pilot [data-login-status][data-state="error"] {
  color: var(--aq-color-error);
}

.aq-ds-pilot [data-login-status],
.aq-ds-pilot [data-apps-status] {
  min-height: var(--aq-geometry-touch-target-min);
  margin: 0;
  padding: var(--aq-spacing-3) var(--aq-spacing-4);
  border-left: 4px solid var(--aq-color-information);
  background: var(--aq-color-information-surface);
  color: var(--aq-color-text-primary);
}

.aq-ds-pilot .card,
.aq-ds-pilot .stat,
.aq-ds-pilot .panel,
.aq-card,
.aq-status-card,
.aq-information-panel,
.aq-empty-state {
  padding: var(--aq-spacing-6);
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-card);
  background: var(--aq-color-surface);
  box-shadow: var(--aq-elevation-card);
  color: var(--aq-color-text-primary);
}

.aq-ds-pilot .card:hover,
.aq-ds-pilot .stat:hover,
.aq-ds-pilot .panel:hover {
  border-color: var(--aq-color-border-strong);
}

.aq-ds-pilot :is(.app-upload-info, .upload-dropzone, .source-card, .upload-file-summary) {
  border-color: var(--aq-color-border);
  background: var(--aq-color-surface);
  color: var(--aq-color-text-primary);
}

.aq-ds-pilot :is(.app-upload-info p, .upload-dropzone__hint, .source-card p, .source-card span, .upload-status) {
  color: var(--aq-color-text-secondary);
}

.aq-ds-pilot :is(.app-upload-info strong, .upload-dropzone__title, .source-card strong) {
  color: var(--aq-color-text-primary);
}

.aq-ds-pilot .hero {
  gap: var(--aq-spacing-6);
}

.aq-page-header {
  display: grid;
  max-width: var(--aq-geometry-container-reading);
  gap: var(--aq-spacing-3);
  margin-bottom: var(--aq-spacing-8);
}

.aq-page-header > :is(h1, p) {
  margin-block: 0;
}

.aq-ds-pilot .home-hero {
  max-width: 880px;
  padding-block: var(--aq-spacing-16);
}

.aq-ds-pilot .home-hero h1 {
  max-width: 14ch;
  font-size: var(--aq-typography-display-size);
  font-weight: var(--aq-typography-display-weight);
  line-height: var(--aq-typography-display-line-height);
}

.aq-ds-pilot .how-section,
.aq-ds-pilot .home-install-section {
  margin-block: 0;
  padding-block: var(--aq-spacing-12);
  border-top: 1px solid var(--aq-color-border);
  background: transparent;
}

.aq-ds-pilot .how-card,
.aq-ds-pilot .home-install-card,
.aq-ds-pilot .state-card {
  border-color: var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-card);
  background: var(--aq-color-surface);
  box-shadow: var(--aq-elevation-card);
}

.aq-status-badge,
.aq-ds-pilot .status-pill,
.aq-ds-pilot .session-pill,
.aq-ds-pilot .pill {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  padding: var(--aq-spacing-1) var(--aq-spacing-3);
  align-items: center;
  gap: var(--aq-spacing-2);
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--aq-color-information-surface);
  color: var(--aq-color-information);
  font-size: var(--aq-typography-body-small-size);
  font-weight: 700;
}

.aq-status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: currentColor;
}

.aq-status-badge--success { background: var(--aq-color-success-surface); color: var(--aq-color-success); }
.aq-status-badge--warning { background: var(--aq-color-warning-surface); color: var(--aq-color-warning); }
.aq-status-badge--error { background: var(--aq-color-error-surface); color: var(--aq-color-error); }
.aq-status-badge--information { background: var(--aq-color-information-surface); color: var(--aq-color-information); }

.aq-alert {
  padding: var(--aq-spacing-4);
  border-left: 4px solid var(--aq-color-information);
  border-radius: var(--aq-geometry-radius-small);
  background: var(--aq-color-information-surface);
  color: var(--aq-color-text-primary);
}

.aq-alert--success { border-color: var(--aq-color-success); background: var(--aq-color-success-surface); }
.aq-alert--warning { border-color: var(--aq-color-warning); background: var(--aq-color-warning-surface); }
.aq-alert--error { border-color: var(--aq-color-error); background: var(--aq-color-error-surface); }

.aq-loading {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  align-items: center;
  gap: var(--aq-spacing-3);
  color: var(--aq-color-text-secondary);
}

.aq-loading::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid var(--aq-color-border-strong);
  border-top-color: var(--aq-color-action-primary);
  border-radius: 50%;
  animation: aq-spin var(--aq-motion-slow) linear infinite;
}

@keyframes aq-spin { to { transform: rotate(360deg); } }

.aq-application-card {
  display: grid;
  gap: var(--aq-spacing-3);
}

.aq-application-card > :is(h2, h3, p) {
  margin: 0;
}

.aq-ds-pilot code,
.aq-ds-reference code,
.aq-code-block {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--aq-typography-font-family-code);
}

.aq-code-block {
  padding: var(--aq-spacing-4);
  overflow-x: auto;
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-background-alternate);
  white-space: pre-wrap;
}

.aq-dialog {
  width: min(calc(100% - 32px), var(--aq-geometry-dialog-default));
  padding: var(--aq-spacing-6);
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-card);
  background: var(--aq-color-surface);
  color: var(--aq-color-text-primary);
  box-shadow: var(--aq-elevation-dialog);
}

.aq-dialog::backdrop { background: var(--aq-color-overlay); }

.aq-documentation-page main,
.aq-documentation-view,
.aq-validation-summary,
.aq-publication-status {
  display: grid;
  gap: var(--aq-spacing-6);
}

.aq-documentation-view[hidden],
[data-workspace-view][hidden],
[data-auth-state-view][hidden] {
  display: none;
}

.aq-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--aq-spacing-6);
}

.aq-content-grid > section,
.aq-content-grid > article {
  min-width: 0;
}

.aq-check-list,
.aq-process-list,
.aq-version-list {
  display: grid;
  gap: var(--aq-spacing-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.aq-check-list li,
.aq-process-list li,
.aq-version-list li {
  min-width: 0;
  padding: var(--aq-spacing-4) 0 var(--aq-spacing-4) var(--aq-spacing-5);
  border-left: 3px solid var(--aq-color-border-strong);
}

.aq-check-list li::before {
  content: "✓";
  margin-right: var(--aq-spacing-2);
  color: var(--aq-color-success);
  font-weight: 800;
}

.aq-process-list h2,
.aq-process-list p,
.aq-version-list p {
  margin-block: 0;
}

.aq-process-list h2 {
  font-size: var(--aq-typography-h3-size);
  line-height: var(--aq-typography-h3-line-height);
}

.aq-process-list--compact li {
  padding-block: var(--aq-spacing-2);
}

.aq-disclosure-list,
.aq-requirements {
  display: grid;
  gap: var(--aq-spacing-3);
}

.aq-disclosure-list details,
.aq-requirements {
  padding: var(--aq-spacing-4);
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-surface);
}

.aq-disclosure-list summary,
.aq-requirements summary {
  min-height: var(--aq-geometry-touch-target-min);
  cursor: pointer;
  color: var(--aq-color-text-primary);
  font-weight: 700;
}

.aq-validation-summary,
.aq-publication-status {
  max-width: var(--aq-geometry-container-reading);
}

.aq-validation-summary > section {
  padding-top: var(--aq-spacing-4);
  border-top: 1px solid var(--aq-color-border);
}

.aq-metadata-list {
  display: grid;
  gap: var(--aq-spacing-2);
  margin: 0;
}

.aq-metadata-list > div {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(0, 1fr);
  gap: var(--aq-spacing-3);
  padding-block: var(--aq-spacing-2);
  border-bottom: 1px solid var(--aq-color-border);
}

.aq-metadata-list dt {
  color: var(--aq-color-text-secondary);
  font-weight: 700;
}

.aq-metadata-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.aq-error-boundary {
  display: grid;
  max-width: var(--aq-geometry-container-reading);
  gap: var(--aq-spacing-4);
  margin-inline: auto;
}

.aq-confirmation-copy {
  display: grid;
  gap: var(--aq-spacing-3);
  margin-bottom: var(--aq-spacing-5);
}

.aq-confirmation-copy > * {
  margin: 0;
}

.aq-reference-main {
  display: grid;
  gap: var(--aq-spacing-12);
}

.aq-reference-section {
  display: grid;
  gap: var(--aq-spacing-5);
  padding-top: var(--aq-spacing-8);
  border-top: 1px solid var(--aq-color-border);
}

.aq-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: var(--aq-spacing-4);
}

.aq-swatch {
  min-height: 92px;
  padding: var(--aq-spacing-4);
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-card);
  background: var(--swatch, var(--aq-color-surface));
  color: var(--swatch-text, var(--aq-color-text-primary));
}

@media (max-width: 900px) {
  .aq-ds-pilot .aq-cabinet-navigation,
  .aq-ds-pilot.aq-cabinet-shell .nav {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .aq-ds-pilot .aq-cabinet-navigation .nav-links,
  .aq-ds-pilot .aq-cabinet-navigation .nav-meta {
    grid-column: 1 / -1;
    width: 100%;
  }

  .aq-ds-pilot .aq-cabinet-navigation .nav-meta {
    justify-self: stretch;
    justify-items: start;
  }

  .aq-ds-pilot .aq-cabinet-navigation > .language-switcher {
    width: min(100%, 180px);
    justify-self: start;
  }
}

@media (max-width: 767px) {
  .aq-ds-pilot .shell,
  .aq-ds-pilot .topbar,
  .aq-ds-pilot .nav,
  .aq-ds-pilot main,
  .aq-reference-header,
  .aq-reference-main {
    width: min(calc(100% - 32px), var(--aq-geometry-container-content));
  }

  .aq-ds-pilot .topbar,
  .aq-reference-header,
  .aq-ds-pilot .nav {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .aq-ds-pilot .aq-cabinet-navigation,
  .aq-ds-pilot.aq-cabinet-shell .nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .aq-ds-pilot .nav-meta {
    justify-self: stretch;
    justify-items: start;
  }

  .aq-ds-pilot .topnav,
  .aq-ds-pilot .nav-links,
  .aq-reference-nav {
    width: 100%;
  }

  .aq-ds-pilot .topnav .button,
  .aq-ds-pilot .nav-links .button,
  .aq-ds-pilot .hero-actions .button,
  .aq-ds-pilot .cta-row .button,
  .aq-action-bar .aq-button {
    width: 100%;
  }

  .aq-ds-pilot .home-hero {
    padding-block: var(--aq-spacing-12);
  }

  .aq-ds-pilot .home-hero h1,
  .aq-ds-pilot h1,
  .aq-ds-reference h1 {
    max-width: none;
    font-size: 2.25rem;
    overflow-wrap: anywhere;
  }

  .aq-ds-pilot .hero,
  .aq-ds-pilot .grid,
  .aq-ds-pilot .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .aq-ds-pilot .card,
  .aq-ds-pilot .stat,
  .aq-ds-pilot .panel,
  .aq-card,
  .aq-empty-state {
    min-width: 0;
    padding: var(--aq-spacing-5);
  }

  .aq-metadata-list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--aq-spacing-1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aq-ds-pilot *,
  .aq-ds-reference * {
    scroll-behavior: auto !important;
    animation-duration: var(--aq-motion-reduced) !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--aq-motion-reduced) !important;
  }
}

/* Stage 5 shared responsive primitives. */
html,
body {
  max-width: 100%;
}

html {
  overflow-x: clip;
}

body.aq-ds-pilot,
body.aq-ds-reference {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

.aq-ds-pilot :is(main, section, article, header, nav, div, form, fieldset, dl, dd, pre),
.aq-ds-reference :is(main, section, article, header, nav, div, form, fieldset, dl, dd, pre) {
  min-width: 0;
}

.aq-ds-pilot :is(.button, .aq-button),
.aq-ds-reference :is(button, .aq-button) {
  max-width: 100%;
  min-width: 0;
  height: auto;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.aq-ds-pilot :is(
  [data-upload-selected-file],
  .upload-file-summary,
  [data-upload-result-meta],
  [data-upload-next-action],
  [data-publication-link],
  [data-publication-message],
  [data-app-public-link],
  .aq-alert,
  .aq-status-card,
  .aq-publication-status,
  .aq-validation-summary,
  .aq-version-list,
  .session-pill
) {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.aq-ds-pilot :is(.how-grid, .install-grid, .home-install-grid) > *,
.aq-ds-pilot :is(.how-card, .flow-card, .install-card, .home-install-card) {
  max-width: 100%;
  min-width: 0;
}

.aq-ds-pilot :is(.detail-link, .aq-information-panel a:not(.button), .aq-breadcrumbs a, .aq-publication-status a:not(.button)) {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  align-items: center;
  padding-block: var(--aq-spacing-2);
}

.aq-auth-shell main a,
.aq-ds-pilot a[data-app-public-link][href] {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  align-items: center;
}

.aq-ds-pilot :is(.topnav, .nav-links, .aq-breadcrumbs) a[aria-current="page"],
.aq-reference-nav a[aria-current="page"] {
  color: var(--aq-color-action-active);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.aq-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.aq-table-scroll > table,
.aq-ds-pilot table {
  width: 100%;
  border-collapse: collapse;
}

.aq-dialog {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.aq-mobile-navigation-panel {
  display: contents;
}

.aq-mobile-nav-toggle,
.aq-mobile-nav-close,
.aq-mobile-nav-backdrop {
  display: none;
}

.aq-ds-reference .aq-mobile-nav-toggle {
  display: none;
}

.aq-ds-reference [hidden],
.aq-ds-reference .aq-mobile-nav-close,
.aq-ds-reference .aq-mobile-nav-backdrop {
  display: none !important;
}

@media (max-width: 1365px) {
  body.aq-mobile-navigation-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .aq-navigation-enhanced {
    position: relative;
    z-index: var(--aq-z_index-sticky);
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 72px;
    gap: var(--aq-spacing-3) !important;
    align-items: center !important;
  }

  .aq-navigation-enhanced.aq-navigation-open {
    z-index: var(--aq-z_index-dialog);
  }

  .aq-navigation-enhanced--public-application {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .aq-navigation-enhanced > .brand,
  .aq-navigation-enhanced > .aq-reference-brand {
    min-width: 0;
  }

  .aq-mobile-nav-toggle,
  .aq-mobile-nav-close,
  .aq-ds-reference .aq-mobile-nav-toggle {
    position: relative;
    display: inline-flex;
    width: auto;
    min-width: var(--aq-geometry-touch-target-min);
    min-height: var(--aq-geometry-touch-target-min);
    padding: var(--aq-spacing-2) var(--aq-spacing-3);
    align-items: center;
    justify-content: center;
    gap: var(--aq-spacing-2);
    border: 1px solid var(--aq-color-border-strong);
    border-radius: var(--aq-geometry-radius-control);
    background: var(--surface, var(--aq-color-surface));
    color: var(--ink, var(--aq-color-text-primary));
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
  }

  .aq-mobile-nav-toggle__icon {
    position: relative;
    width: 20px;
    height: 14px;
    flex: 0 0 20px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
  }

  .aq-mobile-nav-toggle__icon::before {
    position: absolute;
    top: 4px;
    right: 0;
    left: 0;
    height: 2px;
    background: currentColor;
    content: "";
  }

  .aq-mobile-nav-close {
    width: var(--aq-geometry-touch-target-min);
    align-self: end;
    padding: 0;
  }

  .aq-ds-reference .aq-mobile-nav-close {
    display: inline-flex !important;
  }

  .aq-mobile-nav-close::before,
  .aq-mobile-nav-close::after {
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
    content: "";
  }

  .aq-mobile-nav-close::before { transform: rotate(45deg); }
  .aq-mobile-nav-close::after { transform: rotate(-45deg); }

  .aq-mobile-navigation-panel {
    position: fixed;
    z-index: var(--aq-z_index-dialog);
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: min(360px, calc(100vw - 16px));
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: max(var(--aq-spacing-4), env(safe-area-inset-top, 0px));
    padding-right: max(var(--aq-spacing-4), env(safe-area-inset-right, 0px));
    padding-bottom: max(var(--aq-spacing-4), env(safe-area-inset-bottom, 0px));
    padding-left: max(var(--aq-spacing-4), env(safe-area-inset-left, 0px));
    flex-direction: column;
    gap: var(--aq-spacing-4);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid var(--line, var(--aq-color-border));
    background: var(--surface, var(--aq-color-surface));
    box-shadow: var(--aq-elevation-dialog);
    color: var(--ink, var(--aq-color-text-primary));
    touch-action: pan-y;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--aq-motion-normal) var(--aq-motion-easing), visibility var(--aq-motion-normal) var(--aq-motion-easing);
  }

  .aq-mobile-navigation-panel--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .aq-mobile-nav-backdrop {
    position: fixed;
    z-index: var(--aq-z_index-overlay);
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: var(--aq-color-overlay);
    cursor: default;
  }

  .aq-mobile-nav-backdrop[hidden] {
    display: none;
  }

  .aq-ds-reference .aq-mobile-nav-backdrop:not([hidden]) {
    display: block !important;
  }

  .aq-mobile-navigation-panel :is(.topnav, .nav-links, .aq-reference-nav, .nav-meta, .links) {
    display: flex !important;
    width: 100% !important;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: var(--aq-spacing-2) !important;
  }

  .aq-mobile-navigation-panel :is(.topnav, .nav-links, .aq-reference-nav) > a,
  .aq-mobile-navigation-panel .links > :is(a, button, .button),
  .aq-mobile-navigation-panel > .language-switcher,
  .aq-mobile-navigation-panel > .aq-field-group,
  .aq-mobile-navigation-panel .nav-meta :is(.session-pill, .auth-status) {
    width: 100% !important;
    max-width: 100%;
    min-height: var(--aq-geometry-touch-target-min);
    justify-content: flex-start;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .aq-mobile-navigation-panel :is(.topnav, .nav-links, .aq-reference-nav) > a:not(.button),
  .aq-mobile-navigation-panel .links > a:not(.button) {
    color: var(--ink, var(--aq-color-text-primary)) !important;
  }

  .aq-mobile-navigation-panel :is(.topnav, .nav-links, .aq-reference-nav, .links) > a:not(.button):is(:hover, :focus-visible, [aria-current="page"]) {
    color: var(--ink, var(--aq-color-text-primary)) !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
  }

  .aq-mobile-navigation-panel .nav-meta {
    padding-top: var(--aq-spacing-4);
    border-top: 1px solid var(--line, var(--aq-color-border));
  }

  .aq-mobile-navigation-panel .auth-status {
    margin: 0;
  }

  .aq-mobile-navigation-panel .language-switcher,
  .aq-mobile-navigation-panel select {
    min-height: var(--aq-geometry-touch-target-min);
  }
}

@media (max-width: 767px) {
  .aq-auth-shell .nav:not(.aq-navigation-enhanced) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .aq-auth-shell .nav:not(.aq-navigation-enhanced) > .language-switcher {
    width: min(140px, 42vw);
  }

  .aq-auth-shell .nav:not(.aq-navigation-enhanced) > .nav-meta {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: var(--aq-spacing-2);
    border-top: 1px solid var(--line, var(--aq-color-border));
  }

  .aq-action-bar {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .aq-action-bar > :is(.button, .aq-button, button, a) {
    width: 100%;
    min-height: var(--aq-geometry-touch-target-min);
  }

  .aq-dialog {
    width: calc(100% - 32px);
    padding: var(--aq-spacing-5);
  }

  .app-preview-frame {
    min-height: 280px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .aq-mobile-navigation-panel {
    gap: var(--aq-spacing-2);
    padding-top: max(var(--aq-spacing-2), env(safe-area-inset-top, 0px));
    padding-bottom: max(var(--aq-spacing-2), env(safe-area-inset-bottom, 0px));
  }

  .aq-ds-pilot main,
  .aq-reference-main {
    padding-block: var(--aq-spacing-6);
  }

  .app-preview-frame {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aq-mobile-navigation-panel {
    transition-duration: var(--aq-motion-reduced) !important;
  }
}

/* Stage 6: detailed visual and technical polish */

body:is(.aq-ds-pilot, .aq-ds-reference) {
  background: var(--aq-color-background-page);
  color: var(--aq-color-text-primary);
  text-rendering: optimizeLegibility;
}

body:is(.aq-ds-pilot, .aq-ds-reference) :is(h1, h2, h3, h4, p, a, button, input, select, textarea, label, small) {
  letter-spacing: 0;
}

.aq-ds-pilot h1,
.aq-ds-reference h1 {
  font-size: var(--aq-typography-h1-size);
  line-height: var(--aq-typography-h1-line-height);
  font-weight: var(--aq-typography-h1-weight);
}

.aq-ds-pilot h2,
.aq-ds-reference h2 {
  font-size: var(--aq-typography-h2-size);
  line-height: var(--aq-typography-h2-line-height);
  font-weight: var(--aq-typography-h2-weight);
}

.aq-ds-pilot h3,
.aq-ds-reference h3 {
  font-size: var(--aq-typography-h3-size);
  line-height: var(--aq-typography-h3-line-height);
}

.aq-ds-pilot :is(p, li, dd),
.aq-ds-reference :is(p, li, dd) {
  line-height: var(--aq-typography-body-line-height);
}

.aq-ds-pilot :is(.shell, .aq-main, .aq-reference-main),
.aq-ds-reference :is(.shell, .aq-main, .aq-reference-main) {
  max-width: var(--aq-geometry-container-content);
}

.aq-ds-pilot :is(.card, .stat, .panel, .aq-card, .aq-status-card, .aq-validation-summary, .aq-publication-status, .aq-information-panel, .aq-empty-state),
.aq-ds-reference :is(.card, .stat, .panel, .aq-card, .aq-status-card, .aq-validation-summary, .aq-publication-status, .aq-information-panel, .aq-empty-state) {
  border-color: var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-card);
  background: var(--aq-color-surface);
  box-shadow: var(--aq-elevation-card);
}

.aq-ds-pilot :is(.card, .stat, .panel, .aq-card):hover {
  border-color: var(--aq-color-border-strong);
}

.aq-ds-pilot :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)),
.aq-ds-reference :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)) {
  gap: var(--aq-spacing-2);
  border-radius: var(--aq-geometry-radius-control);
  transition:
    background-color var(--aq-motion-fast) var(--aq-motion-easing),
    border-color var(--aq-motion-fast) var(--aq-motion-easing),
    color var(--aq-motion-fast) var(--aq-motion-easing),
    box-shadow var(--aq-motion-fast) var(--aq-motion-easing),
    transform var(--aq-motion-fast) var(--aq-motion-easing);
}

.aq-ds-pilot :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)):not(:disabled):hover,
.aq-ds-reference :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)):not(:disabled):hover {
  box-shadow: var(--aq-elevation-interactive);
  transform: translateY(-1px);
}

.aq-ds-pilot :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)):not(:disabled):active,
.aq-ds-reference :is(.button, .aq-button, button:not(.aq-mobile-nav-backdrop)):not(:disabled):active {
  box-shadow: none;
  transform: translateY(0);
}

.aq-icon {
  display: inline-block;
  width: var(--aq-geometry-icon-default);
  height: var(--aq-geometry-icon-default);
  flex: 0 0 var(--aq-geometry-icon-default);
  vertical-align: -0.2em;
}

.aq-ds-pilot :is(.flow-icon, .install-icon) .aq-icon {
  width: var(--aq-geometry-icon-large);
  height: var(--aq-geometry-icon-large);
  flex-basis: var(--aq-geometry-icon-large);
}

.aq-icon--loader-circle {
  animation: aq-polish-spin 900ms linear infinite;
}

.aq-has-icon {
  align-items: center;
}

.aq-status-badge.aq-has-icon,
.aq-alert.aq-has-icon,
.trust-row > .aq-has-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--aq-spacing-2);
}

.aq-status-badge .aq-icon {
  width: var(--aq-geometry-icon-small);
  height: var(--aq-geometry-icon-small);
  flex-basis: var(--aq-geometry-icon-small);
}

.aq-alert.aq-has-icon {
  width: 100%;
  align-items: flex-start;
}

.aq-alert.aq-has-icon > .aq-icon {
  margin-top: 2px;
}

.aq-ds-pilot :is(input, select, textarea, .input),
.aq-ds-reference :is(input, select, textarea, .input) {
  border-color: var(--aq-color-border-strong);
  background: var(--aq-color-surface);
  color: var(--aq-color-text-primary);
  box-shadow: none;
}

.aq-ds-pilot :is(input, textarea, .input)::placeholder {
  color: var(--aq-color-text-muted);
  opacity: 1;
}

.aq-ds-pilot :is(input, select, textarea, .input):hover {
  border-color: var(--aq-color-action-primary);
}

.aq-ds-pilot.aq-auth-shell .shell > main {
  width: min(calc(100% - 32px), var(--aq-geometry-container-reading));
  max-width: var(--aq-geometry-container-reading);
  margin-inline: auto;
  padding: var(--aq-spacing-8) 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.aq-auth-shell main > p:not(.eyebrow, .label, [role="status"]) {
  max-width: 62ch;
}

.aq-auth-shell :is(label, label span) {
  color: var(--aq-color-text-primary);
}

.aq-auth-shell .auth-status {
  max-width: 48ch;
}

.aq-cabinet-shell .hero {
  gap: var(--aq-spacing-6);
  align-items: stretch;
}

.aq-overview-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--aq-color-border);
}

.aq-cabinet-shell [data-apps-status] {
  min-height: calc(var(--aq-spacing-16) + var(--aq-spacing-2));
}

.aq-cabinet-shell [data-apps-overview] {
  min-height: calc(var(--aq-spacing-16) + var(--aq-spacing-16) + var(--aq-spacing-16) + var(--aq-spacing-12));
}

.aq-cabinet-shell [data-apps-list] > .card {
  min-height: calc(var(--aq-spacing-16) + var(--aq-spacing-16) + var(--aq-spacing-16) + var(--aq-spacing-16) + var(--aq-spacing-4));
}

.aq-overview-metric {
  display: grid;
  min-width: 0;
  gap: var(--aq-spacing-1);
  padding: var(--aq-spacing-3) 0;
  border-bottom: 1px solid var(--aq-color-border);
}

.aq-overview-metric:nth-child(odd) {
  padding-right: var(--aq-spacing-3);
  border-right: 1px solid var(--aq-color-border);
}

.aq-overview-metric:nth-child(even) {
  padding-left: var(--aq-spacing-3);
}

.aq-overview-metric span,
.aq-overview-metric small {
  color: var(--aq-color-text-secondary);
}

.aq-overview-metric strong {
  font-size: var(--aq-typography-h2-size);
  line-height: var(--aq-typography-h2-line-height);
}

.aq-cabinet-shell .hero > .card:first-child {
  padding: var(--aq-spacing-6) 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.aq-cabinet-shell .hero > .card:first-child:hover {
  border-color: transparent;
}

.aq-cabinet-shell .hero > .stat {
  background: var(--aq-color-surface-elevated);
}

.aq-cabinet-shell .apps-section > .card,
.aq-cabinet-shell [data-apps-list] > .card,
.aq-cabinet-shell .aq-application-card {
  position: relative;
  overflow: hidden;
}

.aq-cabinet-shell .apps-section > .card::before,
.aq-cabinet-shell [data-apps-list] > .card::before,
.aq-cabinet-shell .aq-application-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--aq-color-action-primary);
  content: "";
}

.aq-cabinet-shell :is(.aq-validation-summary, .aq-publication-status) {
  padding: var(--aq-spacing-6);
  border-top: 3px solid var(--aq-color-information);
}

.aq-cabinet-shell .aq-validation-summary:has(.aq-status-badge--success),
.aq-cabinet-shell .aq-publication-status:has(.aq-status-badge--success) {
  border-top-color: var(--aq-color-success);
}

.aq-cabinet-shell .aq-validation-summary:has(.aq-status-badge--warning),
.aq-cabinet-shell .aq-publication-status:has(.aq-status-badge--warning) {
  border-top-color: var(--aq-color-warning);
}

.aq-cabinet-shell .aq-validation-summary:has(.aq-status-badge--error),
.aq-cabinet-shell .aq-publication-status:has(.aq-status-badge--error) {
  border-top-color: var(--aq-color-error);
}

.aq-public-application-shell .hero-panel {
  border-color: var(--aq-color-surface-inverse);
  background: var(--aq-color-surface-inverse);
  color: var(--aq-color-text-inverse);
  box-shadow: var(--aq-elevation-interactive);
}

.aq-public-application-shell .hero-panel :is(p, code) {
  color: #CBD8D3;
}

.aq-public-application-shell .hero-panel .aq-status-badge {
  color: var(--aq-color-success);
  background: var(--aq-color-success-surface);
}

.home-page .home-hero {
  width: min(calc(100% - 48px), var(--aq-geometry-container-content));
  max-width: none;
  padding: var(--aq-spacing-page) 0 var(--aq-spacing-section);
}

.home-page .home-hero h1 {
  max-width: 13ch;
  margin-inline: auto;
  color: var(--aq-color-text-primary);
  font-size: var(--aq-typography-display-size);
  line-height: var(--aq-typography-display-line-height);
  font-weight: var(--aq-typography-display-weight);
}

.home-page .home-hero h1 span:first-child {
  color: var(--aq-color-text-primary);
}

.home-page .home-hero h1 span:last-child {
  color: var(--aq-color-action-primary);
}

.home-page .home-hero > p {
  max-width: 66ch;
  font-size: var(--aq-typography-body-large-size);
  line-height: var(--aq-typography-body-large-line-height);
}

.aq-hero-flow {
  position: relative;
  display: grid;
  max-width: 920px;
  margin: var(--aq-spacing-12) auto 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--aq-spacing-4);
}

.aq-hero-flow::before {
  position: absolute;
  top: 31px;
  right: 12%;
  left: 12%;
  height: 2px;
  background: var(--aq-color-border);
  content: "";
}

.aq-hero-flow__step {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: var(--aq-spacing-3);
  color: var(--aq-color-text-secondary);
  font-size: var(--aq-typography-label-size);
  font-weight: var(--aq-typography-label-weight);
  line-height: 1.35;
  text-align: center;
}

.aq-hero-flow__icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--aq-color-border);
  border-radius: 50%;
  background: var(--aq-color-surface);
  color: var(--aq-color-action-primary);
  box-shadow: 0 0 0 8px var(--aq-color-background-page);
}

.aq-hero-flow__icon .aq-icon {
  width: var(--aq-geometry-icon-large);
  height: var(--aq-geometry-icon-large);
  flex-basis: var(--aq-geometry-icon-large);
}

.aq-hero-flow__step:last-child .aq-hero-flow__icon {
  border-color: var(--aq-color-action-primary);
  background: var(--aq-color-action-primary);
  color: var(--aq-color-text-inverse);
}

.home-page .trust-row {
  margin-top: var(--aq-spacing-10);
  gap: var(--aq-spacing-6);
  color: var(--aq-color-text-secondary);
  font-size: var(--aq-typography-body-small-size);
}

.home-page .trust-row > span {
  white-space: normal;
}

.home-page .trust-row .aq-icon {
  width: var(--aq-geometry-icon-small);
  height: var(--aq-geometry-icon-small);
  flex-basis: var(--aq-geometry-icon-small);
  color: var(--aq-color-success);
}

.home-page .how-section {
  padding-top: var(--aq-spacing-section);
}

.home-page .how-card {
  min-height: 0;
  padding: var(--aq-spacing-6);
  text-align: left;
}

.home-page .how-card:hover {
  box-shadow: var(--aq-elevation-interactive);
}

.home-page .step-icon {
  width: 48px;
  height: 48px;
  margin: 0 0 var(--aq-spacing-5);
  border-radius: var(--aq-geometry-radius-card);
}

.home-page .step-icon .aq-icon {
  width: var(--aq-geometry-icon-large);
  height: var(--aq-geometry-icon-large);
  flex-basis: var(--aq-geometry-icon-large);
}

.home-page .home-install-section {
  border: 0;
  border-top: 1px solid var(--aq-color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-page .home-install-card {
  box-shadow: none;
}

.aq-ds-pilot :is(pre, code, .prompt-block) {
  border-color: var(--aq-color-border);
  background: var(--aq-color-surface-inverse);
  color: var(--aq-color-text-inverse);
}

.aq-ds-reference .aq-reference-section {
  border-top: 1px solid var(--aq-color-border);
}

.aq-reference-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aq-spacing-3);
}

.aq-reference-icon-row > span {
  display: inline-flex;
  min-height: var(--aq-geometry-touch-target-min);
  padding: var(--aq-spacing-2) var(--aq-spacing-3);
  align-items: center;
  gap: var(--aq-spacing-2);
  border: 1px solid var(--aq-color-border);
  border-radius: var(--aq-geometry-radius-control);
  background: var(--aq-color-surface-elevated);
  color: var(--aq-color-text-secondary);
  font-weight: var(--aq-typography-label-weight);
}

.aq-lifecycle-grid {
  display: grid;
  margin-block: var(--aq-spacing-5) var(--aq-spacing-8);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--aq-spacing-3);
}

.aq-lifecycle-state {
  min-width: 0;
  padding: var(--aq-spacing-4);
  border: 1px solid var(--aq-color-border);
  border-top-width: 3px;
  border-radius: var(--aq-geometry-radius-card);
  background: var(--aq-color-surface);
}

.aq-lifecycle-state--information { border-top-color: var(--aq-color-information); }
.aq-lifecycle-state--success { border-top-color: var(--aq-color-success); }
.aq-lifecycle-state--warning { border-top-color: var(--aq-color-warning); }
.aq-lifecycle-state--error { border-top-color: var(--aq-color-error); }

.aq-lifecycle-state p {
  margin-bottom: 0;
  color: var(--aq-color-text-secondary);
  font-size: var(--aq-typography-body-small-size);
}

.aq-polish-motion [data-polish-reveal],
.aq-polish-motion [data-hero-flow] .aq-hero-flow__step {
  opacity: 0;
  transform: translateY(8px);
}

.aq-polish-motion [data-polish-reveal].is-visible,
.aq-polish-motion [data-hero-flow].is-visible .aq-hero-flow__step {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--aq-motion-entry) var(--aq-motion-easing),
    transform var(--aq-motion-entry) var(--aq-motion-easing);
}

.aq-polish-motion [data-hero-flow].is-visible .aq-hero-flow__step:nth-child(2) { transition-delay: 120ms; }
.aq-polish-motion [data-hero-flow].is-visible .aq-hero-flow__step:nth-child(3) { transition-delay: 240ms; }
.aq-polish-motion [data-hero-flow].is-visible .aq-hero-flow__step:nth-child(4) { transition-delay: 360ms; }

@keyframes aq-polish-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
  .aq-ds-pilot.aq-auth-shell .shell > main {
    width: min(calc(100% - 24px), var(--aq-geometry-container-reading));
    padding: var(--aq-spacing-5) 0 0;
  }

  .aq-cabinet-shell .hero > .card:first-child {
    padding: var(--aq-spacing-4) 0;
  }

  .home-page .home-hero {
    width: min(calc(100% - 32px), var(--aq-geometry-container-content));
    padding-top: var(--aq-spacing-12);
  }

  .home-page .home-hero h1 {
    max-width: 12ch;
    font-size: 2.25rem;
    line-height: 1.12;
  }

  .aq-hero-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--aq-spacing-6) var(--aq-spacing-3);
  }

  .aq-hero-flow::before {
    display: none;
  }

  .aq-hero-flow__icon {
    width: 56px;
    height: 56px;
    box-shadow: none;
  }

  .home-page .trust-row {
    align-items: flex-start;
    gap: var(--aq-spacing-3);
  }

  .aq-lifecycle-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aq-polish-motion [data-polish-reveal],
  .aq-polish-motion [data-hero-flow] .aq-hero-flow__step,
  .aq-polish-motion [data-polish-reveal].is-visible,
  .aq-polish-motion [data-hero-flow].is-visible .aq-hero-flow__step {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .aq-icon--loader-circle {
    animation: none !important;
  }

  .aq-ds-pilot :is(.button, .aq-button, button),
  .aq-ds-reference :is(.button, .aq-button, button) {
    transform: none !important;
    transition-duration: var(--aq-motion-reduced) !important;
  }
}
