/*
 * RoomUpItalia — Mappa del file CSS
 * Ambito: Fondazioni globali, layout generale, header, sidebar e utility condivise.
 * Classi utilizzate:
 *   .account-button, .account-card, .account-card-label, .account-card-number, .account-favorites-page
 *   .account-grid, .account-hero, .account-info-box, .account-kicker, .account-list
 *   .account-list-card, .account-page, .account-page-header, .account-page-kicker
 *   .account-requests-page, .btn, .btn-danger-outline, .btn-outline, .empty-state, .environment-banner
 *   .eyebrow, .favorite-card-actions, .favorite-card-availability, .favorite-card-body
 *   .favorite-card-footer, .favorite-card-image, .favorite-card-image-link, .favorite-card-location
 *   .favorite-card-placeholder, .favorite-card-price, .favorite-card-title, .favorite-card-top
 *   .favorite-card-type, .favorite-remove-form, .favorites-list, .muted, .page-header, .profile-box
 *   .profile-row, .reliability-badge, .reliability-good, .reliability-high, .reliability-low
 *   .reliability-medium, .reliability-pending, .request-message, .request-status-accepted
 *   .request-status-closed, .request-status-read, .request-status-rejected, .request-status-sent
 *   .sidebar-empty, .sidebar-icon, .sidebar-label, .sidebar-link, .sidebar-nav, .sidebar-user
 *   .tenant-request-card, .tenant-request-content, .tenant-request-description, .tenant-request-footer
 *   .tenant-request-image, .tenant-request-location, .tenant-request-meta, .tenant-request-top
 *   .tenant-requests-list
 *
 * Regola: aggiungere qui solo selettori appartenenti all’ambito indicato.
 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #222;
}

footer {
    text-align: center;
    padding: 25px;
    color: #666;
}

.site-footer {
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.site-footer__inner {
    display: grid;
    gap: 12px;
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
}

.site-footer__links a {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: #1d4ed8;
    text-decoration: underline;
}

@media (min-width: 720px) {
    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: center;
        width: min(1180px, calc(100% - 48px));
        text-align: left;
    }

    .site-footer__links {
        justify-content: flex-end;
    }
}

.muted {
    color: #6b7280;
    margin-top: 6px;
}

.sidebar-user {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-user strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
}

.sidebar-user span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    padding: 14px 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
}

.sidebar-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.sidebar-icon {
    min-width: 24px;
    font-size: 13px;
    color: #64748b;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}

.sidebar-icon img {
    width: 20px;
    height: 20px;
    display: block;
}

.sidebar-label {
    line-height: 1.2;
}

.sidebar-empty {
    padding: 12px;
    color: #64748b;
    font-size: 14px;
}

.account-page {
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
}

.account-hero {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border: 1px solid #dbeafe;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 24px;
}

.account-kicker {
    margin: 0 0 8px;
    color: #2563eb;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.account-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 42px);
    color: #0f172a;
}

.account-hero p {
    margin: 0;
    color: #475569;
}

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

.account-card, .account-list-card, .profile-box, .account-info-box, .empty-state {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.account-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    text-decoration: none;
    color: #0f172a;
}

.account-card-number {
    font-size: 36px;
    font-weight: 800;
    color: #2563eb;
}

.account-card-label {
    color: #475569;
    font-weight: 600;
}

.profile-box {
    padding: 8px 24px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #e5e7eb;
}

.profile-row:last-child {
    border-bottom: 0;
}

.profile-row span {
    color: #64748b;
}

.profile-row strong {
    color: #0f172a;
    text-align: right;
}

.account-info-box, .empty-state {
    padding: 24px;
    margin-top: 20px;
}

.account-list {
    display: grid;
    gap: 16px;
}

.account-list-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 22px;
}

.account-list-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #0f172a;
}

.account-list-card p {
    margin: 0 0 8px;
    color: #64748b;
}

.account-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.request-status-sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.request-status-read {
    background: #fef3c7;
    color: #92400e;
}

.request-status-accepted {
    background: #dcfce7;
    color: #166534;
}

.request-status-rejected, .request-status-closed {
    background: #fee2e2;
    color: #991b1b;
}

.request-message {
    margin-top: 10px !important;
    font-style: italic;
}

@media (max-width: 768px) {
    .account-page {
        width: min(100% - 20px, 1120px);
        margin: 18px auto;
    }

    .account-hero {
        border-radius: 20px;
        padding: 22px;
    }

    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-list-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-row {
        flex-direction: column;
        gap: 6px;
    }

    .profile-row strong {
        text-align: left;
    }

    .account-button {
        width: 100%;
    }
}

.account-requests-page {
    max-width: 980px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 26px;
}

.page-header .eyebrow {
    color: #2563eb;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    margin-bottom: 8px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    color: #111827;
}

.page-header p {
    margin: 0;
    color: #64748b;
}

.empty-state {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 28px;
    text-align: center;
}

.empty-state h2 {
    margin: 0 0 10px;
}

.empty-state p {
    margin: 0 0 20px;
    color: #64748b;
}

.tenant-requests-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tenant-request-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.tenant-request-image {
    background: #f1f5f9;
    min-height: 160px;
}

.tenant-request-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tenant-request-content {
    padding: 20px 20px 20px 0;
}

.tenant-request-top h2 {
    margin: 0 0 6px;
    font-size: 21px;
    color: #111827;
}

.tenant-request-location {
    margin: 0;
    color: #64748b;
}

.tenant-request-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: #475569;
    margin-bottom: 14px;
    font-size: 14px;
}

.tenant-request-description {
    color: #334155;
    line-height: 1.5;
    margin: 0 0 16px;
}

.tenant-request-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

@media (max-width: 760px) {
    .tenant-request-card {
        grid-template-columns: 1fr;
    }

    .tenant-request-content {
        padding: 0 18px 18px;
    }

    .tenant-request-image {
        height: 220px;
    }

    .tenant-request-top {
        flex-direction: column;
    }

    .tenant-request-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tenant-request-footer .btn {
        width: 100%;
        text-align: center;
    }
}

.account-favorites-page {
    max-width: 980px;
    margin: 0 auto;
}

.account-page-header {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 24px;
    padding: 30px 32px;
    margin-bottom: 26px;
}

.account-page-kicker {
    margin: 0 0 6px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.account-page-header h1 {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.05;
    color: #020617;
}

.account-page-header p {
    margin: 0;
    color: #475569;
    font-size: 17px;
}

.account-list, .favorites-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.account-list-card.favorite-card {
    display: grid;
    grid-template-columns: 176px 1fr;
    gap: 22px;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.favorite-card-image-link {
    display: block;
    text-decoration: none;
}

.favorite-card-image {
    width: 176px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: #eef2f7;
}

.favorite-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.favorite-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 800;
    font-size: 14px;
}

.favorite-card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.favorite-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.favorite-card-type {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.favorite-card-title {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
}

.favorite-card-title a {
    color: #0f172a;
    text-decoration: none;
}

.favorite-card-title a:hover {
    color: #2563eb;
}

.favorite-card-location, .favorite-card-availability {
    margin: 0 0 4px;
    color: #475569;
    font-size: 15px;
}

.favorite-card-price {
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
}

.favorite-card-price span {
    margin-left: 2px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.favorite-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.favorite-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.favorite-remove-form {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn-outline {
    color: #2563eb;
    background: #ffffff;
    border-color: #bfdbfe;
}

.btn-outline:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

.btn-danger-outline {
    color: #b91c1c;
    background: #ffffff;
    border-color: #fecaca;
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.reliability-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    background: #e2e8f0;
    color: #334155;
}

.reliability-pending {
    background: #e2e8f0;
    color: #334155;
}

.reliability-low {
    background: #fee2e2;
    color: #991b1b;
}

.reliability-medium {
    background: #fef3c7;
    color: #92400e;
}

.reliability-good {
    background: #dcfce7;
    color: #166534;
}

.reliability-high {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 720px) {
    .account-page-header {
        padding: 24px 22px;
        border-radius: 20px;
    }

    .account-page-header h1 {
        font-size: 34px;
    }

    .account-list-card.favorite-card {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .favorite-card-image {
        width: 100%;
        height: 210px;
    }

    .favorite-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .favorite-card-actions {
        width: 100%;
    }

    .favorite-card-actions .btn,
    .favorite-remove-form {
        width: 100%;
    }

    .favorite-remove-form .btn {
        width: 100%;
    }
}

/* Ambiente di test */

