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

html:has(.aq-body) {
    color-scheme: light;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

.aq-body {
    min-width: 0;
    margin: 0;
    overflow-x: clip;
    background: var(--aq-background);
    color: var(--aq-text);
    font-family: var(--aq-font-sans);
    font-size: 15px;
    line-height: 1.58;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.aq-body img,
.aq-body svg {
    display: block;
    max-width: 100%;
}

.aq-body button,
.aq-body input,
.aq-body select,
.aq-body textarea {
    font: inherit;
}

.aq-body button,
.aq-body summary {
    cursor: pointer;
}

.aq-body a {
    color: var(--aq-info);
    text-underline-offset: 0.2em;
}

.aq-body :focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--aq-focus-ring);
}

.aq-body input::placeholder,
.aq-body textarea::placeholder {
    color: var(--aq-muted);
    opacity: 1;
}

.aq-body :target {
    scroll-margin-top: 88px;
}

.aq-skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 12px;
    padding: 10px 16px;
    border-radius: var(--aq-radius-md);
    background: var(--aq-primary-950);
    color: #fff;
    font-weight: 750;
    transform: translateY(-160%);
}

.aq-skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.aq-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.aq-container {
    width: min(calc(100% - 40px), var(--aq-landing-max));
    margin-inline: auto;
}

.aq-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.aq-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--aq-accent-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aq-section {
    padding-block: clamp(56px, 7vw, 88px);
}

.aq-section--compact {
    padding-block: clamp(44px, 5.5vw, 68px);
}

.aq-section--soft {
    border-block: 1px solid var(--aq-border);
    background: var(--aq-surface-alt);
}

.aq-section-heading {
    max-width: 660px;
    margin-bottom: 32px;
}

.aq-section-heading--center {
    margin-inline: auto;
    text-align: center;
}

.aq-section-heading h2 {
    margin: 9px 0 0;
    color: var(--aq-primary-950);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.aq-section-heading > p:last-child:not(.aq-eyebrow) {
    margin: 12px 0 0;
    color: var(--aq-muted);
}

.aq-stack {
    display: flex;
    flex-direction: column;
    gap: var(--aq-space-4);
}

.aq-cluster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--aq-space-3);
}

.aq-cluster--between {
    justify-content: space-between;
}

.aq-grid {
    display: grid;
    gap: var(--aq-space-6);
}

.aq-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aq-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.aq-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aq-button {
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--aq-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--aq-primary-900);
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease,
        box-shadow 150ms ease;
}

.aq-button:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.aq-button--primary {
    background: var(--aq-primary-900);
    color: #fff;
    box-shadow: 0 8px 22px rgb(7 46 99 / 18%);
}

/* Keep link-based primary actions readable over the global AqshaLink link colour. */
.aq-body a.aq-button--primary {
    color: #fff;
}

.aq-button--primary:hover {
    background: var(--aq-primary-800);
    color: #fff;
}

.aq-button--secondary {
    border-color: var(--aq-control-border);
    background: var(--aq-surface);
    color: var(--aq-primary-900);
}

.aq-button--secondary:hover {
    border-color: var(--aq-primary-700);
    background: var(--aq-surface-alt);
}

.aq-body .button-secondary,
.aq-body .button.secondary {
    border-color: var(--aq-control-border);
    background: var(--aq-surface);
    color: var(--aq-primary-900);
}

.aq-body .button-secondary:hover,
.aq-body .button.secondary:hover {
    border-color: var(--aq-primary-700);
    background: var(--aq-surface-alt);
    color: var(--aq-primary-900);
}

.aq-body .button-primary,
.aq-body .button.primary {
    border-color: var(--aq-primary-900);
    background: var(--aq-primary-900);
    color: #fff;
}

.aq-body .button-primary:hover,
.aq-body .button.primary:hover {
    border-color: var(--aq-primary-800);
    background: var(--aq-primary-800);
    color: #fff;
}

.aq-body .button-danger,
.aq-body .button.danger {
    border-color: var(--aq-danger);
    background: var(--aq-surface);
    color: var(--aq-danger);
}

