/* Moderate, content-only type scale for the user panel views. */
:is(.ah-dashboard-overview, .ah-rsv-workbench, .ah-spots-workbench, .ah-price-workbench, .ah-wallet-workbench, .ah-st-workbench, .ah-tags-workbench) > .dashboard-content {
    --ah-up-title-size: 28px;
    --ah-up-title-size-mobile: 25px;
    --ah-dashboard-text-xs: max(12px, calc(0.875rem + 2px));
    --ah-dashboard-text-sm: max(14px, calc(1rem + 2px));
    --ah-dashboard-text-md: calc(1.25rem + 2px);
    --ah-dashboard-text-lg: calc(1.5625rem + 2px);
    --ah-dashboard-text-xl: calc(1.9531rem + 2px);
    --ah-dashboard-text-2xl: calc(2.4414rem + 2px);
    --ah-rsv-text-readable: max(14px, calc(1.0625rem + 2px));
}

/* Rebind the overview aliases where the enlarged scale is defined. */
:is(.ah-dashboard-overview, .ah-wallet-workbench) > .dashboard-content {
    --text-xs: var(--ah-dashboard-text-xs);
    --text-sm: var(--ah-dashboard-text-sm);
    --text-md: var(--ah-dashboard-text-md);
    --text-lg: var(--ah-dashboard-text-lg);
    --text-xl: var(--ah-dashboard-text-xl);
    --text-2xl: var(--ah-dashboard-text-2xl);
}

.ah-dashboard-overview .ah-dashboard-shortcuts__list a > span {
    white-space: normal;
    line-height: 1.4;
}

/* The compact spot directory uses explicit sizes rather than the shared scale. */
.ah-spots-v3 .ah-spots-header-copy p,
.ah-spots-v3 .sv-directory,
.ah-spots-v3 .sv-tabs a,
.ah-spots-v3 .sv-identity h3 { font-size: 14px; }

.ah-spots-v3 .ah-spots-header :is(.ahms-btn, .ah-spots-role-chip),
.ah-spots-v3 .sv-button,
.ah-spots-v3 .sv-result-total,
.ah-spots-v3 .sv-location,
.ah-spots-v3 .sv-freeze-summary,
.ah-spots-v3 .sv-range-link,
.ah-spots-v3 .sv-status .ahms-status-text,
.ah-spots-v3 .sv-frozen > summary,
.ah-spots-v3 .sv-period-note,
.ah-spots-v3 .sv-other-periods,
.ah-spots-v3 .sv-other-periods p,
.ah-spots-v3 .sv-footer,
.ah-spots-v3 .sv-note { font-size: 13px; }

.ah-spots-v3 .sv-list-head,
.ah-spots-v3 .sv-identity p,
.ah-spots-v3 .sv-location :is(span, small),
.ah-spots-v3 .sv-freeze-summary small,
.ah-spots-v3 .sv-frozen > summary > span:last-child,
.ah-spots-v3 .sv-dates span,
.ah-spots-v3 .sv-period-caption,
.ah-spots-v3 .sv-segment-labels,
.ah-spots-v3 .sv-updated,
.ah-spots-v3 .sv-mobile-label { font-size: 12px; }

.ah-spots-v3 .sv-filter-dropdown .sv-search input,
.ah-spots-v3 .sv-filter-dropdown .sv-filter-fields select { font-size: 14px; }
.ah-spots-v3 .sv-filter-dropdown .sv-filter-fields label,
.ah-spots-v3 .sv-filter-dropdown .sv-frozen-filter { font-size: 13px; }
.ah-spots-v3 .sv-dates strong { font-size: 20px; }

/* Let longer text take a second line inside the existing grid. */
.ah-spots-v3 .sv-frozen > summary,
.ah-spots-v3 .sv-period-caption,
.ah-spots-v3 .sv-other-periods li { flex-wrap: wrap; }
.ah-spots-v3 .sv-tabs a { white-space: normal; }
.ah-spots-v3 .sv-list-head > span { overflow-wrap: anywhere; }

@container (max-width: 600px) {
    .ah-spots-v3 .sv-dates strong { font-size: clamp(15px, 4.5cqi, 18px); }
}

/* Shared filter rules use !important; keep the override limited to these pages. */
:is(.ah-dashboard-overview, .ah-rsv-workbench, .ah-spots-workbench, .ah-price-workbench, .ah-wallet-workbench, .ah-st-workbench, .ah-tags-workbench) .ah-up-filter-drawer :is(input, select, .chat-clean-date-range) {
    font-size: 15px !important;
}

body.ah-userpanel-route #main-content .ah-dashboard-overview .ah-dashboard-heading .ah-up-page-title {
    font-size: var(--ah-up-title-size) !important;
}
.ah-dashboard-overview .ah-dashboard-metric__copy > span {
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 640px) {
    body.ah-userpanel-route #main-content .ah-dashboard-overview .ah-dashboard-heading .ah-up-page-title {
        font-size: var(--ah-up-title-size-mobile) !important;
    }
}

.ah-rsv-workbench .ah-rsv-directory-table .ah-rsv-admin-row > div > :is(strong, span, time) {
    overflow-wrap: anywhere;
}

/* Tags and spot types use their own type scales. Keep them in step with the panel. */
.ah-tags-workbench > .dashboard-content {
    --tags-text-caption: max(12px, calc(0.8125rem + 2px));
    --tags-text-xs: max(13px, calc(0.9375rem + 2px));
    --tags-text-sm: max(14px, calc(1.0625rem + 2px));
    --tags-text-md: calc(1.375rem + 2px);
}

.ah-st-workbench .ah-st-hero-copy > p,
.ah-st-workbench .ah-st-type-cell h3 { font-size: max(14px, calc(1.125rem + 2px)); }

.ah-st-workbench :is(.ah-st-primary-button, .ah-st-secondary-button, .ah-st-description-cell p, .ah-st-toolbar-copy p, .ah-st-empty p),
.ah-st-workbench .ah-st-summary-card span:not(.ah-st-summary-icon),
.ah-st-workbench .ah-st-filter-toggle { font-size: var(--ah-dashboard-text-sm); }

.ah-st-workbench :is(.ah-st-table-head, .ah-st-mobile-label, .ah-st-scope-badge, .ah-st-status),
.ah-st-workbench .ah-st-filter-field > span:first-child,
.ah-st-workbench .ah-st-count-cell > span:last-child { font-size: var(--ah-dashboard-text-xs); }

.ah-st-workbench .ah-st-toolbar-copy h2 { font-size: calc(1.5rem + 2px); }
.ah-st-workbench :is(.ah-st-count-cell strong, .ah-st-empty h3) { font-size: calc(1.375rem + 2px); }
.ah-st-workbench .ah-st-summary-card strong { font-size: clamp(calc(1.875rem + 2px), 2.25vw, calc(2.375rem + 2px)); }
.ah-st-workbench #spot-types-filter-drawer .ah-st-filter-field :is(input, select) { font-size: 15px !important; }

body.ah-userpanel-route #main-content #dashboard:is(.ah-wallet-workbench, .ah-st-workbench, .ah-tags-workbench) :is(.ah-wallet-header, .ah-st-hero, .ah-tags-hero) .ah-up-page-title {
    font-size: var(--ah-up-title-size) !important;
}

@media (max-width: 640px) {
    body.ah-userpanel-route #main-content #dashboard:is(.ah-wallet-workbench, .ah-st-workbench, .ah-tags-workbench) :is(.ah-wallet-header, .ah-st-hero, .ah-tags-hero) .ah-up-page-title {
        font-size: var(--ah-up-title-size-mobile) !important;
    }
}
