/* ==========================================================================
   UMAI — Web Auth Pages
   Uses the site's design tokens from site.css
   ========================================================================== */

.wa-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

/* ---------- Header -------------------------------------------------------- */
.wa-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.wa-header__link {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wa-header__icon {
    height: 34px;
    width: 31px;
    max-width: none;
}

.wa-header__text {
    height: 26px;
    width: 64px;
    max-width: none;
}

:root[data-theme="dark"] .wa-header__text { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .wa-header__text { filter: brightness(0) invert(1); }
}

/* ---------- Main ---------------------------------------------------------- */
.wa-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 1rem 3rem;
}

.wa-card {
    width: 100%;
    max-width: 440px;
    background: var(--panel);
    border: var(--border-brutal);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal);
    padding: 2.5rem 2rem;
}

.wa-card--wide {
    max-width: 720px;
}

.wa-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.wa-card__subtitle {
    color: var(--text-muted);
    font-size: .875rem;
    margin-bottom: 1.5rem;
}

/* ---------- Flash messages ------------------------------------------------ */
.wa-flash {
    padding: .75rem 1rem;
    border-radius: var(--radius-btn);
    margin-bottom: 1.25rem;
    font-size: .875rem;
    font-weight: 500;
    border: 2px solid transparent;
}

.wa-flash--success {
    background: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.wa-flash--error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.wa-flash--info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

:root[data-theme="dark"] .wa-flash--success {
    background: rgba(16, 185, 129, .15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .3);
}

:root[data-theme="dark"] .wa-flash--error {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .3);
}

:root[data-theme="dark"] .wa-flash--info {
    background: rgba(59, 130, 246, .15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .3);
}

/* ---------- Error list ---------------------------------------------------- */
.wa-errors {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fca5a5;
    border-radius: var(--radius-btn);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .875rem;
}

.wa-errors ul {
    list-style: disc;
    padding-left: 1.25rem;
}

.wa-errors li + li {
    margin-top: .25rem;
}

:root[data-theme="dark"] .wa-errors {
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .3);
}

/* ---------- Forms --------------------------------------------------------- */
.wa-form__group {
    margin-bottom: 1.25rem;
}

.wa-form__label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    margin-bottom: .375rem;
    color: var(--text);
}

.wa-form__input,
.wa-support input[type="text"],
.wa-support select,
.wa-support textarea {
    display: block;
    width: 100%;
    padding: .625rem .75rem;
    font-size: .9375rem;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    transition: border-color .15s;
}

select.wa-form__input,
.wa-support select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
}

.wa-form__input:focus,
.wa-support input[type="text"]:focus,
.wa-support select:focus,
.wa-support textarea:focus {
    outline: none;
    border-color: var(--red);
}

.wa-form__input::placeholder {
    color: var(--text-muted);
}

.wa-form__hint {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.wa-form__optional {
    font-weight: 400;
    font-size: .6875rem;
    color: #aaa;
}

.wa-form__check {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
}

.wa-form__check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--red);
}