.aq-body .button-danger:hover,
.aq-body .button.danger:hover {
    border-color: var(--aq-danger);
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-body .eyebrow,
.aq-body .card-kicker {
    color: var(--aq-accent-700);
}

.aq-button--ghost {
    background: transparent;
    color: var(--aq-primary-900);
}

.aq-button--ghost:hover {
    background: var(--aq-surface-alt);
}

.aq-button--danger {
    background: var(--aq-danger);
    color: #fff;
}

.aq-button--large {
    min-height: 54px;
    padding-inline: 24px;
    font-size: 16px;
}

.aq-button--compact {
    min-height: 42px;
    padding: 8px 16px;
    font-size: 14px;
}

.aq-button[aria-disabled="true"],
.aq-button:disabled,
.aq-body a.aq-button[aria-disabled="true"] {
    border-color: var(--aq-control-border);
    background: var(--aq-disabled-bg);
    color: var(--aq-disabled-text);
    opacity: 1;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.aq-body .button[aria-disabled="true"],
.aq-body .button:disabled,
.aq-body button:disabled:not(.aq-button) {
    border-color: var(--aq-control-border);
    background: var(--aq-disabled-bg);
    color: var(--aq-disabled-text);
    opacity: 1;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.aq-text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--aq-primary-800);
    font-weight: 750;
    text-decoration: none;
}

.aq-text-link:hover {
    text-decoration: underline;
}

.aq-badge,
.aq-status-badge,
.aq-risk-badge {
    min-height: 25px;
    padding: 3px 10px;
    border-radius: var(--aq-radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}

.aq-badge--info,
.aq-badge-info,
.aq-status-badge--info {
    background: var(--aq-info-bg);
    color: var(--aq-info);
}

.aq-badge--success,
.aq-status-badge--success {
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-badge--warning,
.aq-status-badge--warning {
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-badge--danger,
.aq-status-badge--danger {
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-badge--neutral,
.aq-badge-muted,
.aq-status-badge--neutral {
    background: var(--aq-neutral-bg);
    color: var(--aq-text-secondary);
}

.aq-card,
.aq-panel,
.aq-kpi-card,
.aq-market-card,
.aq-record-item,
.aq-form-shell,
.aq-filter-panel {
    min-width: 0;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    background: var(--aq-surface);
    box-shadow: var(--aq-shadow-xs);
}

.aq-card,
.aq-panel,
.aq-form-shell,
.aq-filter-panel {
    padding: clamp(var(--aq-space-6), 2.2vw, var(--aq-space-7));
}

.aq-panel-header,
.aq-card__header,
.aq-page-header,
.aq-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--aq-space-4);
}

.aq-panel-header,
.aq-card__header,
.aq-panel__header {
    margin-bottom: var(--aq-space-5);
}

.aq-panel-header h2,
.aq-panel-header h3,
.aq-card__header h2,
.aq-card__header h3,
.aq-panel__header h2,
.aq-panel__header h3 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 18px;
    line-height: 1.3;
}

.aq-panel-header p,
.aq-card__header p,
.aq-panel__header p {
    margin: 5px 0 0;
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-panel-body,
.aq-panel__body {
    min-width: 0;
}

/* Authentication templates reuse a few Stage 1 structural classes. Keep the
 * heading as one readable column and preserve the dark security callout after
 * the generic AqshaLink card surface is applied. */
.aq-body .auth-panel .aq-card__header {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
}

.aq-body .auth-aside.aq-card {
    border-color: rgb(255 255 255 / 14%);
    background:
        radial-gradient(circle at 90% 10%, rgb(45 212 191 / 22%), transparent 13rem),
        var(--aq-primary-950);
    color: #fff;
}

.aq-body .auth-aside.aq-card .auth-aside-title {
    color: #fff;
}

.aq-body .auth-aside.aq-card > p:not(.auth-aside-title) {
    color: rgb(255 255 255 / 78%);
}

.aq-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--aq-space-4);
}

.aq-kpi-card {
    min-height: 132px;
    padding: var(--aq-space-5);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: var(--aq-space-4);
}

.aq-kpi-card.aq-placeholder {
    min-height: 132px;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
}

.aq-kpi-card.is-muted {
    background: #fbfcfe;
}

.aq-kpi-label,
.aq-kpi-card__label {
    margin: 0;
    color: var(--aq-muted);
    font-size: 13px;
    font-weight: 700;
}

.aq-kpi-value,
.aq-kpi-card__value {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
    color: var(--aq-primary-950);
    font-size: clamp(23px, 2.4vw, 30px);
    font-weight: 820;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.aq-kpi-meta,
.aq-kpi-card__meta {
    display: block;
    margin-top: 6px;
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-kpi-card > .aq-kpi-meta:last-child,
.aq-kpi-card > .aq-badge:last-child {
    margin-top: auto;
}

.aq-kpi-card__icon,
.aq-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--aq-radius-lg);
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    background: var(--aq-accent-100);
    color: var(--aq-accent-700);
}

.aq-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--aq-space-6);
}

.aq-dashboard-grid--wide {
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
}

.aq-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--aq-space-5);
}

.aq-alert,
.aq-callout,
.aq-hint {
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--aq-space-3);
}

.aq-alert,
.aq-callout {
    padding: 14px 16px;
}

.aq-hint {
    padding: 10px 12px;
    background: var(--aq-surface-alt);
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-alert--info,
.aq-callout--info {
    border-color: #d5e3fc;
    background: var(--aq-info-bg);
    color: var(--aq-primary-950);
}

.aq-alert--success,
.aq-callout--success {
    border-color: #c8ede1;
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-alert--warning,
.aq-callout--warning {
    border-color: #f2dcad;
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-alert--danger,
.aq-callout--danger {
    border-color: #f3cdd1;
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-alert--info :where(h2, h3, p, li),
.aq-alert--success :where(h2, h3, p, li),
.aq-alert--warning :where(h2, h3, p, li),
.aq-alert--danger :where(h2, h3, p, li),
.aq-callout--info :where(h2, h3, p, li),
.aq-callout--success :where(h2, h3, p, li),
.aq-callout--warning :where(h2, h3, p, li),
.aq-callout--danger :where(h2, h3, p, li) {
    color: inherit;
}

.aq-alert h2,
.aq-alert h3,
.aq-callout h2,
.aq-callout h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.aq-alert > .aq-button,
.aq-callout > .aq-button {
    margin-left: auto;
    flex: 0 0 auto;
}

.aq-alert p,
.aq-callout p,
.aq-hint p {
    margin: 0;
}

.aq-placeholder,
.aq-empty-state {
    min-height: 220px;
    padding: clamp(24px, 4vw, 44px);
    border: 1px dashed var(--aq-border-strong);
    border-radius: var(--aq-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--aq-space-3);
    background: color-mix(in srgb, var(--aq-surface) 86%, var(--aq-surface-alt));
    color: var(--aq-muted);
    text-align: center;
}

.aq-placeholder--horizontal {
    min-height: 156px;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--aq-space-6);
    text-align: left;
}

.aq-placeholder h2,
.aq-placeholder h3,
.aq-empty-state h2,
.aq-empty-state h3 {
    margin: 8px 0 2px;
    color: var(--aq-primary-950);
}

.aq-placeholder p,
.aq-empty-state p {
    max-width: 620px;
    margin: 0;
}

.aq-status-page-wrap {
    padding-block: clamp(var(--aq-space-10), 8vw, 88px);
}

.aq-status-page {
    max-width: 680px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: var(--aq-space-4);
    text-align: center;
}

.aq-status-page__icon {
    width: 72px;
    height: 72px;
    border-radius: var(--aq-radius-xl);
    display: grid;
    place-items: center;
    background: var(--aq-info-bg);
    color: var(--aq-info);
}

.aq-status-page__icon--warning {
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-status-page__icon--danger {
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-status-page__icon svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.aq-status-page__code {
    margin: 0;
    color: var(--aq-muted);
    font: 750 13px/1 var(--aq-font-mono);
    letter-spacing: 0.08em;
}

.aq-status-page h1 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
}

.aq-status-page__message {
    max-width: 560px;
    margin: 0;
    color: var(--aq-text-secondary);
    font-size: 16px;
    line-height: 1.65;
}

.aq-status-page .aq-page-actions {
    justify-content: center;
    margin-top: var(--aq-space-2);
}

.aq-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    background: var(--aq-surface);
    overscroll-behavior-inline: contain;
}

.aq-table,
.aq-data-table,
.aq-table-wrap > table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.aq-table caption,
.aq-data-table caption,
.aq-table-wrap > table caption {
    padding: 12px 16px;
    color: var(--aq-muted);
    text-align: left;
}

.aq-table th,
.aq-table td,
.aq-data-table th,
.aq-data-table td,
.aq-table-wrap > table th,
.aq-table-wrap > table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--aq-border);
    text-align: left;
    vertical-align: middle;
}

.aq-table th,
.aq-data-table th,
.aq-table-wrap > table th {
    background: #fbfcfe;
    color: var(--aq-muted);
    font-size: 12px;
    font-weight: 800;
}

.aq-table tbody tr:last-child td,
.aq-data-table tbody tr:last-child td,
.aq-table-wrap > table tbody tr:last-child td {
    border-bottom: 0;
}

.aq-record-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
}