.environment-banner {
    position: relative;
    z-index: 10000;
    width: 100%;
    padding: 10px 16px;
    box-sizing: border-box;
    background: #8b1e1e;
    color: #fff;
    font-weight: 700;
    text-align: center;
    letter-spacing: .03em;
}

/*
 * Struttura globale condivisa.
 * Queste regole restano in app.css perché header, toolbar e layout sono usati
 * da tutte le aree dell'applicazione.
 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #f5f6f8;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.site-logo img {
    width: auto;
    height: 34px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav a {
    color: #334155;
    font-weight: 600;
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: #1d4ed8;
}

.nav-cta {
    padding: 9px 14px;
    border-radius: 999px;
    background: #0f172a;
    color: #ffffff !important;
}

.layout--full {
    display: block;
    width: 100%;
    min-width: 0;
}

.layout--full .layout__main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.account-toolbar {
    --account-toolbar-control-size: 36px;
    position: sticky;
    z-index: 900;
    top: 0;
    width: 100%;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.account-toolbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    gap: 6px;
    width: min(calc(100% - 32px), 1600px);
    margin: 0 auto;
    padding: 10px 0;
    overflow: visible;
}

.account-toolbar__inner::-webkit-scrollbar {
    display: none;
}

.account-toolbar__scroll {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 3;
    align-items: center;
    justify-content: center;
    width: var(--account-toolbar-control-size);
    height: var(--account-toolbar-control-size);
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease;
}

.account-toolbar__scroll:hover,
.account-toolbar__scroll:focus-visible {
    border-color: #93c5fd;
    background: #eff6ff;
}

.account-toolbar__scroll img {
    width: 18px;
    height: 18px;
}

.account-toolbar__scroll--previous {
    left: 6px;
}

.account-toolbar__scroll--next {
    right: 6px;
}

.account-toolbar__scroll:disabled {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.account-toolbar__link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.account-toolbar__link:hover,
.account-toolbar__link:focus-visible {
    background: #eff6ff;
    color: #1d4ed8;
}

.account-toolbar__link.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.account-toolbar__link--logout {
    margin-left: 0;
    color: #b91c1c;
}

.account-toolbar__link--logout:hover,
.account-toolbar__link--logout:focus-visible {
    background: #fef2f2;
    color: #991b1b;
}

.account-toolbar .ru-icon {
    width: 18px;
    height: 18px;
    margin-right: 0;
}

@media (max-width: 1100px) {
    .account-toolbar {
        padding-right: calc(var(--account-toolbar-control-size) + 10px);
        padding-left: calc(var(--account-toolbar-control-size) + 10px);
    }

    .account-toolbar__inner {
        flex-wrap: nowrap;
        width: 100%;
        max-width: none;
        padding: 8px 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        scroll-behavior: smooth;
        scroll-snap-type: inline proximity;
        scrollbar-width: none;
    }

    .account-toolbar__link {
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .account-toolbar.is-scrollable .account-toolbar__scroll {
        display: inline-flex;
    }
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.alert-success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.alert-danger,
.alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

@media (max-width: 768px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 14px;
    }

    .site-nav {
        width: 100%;
        gap: 12px;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .site-logo img {
        height: 30px;
    }

    .account-toolbar__inner {
        width: 100%;
        padding: 8px 12px;
    }

    .account-toolbar__link {
        min-height: 42px;
        padding: 8px 11px;
    }

    .account-toolbar__link span {
        font-size: 13px;
    }

    .account-toolbar__link--logout {
        margin-left: 0;
    }
}

.error-page {
    width: min(100% - 32px, 760px);
    margin: 48px auto;
}

.error-page h1 {
    margin-top: 0;
    color: #0f172a;
}

.error-page p {
    margin-bottom: 22px;
    color: #64748b;
}

.account-toolbar__badge {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: #dc2626;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px #ffffff;
}

.account-toolbar__link.is-active .account-toolbar__badge {
    background: #b91c1c;
    box-shadow: 0 0 0 2px #dbeafe;
}

/* Launcher leggero: il pannello dell'assistente e i relativi asset vengono caricati solo al primo clic. */
.help-assistant-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 8400;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid #0b57d0;
    border-radius: 999px;
    color: #ffffff;
    background: #0b57d0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
    font-weight: 850;
    cursor: pointer;
}