/* ---------- Toggle switch (slider) --------------------------------------- */
.wa-form__toggle {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .875rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.wa-form__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wa-form__toggle-track {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    background: var(--line);
    border-radius: 10px;
    transition: background .2s;
}

.wa-form__toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.wa-form__toggle input:checked + .wa-form__toggle-track {
    background: var(--red);
}

.wa-form__toggle input:checked + .wa-form__toggle-track .wa-form__toggle-knob {
    transform: translateX(16px);
}

.wa-form__toggle input:focus-visible + .wa-form__toggle-track {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* ---------- Password wrapper ---------------------------------------------- */
.wa-pw-wrap {
    position: relative;
}

.wa-pw-wrap .wa-form__input {
    padding-right: 2.75rem;
}

.wa-pw-toggle {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: .25rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
    transition: color .15s;
}

.wa-pw-toggle:hover {
    color: var(--text);
}

.wa-pw-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ---------- Password strength meter -------------------------------------- */
.wa-pw-strength {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .375rem;
}

.wa-pw-strength__track {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.wa-pw-strength__bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .3s, background-color .3s;
}

.wa-pw-strength__label {
    font-size: .6875rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: right;
    transition: color .3s;
}

.wa-pw-strength[data-level="0"] .wa-pw-strength__bar { width: 0; background: transparent; }
.wa-pw-strength[data-level="0"] .wa-pw-strength__label { color: var(--text-muted); }

.wa-pw-strength[data-level="1"] .wa-pw-strength__bar { width: 25%; background: #ef4444; }
.wa-pw-strength[data-level="1"] .wa-pw-strength__label { color: #ef4444; }

.wa-pw-strength[data-level="2"] .wa-pw-strength__bar { width: 50%; background: #f59e0b; }
.wa-pw-strength[data-level="2"] .wa-pw-strength__label { color: #f59e0b; }

.wa-pw-strength[data-level="3"] .wa-pw-strength__bar { width: 75%; background: #22c55e; }
.wa-pw-strength[data-level="3"] .wa-pw-strength__label { color: #22c55e; }

.wa-pw-strength[data-level="4"] .wa-pw-strength__bar { width: 100%; background: #16a34a; }
.wa-pw-strength[data-level="4"] .wa-pw-strength__label { color: #16a34a; }

/* ---------- Password match indicator ------------------------------------- */
.wa-pw-match {
    font-size: .6875rem;
    font-weight: 600;
    margin-top: .25rem;
    transition: color .2s;
}

.wa-pw-match--ok { color: #22c55e; }
.wa-pw-match--no { color: #ef4444; }

/* ---------- Buttons ------------------------------------------------------- */
.wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .75rem 1.25rem;
    font-size: .9375rem;
    font-weight: 600;
    border-radius: var(--radius-btn);
    border: var(--border-brutal);
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
    text-decoration: none;
}

.wa-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-brutal-sm);
}

.wa-btn:active {
    transform: translate(0, 0);
    box-shadow: none;
}

.wa-btn--primary {
    background: var(--red);
    color: #fff;
    border-color: var(--text);
}

.wa-btn--outline {
    background: transparent;
    color: var(--text);
}

.wa-btn--google {
    background: #fff;
    color: #333;
    border-color: #777;
    font-weight: 500;
}

:root[data-theme="dark"] .wa-btn--google {
    background: #1a1a1a;
    color: var(--text);
    border-color: #888;
}

.wa-btn--passkey {
    background: var(--bg);
    color: var(--text);
    border-color: #777;
    font-weight: 500;
    margin-top: .5rem;
}

:root[data-theme="dark"] .wa-btn--passkey {
    border-color: #888;
}

/* ---------- Passkey status ----------------------------------------------- */
.wa-passkey-status {
    font-size: .8125rem;
    text-align: center;
    padding: .5rem;
    margin-top: .5rem;
    color: var(--text-muted);
}

.wa-passkey-status--error {
    color: #ef4444;
}

.wa-btn--sm {
    padding: .5rem .875rem;
    font-size: .8125rem;
    width: auto;
}

.wa-btn--danger {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}

.wa-btn--danger:hover {
    background: var(--red);
    color: #fff;
}

:root[data-theme="dark"] .wa-btn--primary {
    background: #dc2626;
    border-color: rgba(255, 255, 255, .18);
}

:root[data-theme="dark"] .wa-btn--danger {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, .4);
    background: rgba(220, 38, 38, .1);
}

:root[data-theme="dark"] .wa-btn--danger:hover {
    background: #dc2626;
    color: #fff;
    border-color: rgba(255, 255, 255, .18);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .wa-btn--primary {
        background: #dc2626;
        border-color: rgba(255, 255, 255, .18);
    }

    :root[data-theme="auto"] .wa-btn--danger {
        color: #fca5a5;
        border-color: rgba(252, 165, 165, .4);
        background: rgba(220, 38, 38, .1);
    }

    :root[data-theme="auto"] .wa-btn--danger:hover {
        background: #dc2626;
        color: #fff;
        border-color: rgba(255, 255, 255, .18);
    }
}

/* ---------- Separator ----------------------------------------------------- */
.wa-separator {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: .8125rem;
}

.wa-separator::before,
.wa-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ---------- Links --------------------------------------------------------- */
.wa-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-top: 1.5rem;
    font-size: .875rem;
}

.wa-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

:root[data-theme="dark"] .wa-link {
    color: #999;
}

.wa-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ---------- Verification code input --------------------------------------- */
.wa-code-input {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: .5rem;
    padding: .75rem 1rem;
}

/* ---------- Tabs ---------------------------------------------------------- */
.wa-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--line);
    margin-bottom: 1.5rem;
}

.wa-tabs__tab {
    padding: .625rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    text-decoration: none;
}

.wa-tabs__tab:hover {
    color: var(--text);
}

.wa-tabs__tab--active {
    color: var(--text);
    border-bottom-color: var(--red);
}

/* ---------- Account sections ---------------------------------------------- */
.wa-section {
    margin-bottom: 2rem;
}

.wa-section__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.wa-section__subtitle {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ---------- Media list ---------------------------------------------------- */
.wa-media-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.wa-media-item:last-child {
    border-bottom: none;
}

.wa-media-item__info {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.wa-media-item__favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--bg-alt);
}

.wa-media-item__name {
    font-weight: 600;
    font-size: .9375rem;
}

.wa-media-item__title {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ---------- Media search -------------------------------------------------- */
.wa-media-search {
    position: relative;
}

.wa-media-search__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.wa-media-search__results.is-open {
    display: block;
}

.wa-media-search__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .875rem;
    transition: background .1s;
}

.wa-media-search__item:hover {
    background: var(--bg-alt);
}

.wa-media-search__favicon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    flex-shrink: 0;
    object-fit: contain;
}

.wa-media-search__favicon-empty {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--line);
}

.wa-media-search__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Selected media chip ------------------------------------------ */
.wa-media-selected[hidden] {
    display: none;
}

.wa-media-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .625rem .75rem;
    border: 2px solid var(--green);
    border-radius: var(--radius-btn);
    background: rgba(34, 197, 94, .04);
    margin-top: .375rem;
}

:root[data-theme="dark"] .wa-media-selected {
    background: rgba(34, 197, 94, .08);
}

.wa-media-selected__info {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-width: 0;
}

.wa-media-selected__favicon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--bg);
}