.aq-record-item {
    padding: var(--aq-space-4);
}

.aq-record-list .aq-record-item + .aq-record-item {
    margin-top: var(--aq-space-3);
}

.aq-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--aq-space-3);
}

.aq-data-list {
    margin: 0;
    display: grid;
    gap: 10px;
}

.aq-data-list > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1.25fr);
    gap: var(--aq-space-3);
}

.aq-data-list dt {
    color: var(--aq-muted);
}

.aq-data-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--aq-primary-950);
    font-weight: 700;
}

.aq-data-list--compact {
    gap: 7px;
}

.aq-data-list--compact > div {
    grid-template-columns: minmax(88px, 0.8fr) minmax(0, 1.2fr);
    gap: 8px;
    font-size: 12px;
}

.aq-progress {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    list-style: none;
}

.aq-progress-item {
    position: relative;
    min-width: 0;
    padding: 32px 10px 0 0;
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-progress-item::before {
    position: absolute;
    z-index: 2;
    top: 5px;
    left: 0;
    width: 16px;
    height: 16px;
    border: 3px solid var(--aq-surface);
    border-radius: 50%;
    background: var(--aq-control-border);
    box-shadow: 0 0 0 1px var(--aq-control-border);
    content: "";
}

.aq-progress-item::after {
    position: absolute;
    top: 12px;
    right: 0;
    left: 16px;
    height: 2px;
    background: var(--aq-border);
    content: "";
}

.aq-progress-item:last-child::after {
    display: none;
}

.aq-progress-item.is-complete::before,
.aq-progress-item.is-current::before {
    background: var(--aq-accent-600);
    box-shadow: 0 0 0 1px var(--aq-accent-600);
}

.aq-progress-item.is-complete::after {
    background: var(--aq-accent-500);
}

.aq-progress-item.is-current {
    color: var(--aq-primary-950);
    font-weight: 800;
}

.aq-progress-item.is-locked {
    color: var(--aq-muted);
    opacity: 1;
}

.aq-progress-marker {
    position: absolute;
    z-index: 3;
    top: 5px;
    left: 0;
    width: 16px;
    height: 16px;
    border: 3px solid var(--aq-surface);
    border-radius: 50%;
    background: var(--aq-control-border);
    box-shadow: 0 0 0 1px var(--aq-control-border);
}

.aq-progress-item.is-complete .aq-progress-marker,
.aq-progress-item.is-current .aq-progress-marker {
    background: var(--aq-accent-600);
    box-shadow: 0 0 0 1px var(--aq-accent-600);
}

.aq-status-list,
.aq-help-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
}

.aq-status-list {
    margin-bottom: var(--aq-space-5);
}

.aq-status-list li {
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--aq-muted);
    background: var(--aq-surface-alt);
}

.aq-status-list li > span:first-child {
    width: 12px;
    height: 12px;
    border: 2px solid var(--aq-border-strong);
    border-radius: 50%;
    flex: 0 0 12px;
}

.aq-status-list li.is-complete {
    color: var(--aq-text-secondary);
}

.aq-status-list li.is-complete > span:first-child {
    border-color: var(--aq-success);
    background: var(--aq-success);
    box-shadow: inset 0 0 0 2px var(--aq-surface);
}

.aq-help-list li {
    position: relative;
    padding-left: 22px;
    color: var(--aq-text-secondary);
}

.aq-help-list li::before {
    position: absolute;
    left: 0;
    color: var(--aq-accent-700);
    font-weight: 900;
    content: "✓";
}

.aq-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.aq-field label,
.aq-field__label {
    color: var(--aq-text-secondary);
    font-size: 13px;
    font-weight: 750;
}

.aq-input,
.aq-select,
.aq-textarea,
.aq-field input,
.aq-field select,
.aq-field textarea,
.aq-body .field input,
.aq-body .field select,
.aq-body .field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--aq-control-border);
    border-radius: var(--aq-radius-md);
    background: var(--aq-surface);
    color: var(--aq-text);
}

.aq-body input:disabled,
.aq-body select:disabled,
.aq-body textarea:disabled {
    border-color: var(--aq-control-border);
    background: var(--aq-disabled-bg);
    color: var(--aq-disabled-text);
    opacity: 1;
    -webkit-text-fill-color: var(--aq-disabled-text);
}

.aq-body input[readonly],
.aq-body textarea[readonly] {
    background: var(--aq-surface-alt);
    color: var(--aq-text-secondary);
}

.aq-body :is(input, select, textarea)[aria-invalid="true"] {
    border-width: 2px;
    border-color: var(--aq-danger);
}

.aq-textarea,
.aq-field textarea,
.aq-body .field textarea {
    min-height: 112px;
    resize: vertical;
}

.aq-input:focus,
.aq-select:focus,
.aq-textarea:focus,
.aq-field input:focus,
.aq-field select:focus,
.aq-field textarea:focus,
.aq-body .field input:focus-visible,
.aq-body .field select:focus-visible,
.aq-body .field textarea:focus-visible {
    border-color: var(--aq-info);
    outline: 0;
    box-shadow: var(--aq-focus-ring);
}

.aq-body :is(input, select, textarea)[aria-invalid="true"]:focus {
    border-color: var(--aq-danger);
}

.aq-field__hint {
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, auto));
    align-items: end;
    gap: 10px;
}

.aq-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    background: var(--aq-surface-alt);
    color: var(--aq-accent-700);
    font-size: 14px;
    font-weight: 850;
    object-fit: cover;
}

.aq-market-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: var(--aq-space-3);
}

.aq-market-card h3 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 20px;
}

.aq-risk-badge {
    color: var(--aq-warning);
    background: var(--aq-warning-bg);
}

.aq-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.aq-page .aq-section-heading,
.aq-dashboard .aq-section-heading {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--aq-space-4);
}

.aq-page .aq-section-heading h2,
.aq-dashboard .aq-section-heading h2 {
    margin: 0;
    font-size: 21px;
}

