/**
 * 21C Systems — Auth front-end styles.
 *
 * Scoped under .auth-app. Token names match the proven Frontend Styler
 * convention (--auth-*) so a future theming module can override them.
 */

:root {
    --auth-color-primary: #2563eb;
    --auth-color-primary-hover-bg: #1d4ed8;
    --auth-color-primary-hover-text: #ffffff;
    --auth-color-primary-border: #1e40af;
    --auth-primary-radius: var(--auth-radius);
    --auth-color-success: #15803d;
    --auth-color-danger: #b91c1c;
    --auth-color-error: var(--auth-color-danger);
    --auth-color-warning: #b45309;
    --auth-color-info: #1d4ed8;
    --auth-alert-font-size: 1rem;
    --auth-alert-font-weight: 400;
    --auth-color-border: #d1d5db;
    --auth-color-text: #111827;
    --auth-color-muted: #6b7280;
    --auth-color-surface: #ffffff;
    --auth-color-on-primary: #ffffff;
    --auth-color-secondary-bg: #f3f4f6;
    --auth-color-secondary-hover-bg: #e5e7eb;
    --auth-color-secondary-hover-text: #111827;
    --auth-color-secondary-text: #111827;
    --auth-color-secondary-border: #d1d5db;
    --auth-secondary-radius: var(--auth-radius);
    /* Ask AI button — independent of secondary button tokens (same defaults). */
    --auth-ask-ai-bg: #f3f4f6;
    --auth-ask-ai-hover-bg: #e5e7eb;
    --auth-ask-ai-hover-text: #111827;
    --auth-ask-ai-text: #111827;
    --auth-ask-ai-border: #d1d5db;
    --auth-ask-ai-radius: 6px;
    --auth-button-padding-y: 0.6rem;
    --auth-button-padding-x: 1.1rem;
    --auth-button-font-weight: 600;
    --auth-radius: 6px;
    --auth-spacing: 1rem;
    --auth-control-stack-gap: 1rem;
    --auth-max-width: 28rem;
    --auth-field-section-border-width: 1px;
    --auth-field-section-border-color: #d1d5db;
    --auth-field-section-bg: #f9fafb;
    --auth-field-section-radius: 8px;
    --auth-field-section-padding: 0.75rem;

    /* Media capture-item / card grid (Frontend Styler subset) */
    --auth-capture-item-bg: #ffffff;
    --auth-capture-item-border-color: #d1d5db;
    --auth-capture-item-border-width: 1px;
    --auth-capture-item-radius: 12px;
    --auth-capture-item-padding: 0.75rem;
    --auth-capture-item-gap: 0.75rem;
    --auth-capture-item-spacing: 0.75rem;
    --auth-capture-item-min-width: 280px;
    --auth-document-icon-size: 7rem;
    --auth-document-filename-font-size: 1rem;
    --auth-document-filename-margin-above: 0.5rem;
    --auth-document-filename-margin-below: 0;
    --auth-short-description-gap-above: 0.4rem;
    --auth-short-description-gap-below: 0.4rem;
    --cs-media-card-bg: #F8F9FB;
    --cs-media-card-border-colour: #000000;
    --cs-media-card-border-width: 1px;
    --cs-media-card-radius: 30px;
    --cs-media-card-padding: 30px;
    --cs-media-card-shadow: none;
    --cs-media-card-meter-height: 8px;
    --cs-media-card-meter-player-spacing: 2px;
    --cs-media-card-player-bottom-spacing: 8px;
}

/* Light theme-bleed reset inside Auth UI */
.auth-app,
.auth-app *,
.auth-app *::before,
.auth-app *::after {
    box-sizing: border-box;
}

.auth-app h1,
.auth-app h2,
.auth-app h3,
.auth-app h4,
.auth-app p,
.auth-app ul,
.auth-app ol,
.auth-app li,
.auth-app figure,
.auth-app figcaption,
.auth-app blockquote,
.auth-app dl,
.auth-app dd,
.auth-app section,
.auth-app article,
.auth-app header,
.auth-app footer,
.auth-app nav {
    margin: 0;
    padding: 0;
}

.auth-app button {
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    background: none;
    border: none;
}