.wa-media-selected__name {
    font-weight: 600;
    font-size: .9375rem;
}

.wa-media-selected__url {
    font-size: .75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-media-selected__remove {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: .25rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.wa-media-selected__remove:hover {
    color: var(--red);
    background: rgba(230, 57, 70, .08);
}

/* ---------- Suggest link ------------------------------------------------- */
.wa-suggest-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin-top: .5rem;
    font-size: .8125rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.wa-suggest-link svg {
    flex-shrink: 0;
}

.wa-suggest-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* ---------- Media item dates --------------------------------------------- */
.wa-media-item__dates {
    font-size: .6875rem;
    color: var(--text-muted);
    margin-top: .125rem;
}

/* ---------- Modal -------------------------------------------------------- */
.wa-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.wa-modal-overlay.is-open {
    display: flex;
}

.wa-modal {
    background: var(--panel);
    border: var(--border-brutal);
    border-radius: var(--radius);
    box-shadow: var(--shadow-brutal);
    width: 100%;
    max-width: 420px;
}

.wa-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.wa-modal__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
}

.wa-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 .25rem;
}

.wa-modal__close:hover {
    color: var(--text);
}

.wa-modal__body {
    padding: 1.25rem 1.5rem;
}

.wa-modal__body .wa-form__group:last-child {
    margin-bottom: 0;
}

.wa-modal__footer {
    padding: 0 1.5rem 1.25rem;
}

/* ---------- Card header with logout --------------------------------------- */
.wa-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.wa-btn--logout {
    flex-shrink: 0;
    margin-top: .25rem;
}

/* ---------- Session cards ------------------------------------------------- */
.wa-sessions {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.wa-session-card {
    display: flex;
    gap: .875rem;
    padding: .875rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
    transition: border-color .15s;
}

.wa-session-card--current {
    border-color: var(--green);
    background: rgba(34, 197, 94, .04);
}

:root[data-theme="dark"] .wa-session-card--current {
    background: rgba(34, 197, 94, .08);
}

.wa-session-card__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    margin-top: .125rem;
}