.aq-page .aq-section-heading p,
.aq-dashboard .aq-section-heading p {
    margin: 5px 0 0;
    color: var(--aq-muted);
}

.aq-meta-pill,
.aq-placeholder__badge,
.aq-status {
    min-height: 25px;
    padding: 3px 10px;
    border-radius: var(--aq-radius-pill);
    display: inline-flex;
    align-items: center;
    color: var(--aq-text-secondary);
    background: var(--aq-neutral-bg);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}

.aq-status--success {
    color: var(--aq-success);
    background: var(--aq-success-bg);
}

.aq-status--warning {
    color: var(--aq-warning);
    background: var(--aq-warning-bg);
}

.aq-status--danger {
    color: var(--aq-danger);
    background: var(--aq-danger-bg);
}

.aq-stat-card {
    min-height: 130px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
}

.aq-stat-card__label {
    color: var(--aq-muted);
    font-size: 13px;
    font-weight: 750;
}

.aq-stat-card strong {
    margin-top: 5px;
    color: var(--aq-primary-950);
    font-size: clamp(25px, 2.5vw, 32px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.aq-stat-card small {
    margin-top: auto;
    color: var(--aq-muted);
}

.aq-stat-card--success {
    border-color: #c8e9df;
    background: linear-gradient(145deg, var(--aq-surface), var(--aq-success-bg));
}

.aq-stat-card--warning {
    border-color: #f0d9aa;
    background: linear-gradient(145deg, var(--aq-surface), var(--aq-warning-bg));
}

.aq-card--muted {
    background: #fbfcfe;
}

.aq-card--soft {
    background: var(--aq-surface-alt);
    box-shadow: none;
}

.aq-card--action {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    color: var(--aq-text-secondary);
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.aq-card--action:hover {
    border-color: #aabbd0;
    color: var(--aq-text-secondary);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--aq-shadow-card);
}

.aq-card--action strong,
.aq-card--action h3 {
    margin: 0;
    color: var(--aq-primary-950);
}

.aq-card--action p,
.aq-card--action span {
    margin: 0;
    color: var(--aq-muted);
}

.aq-action-list {
    display: flex;
    flex-direction: column;
}

.aq-action-row {
    min-width: 0;
    min-height: 60px;
    padding: 12px 2px;
    border-top: 1px solid var(--aq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--aq-text-secondary);
    text-decoration: none;
}

.aq-action-row:first-child {
    border-top: 0;
}

.aq-action-row:hover {
    color: var(--aq-info);
    text-decoration: none;
}

.aq-action-row > span:first-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.aq-action-row strong {
    color: var(--aq-primary-950);
}

.aq-action-row small {
    overflow: hidden;
    color: var(--aq-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aq-placeholder__chart {
    width: min(100%, 320px);
    height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
}

.aq-placeholder__chart span {
    width: 12%;
    min-height: 18px;
    border-radius: 6px 6px 2px 2px;
    background: var(--aq-border-strong);
}

.aq-placeholder__chart span:nth-child(2) {
    height: 42%;
}

.aq-placeholder__chart span:nth-child(3) {
    height: 70%;
}

.aq-placeholder__chart span:nth-child(4) {
    height: 54%;
}

.aq-placeholder__chart span:nth-child(5) {
    height: 86%;
}

.aq-three-column-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--aq-space-5);
}

.aq-compact-card {
    min-height: 174px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}

.aq-compact-card h3 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 16px;
}

.aq-compact-card p {
    margin: 8px 0 18px;
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-compact-card .aq-text-link {
    margin-top: auto;
}

.aq-compact-card.aq-placeholder {
    min-height: 174px;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

.aq-roles-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--aq-space-6);
}

.aq-roles-card h2 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 18px;
}

.aq-roles-card p {
    margin: 5px 0 0;
    color: var(--aq-muted);
}

.aq-chip-list {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.aq-chip-list li {
    padding: 6px 11px;
    border-radius: var(--aq-radius-pill);
    color: var(--aq-primary-800);
    background: var(--aq-info-bg);
    font-size: 12px;
    font-weight: 750;
}

/* Public shell */
.aq-public-header {
    position: sticky;
    z-index: 50;
    top: 0;
    min-height: 72px;
    border-bottom: 1px solid rgb(220 230 241 / 88%);
    background: rgb(255 255 255 / 94%);
    box-shadow: 0 1px 0 rgb(8 38 78 / 2%);
    backdrop-filter: blur(16px);
}

.aq-public-header__inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 40px);
}

.aq-public-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.aq-public-brand img {
    width: auto;
    height: 36px;
}

.aq-public-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 1.8vw, 26px);
    flex: 1 1 auto;
}

.aq-public-nav a {
    color: var(--aq-text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.aq-public-nav a:hover {
    color: var(--aq-primary-900);
}

.aq-public-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.aq-public-menu {
    position: relative;
    display: none;
}

.aq-public-menu > summary {
    width: 44px;
    height: 44px;
    border: 1px solid var(--aq-control-border);
    border-radius: var(--aq-radius-md);
    display: grid;
    place-items: center;
    color: var(--aq-primary-900);
    list-style: none;
}

.aq-public-menu > summary::-webkit-details-marker {
    display: none;
}

.aq-public-menu__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.aq-public-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(300px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    display: flex;
    flex-direction: column;
    background: var(--aq-surface);
    box-shadow: var(--aq-shadow-floating);
}

.aq-public-menu__panel a {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    color: var(--aq-text-secondary);
    font-weight: 700;
    text-decoration: none;
}

.aq-public-menu__panel a:hover {
    background: var(--aq-surface-alt);
    color: var(--aq-primary-900);
}

.aq-public-main {
    min-height: 60vh;
    outline: 0;
}

.aq-public-footer {
    padding: 48px 0 18px;
    border-top: 1px solid var(--aq-border);
    background: var(--aq-surface);
}

.aq-public-footer__grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(145px, 0.8fr));
    gap: 36px;
}

.aq-public-footer__about p {
    max-width: 380px;
    margin: 18px 0 0;
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-public-footer nav {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
}

.aq-public-footer nav strong {
    margin-bottom: 4px;
    color: var(--aq-primary-950);
    font-size: 13px;
}

.aq-public-footer nav a {
    color: var(--aq-muted);
    font-size: 13px;
    text-decoration: none;
}

.aq-public-footer nav a:hover {
    color: var(--aq-primary-800);
    text-decoration: underline;
}

.aq-public-footer__bottom {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid var(--aq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--aq-muted);
    font-size: 12px;
}

/* Landing */
.aq-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(58px, 7.5vw, 98px) 0 clamp(50px, 7vw, 84px);
    background: var(--aq-surface);
}