.help-assistant-launcher img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.page-owner-app .help-assistant-launcher {
    bottom: 72px;
}

@media (max-width: 640px) {
    .help-assistant-launcher {
        right: 12px;
        bottom: 12px;
    }

    .page-owner-app .help-assistant-launcher {
        bottom: 66px;
    }
}

/* Nella ricerca annunci mobile la Guida resta separata dal pulsante Mappa. */
@media (max-width: 1080px) {
    .page-listing-search .help-assistant-launcher {
        right: auto;
        left: calc(12px + env(safe-area-inset-left));
    }
}


/* V25.14.1 — utilizzo esclusivo del marchio grafico ufficiale. */
.site-logo {
    flex: 0 0 auto;
    max-width: min(194px, 46vw);
    line-height: 0;
}

.site-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 43px;
    object-fit: contain;
    object-position: left center;
}

/* Header mobile: ricerca a scomparsa sotto la testata. */
.mobile-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mobile-header-search-toggle,
.mobile-header-search {
    display: none;
}

@media (max-width: 768px) {
    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 12px;
        padding: 12px 14px;
    }

    .site-logo {
        grid-column: 1;
        min-width: 0;
    }

    .site-logo img {
        max-width: min(100%, 255px);
        height: auto;
        max-height: 48px;
    }

    .mobile-header-actions {
        grid-column: 2;
        justify-self: end;
    }

    .account-context-switcher,
    .mobile-header-search,
    .site-nav {
        grid-column: 1 / -1;
    }

    .mobile-header-search-toggle {
        display: inline-grid;
        width: 42px;
        height: 42px;
        place-items: center;
        padding: 0;
        border: 1px solid #d7dfeb;
        border-radius: 12px;
        color: #0f172a;
        background: #ffffff;
        cursor: pointer;
    }

    .mobile-header-search-toggle:hover,
    .mobile-header-search-toggle:focus-visible,
    .mobile-header-search-toggle[aria-expanded="true"] {
        border-color: #8da9d0;
        background: #f4f8fd;
    }

    .mobile-header-search-toggle img {
        width: 21px;
        height: 21px;
    }

    .mobile-header-search {
        display: block;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-6px);
        transition: max-height 180ms ease, opacity 160ms ease, transform 180ms ease;
    }

    .mobile-header-search[hidden] {
        display: none;
    }

    .mobile-header-search.is-open {
        max-height: 78px;
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-header-search__form {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 8px;
        padding: 8px;
        border: 1px solid #d7dfeb;
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    }

    .mobile-header-search__form > img {
        width: 20px;
        height: 20px;
        margin-left: 4px;
    }

    .mobile-header-search__form input {
        width: 100%;
        min-width: 0;
        height: 42px;
        padding: 0 4px;
        border: 0;
        outline: 0;
        color: #0f172a;
        background: transparent;
        font: inherit;
    }

    .mobile-header-search__form input::placeholder {
        color: #64748b;
    }

    .mobile-header-search__submit {
        min-height: 38px;
        padding: 0 14px;
        border: 0;
        border-radius: 10px;
        color: #ffffff;
        background: #0b5cab;
        font-weight: 800;
        cursor: pointer;
    }

    .mobile-header-search__close {
        display: grid;
        width: 38px;
        height: 38px;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        cursor: pointer;
    }

    .mobile-header-search__close:hover,
    .mobile-header-search__close:focus-visible {
        background: #eef2f7;
    }

    .mobile-header-search__close img {
        width: 18px;
        height: 18px;
    }

    .site-nav {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-header-search {
        transition: none;
    }
}

/* Menu amministrativo organizzato per categorie. */
.admin-menu-group {
    position: relative;
    flex: 0 0 auto;
}

.admin-menu-group > summary {
    list-style: none;
}

.admin-menu-group > summary::-webkit-details-marker {
    display: none;
}

.admin-menu-group__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-menu-group__toggle:hover,
.admin-menu-group__toggle:focus-visible,
.admin-menu-group[open] .admin-menu-group__toggle {
    background: #eff6ff;
    color: #1d4ed8;
}

.admin-menu-group.is-active .admin-menu-group__toggle {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-menu-group__chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.admin-menu-group[open] .admin-menu-group__chevron {
    transform: rotate(180deg);
}

.admin-menu-group__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 950;
    display: grid;
    min-width: 250px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.admin-menu-group:last-of-type .admin-menu-group__panel {
    right: 0;
    left: auto;
}

.admin-menu-group__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 9px;
    color: #334155;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.admin-menu-group__item:hover,
.admin-menu-group__item:focus-visible {
    background: #f1f5f9;
    color: #1d4ed8;
}

.admin-menu-group__item.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.admin-menu-group__item--logout {
    color: #b91c1c;
}

.admin-menu-group__item--logout:hover,
.admin-menu-group__item--logout:focus-visible {
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 1100px) {
    .account-toolbar--admin {
        padding-right: 12px;
        padding-left: 12px;
    }

    .account-toolbar--admin .account-toolbar__inner {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        padding: 8px 0;
        overflow: visible;
    }

    .account-toolbar--admin .account-toolbar__scroll {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .account-toolbar--admin .account-toolbar__inner {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .account-toolbar--admin .account-toolbar__link,
    .account-toolbar--admin .admin-menu-group,
    .account-toolbar--admin .admin-menu-group__toggle {
        width: 100%;
    }

    .account-toolbar--admin .account-toolbar__link,
    .account-toolbar--admin .admin-menu-group__toggle {
        justify-content: flex-start;
    }

    .account-toolbar--admin .admin-menu-group__chevron {
        margin-left: auto;
    }

    .account-toolbar--admin .admin-menu-group__panel {
        position: fixed;
        top: 132px;
        right: 12px;
        left: 12px;
        min-width: 0;
        max-height: calc(100vh - 152px);
        overflow-y: auto;
    }
}