.wa-session-card__icon svg {
    width: 100%;
    height: 100%;
}

.wa-session-card--current .wa-session-card__icon {
    color: var(--green);
}

.wa-session-card__body {
    flex: 1;
    min-width: 0;
}

.wa-session-card__name {
    font-weight: 600;
    font-size: .9375rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.wa-session-card__badge {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--green);
    background: rgba(34, 197, 94, .12);
    padding: .125rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}

:root[data-theme="dark"] .wa-session-card__badge {
    background: rgba(34, 197, 94, .2);
}

.wa-session-card__details {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-top: .25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
}

.wa-session-card__method {
    font-weight: 500;
    color: var(--text);
}

.wa-session-card__sep {
    color: var(--line);
}

.wa-session-card__time {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.wa-session-card__close {
    flex-shrink: 0;
    align-self: center;
    opacity: 0;
    transition: opacity .15s;
    margin: 0;
}

.wa-session-card:hover .wa-session-card__close {
    opacity: 1;
}

.wa-sessions__summary {
    font-size: .8125rem;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.wa-sessions__bulk {
    margin-top: 1rem;
}

/* ---------- Passkey list ------------------------------------------------- */
.wa-passkey-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.wa-passkey-item:last-child {
    border-bottom: none;
}

.wa-passkey-item__info {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.wa-passkey-item__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.wa-passkey-item__name {
    font-weight: 600;
    font-size: .9375rem;
}

.wa-passkey-item__meta {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .125rem;
}

/* ---------- Google linked ------------------------------------------------- */
.wa-google-status {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius-btn);
    margin-bottom: 1rem;
}

.wa-google-status__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.wa-google-status__text {
    font-size: .875rem;
}

.wa-google-status__email {
    font-weight: 600;
}

/* ---------- Inline form row ----------------------------------------------- */
.wa-form__row {
    display: flex;
    gap: .75rem;
}

.wa-form__row > * {
    flex: 1;
}

/* ---------- Footer -------------------------------------------------------- */
.wa-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .75rem;
    color: var(--text-muted);
}

.wa-footer a {
    color: var(--text-muted);
    text-decoration: underline;
}

/* ---------- Avatar upload ------------------------------------------------- */
.wa-avatar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.wa-avatar__preview {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--line);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-avatar__preview picture {
    width: 100%;
    height: 100%;
}

.wa-avatar__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.wa-avatar__preview img[hidden] {
    display: none;
}

.wa-avatar__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    background: var(--red);
    border-radius: 50%;
    user-select: none;
}

.wa-avatar__placeholder[hidden] {
    display: none;
}

.wa-avatar__dropzone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1.5rem 1rem;
    border: 2px dashed var(--line);
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, background .15s;
    position: relative;
}

.wa-avatar__dropzone:hover {
    border-color: var(--text-muted);
}

.wa-avatar__dropzone--dragover {
    border-color: var(--red);
    background: rgba(230, 57, 70, .04);
}

:root[data-theme="dark"] .wa-avatar__dropzone--dragover {
    background: rgba(230, 57, 70, .08);
}

.wa-avatar__dropzone-icon {
    color: var(--text-muted);
}

.wa-avatar__dropzone-text {
    font-size: .8125rem;
    color: var(--text-muted);
}

.wa-avatar__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.wa-avatar__message {
    font-size: .8125rem;
    margin-top: .5rem;
    min-height: 1.25em;
}

.wa-avatar__message:empty {
    display: none;
}