.aq-hero::before {
    position: absolute;
    top: -190px;
    right: -140px;
    width: 650px;
    height: 650px;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(17 170 169 / 10%), transparent 66%);
    content: "";
    pointer-events: none;
}

.aq-hero__grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    align-items: center;
    gap: clamp(40px, 7vw, 90px);
}

.aq-hero__copy h1 {
    max-width: 760px;
    margin: 18px 0 0;
    color: var(--aq-primary-950);
    font-size: clamp(38px, 5.1vw, 64px);
    font-weight: 830;
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.aq-hero__lead {
    max-width: 650px;
    margin: 24px 0 0;
    color: var(--aq-text-secondary);
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.55;
}

.aq-hero__actions {
    margin-top: 30px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.aq-hero__disclaimer {
    max-width: 670px;
    margin: 18px 0 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-hero__disclaimer .aq-icon {
    margin-top: 1px;
    color: var(--aq-accent-700);
}

.aq-product-preview {
    position: relative;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-2xl);
    background: rgb(255 255 255 / 94%);
    box-shadow: var(--aq-shadow-floating);
}

.aq-product-preview::after {
    position: absolute;
    z-index: -1;
    inset: 16px -16px -16px 16px;
    border-radius: inherit;
    background: var(--aq-primary-900);
    content: "";
}

.aq-product-preview__bar {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--aq-border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.aq-product-preview__bar div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.aq-product-preview__bar span:not(.aq-badge) {
    color: var(--aq-muted);
    font-size: 11px;
}

.aq-product-preview__bar strong {
    overflow: hidden;
    color: var(--aq-primary-950);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aq-preview-steps {
    margin: 22px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
}

.aq-preview-steps li {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--aq-surface);
}

.aq-preview-steps li.is-complete {
    border-color: #c7e9e5;
    background: #f8fdfc;
}

.aq-preview-steps li.is-locked {
    border-style: dashed;
    background: var(--aq-surface-alt);
}

.aq-preview-steps__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    background: var(--aq-accent-100);
    color: var(--aq-accent-700);
}

.aq-preview-steps li.is-locked .aq-preview-steps__icon {
    background: var(--aq-neutral-bg);
    color: var(--aq-muted);
}

.aq-preview-steps li div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.aq-preview-steps strong {
    color: var(--aq-primary-950);
    font-size: 14px;
}

.aq-preview-steps div span {
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-product-preview__notice {
    padding: 14px 16px;
    border-radius: var(--aq-radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--aq-info-bg);
}

.aq-product-preview__notice img {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
}

.aq-product-preview__notice p {
    margin: 0;
    color: var(--aq-text-secondary);
    font-size: 12px;
}

.aq-how-grid {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    list-style: none;
    counter-reset: none;
}

.aq-how-grid > li {
    position: relative;
    min-width: 0;
    min-height: 188px;
    padding: 24px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    gap: 18px;
    background: var(--aq-surface);
    box-shadow: var(--aq-shadow-xs);
}

.aq-how-grid > li.is-planned {
    border-style: dashed;
    background: #fbfcfe;
}

.aq-step-number {
    position: absolute;
    top: 12px;
    right: 14px;
    color: var(--aq-muted-light);
    font-size: 12px;
    font-weight: 850;
}

.aq-how-grid__icon {
    width: 46px;
    height: 46px;
    padding: 11px;
    border-radius: 14px;
    background: var(--aq-accent-100);
    color: var(--aq-accent-700);
}

.aq-how-grid h3 {
    margin: 1px 0 7px;
    color: var(--aq-primary-950);
    font-size: 17px;
}

.aq-how-grid p {
    margin: 0;
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-title-with-badge {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
}

.aq-title-with-badge h3 {
    margin-right: auto;
}

.aq-segment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.aq-segment-card {
    min-width: 0;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-xl);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    scroll-margin-top: 96px;
}

.aq-segment-card--accent {
    border-color: #c9e7e5;
    background: linear-gradient(135deg, #fff, #edf9f8);
}

.aq-segment-card--info {
    border-color: #d3e0f8;
    background: linear-gradient(135deg, #fff, #f0f5ff);
}

.aq-segment-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--aq-surface);
    color: var(--aq-accent-700);
    box-shadow: var(--aq-shadow-xs);
}

.aq-segment-card h3 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 22px;
}

.aq-segment-card p {
    margin: 8px 0 0;
    color: var(--aq-muted);
}

.aq-check-list {
    margin: 18px 0;
    padding: 0;
    display: grid;
    gap: 8px;
    list-style: none;
}

.aq-check-list li {
    position: relative;
    padding-left: 22px;
    color: var(--aq-text-secondary);
    font-size: 13px;
}

.aq-check-list li::before {
    position: absolute;
    top: 0.15em;
    left: 0;
    color: var(--aq-accent-700);
    font-weight: 900;
    content: "✓";
}

.aq-benefit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.aq-benefit-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    background: var(--aq-surface);
}

.aq-benefit-card img {
    width: 64px;
    height: 64px;
}

.aq-benefit-card h3 {
    margin: 16px 0 7px;
    color: var(--aq-primary-950);
    font-size: 16px;
}

.aq-benefit-card p {
    margin: 0;
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-tariff-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.aq-tariff-card {
    padding: 24px;
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    background: var(--aq-surface);
}

.aq-tariff-card h3 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: 16px;
}

.aq-tariff-card__value {
    margin: 14px 0 6px;
    color: var(--aq-accent-700);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 850;
    line-height: 1.1;
}

.aq-tariff-card p:last-child {
    color: var(--aq-muted);
    font-size: 13px;
}

.aq-faq-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
    align-items: start;
    gap: clamp(32px, 6vw, 78px);
}

.aq-faq-layout .aq-section-heading {
    margin: 0;
}

.aq-accordion {
    border: 1px solid var(--aq-border);
    border-radius: var(--aq-radius-lg);
    overflow: hidden;
    background: var(--aq-surface);
}

.aq-accordion details + details {
    border-top: 1px solid var(--aq-border);
}

.aq-accordion summary {
    min-height: 58px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--aq-primary-950);
    font-weight: 750;
    list-style: none;
}

.aq-accordion summary::-webkit-details-marker {
    display: none;
}