.auth-login,
.auth-register,
.auth-verify-email,
.auth-resend-verification,
.auth-forgot-password,
.auth-reset-password,
.auth-status {
    max-width: var(--auth-max-width);
    margin: 0 auto;
    color: var(--auth-color-text);
}

.auth-records {
    max-width: min(100%, 58rem);
    margin: 0 auto;
    color: var(--auth-color-text);
}

.auth-form {
    display: grid;
    gap: var(--auth-spacing);
}

.auth-form__group {
    display: grid;
    gap: 0.35rem;
}

/* Record Add/Edit/View/Public form sections — shared .auth-form__group wrapper */
.auth-records .auth-form > .auth-form__group {
    border: var(--auth-field-section-border-width, 1px) solid var(--auth-field-section-border-color, #d1d5db);
    border-radius: var(--auth-field-section-radius, 8px);
    background: var(--auth-field-section-bg, #f9fafb);
    padding: var(--auth-field-section-padding, 0.75rem);
}

.auth-form__label {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

.auth-app .auth-form__input,
.auth-app input.auth-form__input,
.auth-form__input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--auth-color-border);
    border-radius: var(--auth-radius);
    font-size: 1rem;
    background: var(--auth-color-surface);
    color: var(--auth-color-text);
}

.auth-form__input:focus,
.auth-form__input:focus-visible {
    outline: none;
    border-color: var(--auth-color-border);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--auth-color-muted) 35%, transparent);
}