.wa-avatar__message--success { color: #22c55e; }
.wa-avatar__message--error   { color: #ef4444; }
.wa-avatar__message--info    { color: var(--text-muted); }

/* ---------- Avatar editor modal ------------------------------------------ */
.wa-modal--avatar {
    max-width: 480px;
}

.wa-avatar-editor__canvas-wrap {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.wa-avatar-editor__canvas-wrap canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-btn);
    cursor: grab;
    touch-action: none;
}

.wa-avatar-editor__canvas-wrap canvas:active {
    cursor: grabbing;
}

.wa-avatar-editor__controls {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: 1rem;
}

.wa-avatar-editor__control {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.wa-avatar-editor__control label {
    font-size: .8125rem;
    font-weight: 600;
    min-width: 3.5rem;
    color: var(--text);
}

.wa-avatar-editor__control input[type="range"] {
    flex: 1;
    accent-color: var(--red);
}

.wa-modal__footer--actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* ---------- Role picker -------------------------------------------------- */
.wa-role-picker {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.wa-role-picker__option {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .75rem 1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.wa-role-picker__option:hover {
    border-color: var(--text-muted);
}

.wa-role-picker__option--checked {
    border-color: var(--red);
    background: rgba(230, 57, 70, .04);
}

:root[data-theme="dark"] .wa-role-picker__option--checked {
    background: rgba(230, 57, 70, .08);
}

.wa-role-picker__option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: .25rem;
    accent-color: var(--red);
    flex-shrink: 0;
}

.wa-role-picker__content {
    display: flex;
    flex-direction: column;
    gap: .125rem;
}

.wa-role-picker__name {
    font-weight: 600;
    font-size: .9375rem;
}

.wa-role-picker__desc {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ---------- Searchable picker --------------------------------------------- */
.wa-picker {
    position: relative;
}

.wa-picker__trigger {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .625rem .75rem;
    font-size: .9375rem;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s;
    width: 100%;
    text-align: left;
}

.wa-picker__trigger:focus {
    outline: none;
    border-color: var(--red);
}

.wa-picker__flag {
    font-size: 1.125rem;
    line-height: 1;
}

.wa-picker__text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-picker__arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform .2s;
}

.wa-picker.is-open .wa-picker__arrow {
    transform: rotate(180deg);
}

.wa-picker__icon {
    flex-shrink: 0;
    line-height: 0;
    display: flex;
    align-items: center;
}

.wa-picker__icon svg {
    display: block;
}

.wa-picker__icon--flag {
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}

:root[data-theme="dark"] .wa-picker__icon--flag {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .wa-picker__icon--flag {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
    }
}

.wa-picker__option-icon {
    flex-shrink: 0;
    line-height: 0;
    display: flex;
    align-items: center;
}

.wa-picker__option-icon svg {
    display: block;
}

.wa-picker__option-icon--flag {
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .1);
}

:root[data-theme="dark"] .wa-picker__option-icon--flag {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .wa-picker__option-icon--flag {
        box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
    }
}

.wa-picker.is-open .wa-picker__trigger {
    border-color: var(--red);
}

.wa-picker__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 280px;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 20;
    display: none;
    flex-direction: column;
    max-height: 280px;
    overflow: hidden;
}

.wa-picker.is-open .wa-picker__dropdown {
    display: flex;
}

:root[data-theme="dark"] .wa-picker__dropdown {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.wa-picker__search-wrap {
    padding: .5rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.wa-picker__search {
    display: block;
    width: 100%;
    padding: .5rem .625rem;
    font-size: .8125rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
}

.wa-picker__search:focus {
    outline: none;
    border-color: var(--red);
}

.wa-picker__search::placeholder {
    color: var(--text-muted);
}

.wa-picker__options {
    overflow-y: auto;
    flex: 1;
    padding: .25rem 0;
}

.wa-picker__option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    font-size: .875rem;
    cursor: pointer;
    transition: background .1s;
}

.wa-picker__option:hover {
    background: var(--bg-alt);
}

/* The arrow keys move focus between options, so where that focus sits has to
   be visible: without this a keyboard user can operate the list but cannot
   see which option they are on. Plain :focus, not :focus-visible, because
   this focus is moved by script and browsers disagree about whether that
   counts as visible. */
.wa-picker__option:focus {
    outline: 2px solid var(--red);
    outline-offset: -2px;
    background: var(--bg-alt);
}

.wa-picker__option--active {
    background: rgba(230, 57, 70, .06);
}

:root[data-theme="dark"] .wa-picker__option--active {
    background: rgba(230, 57, 70, .12);
}

.wa-picker__option-flag {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.wa-picker__option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-picker__option-code {
    color: var(--text-muted);
    font-size: .8125rem;
    flex-shrink: 0;
}

.wa-picker__empty {
    padding: .75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .8125rem;
}

/* ---------- Contact phone row --------------------------------------------- */
.wa-contact-phone {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.wa-contact-phone .wa-picker {
    flex-shrink: 0;
    width: 130px;
}

.wa-contact-phone > .wa-form__input {
    flex: 1;
}

/* ---------- Social network rows ------------------------------------------ */
.wa-social-row {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .5rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
    margin-bottom: .5rem;
    transition: border-color .15s;
}

.wa-social-row:hover {
    border-color: var(--text-muted);
}

/* Social platform picker */
.wa-social-picker {
    position: relative;
    flex-shrink: 0;
    width: 160px;
}

.wa-social-picker__trigger {
    display: flex;
    align-items: center;
    gap: .375rem;
    width: 100%;
    padding: .25rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    white-space: nowrap;
    line-height: 1.2;
}

.wa-social-picker__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 0;
}

.wa-social-picker__icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.wa-social-picker__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-social-picker__name--empty {
    color: var(--text-muted);
    font-weight: 400;
}

.wa-social-picker__arrow {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    transition: transform .2s;
}

.wa-social-picker.is-open .wa-social-picker__arrow {
    transform: rotate(180deg);
}

.wa-social-picker__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: -.75rem;
    min-width: 200px;
    background: var(--panel);
    border: 2px solid var(--line);
    border-radius: var(--radius-btn);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 20;
    display: none;
    padding: .25rem 0;
    max-height: 260px;
    overflow-y: auto;
}

.wa-social-picker.is-open .wa-social-picker__menu {
    display: block;
}

:root[data-theme="dark"] .wa-social-picker__menu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

.wa-social-picker__option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    font-size: .875rem;
    cursor: pointer;
    transition: background .1s;
}

.wa-social-picker__option:hover {
    background: var(--bg-alt);
}

.wa-social-picker__option--active {
    background: rgba(230, 57, 70, .06);
}

:root[data-theme="dark"] .wa-social-picker__option--active {
    background: rgba(230, 57, 70, .12);
}

.wa-social-picker__option-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 0;
}