.aq-accordion summary:hover {
    background: var(--aq-surface-alt);
}

.aq-accordion details[open] summary .aq-icon {
    transform: rotate(180deg);
}

.aq-accordion details p {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--aq-muted);
}

/* Application shell shared by operator and user dashboards */
.aq-app-content {
    min-height: 100vh;
    outline: 0;
}

.aq-app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--aq-app-sidebar) minmax(0, 1fr);
    background: var(--aq-background);
}

.aq-sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 100vh;
    min-width: 0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, var(--aq-primary-950), var(--aq-primary-900));
}

.aq-sidebar__brand {
    margin: 0 8px 22px;
}

.aq-sidebar__brand a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #fff;
    text-decoration: none;
}

.aq-sidebar__brand img {
    width: min(100%, 172px);
    height: auto;
}

.aq-sidebar__brand small {
    color: rgb(255 255 255 / 72%);
    font-size: 11px;
}

.aq-sidebar__menu {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.aq-sidebar__menu-toggle {
    display: none;
}

.aq-sidebar__menu-panel {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.aq-sidebar__nav,
.aq-sidebar-nav {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aq-sidebar__section-label {
    margin: 14px 12px 5px;
    color: rgb(255 255 255 / 68%);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aq-body .aq-sidebar__link,
.aq-body .aq-sidebar-link,
.aq-body .aq-sidebar__exit {
    position: relative;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: var(--aq-radius-md);
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgb(255 255 255 / 88%);
    font-size: 13px;
    font-weight: 680;
    text-decoration: none;
}

.aq-body .aq-sidebar__link:hover,
.aq-body .aq-sidebar-link:hover,
.aq-body .aq-sidebar__link.is-active,
.aq-body .aq-sidebar-link.is-active,
.aq-body .aq-sidebar__link[aria-current="page"],
.aq-body .aq-sidebar-link[aria-current="page"],
.aq-body .aq-sidebar__exit:hover {
    background: rgb(255 255 255 / 10%);
    color: #fff;
    text-decoration: none;
}

.aq-sidebar__dot {
    width: 8px;
    height: 8px;
    border: 2px solid rgb(255 255 255 / 68%);
    border-radius: 50%;
    flex: 0 0 8px;
}

.aq-sidebar__link.is-active .aq-sidebar__dot,
.aq-sidebar__link[aria-current="page"] .aq-sidebar__dot {
    border-color: var(--aq-accent-500);
    background: var(--aq-accent-500);
}

.aq-sidebar__future {
    margin-top: auto;
    padding: 14px 12px;
    border: 1px solid rgb(255 255 255 / 28%);
    border-radius: var(--aq-radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: rgb(255 255 255 / 70%);
    font-size: 11px;
}

.aq-sidebar__future-label {
    color: rgb(255 255 255 / 92%);
    font-weight: 800;
}

.aq-sidebar__footer {
    margin-top: auto;
}

.aq-sidebar__footer .aq-sidebar__future {
    margin-top: 0;
}

.aq-sidebar__logout {
    margin: 0;
}

.aq-sidebar__exit {
    margin-top: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.aq-app-main {
    min-width: 0;
}

.aq-topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    min-height: var(--aq-app-topbar);
    padding: 12px var(--aq-page-padding);
    border-bottom: 1px solid var(--aq-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(14px);
}

.aq-topbar h1,
.aq-topbar h2,
.aq-topbar p {
    margin: 0;
}

.aq-topbar__title {
    min-width: 0;
}

.aq-topbar__title strong {
    display: block;
    overflow: hidden;
    color: var(--aq-primary-950);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aq-topbar__title span {
    display: block;
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aq-topbar__profile {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--aq-text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.aq-page,
.aq-dashboard {
    min-width: 0;
    padding: var(--aq-page-padding);
}

.aq-page--flow,
.aq-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--aq-space-8);
}

.aq-dashboard > section:only-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--aq-space-8);
}

.aq-page-header {
    margin-bottom: var(--aq-space-7);
}

.aq-page--flow > .aq-page-header,
.aq-dashboard > .aq-page-header {
    margin-bottom: 0;
}

.aq-page-header h1 {
    margin: 0;
    color: var(--aq-primary-950);
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.aq-page-header p {
    margin: 7px 0 0;
    color: var(--aq-muted);
}

.aq-breadcrumbs {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--aq-muted);
    font-size: 12px;
}

.aq-breadcrumbs > a,
.aq-breadcrumbs > span {
    color: inherit;
}

.aq-breadcrumbs ol {
    margin: 0 0 7px;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--aq-muted);
    font-size: 12px;
    list-style: none;
}

.aq-breadcrumbs li + li::before {
    margin-right: 7px;
    content: "/";
}

.aq-breadcrumbs a {
    color: var(--aq-muted);
}

.aq-body--app .admin-shell,
.aq-body--app .account-page {
    max-width: none;
}

.aq-body--app .panel,
.aq-body--app .notice-card,
.aq-body--app .stat-card,
.aq-body--app .info-card {
    box-shadow: var(--aq-shadow-xs);
}

/* Compatibility layer for migrated server-rendered admin pages. */
.aq-operator-shell > .aq-app-main.admin-content {
    padding: var(--aq-page-padding);
    gap: var(--aq-space-7);
}

.aq-operator-shell .admin-header.aq-page-header {
    margin-bottom: 0;
}

.aq-operator-shell .admin-header h1,
.aq-operator-shell .panel-header h1 {
    color: var(--aq-primary-950);
}

.aq-operator-shell .panel,
.aq-operator-shell .notice-card,
.aq-operator-shell .stat-card,
.aq-operator-shell .info-card {
    border-color: var(--aq-border);
    border-radius: var(--aq-radius-lg);
    background: var(--aq-surface);
}

.aq-operator-shell .panel,
.aq-operator-shell .notice-card {
    padding: var(--aq-space-5);
}

.aq-operator-shell .table-wrap {
    max-width: 100%;
    border-color: var(--aq-border);
    border-radius: var(--aq-radius-lg);
    overflow-x: auto;
    background: var(--aq-surface);
    overscroll-behavior-inline: contain;
}

.aq-operator-shell .button {
    min-height: 44px;
    border-radius: var(--aq-radius-md);
}

.aq-operator-shell .button-primary,
.aq-operator-shell .button.primary {
    background: var(--aq-primary-900);
    color: #fff;
}

.aq-operator-shell .button-secondary,
.aq-operator-shell .button.secondary {
    border-color: var(--aq-control-border);
    background: var(--aq-surface);
    color: var(--aq-primary-900);
}

.aq-operator-shell .field input,
.aq-operator-shell .field select,
.aq-operator-shell .field textarea {
    border-color: var(--aq-control-border);
    border-radius: var(--aq-radius-md);
}

.aq-operator-shell .field label,
.aq-operator-shell .field > span {
    color: var(--aq-text-secondary);
}

.aq-operator-shell .field-hint,
.aq-operator-shell th,
.aq-operator-shell .empty-state,
.aq-operator-shell .notice-card p {
    color: var(--aq-muted);
}

.aq-operator-shell th {
    background: #fbfcfe;
}

.aq-operator-shell .badge {
    border-color: var(--aq-border-strong);
    background: var(--aq-neutral-bg);
    color: var(--aq-text-secondary);
}

.aq-operator-shell :is(.badge-active, .badge-verified, .badge-approved_for_publication, .badge-published,
    .badge-offers_available, .badge-locked) {
    border-color: #9fd8c5;
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-operator-shell :is(.badge-submitted, .badge-under_review, .badge-collecting_offers,
    .badge-package_selected, .badge-lender_reconfirmation) {
    border-color: #bdcff0;
    background: var(--aq-info-bg);
    color: var(--aq-info);
}

.aq-operator-shell :is(.badge-pending_verification, .badge-additional_data_required, .badge-draft) {
    border-color: #e6c884;
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-operator-shell :is(.badge-restricted, .badge-restricted_pending_legal, .badge-rejected,
    .badge-closed, .badge-cancelled, .badge-expired) {
    border-color: #e7b8be;
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-body .notice-card-error,
.aq-body .alert-error,
.aq-body .alert.error {
    border-color: #e7b8be;
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-body .alert-success,
.aq-body .alert.success,
.aq-body .notice-card-success {
    border-color: #9fd8c5;
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-body .alert-warning,
.aq-body .alert.warning,
.aq-body .notice-card-warning {
    border-color: #e6c884;
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-body :is(.notice-card-error, .alert-error, .alert.error, .alert-success, .alert.success,
    .notice-card-success, .alert-warning, .alert.warning, .notice-card-warning) :where(h2, h3, p, li) {
    color: inherit;
}

.aq-body .stage3-progress {
    gap: var(--aq-space-4);
    margin-bottom: var(--aq-space-6);
}

.aq-body .stage3-progress li {
    padding: var(--aq-space-4);
    border-color: var(--aq-border-strong);
    background: var(--aq-surface);
    color: var(--aq-muted);
}

.aq-body .stage3-progress li[aria-current="step"] {
    border-color: var(--aq-info);
    color: var(--aq-text);
    box-shadow: inset 0 0 0 1px var(--aq-info);
}

.aq-body .stage3-progress li.is-complete {
    border-color: #9fd8c5;
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-body .stage3-progress-number {
    background: var(--aq-surface-alt);
    color: var(--aq-primary-900);
}

.aq-body :is(.badge-document_pending, .badge-signature_pending, .badge-partially_signed) {
    border-color: #bdcff0;
    background: var(--aq-info-bg);
    color: var(--aq-info);
}

.aq-body .badge-fully_signed {
    border-color: #9fd8c5;
    background: var(--aq-success-bg);
    color: var(--aq-success);
}

.aq-body :is(.badge-failed, .badge-voided) {
    border-color: #e7b8be;
    background: var(--aq-danger-bg);
    color: var(--aq-danger);
}

.aq-body .stage4-legal-warning {
    border-style: dashed;
}

.aq-body .stage3-card-list {
    gap: var(--aq-space-5);
    margin-top: var(--aq-space-5);
}

.aq-body .stage3-sandbox-notice {
    border-color: var(--aq-warning);
    background: var(--aq-warning-bg);
    color: var(--aq-warning);
}

.aq-body .stage3-sandbox-notice :where(h2, h3, p, li) {
    color: inherit;
}

.aq-body .stage3-finance-jumps {
    gap: var(--aq-space-3);
    margin-block: var(--aq-space-5);
}

.aq-body .stage3-finance-jumps a {
    min-height: 42px;
    border-color: var(--aq-control-border);
    display: inline-flex;
    align-items: center;
    background: var(--aq-surface);
    color: var(--aq-primary-900);
}

.aq-body .stage3-finance-jumps a:hover {
    border-color: var(--aq-primary-700);
    background: var(--aq-surface-alt);
    text-decoration: none;
}

.aq-operator-shell .breadcrumbs ol {
    color: var(--aq-muted);
}

@media (max-width: 1180px) {
    .aq-public-nav {
        gap: 13px;
    }

    .aq-public-nav a {
        font-size: 12px;
    }

    .aq-public-actions .aq-button--ghost {
        display: none;
    }

    .aq-benefit-grid,
    .aq-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aq-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aq-three-column-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .aq-public-nav {
        display: none;
    }

    .aq-public-header__inner {
        justify-content: space-between;
    }

    .aq-public-actions {
        margin-left: auto;
    }

    .aq-public-menu {
        display: block;
    }

    .aq-hero__grid {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
        gap: 42px;
    }

    .aq-hero__copy h1 {
        font-size: clamp(38px, 5.4vw, 52px);
    }

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

    .aq-how-grid > li {
        min-height: 0;
    }

    .aq-benefit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aq-public-footer__grid {
        grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(140px, 0.8fr));
    }

    .aq-public-footer__grid nav:last-child {
        grid-column: 2 / -1;
    }

    .aq-app-shell {
        grid-template-columns: 196px minmax(0, 1fr);
    }

    .aq-sidebar {
        padding-inline: 10px;
    }

    .aq-page,
    .aq-dashboard {
        padding: 22px;
    }

    .aq-topbar {
        padding-inline: 22px;
    }

    .aq-dashboard-grid,
    .aq-dashboard-grid--wide,
    .aq-grid--3,
    .aq-tariff-grid {
        grid-template-columns: 1fr;
    }

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

    .aq-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    html:has(.aq-body) {
        scroll-padding-top: 72px;
    }

    .aq-container {
        width: min(calc(100% - 28px), var(--aq-landing-max));
    }

    .aq-public-header,
    .aq-public-header__inner {
        min-height: 64px;
    }

    .aq-public-brand img {
        height: 31px;
    }

    .aq-public-actions .aq-button {
        min-height: 40px;
        padding-inline: 12px;
    }

    .aq-public-actions .aq-button--ghost {
        display: inline-flex;
    }

    .aq-public-actions .aq-button--primary {
        display: none;
    }

    .aq-hero {
        padding-top: 46px;
    }

    .aq-hero__grid {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .aq-hero__copy h1 {
        font-size: clamp(36px, 11vw, 50px);
    }

    .aq-product-preview {
        margin-right: 12px;
    }

    .aq-segment-grid,
    .aq-benefit-grid,
    .aq-grid--2,
    .aq-grid--4,
    .aq-card-grid,
    .aq-kpi-grid,
    .aq-faq-layout {
        grid-template-columns: 1fr;
    }

    .aq-faq-layout {
        gap: 26px;
    }

    .aq-public-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .aq-public-footer__about {
        grid-column: 1 / -1;
    }

    .aq-public-footer__grid nav:last-child {
        grid-column: 1 / -1;
    }

    .aq-public-footer__bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .aq-app-shell {
        display: block;
    }

    .aq-sidebar {
        position: sticky;
        height: 64px;
        max-width: 100vw;
        padding: 10px 14px;
        flex-direction: row;
        align-items: center;
        box-shadow: 0 1px 0 rgb(255 255 255 / 14%);
    }

    .aq-sidebar__brand {
        margin: 0;
    }

    .aq-sidebar__brand a {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .aq-sidebar__brand img {
        width: 132px;
    }

    .aq-sidebar__brand small {
        display: none;
    }

    .aq-sidebar__menu {
        position: static;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .aq-sidebar__menu-toggle {
        min-width: 98px;
        min-height: 44px;
        padding: 8px 12px;
        border: 1px solid rgb(255 255 255 / 42%);
        border-radius: var(--aq-radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        color: #fff;
        font-size: 14px;
        font-weight: 760;
        list-style: none;
    }

    .aq-sidebar__menu-toggle::-webkit-details-marker {
        display: none;
    }

    .aq-sidebar__menu-toggle .aq-icon {
        width: 20px;
        height: 20px;
    }

    .aq-sidebar__menu[open] > .aq-sidebar__menu-toggle {
        background: rgb(255 255 255 / 14%);
    }

    .aq-sidebar__menu:not([open]) > .aq-sidebar__menu-panel {
        display: none;
    }

    .aq-sidebar__menu-panel {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        max-height: calc(100dvh - 64px);
        padding: 12px 14px 18px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: linear-gradient(180deg, var(--aq-primary-950), var(--aq-primary-900));
        box-shadow: 0 18px 30px rgb(4 29 67 / 28%);
    }

    .aq-sidebar__nav,
    .aq-sidebar-nav {
        padding: 0;
        overflow: initial;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .aq-sidebar__link,
    .aq-sidebar-link {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        padding: 10px 12px;
        align-items: center;
        line-height: 1.3;
        white-space: normal;
    }

    .aq-sidebar__link > span:last-child,
    .aq-sidebar-link > span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .aq-sidebar__link .aq-sidebar__dot,
    .aq-sidebar-link .aq-sidebar__dot {
        margin-top: 0;
    }

    .aq-sidebar__future {
        display: none;
    }

    .aq-sidebar__section-label {
        display: block;
        margin-top: 12px;
        color: rgb(255 255 255 / 78%);
    }

    .aq-sidebar__footer {
        margin-top: 4px;
    }

    .aq-sidebar__exit {
        width: 100%;
        margin-top: 8px;
        border: 1px solid rgb(255 255 255 / 32%);
        justify-content: center;
    }

    .aq-topbar {
        min-height: 62px;
        padding: 9px 14px;
    }

    .aq-page,
    .aq-dashboard {
        padding: 16px 14px 28px;
    }

    .aq-page--flow,
    .aq-dashboard,
    .aq-dashboard > section:only-child {
        gap: var(--aq-space-6);
    }

    .aq-operator-shell > .aq-app-main.admin-content {
        padding: 16px 14px 28px;
        gap: var(--aq-space-6);
    }

    .aq-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .aq-topbar__profile {
        margin-left: auto;
        flex-wrap: wrap;
    }

    .aq-page-header {
        flex-direction: column;
    }

    .aq-page .aq-section-heading,
    .aq-dashboard .aq-section-heading,
    .aq-roles-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .aq-page-actions {
        width: 100%;
    }

    .aq-page-actions .aq-button {
        flex: 1 1 auto;
    }

    .aq-alert {
        flex-wrap: wrap;
    }

    .aq-alert > .aq-button,
    .aq-callout > .aq-button {
        width: 100%;
        margin-left: 0;
    }

    .aq-kpi-card {
        min-height: 112px;
    }

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

    .aq-placeholder--horizontal {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 430px) {
    .aq-public-header__inner {
        gap: 8px;
    }

    .aq-public-brand img {
        width: 134px;
        height: auto;
    }

    .aq-public-actions .aq-button {
        font-size: 12px;
    }

    .aq-public-menu > summary {
        width: 42px;
        height: 42px;
    }

    .aq-breadcrumbs,
    .aq-topbar__profile {
        width: 100%;
        justify-content: space-between;
    }

    .aq-sidebar__brand small {
        max-width: 122px;
        text-align: right;
    }

    .aq-hero__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .aq-hero__actions .aq-button {
        width: 100%;
    }

    .aq-product-preview {
        padding: 16px;
    }

    .aq-product-preview__bar {
        grid-template-columns: auto 1fr;
    }

    .aq-product-preview__bar > .aq-badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

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

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

    .aq-public-footer__about,
    .aq-public-footer__grid nav:last-child {
        grid-column: auto;
    }

    .aq-data-list > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

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

    .aq-progress-item {
        min-height: 54px;
        padding: 0 0 16px 34px;
    }

    .aq-progress-item::before {
        top: 3px;
    }

    .aq-progress-marker {
        top: 3px;
    }

    .aq-progress-item::after {
        top: 19px;
        right: auto;
        bottom: 0;
        left: 7px;
        width: 2px;
        height: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:has(.aq-body) {
        scroll-behavior: auto;
    }

    .aq-body *,
    .aq-body *::before,
    .aq-body *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        scroll-behavior: auto;
        transition-duration: 0.01ms;
    }
}

@media (forced-colors: active) {
    .aq-button,
    .aq-card,
    .aq-panel,
    .aq-kpi-card,
    .aq-placeholder,
    .aq-sidebar__link {
        border: 1px solid CanvasText;
    }
}