.auth-form__actions {
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.auth-app nav.auth-form__links,
.auth-app .auth-form__links,
.auth-form__links {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form__links-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-form__links-list > li + li {
    margin-top: 0.5rem;
}

.auth-app .auth-form__links--inline,
.auth-form__links--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0;
}

.auth-form__link {
    color: var(--auth-color-primary);
    font-size: 0.95rem;
    text-decoration: underline;
}

.auth-form__link:hover,
.auth-form__link:focus {
    color: var(--auth-color-primary);
    filter: brightness(0.9);
}

/* Beat .auth-app button { padding:0 } (0,1,1): use .auth-app .auth-button (0,2,0).
 * Variant colour rules below must match or exceed this specificity. */
.auth-app .auth-button,
button.auth-button,
a.auth-button,
.auth-button {
    display: inline-block;
    padding: var(--auth-button-padding-y, 0.6rem) var(--auth-button-padding-x, 1.1rem);
    border-radius: var(--auth-radius, 6px);
    border: 1px solid var(--auth-color-border, #d1d5db);
    font-size: 1rem;
    font-weight: var(--auth-button-font-weight, 600);
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: none;
    background: var(--auth-color-surface, #ffffff);
    color: var(--auth-color-text, #111827);
}

.auth-app .auth-button:hover,
.auth-app .auth-button:focus,
.auth-button:hover,
.auth-button:focus {
    text-decoration: none;
    transition: none;
}

/* The hidden attribute must win over component display rules (e.g.
   .auth-button { display: inline-block }, .auth-media-capture { display: grid })
   so capture controls stay hidden until their state applies. */
.auth-button[hidden],
[hidden] {
    display: none !important;
}

.auth-app .auth-button--primary,
.auth-app button.auth-button--primary,
button.auth-button.auth-button--primary,
.auth-button--primary {
    background: var(--auth-color-primary, #2563eb);
    color: var(--auth-color-on-primary, #ffffff);
    border-color: var(--auth-color-primary-border, #1e40af);
    border-radius: var(--auth-primary-radius, var(--auth-radius, 6px));
}

.auth-app .auth-button--primary:hover,
.auth-app .auth-button--primary:focus,
.auth-app button.auth-button--primary:hover,
.auth-app button.auth-button--primary:focus,
button.auth-button.auth-button--primary:hover,
button.auth-button.auth-button--primary:focus,
.auth-button--primary:hover,
.auth-button--primary:focus {
    background: var(--auth-color-primary-hover-bg, #1d4ed8);
    color: var(--auth-color-primary-hover-text, #ffffff);
    border-color: var(--auth-color-primary-border, #1e40af);
    text-decoration: none;
    transition: none;
    filter: none;
}

.auth-app a.auth-button,
a.auth-button,
a.auth-button:link,
a.auth-button:visited,
a.auth-button:active {
    text-decoration: none;
    transition: none;
    filter: none;
    opacity: 1;
}

.auth-app a.auth-button:hover,
.auth-app a.auth-button:focus,
a.auth-button:hover,
a.auth-button:focus {
    text-decoration: none;
    transition: none;
    filter: none;
    opacity: 1;
}

.auth-app .auth-button--secondary,
.auth-app button.auth-button--secondary,
button.auth-button.auth-button--secondary,
.auth-button--secondary {
    background: var(--auth-color-secondary-bg, #f3f4f6);
    color: var(--auth-color-secondary-text, #111827);
    border-color: var(--auth-color-secondary-border, #d1d5db);
    border-radius: var(--auth-secondary-radius, var(--auth-radius, 6px));
}

.auth-app .auth-button--secondary:hover,
.auth-app .auth-button--secondary:focus,
.auth-app button.auth-button--secondary:hover,
.auth-app button.auth-button--secondary:focus,
button.auth-button.auth-button--secondary:hover,
button.auth-button.auth-button--secondary:focus,
.auth-button--secondary:hover,
.auth-button--secondary:focus {
    background: var(--auth-color-secondary-hover-bg, #e5e7eb);
    color: var(--auth-color-secondary-hover-text, #111827);
    border-color: var(--auth-color-secondary-border, #d1d5db);
    text-decoration: none;
    transition: none;
}

.auth-app .auth-success,
.auth-app .auth-error,
.auth-app .auth-warning,
.auth-app .auth-info,
.auth-success,
.auth-error,
.auth-warning,
.auth-info {
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius);
    margin: 0 0 var(--auth-spacing);
    border: 1px solid transparent;
    font-size: var(--auth-alert-font-size);
    font-weight: var(--auth-alert-font-weight);
}

.auth-success {
    color: var(--auth-color-success);
    background: color-mix(in srgb, var(--auth-color-success) 12%, var(--auth-color-surface));
    border-color: color-mix(in srgb, var(--auth-color-success) 40%, var(--auth-color-surface));
}

.auth-error {
    color: var(--auth-color-danger);
    background: color-mix(in srgb, var(--auth-color-danger) 12%, var(--auth-color-surface));
    border-color: color-mix(in srgb, var(--auth-color-danger) 40%, var(--auth-color-surface));
}

.auth-warning {
    color: var(--auth-color-warning);
    background: color-mix(in srgb, var(--auth-color-warning) 12%, var(--auth-color-surface));
    border-color: color-mix(in srgb, var(--auth-color-warning) 40%, var(--auth-color-surface));
}

.auth-info {
    color: var(--auth-color-info);
    background: color-mix(in srgb, var(--auth-color-info) 12%, var(--auth-color-surface));
    border-color: color-mix(in srgb, var(--auth-color-info) 40%, var(--auth-color-surface));
}

.auth-form__error {
    color: var(--auth-color-danger);
    font-size: 0.875rem;
    margin: 0;
}

.auth-form__help {
    margin: 0 0 0.35rem;
    font-size: 0.875rem;
    color: #000;
}

.auth-form__help p {
    margin: 0 0 1rem;
}

.auth-form__help p:last-child {
    margin-bottom: 0;
}

.auth-form__help ul,
.auth-form__help ol {
    margin: 0.25rem 0 0.35rem 1.25rem;
    padding: 0;
}

.auth-form__help li {
    margin: 0.15rem 0;
}

.auth-form__help a {
    color: inherit;
    text-decoration: underline;
}

.auth-form__checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.auth-form__checkbox {
    margin: 0.2rem 0 0;
    flex-shrink: 0;
}

.auth-form__radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.auth-asset-description-needed {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.875rem;
    color: var(--auth-color-danger, #b91c1c);
}

.auth-capture-item__description-slot > .auth-asset-description-needed[hidden] {
    display: none !important;
}

.auth-asset-description-field {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

.auth-asset-description-field[hidden] {
    display: none !important;
}

.auth-asset-description-field__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-capture-item.is-description-needed .auth-asset-description-input,
.auth-asset-description-input[aria-invalid="true"] {
    border-color: var(--auth-color-danger, #b91c1c);
}

.auth-password-strength {
    font-size: 0.875rem;
    color: var(--auth-color-muted);
    min-height: 1.25em;
}

.auth-password-strength--weak {
    color: var(--auth-color-danger);
}

.auth-password-strength--good,
.auth-password-strength--strong {
    color: var(--auth-color-success);
}

.auth-status__title {
    margin: 0 0 0.5rem;
}

.auth-records__toolbar {
    margin: 0 0 var(--auth-spacing);
}

.auth-records__heading {
    margin: 0 0 var(--auth-spacing);
}

.auth-records__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.auth-records__item {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--auth-color-border);
}

.auth-records__item:last-child {
    border-bottom: 0;
}

.auth-records__item-title {
    font-weight: 600;
    font-size: 1rem;
}

.auth-form__required {
    color: var(--auth-color-danger);
    margin-left: 0.15rem;
}

.auth-form__readonly {
    margin: 0;
    color: var(--auth-color-text);
}

.auth-records__image,
.auth-records__image-preview,
.auth-records__media-preview,
.auth-records__media-list {
    margin: 0 0 var(--auth-spacing);
    display: grid;
    gap: 0.75rem;
}

.auth-records__image img,
.auth-records__image-preview img,
.auth-records__media-item--image img,
.auth-media-capture__preview,
.auth-media-capture__playback {
    display: block;
    max-width: 100%;
    height: auto;
}

.auth-records__media-item--video video,
.auth-media-capture__preview,
.auth-media-capture__playback[controls] {
    width: 100%;
    max-width: 100%;
    background: #111;
}

.auth-media-capture__preview--mirror {
    transform: scaleX(-1);
}

.auth-records__media-item--audio audio,
.auth-media-capture__playback {
    width: 100%;
    max-width: 100%;
}

.auth-media-capture {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.auth-media-capture__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--auth-capture-item-gap, 0.75rem);
}

.auth-media-capture__timer {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: center;
}

.auth-media-capture__status {
    margin: 0;
    color: var(--auth-color-muted, #6b7280);
    text-align: center;
}

.auth-media-capture__status.auth-warning,
.auth-media-capture__status.auth-error,
.auth-media-capture__status.auth-info,
.auth-media-capture__status.auth-success {
    text-align: left;
    /* Match shared notice spacing token (--auth-spacing) used by .auth-warning etc. */
    margin-top: var(--auth-spacing);
    margin-bottom: var(--auth-spacing);
}

.auth-media-capture__status.auth-warning {
    color: var(--auth-color-warning);
}

.auth-media-capture__status.auth-error {
    color: var(--auth-color-danger);
}

.auth-media-capture__status.auth-info {
    color: var(--auth-color-info);
}

.auth-media-capture__status.auth-success {
    color: var(--auth-color-success);
}

/* =============================================================================
 * Media card shell (cs-media-card)
 * ============================================================================= */

.auth-app .cs-media-card,
.cs-media-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--cs-media-card-bg);
    border-style: solid;
    border-width: var(--cs-media-card-border-width);
    border-color: var(--cs-media-card-border-colour);
    border-radius: var(--cs-media-card-radius);
    padding: var(--cs-media-card-padding);
    box-shadow: var(--cs-media-card-shadow);
    color: var(--auth-color-text);
    overflow: hidden;
}

.cs-media-card__playback,
.cs-media-card__status {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.cs-media-card__playback {
    gap: var(--cs-media-card-meter-player-spacing);
}

.cs-media-card__meta {
    margin: var(--cs-media-card-player-bottom-spacing) 0 0;
}

.auth-audio-capture__meter {
    margin: 0;
    width: 100%;
}

.auth-audio-capture__meter[hidden] {
    display: none !important;
}

.cs-media-card .auth-audio-capture__meter-track,
.auth-audio-capture__meter-track {
    height: var(--cs-media-card-meter-height, 8px);
    background: var(--auth-color-border, #d1d5db);
    border-radius: var(--auth-radius, 6px);
    overflow: hidden;
}

.auth-audio-capture__meter-bar {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--auth-color-primary, #2563eb);
    transition: width 0.05s linear;
}

.auth-audio-capture__meter--recording .auth-audio-capture__meter-bar {
    background: var(--auth-color-danger, #b91c1c);
}

/* =============================================================================
 * Capture-item grid + cards
 * ============================================================================= */

.auth-app .auth-capture-item-grid,
.auth-app .auth-my-ai__gallery-capture .auth-gallery-capture__items,
.auth-capture-item-grid,
.auth-gallery-capture__items {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(min(100%, var(--auth-capture-item-min-width, 280px)), 1fr)
    );
    gap: var(--auth-capture-item-spacing, 0.75rem);
    align-items: start;
}

@media (max-width: 480px) {
    .auth-app .auth-capture-item-grid,
    .auth-app .auth-my-ai__gallery-capture .auth-gallery-capture__items,
    .auth-capture-item-grid,
    .auth-gallery-capture__items {
        grid-template-columns: 1fr;
    }
}

/* Index browse grid (usage_mode=index view="grid") — same minmax pattern as capture grids */
.auth-app .auth-records-grid,
.auth-records-grid {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(min(100%, var(--auth-capture-item-min-width, 280px)), 1fr)
    );
    gap: var(--auth-capture-item-spacing, 0.75rem);
    align-items: start;
}

.auth-records-grid__media-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.auth-records-grid__placeholder {
    min-height: 10rem;
    background: color-mix(in srgb, var(--auth-color-border, #c3c4c7) 35%, var(--cs-media-card-bg, #f8f9fb));
    border-radius: calc(var(--cs-media-card-radius, 30px) * 0.5);
}

.auth-records-grid__title {
    margin: 0.75rem 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.auth-records-grid__summary {
    margin: 0 0 0.5rem;
}

@media (max-width: 480px) {
    .auth-app .auth-records-grid,
    .auth-records-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide Audio/Video (singular) grid shell when its only card is not shown yet. */
.auth-capture-item-grid:not(:has(.auth-capture-item:not([hidden]))) {
    display: none;
    margin: 0;
}

/* Gallery items list: no grid chrome until at least one item exists. */
.auth-gallery-capture__items:not(:has(.auth-capture-item)) {
    display: none;
    margin: 0;
}

.auth-document-capture-file-input--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-app .auth-document-capture__file,
.auth-document-capture__file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0.5rem 0.5rem 0;
    text-align: center;
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
}

.auth-capture-item__media > .auth-document-capture__file,
.auth-capture-item__media .auth-document-capture__file {
    width: 100%;
    align-self: stretch;
}

.auth-app .auth-document-capture__icon,
.auth-document-capture__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--auth-document-icon-size, 7rem);
    height: var(--auth-document-icon-size, 7rem);
    max-width: 100%;
    margin: 0 auto;
    padding: calc(var(--auth-document-icon-size, 7rem) * 0.12);
    border: var(--auth-capture-item-border-width, 1px) solid var(--auth-capture-item-border-color, var(--auth-color-border, #d1d5db));
    border-radius: var(--auth-capture-item-radius, var(--auth-radius, 6px));
    background: var(--auth-capture-item-bg, var(--auth-color-surface, #ffffff));
    color: var(--auth-color-text, #111827);
    box-sizing: border-box;
}

.auth-document-capture__icon--pdf {
    color: #b91c1c;
}

.auth-document-capture__icon--doc,
.auth-document-capture__icon--docx {
    color: #1d4ed8;
}

.auth-document-capture__icon--txt {
    color: #374151;
}

.auth-document-capture__icon--generic {
    color: var(--auth-color-muted, #6b7280);
}

.auth-document-capture__icon-fallback {
    font-size: calc(var(--auth-document-icon-size, 7rem) * 0.22);
    font-weight: var(--auth-button-font-weight, 600);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.auth-app .auth-document-capture__filename,
.auth-document-capture__filename {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: var(--auth-document-filename-margin-above, 0.5rem);
    margin-right: auto;
    margin-bottom: var(--auth-document-filename-margin-below, 0);
    margin-left: auto;
    padding: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--auth-color-text, #111827);
    font-size: var(--auth-document-filename-font-size, 1rem);
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
}

.auth-app .auth-capture-item,
.auth-capture-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: var(--auth-capture-item-padding, 0.75rem);
    border: var(--auth-capture-item-border-width, 1px) solid var(--auth-capture-item-border-color, #d1d5db);
    border-radius: var(--auth-capture-item-radius, 12px);
    background: var(--auth-capture-item-bg, #ffffff);
}

.auth-capture-item__footer {
    display: contents;
}

.auth-capture-item__media,
.auth-capture-item__description-slot,
.auth-capture-item__actions {
    display: block;
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.auth-capture-item__description-slot {
    min-height: 1.5em;
    margin-top: var(--auth-short-description-gap-above, 0.4rem);
    margin-right: 0;
    margin-bottom: var(--auth-short-description-gap-below, 0.4rem);
    margin-left: 0;
    padding: 0;
    text-align: center;
}

.auth-capture-item__description-slot > p.auth-capture-item__description {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 1.4;
    font-size: 1rem;
    color: var(--auth-color-text);
    font-weight: 400;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.auth-capture-item__description-prefix {
    font-weight: 500;
}

.auth-app .auth-capture-item__actions,
.auth-capture-item__actions,
.auth-capture-item .auth-media-inline-actions,
.auth-capture-item .auth-gallery-capture__media-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--auth-capture-item-gap, 0.75rem);
    margin: 0;
    text-align: center;
}

.auth-capture-item__media .auth-gallery-capture__thumb,
.auth-capture-item .auth-gallery-capture__thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.auth-capture-item__media video.auth-my-ai__primary-video,
.auth-capture-item__media .auth-media-capture__preview,
.auth-capture-item__media .auth-media-capture__playback[controls] {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: transparent;
}

.auth-capture-item__media audio.auth-my-ai__primary-audio,
.auth-capture-item__media .auth-media-capture__playback {
    display: block;
    width: 100%;
    max-width: 100%;
}

.auth-capture-item .auth-button {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    align-self: center;
    margin: 0;
}

.auth-capture-item .auth-form__error {
    margin-top: 0.5rem;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-capture-item__actions,
    .auth-capture-item .auth-media-inline-actions,
    .auth-capture-item .auth-gallery-capture__media-actions {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .auth-capture-item .auth-button {
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* Gallery slot section (labeled shell; items use full capture-item cards) */
.auth-media-slot--gallery.auth-my-ai__gallery-capture,
.auth-form__group.auth-media-slot--gallery {
    margin: 0 0 1.25rem;
}

.auth-media-slot--gallery > .auth-form__label {
    margin: 0 0 0.5rem;
}

.auth-document-capture-acquire {
    display: flex;
    flex-wrap: wrap;
    gap: var(--auth-capture-item-gap, 0.75rem);
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.auth-document-capture-acquire[hidden],
.auth-media-slot > [data-21csystems-acquire][hidden] {
    display: none !important;
}

.auth-form__group.auth-media-slot:not(.auth-media-slot--gallery) {
    margin: 0 0 1.25rem;
}

.auth-form__group.auth-media-slot:not(.auth-media-slot--gallery) > .auth-form__label {
    margin: 0 0 0.5rem;
}

/*
 * Primary Image preview — not Frontend Styler token-controlled (shared
 * --auth-capture-item-min-width only sized the grid column ~280px).
 * Target ~3× original display size (840px); width/height scale together via height:auto.
 */
.auth-app .auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-capture-item-grid,
.auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-capture-item-grid {
    grid-template-columns: minmax(0, 840px);
}

.auth-app .auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-capture-item,
.auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-capture-item {
    max-width: 840px;
}

.auth-app .auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-gallery-capture__thumb,
.auth-media-slot[data-21csystems-media-slot="primary_image"] .auth-gallery-capture__thumb {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.auth-records__table-wrap {
    overflow-x: auto;
}

.auth-records__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.auth-records__table th,
.auth-records__table td {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--auth-color-border);
    vertical-align: top;
}

.auth-records__table th {
    font-weight: 600;
}

.auth-records__locked {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-color-danger, #b32d2e);
}

.auth-records__delete-form {
    display: inline;
    margin: 0;
}

.auth-records__delete-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
}

/* Profile-usage field_visibility toggles (edit form only) */
.c21-profile-visibility {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
}

.c21-profile-visibility label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

/* Profile Showcased Work — edit picker + public grid */
.c21-profile-showcase__visibility-notice {
  font-weight: 600;
  margin-top: 0.35em;
  margin-bottom: 1em;
}

.c21-profile-showcase__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0;
}

.c21-profile-showcase__filters input[type="search"],
.c21-profile-showcase__filters select {
    min-width: 10rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--auth-color-border, #d1d5db);
    border-radius: var(--auth-radius, 6px);
    font-size: 0.95rem;
}

.c21-profile-showcase__results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}

.c21-profile-showcase__card {
    display: grid;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid var(--auth-color-border, #d1d5db);
    border-radius: 8px;
    background: var(--auth-color-surface, #fff);
}

.c21-profile-showcase__card-thumb,
.c21-profile-showcase__thumb {
    aspect-ratio: 1;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.c21-profile-showcase__card-thumb img,
.c21-profile-showcase__thumb img,
.c21-profile-showcase-view__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c21-profile-showcase__thumb-empty {
    font-size: 0.8rem;
    color: var(--auth-color-muted, #6b7280);
    text-align: center;
    padding: 0.5rem;
}

.c21-profile-showcase__card-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.c21-profile-showcase__card-meta,
.c21-profile-showcase__type {
    font-size: 0.8rem;
    color: var(--auth-color-muted, #6b7280);
}

.c21-profile-showcase__items {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.c21-profile-showcase__item {
    display: grid;
    grid-template-columns: auto 4.5rem 1fr auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--auth-color-border, #d1d5db);
    border-radius: 8px;
    background: var(--auth-color-surface, #fff);
}

.c21-profile-showcase__item.is-dragging {
    opacity: 0.55;
}

.c21-profile-showcase__handle {
    cursor: grab;
    user-select: none;
    padding: 0.25rem;
    color: var(--auth-color-muted, #6b7280);
}

.c21-profile-showcase__meta {
    display: grid;
    gap: 0.25rem;
}

.c21-profile-showcase__slot {
    display: grid;
    gap: 0.2rem;
    font-size: 0.85rem;
}

.c21-profile-showcase__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.c21-profile-showcase-view__grid {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 1rem;
}

.c21-profile-showcase-view__item {
    display: grid;
    gap: 0.4rem;
}

.c21-profile-showcase-view__media {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
}

.c21-profile-showcase-view__title {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .c21-profile-showcase__item {
        grid-template-columns: auto 3.5rem 1fr;
    }

    .c21-profile-showcase__actions {
        grid-column: 1 / -1;
    }
}

/* My Account shell */
.auth-my-account {
    max-width: 48rem;
}

.auth-my-account__greeting {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
}

.auth-my-account__grid,
.auth-my-account__extensions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.auth-my-account__extensions:empty {
    display: none;
}

.auth-my-account__extensions:not(:empty) {
    margin-top: 1rem;
}

.auth-my-account__card {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--auth-color-border, #d1d5db);
    border-radius: var(--auth-field-section-radius, 8px);
    background: var(--auth-field-section-bg, #f9fafb);
    color: var(--auth-color-text, #111827);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-my-account__card:hover,
.auth-my-account__card:focus {
    border-color: var(--auth-color-primary-border, #1e40af);
    background: var(--auth-color-surface, #fff);
    color: var(--auth-color-text, #111827);
    text-decoration: none;
}

.auth-my-account__card-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.auth-my-account__card-desc {
    font-size: 0.9rem;
    color: #000;
    line-height: 1.4;
}

.auth-my-account__card-cta {
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--auth-color-primary, #2563eb);
}

/* Profile direct messaging — disabled control (logged-out / opt-out). */
.auth-app .c21-profile-message-btn:disabled,
.auth-app .c21-profile-message-btn[aria-disabled="true"],
button.c21-profile-message-btn:disabled,
button.c21-profile-message-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.c21-profile-message-wrap {
    margin: 1.25rem 0 0;
}