.wa-social-picker__option-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.wa-social-picker__option-name {
    flex: 1;
}

.wa-social-row__handle {
    flex: 1;
    min-width: 0;
    border-color: transparent !important;
    background: transparent !important;
}

.wa-social-row__handle:focus {
    border-color: var(--line) !important;
    background: var(--bg) !important;
}

.wa-social-row__remove {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: .375rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
    border-radius: 4px;
    transition: color .15s, background .15s;
}

.wa-social-row__remove:hover {
    color: var(--red);
    background: rgba(230, 57, 70, .08);
}

.wa-social-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    width: 100%;
    padding: .75rem;
    border: 2px dashed var(--line);
    border-radius: var(--radius-btn);
    background: none;
    color: var(--text-muted);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    margin-top: .25rem;
}

.wa-social-add:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(230, 57, 70, .03);
}

:root[data-theme="dark"] .wa-social-add:hover {
    background: rgba(230, 57, 70, .06);
}

/* ---------- Privacy badges ------------------------------------------------ */
.wa-privacy-badge {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: help;
    color: var(--text-muted);
    vertical-align: middle;
    margin-left: .25rem;
}

.wa-privacy-badge svg {
    width: 14px;
    height: 14px;
}

.wa-privacy-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--panel);
    font-size: .6875rem;
    font-weight: 500;
    line-height: 1.35;
    padding: .375rem .625rem;
    border-radius: 6px;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 30;
    white-space: normal;
}

.wa-privacy-badge::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    z-index: 30;
}

.wa-privacy-badge:hover::after,
.wa-privacy-badge:hover::before {
    opacity: 1;
}

.wa-privacy-badge--private {
    color: var(--text-muted);
}

.wa-privacy-badge--public {
    color: var(--text-muted);
}

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 480px) {
    .wa-card {
        padding: 1.75rem 1.25rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-shadow: none;
    }

    .wa-form__row {
        flex-direction: column;
        gap: .5rem;
    }

    .wa-session-card__close {
        opacity: 1;
    }

    .wa-avatar {
        flex-direction: column;
        text-align: center;
    }

    .wa-avatar__preview {
        width: 100px;
        height: 100px;
    }

    .wa-contact-phone {
        flex-direction: column;
    }

    .wa-contact-phone .wa-picker {
        width: 100%;
    }

    .wa-picker__dropdown {
        min-width: 0;
        right: 0;
    }

    .wa-social-picker {
        width: 140px;
    }
}

/* ---------- Tags --------------------------------------------------------- */
.wa-tags-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.wa-tag-item {
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.wa-tag-item:last-child {
    border-bottom: none;
}

.wa-tag-item__display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.wa-tag-item__actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.wa-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.wa-tag-item__edit-form {
    margin-top: .75rem;
    padding: .75rem;
    background: var(--bg-alt, #f9fafb);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.wa-tag-edit-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.wa-tag-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.wa-tag-input-wrap__color {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    z-index: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.wa-tag-input-wrap__color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.wa-tag-input-wrap__color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.wa-tag-input-wrap__color::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

.wa-form__input--with-color {
    padding-left: 42px;
}

.wa-form__input--sm {
    padding: .5rem .75rem;
    font-size: .875rem;
}

.wa-form__input--sm.wa-form__input--with-color {
    padding-left: 42px;
}

.wa-tags-empty {
    color: var(--text-muted);
    font-size: .875rem;
}

/* ---------- Support -------------------------------------------------------- */
.wa-support {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* The public shell already wraps content in a card, so the thread's own
   cards would nest two borders and two shadows. The account shell does not
   wrap, so this only ever matches the guest view. */
.wa-card .wa-support > .wa-card {
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: none;
}

/* Carried over from the rules the rewrite replaced: these three still match
   the thread markup and have no equivalent in the block below. */
.wa-support__message header time {
    flex-shrink: 0;
    font-size: .75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.wa-support__files a {
    display: inline-block;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: underline;
    /* An uploaded file can be named anything, including one long unbroken
       string, and this list sits inside the same bordered card. */
    overflow-wrap: anywhere;
}

.wa-support__files a:hover {
    color: var(--red);
}

/* ==========================================================================
   Support tab (/cuenta/soporte)
   ========================================================================== */

/* The attachment picker's rules live in css/file-drop.css, shared with the
   panel. This is only the account palette mapped onto the tokens it reads. */
.file-drop {
    --fd-surface: var(--panel);
    --fd-surface-muted: var(--bg-alt);
    --fd-border: var(--text);
    --fd-text: var(--text);
    --fd-text-muted: var(--text-muted);
    --fd-accent: var(--orange);
    --fd-accent-soft: rgba(255, 107, 53, .18);
    --fd-danger: var(--red);
    --fd-danger-soft: rgba(230, 57, 70, .14);
    --fd-radius: var(--radius, 12px);
    --fd-radius-sm: 8px;
}

.wa-support__empty {
    margin: 0;
    padding: 1.25rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius, 12px);
    color: var(--text-muted);
    text-align: center;
}

.wa-support__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.wa-support__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .875rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
    background: var(--panel);
    transition: border-color .15s ease, transform .15s ease;
}

.wa-support__item:hover {
    border-color: var(--text);
    transform: translateY(-1px);
}

.wa-support__link {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.wa-support__ref {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.wa-support__subject {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-support__status {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .25rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-muted);
}

/* Open and pending are the two that want an answer, so they are the two that
   carry colour. Resolved and closed stay quiet. */
.wa-support__status--open {
    border-color: var(--orange);
    color: var(--orange);
}

.wa-support__status--pending {
    border-color: var(--blue);
    color: var(--blue);
}

.wa-support__form {
    display: grid;
    gap: 1.25rem;
}

.wa-support__form textarea.wa-form__input {
    resize: vertical;
    min-height: 8rem;
}

.wa-form__hint {
    display: block;
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.wa-support__actions {
    display: flex;
    justify-content: flex-end;
}

/* .wa-btn is width: 100% by default, so the submit needs telling not to
   stretch across the section. The rules this replaced did the same thing
   through a .wa-support .wa-btn selector. */
.wa-support__actions .wa-btn {
    width: auto;
    padding: .625rem 1.5rem;
}

@media (max-width: 560px) {
    .wa-support__item {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }

    .wa-support__actions .wa-btn {
        width: 100%;
    }

    /* Carried over from the responsive rules the rewrite replaced. */
    .wa-support__reply,
    .wa-support__message {
        padding: 1rem;
    }
}

/* Ticket thread (one ticket inside the Support tab) */
.wa-support__head {
    display: grid;
    gap: .4rem;
}

.wa-support__back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    align-self: flex-start;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.wa-support__back:hover {
    color: var(--text);
}

.wa-support__meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 0;
}

.wa-support__message {
    padding: 1rem 1.125rem;
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
    background: var(--panel);
    margin-bottom: .75rem;
}

.wa-support__message header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: .5rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.wa-support__message header strong {
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* A pasted URL or an error string has no spaces to break at, and this sits
   inside a card with a border: without a break rule it pushes the card wider
   than the screen rather than wrapping. */
.wa-support__body {
    font-size: .9375rem;
    line-height: 1.6;
    color: var(--text);
    overflow-wrap: break-word;
}

.wa-support__files {
    list-style: none;
    margin: .75rem 0 0;
    padding: .625rem 0 0;
    border-top: 1px dashed var(--line);
    display: grid;
    gap: .3rem;
    font-size: .875rem;
}

/* A panel, as it was before: the reply form is a distinct block at the foot
   of the thread rather than loose fields under the last message. The mobile
   rule further down reduces this padding, and had nothing to reduce while
   these four properties were missing. */
.wa-support__reply {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-btn);
    background: var(--bg-alt);
}

.wa-support__closed {
    margin-top: 1.25rem;
    padding: 1rem;
    font-size: .875rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius, 12px);
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Account calendar (/cuenta/calendario)
   ========================================================================== */

.wa-cal__toolbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

.wa-cal__views {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

/* .wa-btn is width: 100% by default, so these have to be told not to stretch. */
.wa-cal__views .wa-btn,
.wa-cal__actions .wa-btn,
.wa-cal__delete .wa-btn {
    width: auto;
    padding: .375rem .75rem;
    font-size: .8125rem;
}

.wa-cal__month {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.wa-cal__day {
    height: 6rem;
    vertical-align: top;
    padding: .375rem;
    border: 1px solid var(--line);
}

.wa-cal__day--outside {
    background: var(--bg-alt);
    color: var(--text-muted);
}

.wa-cal__date {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.wa-cal__event {
    display: block;
    margin-bottom: 2px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 107, 53, .16);
    color: var(--text);
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-cal__event:hover {
    background: rgba(255, 107, 53, .28);
}

.wa-cal__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .5rem;
}

.wa-cal__weekday {
    min-height: 7rem;
    padding: .5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
}

.wa-cal__list,
.wa-cal__preview {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.wa-cal__list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .625rem .75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius, 12px);
}

.wa-cal__preview li {
    padding: .5rem .75rem;
    border-left: 3px solid var(--orange);
    background: var(--bg-alt);
}

.wa-cal__preview--skipped li {
    border-left-color: var(--text-muted);
    color: var(--text-muted);
}

.wa-cal__subtitle {
    font-size: .875rem;
    font-weight: 700;
    margin: 1rem 0 .5rem;
}

.wa-cal__muted {
    font-size: .8125rem;
    color: var(--text-muted);
}

.wa-cal__form {
    display: grid;
    gap: 1rem;
}

.wa-cal__actions,
.wa-cal__delete {
    display: flex;
    justify-content: flex-end;
}

.wa-cal__delete {
    margin-top: .75rem;
}

@media (max-width: 900px) {
    .wa-cal__week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .wa-cal__week { grid-template-columns: 1fr; }
    .wa-cal__day { height: auto; }
    .wa-cal__list li { flex-direction: column; gap: .25rem; }
}
