/* Workaround for Safari (iOS, Desktop) SVG rendering */
.is-hero-image {
    margin-left: auto;
    margin-right: auto;
    max-width: 25rem;
}

.is-auth-logo {
    margin-left: auto;
    margin-right: auto;
    max-width: 20rem;
    width: 320px !important;
}

.competition-detail-box {
    max-height: 100vh;
    overflow-y: auto;
}

/* Wider than Bulma's 960-1344px container steps, capped so the detail panel's text lines stay readable. !important beats Bulma's :not()-chained breakpoint selectors */
.search-results-section.container {
    max-width: 1600px !important;
}

.column.main-content {
    position: sticky;
    top: 0;
    align-self: flex-start;
    /* Without it the detail tabs' min-content width widens this column and squeezes the results list */
    min-width: 0;
}

@media (max-width: 768px) {
    .is-hero-image {
        max-width: 30rem;
    }
}

@media (min-width: 1024px) {
    .highlighted-box {
        border: 2px solid #00D1B2;
    }
}

/* On tablet portrait (769–1023px), the desktop filter dropdowns are hidden
   via `is-hidden-touch` and only the results count remains in the level —
   center it horizontally so it doesn't sit pinned to the left. Mobile already
   centers via Bulma's column-direction collapse at ≤768px.
   The selector combines `.level` and the data-controller attribute to outrank
   Bulma's `.level { justify-content: space-between }`, which is loaded after
   this file. */
@media screen and (min-width: 769px) and (max-width: 1023px) {
    .level[data-controller="competition-filters"] {
        justify-content: center;
    }
}

/* Notification-style dot on the Simulazioni nav link. The anchor wraps the label rather than the
   whole padded navbar-item, so the dot sits on the corner of the word instead of floating in the
   item's padding — and it works unchanged in the burger menu, where items become a vertical list.
   Absolutely positioned, so showing or hiding it never moves anything around it. */
/* ---- Profile sections: app-style bottom tab bar (touch only) ---- */
/* z-index 30 and the safe-area padding match the other fixed bottom bars (.mobile-cta-bar,
   .search-actions-sticky-bar); none of them appear on the profile pages, so they never stack. */
.profile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: stretch;
    /* Centred rather than spread: the bar spans the screen, but on a tablet five stretched items
       left huge dead zones and turned the active item's underline into a ~164px blue line that read
       as a broken element. */
    justify-content: center;
    background: #fff;
    border-top: 1px solid #dbdbdb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    /* Lift the items clear of the screen edge. env() alone is 0 in every browser that keeps its own
       chrome down there (Chrome/Firefox Android, Safari with the bottom toolbar), which left the
       tap targets flush against the edge and half-swallowed by that chrome -- same complaint the
       competition detail bar's pb-5 fixed. max(), so a bigger home-indicator inset still wins. */
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.profile-bottom-nav__item {
    /* Share the width on a phone, but stop growing once there is more of it than the labels need.
       min-width 0 lets them shrink below their label's natural width instead of overflowing. */
    flex: 1 1 0;
    min-width: 0;
    max-width: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.125rem;
    color: #7a7a7a;
    text-align: center;
}

.profile-bottom-nav__item:hover {
    color: #485fc7;
}

.profile-bottom-nav__item.is-active {
    color: #485fc7;
    box-shadow: inset 0 2px 0 0 #485fc7;
}

.profile-bottom-nav__icon {
    position: relative;
    font-size: 1rem;
    line-height: 1;
}

.profile-bottom-nav__label {
    font-size: 0.625rem;
    line-height: 1.2;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main tab row of the private area: slim underlined tabs (Bulma's plain .tabs), tighter than the
   boxed version so the page starts higher. */
.tabs.user-tabs {
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.tabs.user-tabs a {
    padding: 0.4em 0.9em;
}

/* Profile sub-tabs: a segmented control on a grey track, in the page header in place of the visible
   title, with the page's action on the right. `.tabs.profile-subtabs` outranks Bulma, which loads
   after this file. */
.tabs.profile-subtabs {
    overflow-x: auto;
}

/* Beats Bulma's `.tabs:not(:last-child) { margin-bottom }`: the header's gap spaces it instead. */
.user-page__header .tabs.profile-subtabs {
    margin-bottom: 0;
}

.tabs.profile-subtabs ul {
    flex-wrap: nowrap;
    flex-grow: 0;
    margin: 0;
    padding: 0.25rem;
    gap: 0.25rem;
    border-radius: 9999px;
    background-color: #eef0f6;
    border: 0;
}

.tabs.profile-subtabs li a {
    white-space: nowrap;
    border: 0 !important;
    border-radius: 9999px !important;
    padding: 0.5em 1.1em;
    font-weight: 600;
    color: #4a4f63;
    background-color: transparent;
}

.tabs.profile-subtabs li a:hover {
    background-color: #ffffff;
    color: #4258ff;
}

.tabs.profile-subtabs li.is-active a {
    background-color: #4258ff;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(66, 88, 255, 0.35);
}

.tabs.profile-subtabs li a:focus-visible {
    outline: 3px solid #4258ff;
    outline-offset: 2px;
}

/* Phone: three equal cells, icon above a short label, so all three fit without scrolling. The full
   label stays in the accessible name (the short one is aria-hidden). */
@media screen and (max-width: 768px) {
    .tabs.profile-subtabs {
        flex-basis: 100%;
    }

    .tabs.profile-subtabs ul {
        width: 100%;
        border-radius: 1rem;
    }

    .tabs.profile-subtabs li {
        flex: 1 1 0;
    }

    .tabs.profile-subtabs li a {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.45em 0.25em;
        border-radius: 0.75rem !important;
        font-size: 0.8rem;
        position: relative;
    }

    .tabs.profile-subtabs li a .icon {
        margin: 0 !important;
    }

    .tabs.profile-subtabs .profile-subtabs__dot {
        position: absolute;
        top: 0.4rem;
        right: 0.6rem;
        margin: 0;
    }
}

.profile-subtabs__dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.4rem;
    border-radius: 50%;
    background-color: #e5484d;
}

/* Position the scroller so it clips its absolutely-positioned descendants too. Bulma's
   .table-container is overflow-x only and NOT positioned, so an abspos descendant -- e.g. the
   .is-sr-only screen-reader label in the history table's last th -- has the page as containing
   block and escapes the clip: its static position at the table's far right (x=670 on a 375px
   phone) becomes document-level horizontal overflow. Desktop browsers merely report the phantom
   width, but iOS Safari sizes/pans its layout viewport on it, which oversizes and detaches
   position:fixed bars (.profile-bottom-nav). Bulma sets no `position` on .table-container, so
   load order cannot override this. */
.table-container {
    position: relative;
}

/* `.section.has-profile-bottom-nav`, not `.has-profile-bottom-nav`: Bulma loads after this file, so
   a single class loses to its `.section { padding: 3rem 1.5rem }` and the reserved space silently
   became Bulma's 48px — leaving the last row of content under the bar with no clearance. */
.section.has-profile-bottom-nav {
    padding-bottom: calc(4.25rem + max(1.5rem, env(safe-area-inset-bottom)));
}

@media screen and (min-width: 1024px) {
    .section.has-profile-bottom-nav {
        padding-bottom: 3rem;
    }
}

/* ---- Navbar account control ---- */
/* Initials in a circle, standing in for the old Area Personale + Disconnetti pair. Sized to the
   navbar rather than the text so it reads as a control, not a word. */
.nav-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

/* The static pages' navbar is white, where a translucent white circle would vanish. */
.navbar.has-background-white .nav-avatar {
    background-color: #485fc7;
    color: #fff;
}

/* Bulma's .navbar-link paints its own hover background; keep the trigger flat so only the circle
   reads as interactive, and inherit the bar's own text colour on both palettes. */
.nav-account__trigger,
.nav-account__trigger:hover,
.nav-account__trigger:focus {
    background-color: transparent;
    color: inherit;
}

/* The circle keeps the initials; the name beside it says whose profile the menu belongs to.
   The whole trigger is one link, so clicking the name opens the menu exactly as the circle does. */
.nav-account__trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-account__name {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The touch copy sits in navbar-brand, which Bulma lays out with the burger pushed right by an auto
   margin. Moving that margin onto the account control keeps it beside the burger rather than the logo,
   and the shorter name leaves the logo room on a 360px phone. */
.nav-account-touch {
    margin-inline-start: auto;
}

.nav-account-touch + .navbar-burger {
    margin-inline-start: 0;
}

.nav-account-touch .nav-account__name {
    max-width: 6rem;
}

/* Bulma hides .navbar-divider below desktop, but the burger panels now show grouped lists — public
   links, then the profile's own, then signing out — and the groups are the point. Any divider that
   should stay desktop-only carries .is-hidden-desktop, whose !important still wins here. */
.navbar-menu .navbar-divider {
    display: block;
}

.nav-dot-anchor {
    position: relative;
    display: inline-block;
}

.nav-dot-new {
    position: absolute;
    top: -0.1rem;
    right: -0.5rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background-color: #f14668;
}

/* Search result card: badges on their own row, facts on another.
   Each fact stays on one line and the row wraps, rather than the row holding its
   shape and breaking "1 posto" across two lines on a narrow phone. */
.competition-card__facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
}

.competition-card__facts > span {
    white-space: nowrap;
}

/* The place can be long enough to need the whole row to itself; let it shrink and
   ellipsise instead of pushing the others off. */
.competition-card__facts > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Competition search results — list items */
.competition-list-item {
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.competition-list-item:hover {
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1),
                0 0 0 1px rgba(10, 10, 10, 0.02);
}

/* Homepage competition lists: a divided list of rows, each a 2x2 grid of
   single lines (role | deadline, entity | posti). Fixed row heights keep a
   missing role or a long name from changing the height. */
.competition-compact-list {
    margin-bottom: 1.5rem;
    border-top: 1px solid var(--bulma-border-weak);
}

.competition-compact-list > li {
    border-bottom: 1px solid var(--bulma-border-weak);
}

.competition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-auto-rows: 1.5rem;
    align-items: center;
    column-gap: 1rem;
    padding: 0.75rem 0.5rem;
    color: inherit;
    transition: background-color 0.15s ease;
}

.competition-row:hover,
.competition-row:focus-visible {
    background-color: var(--bulma-scheme-main-bis);
    color: inherit;
}

.competition-row__title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.competition-row__title > .tag {
    flex-shrink: 0;
}

.competition-row__truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.competition-row__end {
    justify-self: end;
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--bulma-text-weak);
}

/* Homepage Telegram row: flat like the lists above it, with a light tint so it
   doesn't read as one more competition. */
.telegram-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: #eef7fc;
    color: var(--bulma-text-strong);
}

.telegram-row:hover,
.telegram-row:focus-visible {
    background: #e1f1fa;
    color: var(--bulma-text-strong);
}

.telegram-row__icon {
    flex-shrink: 0;
    color: #229ed9;
}

.telegram-row__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.telegram-row__text > .has-text-grey {
    font-size: 0.875rem;
}

.telegram-row > .list-section-link {
    color: var(--bulma-link);
}

/* Homepage search map: the same divided rows, two columns from desktop up. */
.link-grid {
    display: grid;
    column-gap: 2rem;
}

.link-grid > li {
    border-bottom: 1px solid var(--bulma-border-weak);
}

.link-grid > li:first-child {
    border-top: 1px solid var(--bulma-border-weak);
}

@media screen and (min-width: 1024px) {
    .link-grid {
        grid-template-columns: 1fr 1fr;
    }

    .link-grid > li:nth-child(2) {
        border-top: 1px solid var(--bulma-border-weak);
    }
}

.link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    padding: 0.75rem 0.5rem;
    color: var(--bulma-text-strong);
    transition: background-color 0.15s ease;
}

.link-row:hover,
.link-row:focus-visible {
    background-color: var(--bulma-scheme-main-bis);
    color: var(--bulma-text-strong);
}

.link-row > span:first-child {
    display: flex;
    flex-direction: column;
}

.link-row__title {
    font-weight: 700;
}

/* Homepage blog tiles: flat like the competition lists. The image is cropped
   to one ratio so the titles start on the same line. */
.article-tile {
    display: block;
    color: var(--bulma-text-strong);
}

.article-tile__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0.5rem;
}

.article-tile__title {
    display: block;
    margin-top: 0.75rem;
    font-weight: 700;
    line-height: 1.35;
}

.article-tile:hover,
.article-tile:focus-visible {
    color: var(--bulma-link);
}

.article-tile:hover .article-tile__title {
    text-decoration: underline;
}

/* Competition search results — "read more" divider */
.detail-read-more {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.detail-read-more::before,
.detail-read-more::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dbdbdb;
}

/* Competition search results — detail tabs */
.detail-tabs {
    padding: 0;
}

.detail-tabs ul {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #dbdbdb;
}

.detail-tabs li {
    flex: 1 1 0;
}

.detail-tabs li a {
    border-bottom: 2px solid transparent;
    color: #7a7a7a;
    padding: 0.5em;
    justify-content: center;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.detail-tabs li a:hover {
    color: #485fc7;
    border-bottom-color: #dbdbdb;
    background: none;
}

.detail-tabs li.is-active a {
    color: #485fc7;
    font-weight: 600;
    border-bottom-color: #485fc7;
    background: none;
}

/* Five tabs with icons need ~535px; narrower desktops would scroll the tab bar. Container queries measure the content box, padding excluded */
@container (max-width: 534px) {
    .detail-tabs {
        font-size: 0.875rem;
    }

    .detail-tabs .icon {
        display: none;
    }
}

/* Competition search results — detail panel */
.detail-panel-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #ededed;
}

.detail-tab-panel {
    padding: 0.75rem 0;
}

.detail-overview-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.detail-overview-row:last-child {
    border-bottom: none;
}

.detail-job-role-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    min-height: 4.5rem;
    padding: 0.75rem;
    border: 1px solid #ededed;
    border-radius: 6px;
    background: #fafafa;
}

.detail-course-row {
    display: block;
    padding: 0.75rem 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

.detail-course-row + .detail-course-row {
    margin-top: -1px;
}

.detail-course-row:hover {
    border-color: var(--bulma-link);
    position: relative;
    z-index: 1;
}

/* The row past the card's limit: a hint that more follow, the link under it leads to them. */
.detail-course-row.is-faded {
    max-height: 3.5rem;
    overflow: hidden;
    border-bottom: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
    mask-image: linear-gradient(to bottom, #000, transparent);
}

.detail-course-row.is-faded + .detail-read-more {
    margin-top: 0;
}

.detail-course-row.is-faded + .detail-read-more a {
    padding-block: 0.625rem;
}

.detail-attachment-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 4px;
    font-size: 0.9rem;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}

.detail-attachment-row:hover {
    background: #f5f5f5;
    color: inherit;
}

.detail-attachment-row:last-child {
    border-bottom: none;
}



a[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}


.static-page-section {
    min-height: 30rem;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: auto;
}

/* Short pages (newsletter unsubscribe): stretch body to the viewport so the footer sits at the bottom.
   ponytail: opt-in per page, make it global on body once every page has been checked with it. */
body:has(> main > .page-fill) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.underline-marker {
    --a: -45deg; /* control the angle */
    --t: .23em; /* thickness of the underline */
    color: #F1D4AF;

    --_s: calc(var(--t) * cos(var(--a)));
    background: linear-gradient(var(--a), #0000 var(--_s), currentColor 0 calc(100% - var(--_s)), #0000 0) bottom/var(--i, 90%) var(--t) no-repeat;
    padding: 0 .25em calc(var(--t) + .1em);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.underline-marker:hover {
    --i: 100%;
}

/* Fix Bulma strange z-index on arrows in select */
.select:not(.is-multiple):not(.is-loading):after {
    z-index: auto;
}

/* Skeleton loader styles */
.skeleton {
    background-color: #f0f0f0;
    height: 100%;
    width: 100%;
    animation: loading 1.5s infinite ease-in-out;
}

.skeleton-title {
    background-color: #f0f0f0;
    height: 20px;
    margin-bottom: 10px;
    animation: loading 1.5s infinite ease-in-out;
}

.skeleton-button {
    background-color: #f0f0f0;
    height: 88px;
    width: 100%;
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% {
        background-color: #f0f0f0;
    }
    50% {
        background-color: #e0e0e0;
    }
    100% {
        background-color: #f0f0f0;
    }
}

th a .fa-sort {
    color: #b5b5b5;
}

th a .fa-sort-amount-up-alt,
th a .fa-sort-amount-down-alt {
    color: #363636;
    margin-left: 0.25rem;
}

.is-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* Public Entity Search Component Styles */
.public-entity-search .loading-skeleton {
    display: none;
}

.public-entity-search .loading-skeleton.is-active {
    display: contents;
}

.public-entity-search .control.has-icons-left .input:focus ~ .icon.is-left {
    color: hsl(229, 53%, 53%);
}

.public-entity-search .tag.is-link {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.public-entity-search .tag.is-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1);
}

.tag.is-link .chip-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Hero Search Bar Component Style */
input #hero-search-input {
    display: block;
    font-size: 35px;
    padding-left: 0px;
    padding-right: 10px;
    width: 100%;
}

/* Search form tabs container */
.search-form__tabs {
    display: flex;
    gap: 2rem;
    align-items: center;
}

/* Individual tab link - default state with white color scheme */
.search-form__tab {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

/* Tab hover state - brighter white */
.search-form__tab:hover {
    color: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* Active tab state - full white with underline */
.search-form__tab--active {
    color: #ffffff;
    border-bottom-color: #ffffff;
    font-weight: 600;
}

/* Ensure specificity by using the parent class */
.search-form .search-form__tabs .search-form__tab--active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* Mobile: restore rounded corners on input when icon is hidden */
@media screen and (max-width: 768px) {
    .search-form__input {
        border-top-left-radius: 4px !important;
        border-bottom-left-radius: 4px !important;
    }
}

/* Placeholder animation styles */
::-webkit-input-placeholder {
    display: inline-block;
    padding-right: .15em;
    white-space: nowrap;
}

::-moz-placeholder {
    display: inline-block;
    padding-right: .15em;
    white-space: nowrap;
}

:-ms-input-placeholder {
    display: inline-block;
    padding-right: .15em;
    white-space: nowrap;
}

::placeholder {
    display: inline-block;
    padding-right: .15em;
    white-space: nowrap;
}

/* The nowrap above is for single-line inputs: a textarea's placeholder has to wrap or it is cut off. */
textarea::placeholder {
    white-space: normal;
}

/* Navbar shadow */
.navbar-menu.is-active.has-shadow {
    box-shadow: 0 10px 16px rgba(255, 255, 255, 0.1);
}

.navbar.has-background-white .navbar-menu.is-active {
    box-shadow: 0 8px 16px rgba(10, 10, 10, 0.1);
}

/* Tom Select Bulma styling */
.ts-wrapper.single .ts-control {
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    background-color: #fff;
    color: #363636;
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
    font-size: 1rem;
    height: 2.5em;
    line-height: 1.5;
    padding: calc(0.5em - 1px) calc(0.75em - 1px);
    position: relative;
    vertical-align: top;
    max-width: 100%;
    display: flex;
    align-items: center;
}

.ts-wrapper.single .ts-control .item {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline !important;
    color: #363636;
    font-size: 1rem;
    flex: 1;
}

/* Hide remove button in single select mode */
.ts-wrapper.single .ts-control .item .remove {
    display: none !important;
}

.ts-wrapper.single .ts-control:focus,
.ts-wrapper.single.focus .ts-control {
    border-color: #485fc7;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
    outline: none;
}

.ts-wrapper.single.disabled .ts-control {
    background-color: #f5f5f5;
    border-color: #f5f5f5;
    box-shadow: none;
    color: #7a7a7a;
    cursor: not-allowed;
}

.ts-wrapper.single .ts-control input::placeholder {
    color: #b5b5b5;
}

.ts-dropdown .option {
    padding: 0.5em 0.75em;
    cursor: pointer;
    color: #363636;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background-color: #485fc7;
    color: #fff;
}

.ts-dropdown .option.selected {
    background-color: #f5f5f5;
    color: #363636;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background-color: #f5f5f5;
}

/* Error page styles */
@media (max-width: 768px) {
    .error-page .box {
        height: 100vh;
        overflow: auto; /* Add a scrollbar if the content is taller than the screen */
    }
}

/* Competition detail page styles */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media screen and (max-width: 1023px) {
    .competition-detail-page > .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Sticky navbar on touch (tablet and below) */
@media screen and (max-width: 1023px) {
    /* Pages with hero: fixed when hero scrolls out */
    .navbar.is-navbar-stuck {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 30;
    }

    .navbar.is-navbar-stuck + .hero,
    .navbar.is-navbar-stuck + main > .hero {
        padding-top: 3.25rem;
    }

    /* Navbars that are always sticky (no hero dependency) */
    .navbar.is-navbar-static-sticky {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 30;
    }

    .is-navbar-static-sticky + main {
        padding-top: 3.25rem;
    }
}

.navbar .navbar-item img[height="28"] {
    max-height: 1.75rem;
}

/* Competition detail - section scroll offset */
.competition-detail-page section[id] {
    scroll-margin-top: 1rem;
}

@media screen and (max-width: 1023px) {
    .competition-detail-page section[id] {
        scroll-margin-top: 7.25rem;
    }
}

/* Competition detail - sidebar TOC */
.competition-sidebar {
    position: sticky;
    top: 1rem;
}

.competition-sidebar .menu-list a {
    border-left: 2px solid transparent;
    border-radius: 0;
    padding: 0.5em 0.75em;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.competition-sidebar .menu-list a.is-active {
    border-left-color: #485fc7;
    background-color: rgba(72, 95, 199, 0.05);
    color: #485fc7;
}

.competition-sidebar .menu-list a:hover {
    background-color: #f5f5f5;
}

/* Competition detail - mobile sticky TOC */
.competition-toc-mobile {
    position: sticky;
    top: 3.25rem;
    z-index: 10;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
}

.competition-toc-mobile .tabs ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.competition-toc-mobile .tabs ul::-webkit-scrollbar {
    display: none;
}

.competition-toc-mobile .tabs li {
    flex-shrink: 0;
}

/* Competition detail - overview items */
.competition-overview-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.competition-overview-item:last-child {
    border-bottom: none;
}

.competition-overview-item .icon {
    flex-shrink: 0;
    color: #485fc7;
}

.competition-overview-label {
    color: #7a7a7a;
    font-size: 0.875rem;
    flex-shrink: 0;
}

@media screen and (min-width: 769px) {
    .competition-overview-label {
        min-width: 10rem;
    }
}

@media screen and (max-width: 768px) {
    .competition-overview-item {
        flex-wrap: wrap;
    }
}

.competition-overview-value {
    font-weight: 600;
}

/* Long location lists: the first three stay visible, the rest fold behind a native <details> */
.location-list summary {
    cursor: pointer;
    list-style: none;
}

.location-list summary::-webkit-details-marker {
    display: none;
}

.location-list summary:focus-visible {
    outline: 2px solid var(--bulma-link);
    outline-offset: 2px;
}

.location-list .tag {
    margin-left: 0.25rem;
    font-weight: 600;
}

.competition-overview-item:has(.location-list[open]),
.detail-overview-row:has(.location-list[open]) {
    align-items: baseline;
}

.location-list[open] .location-list-more,
.location-list:not([open]) .location-list-less {
    display: none;
}

/* SEO maps regions page styles */
/* Default: wrap for readability */
.seo-maps-regions .tag.is-link .chip-text {
    overflow-wrap: anywhere;
    white-space: normal;
}

/* Tablet and up: enforce single-line ellipsis to keep rows tidy */
@media screen and (min-width: 769px) {
    .seo-maps-regions .tag.is-link .chip-text {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

/* Turnstile widget styles */
.turnstile-widget .turnstile-skeleton {
    display: block;
}

.turnstile-widget .turnstile-skeleton.is-hidden {
    display: none;
}

@keyframes turnstile-loading {
    0% {background-position: 200% 0;}
    100% {background-position: -200% 0;}
}

/* Lead modal — navbar must not sit above the modal overlay */
body:has(.modal.is-active) .navbar {
    z-index: auto;
}

/* Lead modal — full-screen on mobile */
@media screen and (max-width: 768px) {
    .modal > .modal-content {
        max-width: 100% !important;
        width: 100%;
        height: 100%;
        margin: 0;
        max-height: 100vh;
    }

    .modal > .modal-content > .box {
        min-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
        padding-top: 3.5rem;
    }

    .modal > .modal-close {
        position: fixed;
        top: 0.75rem;
        right: 0.75rem;
        z-index: 50;
        background-color: #fff;
        border: 2px solid #dbdbdb;
    }

    .modal > .modal-close::before,
    .modal > .modal-close::after {
        background-color: #363636;
    }
}

.dropdown.is-fullwidth {
    display: flex;
}

.dropdown.is-fullwidth .dropdown-trigger {
    width: 100%;
}

.dropdown.is-fullwidth .dropdown-menu {
    width: 100%;
}

.dropdown-large .dropdown-item {
    padding: 0.7rem;
    font-size: 0.9rem;
}

/* FAQ Accordion Transitions */
/* Grid rows animate from 0fr to 1fr, so the answer opens over its real height (max-height would
   need a guessed ceiling). A closed answer is hidden from screen readers and Tab too: visibility
   flips after the fold on close and at once on open. */
[data-faq-accordion-target="content"] {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    visibility: hidden;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
}

[data-faq-accordion-target="content"].is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* A bare wrapper: padding on the grid item itself would hold the 0fr row open. */
[data-faq-accordion-target="content"] > * {
    min-height: 0;
    overflow: hidden;
}

.icon[data-faq-accordion-target="icon"] {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-accordion label.box {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-accordion label.box:hover {
    box-shadow: 0 0.5em 1em -0.125em rgba(50, 115, 220, 0.1),
    0 0px 0 1px rgba(50, 115, 220, 0.1);
}

/* ---- Gazzetta pages ----
   A masthead in the paper's own style, then rows that say they open: a sector icon, the role and the
   body, the deadline and an "Apri" pill. Rows are native <details>; gazzetta-issue_controller.js
   filters them and ticks the ones already read. */
.gazzetta-masthead {
    border-top: 3px solid var(--bulma-text-strong);
    border-bottom: 1px solid var(--bulma-text-strong);
    padding: 0.75rem 0 0.5rem;
    text-align: center;
}

.gazzetta-masthead__paper {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: var(--bulma-text-strong);
}

.gazzetta-masthead__series {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    color: var(--bulma-text-weak);
}

.gazzetta-masthead__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--bulma-border);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bulma-text);
}

.gazzetta-issue-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 1.5rem;
    font-weight: 600;
}

.gazzetta-issue-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}

.gazzetta-issue-nav > :last-child {
    justify-self: end;
}

/* Archive past page one, signed out: the prompt sits on top of the faded, unlinked issues. */
.gazzetta-gate {
    position: relative;
    margin-top: 1.5rem;
}

.gazzetta-gate__prompt {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #c9d1f3;
    border-radius: 0.5rem;
    background: #f5f7fe;
    box-shadow: 0 8px 24px rgba(58, 89, 221, 0.12);
}

.gazzetta-gate__text {
    flex: 1 1 18rem;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    color: var(--bulma-text-strong);
}

.gazzetta-gate__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.gazzetta-gate__actions .button {
    min-height: 2.75rem;
}

.gazzetta-gate__locked {
    margin-top: -0.5rem;
    opacity: 0.45;
    filter: grayscale(1);
    user-select: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

.gazzetta-gate__locked .gazzetta-row {
    cursor: default;
}

/* The archive's pages, in the same style as the issue navigation, clear of the last row. */
.gazzetta-pager {
    margin: 2rem 0 0;
    font-weight: 600;
}

.gazzetta-tools {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Type filter: radios styled as tabs. */
.gazzetta-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    border-bottom: 1px solid var(--bulma-border-weak);
}

.gazzetta-filter label,
.gazzetta-sectors label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    font-weight: 600;
    cursor: pointer;
}

.gazzetta-filter label {
    color: var(--bulma-text-weak);
}

.gazzetta-filter input,
.gazzetta-sectors input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gazzetta-filter label:has(input:checked) {
    color: var(--bulma-link);
    box-shadow: inset 0 -2px 0 var(--bulma-link);
}

.gazzetta-filter label:has(input:focus-visible),
.gazzetta-sectors label:has(input:focus-visible) {
    outline: 2px solid var(--bulma-link);
    outline-offset: 2px;
}

/* Kind of body: chips, each in its sector's colour. */
/* A fieldset is as wide as its content by default, which defeats the sideways scroll. */
.gazzetta-sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.gazzetta-sectors label {
    min-height: 2.25rem;
    padding: 0 0.85rem;
    border: 1px solid var(--bulma-border-weak);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--bulma-text);
    background: var(--bulma-scheme-main);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gazzetta-sectors label:has(input:checked) {
    border-color: var(--bulma-link);
    background: var(--bulma-link);
    color: #fff;
}

.gazzetta-sectors label:has(input:checked) i {
    color: inherit;
}

@media (pointer: coarse) {
    .gazzetta-sectors label {
        min-height: 2.75rem;
    }
}

.gazzetta-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--bulma-text-weak);
}

.gazzetta-progress__bar {
    flex: 0 0 8rem;
    height: 6px;
    border-radius: 999px;
    background: var(--bulma-border-weak);
    overflow: hidden;
}

.gazzetta-progress__bar > span {
    display: block;
    height: 100%;
    background: var(--bulma-link);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--motion-ease-out);
}

/* Sector colours: the row icon and the chip icon share them. */
.gazzetta-sector--health { --sector-bg: #feecf0; --sector-fg: #cc0f35; }
.gazzetta-sector--university { --sector-bg: #eef3fc; --sector-fg: #3e56c4; }
.gazzetta-sector--research { --sector-bg: #f3eefc; --sector-fg: #7a3ec4; }
.gazzetta-sector--local { --sector-bg: #effaf5; --sector-fg: #257953; }
.gazzetta-sector--state { --sector-bg: #fffaeb; --sector-fg: #946c00; }
.gazzetta-sector--other { --sector-bg: #f5f5f5; --sector-fg: #4a4a4a; }

.gazzetta-sectors label > i {
    color: var(--sector-fg);
}

.gazzetta-entry-list {
    border-top: 1px solid var(--bulma-border-weak);
}

.gazzetta-entry-list > li {
    border-bottom: 1px solid var(--bulma-border-weak);
}

.gazzetta-row {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.875rem;
    padding: 0.75rem 0.5rem;
    color: inherit;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s ease;
}

.gazzetta-row::-webkit-details-marker {
    display: none;
}

.gazzetta-row:hover,
.gazzetta-row:focus-visible,
.gazzetta-entry[open] > .gazzetta-row {
    background-color: var(--bulma-scheme-main-bis);
    color: inherit;
}

.gazzetta-row__icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: var(--sector-bg);
    color: var(--sector-fg);
}

.gazzetta-issue-icon {
    background: #eef1fc;
    color: #3A59DD;
}

/* Archive: the newest issue stands out, since it is the one most readers came for. */
.gazzetta-entry-list > li.is-latest > .gazzetta-row {
    background: #eef1fc;
    box-shadow: inset 3px 0 0 #3A59DD;
}

.gazzetta-entry-list > li.is-latest > .gazzetta-row:hover,
.gazzetta-entry-list > li.is-latest > .gazzetta-row:focus-visible {
    background: #e3e8fb;
}

.is-latest .gazzetta-issue-icon {
    background: #3A59DD;
    color: #fff;
}

.is-latest .gazzetta-row__open {
    border-color: #3A59DD;
    background: #3A59DD;
    color: #fff;
}

/* Plain text above the solid "Apri", so the two read as a label and a button. */
.gazzetta-latest-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #3A59DD;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gazzetta-latest-label > i {
    font-size: 0.45rem;
    animation: gazzetta-latest-pulse 1.6s var(--motion-ease-in-out) infinite;
}

@keyframes gazzetta-latest-pulse {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .gazzetta-latest-label > i {
        animation: none;
    }
}

.gazzetta-row__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.5;
}

.gazzetta-row__title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.gazzetta-row__truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gazzetta-row__title > .gazzetta-row__check {
    display: none;
    flex-shrink: 0;
    color: #48c78e;
}

.is-read .gazzetta-row__title > .gazzetta-row__check {
    display: inline;
}

.is-read .gazzetta-row__title {
    color: var(--bulma-text-weak);
}

.gazzetta-row__end {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    white-space: nowrap;
}

.gazzetta-row__meta {
    font-size: 0.75rem;
    color: var(--bulma-text-weak);
}

/* The pill that says the row opens. */
.gazzetta-row__open {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.7rem;
    border: 1px solid #c9d1f3;
    border-radius: 999px;
    background: var(--bulma-scheme-main);
    color: var(--bulma-link);
    font-size: 0.8rem;
    font-weight: 600;
}

.gazzetta-row:hover .gazzetta-row__open {
    border-color: var(--bulma-link);
}

.gazzetta-row__open > i {
    font-size: 0.7rem;
    transition: transform 0.2s var(--motion-ease-out);
}

.gazzetta-row__close-label,
.gazzetta-entry[open] .gazzetta-row__open-label {
    display: none;
}

.gazzetta-entry[open] .gazzetta-row__close-label {
    display: inline;
}

.gazzetta-entry[open] .gazzetta-row__open > i {
    transform: rotate(180deg);
}

.gazzetta-entry__body {
    padding: 0.25rem 0.5rem 1.25rem calc(0.5rem + 2.5rem + 0.875rem);
    background-color: var(--bulma-scheme-main-bis);
}

/* Narrow screens: the title may take two lines next to the icon and the pill, and the sector
   chips scroll sideways on one line instead of stacking. */
@media screen and (max-width: 768px) {
    .gazzetta-entry__body {
        padding-left: 0.5rem;
    }

    .gazzetta-row {
        grid-template-columns: 2rem minmax(0, 1fr) auto;
        column-gap: 0.625rem;
    }

    .gazzetta-row__icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }

    .gazzetta-row__title > .gazzetta-row__truncate {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
        line-height: 1.3;
    }

    .gazzetta-sectors {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -0.75rem;
        padding: 0 0.75rem 0.25rem;
        scrollbar-width: none;
    }

    .gazzetta-sectors label {
        flex-shrink: 0;
    }
}

.gazzetta-entry__body .content {
    max-width: 75ch;
    overflow-wrap: anywhere;
}

/* An act in articles (#210): one folded row per article, so an opened bando is a table of
   contents instead of 40,000 characters. */
.gazzetta-articles {
    max-width: 75ch;
    border-top: 1px solid var(--bulma-border-weak);
}

.gazzetta-articles > li {
    border-bottom: 1px solid var(--bulma-border-weak);
}

.gazzetta-article__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    min-height: 2.75rem;
    padding: 0.625rem 0.5rem;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s ease;
}

.gazzetta-article__row::-webkit-details-marker {
    display: none;
}

.gazzetta-article__row:hover,
.gazzetta-article__row:focus-visible,
.gazzetta-article[open] > .gazzetta-article__row {
    background-color: var(--bulma-scheme-main-ter);
}

.gazzetta-article__heading {
    flex-shrink: 0;
    min-width: 4.5rem;
    font-weight: 600;
    color: var(--bulma-text-weak);
    font-variant-numeric: tabular-nums;
}

.gazzetta-article__title {
    flex: 1;
    font-weight: 600;
    color: var(--bulma-text-strong);
}

.gazzetta-article__chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--bulma-text-weak);
    transition: transform 0.2s var(--motion-ease-out);
}

.gazzetta-article[open] .gazzetta-article__chevron {
    transform: rotate(180deg);
}

.gazzetta-article__text {
    padding: 0.25rem 0.5rem 1rem;
}

.gazzetta-entry__body > .content + .gazzetta-articles {
    margin-top: 1rem;
}

.gazzetta-entry__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

/* A long entity name wraps inside the button instead of overflowing on mobile. */
.gazzetta-entry__actions .button {
    height: auto;
    min-height: 2.75rem;
    white-space: normal;
    text-align: left;
}

/* The fake result: a tinted row between the entries, without the list's divider. */
.gazzetta-entry-list > li.gazzetta-promo {
    border-bottom: 0;
    padding: 0.5rem 0;
}

.gazzetta-empty {
    padding: 2rem 0;
    text-align: center;
}

/* Every avviso opened: the issue gets stamped, the way the footer's sheets do. */
.gazzetta-stamp {
    width: max-content;
    margin: 2.5rem auto 1rem;
    padding: 0.6rem 1.5rem;
    border: 4px double #cc0f35;
    border-radius: 10px;
    color: #cc0f35;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.14em;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-6deg);
    opacity: 0.85;
    pointer-events: none;
}

.gazzetta-stamp small {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.gazzetta-stamp.is-landing {
    animation: gazzetta-stamp-land 0.45s var(--motion-ease-out) both;
}

@keyframes gazzetta-stamp-land {
    0% { opacity: 0; transform: rotate(-14deg) scale(1.8); }
    70% { opacity: 0.9; transform: rotate(-5deg) scale(0.94); }
    100% { opacity: 0.85; transform: rotate(-6deg) scale(1); }
}

/* Anonymous visitors: the way to the alerts, fixed at the bottom while they read. */
.gazzetta-signup-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid var(--bulma-border-weak);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    padding: 0.625rem 1rem max(0.625rem, env(safe-area-inset-bottom));
}

.gazzetta-signup-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1152px;
    margin: 0 auto;
}

.gazzetta-signup-bar__text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    line-height: 1.3;
}

.gazzetta-signup-bar .button {
    flex-shrink: 0;
    min-height: 2.75rem;
}

.gazzetta-signup-bar__spacer {
    height: 4.5rem;
}

/* Competition detail - title evaluation */
.title-evaluation {
    background: #fafafa;
    border: 1px solid #ededed;
    border-radius: 6px;
    padding: 1.25rem;
}

.title-evaluation-summary {
    display: flex;
    flex-direction: column;
}

.title-evaluation-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Now a real <ul>, so a screen reader announces the criteria as a list. */
    list-style: none;
    margin: 0;
}

.title-evaluation-item {
    display: flex;
    /* Was center: the name column can now wrap onto several lines (a match marker,
       a disclosure), and centring left the icon and the points floating mid-block. */
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.title-evaluation-match {
    display: block;
    font-size: 0.8rem;
    color: #257953;
}

/* Native disclosure: no JS, and keyboard plus screen reader support for free. */
.title-evaluation-source {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.title-evaluation-source > summary {
    color: #485fc7;
    cursor: pointer;
    width: fit-content;
}

.title-evaluation-source > summary:focus-visible {
    outline: 2px solid #485fc7;
    outline-offset: 2px;
}

.title-evaluation-source > p {
    color: #4a4a4a;
    margin: 0.375rem 0 0;
    padding-left: 0.625rem;
    border-left: 2px solid #ededed;
    /* Bando tables arrive as long unbroken strings often enough to overflow. */
    overflow-wrap: anywhere;
}

.title-evaluation-item:last-child {
    border-bottom: none;
}

.title-evaluation-item-name {
    flex: 1;
    min-width: 0;
}

.title-evaluation-item-points {
    font-weight: 600;
    white-space: nowrap;
    color: #485fc7;
}

/* Competition detail - deadline color scale */
.deadline-safe {
    color: #48c78e;
}

.deadline-warning {
    color: #946c00;
}

.deadline-urgent {
    color: #f14668;
}

.deadline-expired {
    color: #4a4a4a;
}

.deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.deadline-safe .icon,
.deadline-warning .icon,
.deadline-urgent .icon,
.deadline-expired .icon {
    color: inherit;
}

.deadline-tag-deadline-safe {
    background-color: rgba(72, 199, 142, 0.15);
    color: #257953;
}

.deadline-tag-deadline-warning {
    background-color: rgba(148, 108, 0, 0.12);
    color: #946c00;
}

.deadline-tag-deadline-urgent {
    background-color: rgba(241, 70, 104, 0.12);
    color: #f14668;
}

.deadline-tag-deadline-expired {
    background-color: rgba(74, 74, 74, 0.1);
    color: #4a4a4a;
}

/* Competition detail - header */
.competition-header {
    padding-bottom: 1.25rem;
    border-bottom: 2px solid #ededed;
}

.competition-header-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Competition detail - lighter section separators */
.competition-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #ededed;
}

.competition-section:last-of-type {
    border-bottom: none;
}

/* Competition detail - correlated searches */
.correlated-searches {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.correlated-search-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4em 0.85em;
    border: 1px solid #dbdbdb;
    border-radius: 2rem;
    font-size: 0.875rem;
    color: #363636;
    background-color: #fafafa;
    width: fit-content;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.correlated-search-chip:hover {
    background-color: #485fc7;
    border-color: #485fc7;
    color: #fff;
}

.correlated-search-chip .icon {
    font-size: 0.7rem;
    opacity: 0.5;
}

.correlated-search-chip:hover .icon {
    opacity: 1;
}

/* Competition detail - related competitions */
.related-competition-card {
    display: block;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.related-competition-card:hover {
    border-color: #485fc7;
    box-shadow: 0 0.125em 0.25em rgba(72, 95, 199, 0.15);
}

/* Competition detail - mobile inline CTA buttons */
.mobile-inline-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mobile-inline-cta .button {
    width: 100%;
}

/* Competition detail - mobile sticky CTA bar */
.mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid #dbdbdb;
    padding: 0.625rem 1rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-cta-bar.is-visible {
    transform: translateY(0);
}

.mobile-cta-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-cta-bar-inner .button {
    width: 100%;
}


/* Reduce spacing before footer on mobile and add room for sticky CTA */
@media screen and (max-width: 768px) {
    .competition-detail-page > .container {
        margin-bottom: 1rem !important;
    }
}

/* Telegram inline banner (competition detail, tablet/mobile) */
.telegram-inline-banner {
    border-radius: 8px;
    background: linear-gradient(135deg, #229ed9 0%, #1b7ab5 100%);
    overflow: hidden;
}

.telegram-inline-banner-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #fff !important;
    text-decoration: none;
}

.telegram-inline-banner-link:hover {
    color: #fff;
    opacity: 0.95;
}

.telegram-inline-banner-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.telegram-inline-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.telegram-inline-banner-text strong {
    color: #fff;
    font-size: 0.875rem;
}

.telegram-inline-banner-text small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
}

/* Telegram CTA banner (top of listing pages and homepage) */
.telegram-cta {
    background-color: #eaf6fc;
    border-left: 4px solid #229ed9;
}

.telegram-cta .message-body {
    border: none;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    color: #1a1a1a;
}

.telegram-cta-icon {
    color: #229ed9;
    width: 3rem;
    height: 3rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(34, 158, 217, 0.12);
    border-radius: 50%;
}

/* Mobile: stack the button below the message and make it full-width. */
@media screen and (max-width: 768px) {
    .telegram-cta .message-body {
        padding: 0.875rem 1rem;
    }
    .button.is-fullwidth-mobile {
        width: 100%;
    }
}

/* Site footer. The bottom padding is the strip where footer-pile_controller.js piles its
   stamped sheets; everything readable sits above it, on a higher layer. */
.site-footer {
    position: relative;
    overflow: hidden;
    background: #3A59DD;
    color: #fff;
    padding: 2rem 1.25rem 210px;
}

.site-footer__top {
    position: relative;
    z-index: 2;
}

.site-footer a,
.site-footer button {
    color: #fff;
}

.site-footer a:hover,
.site-footer button:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer a:focus-visible,
.site-footer button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.site-footer__logo {
    display: block;
    width: auto;
    height: 36px;
    filter: brightness(0) invert(1);
}

.site-footer__brand p {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.site-footer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.25rem;
}

.site-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.15rem;
}

.site-footer__social a:hover {
    background: rgba(255, 255, 255, 0.24);
    text-decoration: none;
}

.site-footer__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    margin-top: 1rem;
}

/* On touch screens each group flows into the shared two-column grid. */
.site-footer__group {
    display: contents;
}

.site-footer__heading {
    grid-column: 1 / -1;
    margin: 1rem 0 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.65;
}

.site-footer__group a,
.site-footer__group button {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.95rem;
}

.site-footer__group button {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}

@media screen and (min-width: 1024px) {
    .site-footer {
        padding: 2.5rem 3rem 200px;
    }

    .site-footer__top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 2rem;
    }

    .site-footer__logo {
        height: 42px;
    }

    .site-footer__links {
        display: flex;
        gap: 3.5rem;
        margin-top: 0;
    }

    .site-footer__group {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .site-footer__heading {
        margin: 0 0 0.15rem;
    }

    .site-footer__group a,
    .site-footer__group button {
        min-height: 0;
        font-size: 0.9rem;
    }
}

/* Stamped sheets drawn by footer-pile_controller.js */
.footer-sheet {
    --line: 12px;
    position: absolute;
    top: -160px;
    z-index: 1;
    width: 104px;
    height: 138px;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transition: top 0.9s cubic-bezier(0.5, 0, 0.65, 1.25), transform 0.9s;
}

.footer-sheet::before {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    top: 10%;
    height: 6%;
    border-radius: 2px;
    background: #3A59DD;
    opacity: 0.18;
}

.footer-sheet::after {
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    top: 22%;
    bottom: 12%;
    background: repeating-linear-gradient(transparent 0 calc(var(--line) - 1px), #e5e7eb calc(var(--line) - 1px) var(--line));
}

@media screen and (min-width: 1024px) {
    .footer-sheet {
        --line: 15px;
        top: -190px;
        width: 128px;
        height: 170px;
    }
}

.footer-stamp {
    position: absolute;
    left: 50%;
    top: 58%;
    z-index: 1;
    opacity: 0;
    filter: url(#footer-ink);
    animation: footer-stamp-thump 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.9s forwards;
}

.footer-stamp--word {
    padding: 0.3rem 0.45rem;
    border: 3px double currentColor;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.footer-stamp--seal {
    width: 86px;
    height: 86px;
}

.footer-stamp--seal svg {
    display: block;
    width: 100%;
    height: 100%;
}

.footer-stamp__emblem {
    position: absolute;
    inset: 25%;
    background: currentColor;
    -webkit-mask: url("../imgs/favicon-GcVWRDn.png") center / contain no-repeat;
    mask: url("../imgs/favicon-GcVWRDn.png") center / contain no-repeat;
}

@keyframes footer-stamp-thump {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--r)) scale(calc(var(--s) * 1.9));
    }
    to {
        opacity: 0.88;
        transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s));
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-sheet {
        transition: none;
    }

    .footer-stamp {
        animation: none;
        opacity: 0.88;
        transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s));
    }
}

/* Homepage feature steps — Registrati / Cerca / Salva */
.feature-steps.columns {
    position: relative;
    align-items: stretch;
}

.feature-steps::before {
    content: '';
    position: absolute;
    top: calc(0.75rem + 18px);
    left: 16.67%;
    right: 16.67%;
    border-top: 2px dashed #dbdbdb;
    z-index: 0;
}

.feature-steps .column.feature-step {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.feature-step-card {
    padding: 1rem 0.75rem 0;
}

.feature-step-number {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 auto 12px;
}

.feature-step-number--blue {
    background: linear-gradient(135deg, #485fc7, #6b7fd4);
}

.feature-step-number--teal {
    background: linear-gradient(135deg, #00D1B2, #3ddbc6);
}

.feature-step-number--green {
    background: linear-gradient(135deg, #48c78e, #6dd4a8);
}

.feature-step-icon {
    display: block;
    margin-bottom: 1rem;
}

@media screen and (max-width: 768px) {
    .feature-steps {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding: 0 1rem 1rem;
        gap: 1rem;
    }

    .feature-steps::-webkit-scrollbar {
        display: none;
    }

    .feature-steps::before {
        display: none;
    }

    .feature-step:not(:last-child) .feature-step-number::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 100%;
        width: calc(80vw + 1rem - 36px);
        border-top: 2px dashed #dbdbdb;
    }

    .feature-step {
        min-width: 80vw;
        flex-shrink: 0;
        scroll-snap-align: center;
    }
}

#competition-results {
    transition: opacity 0.2s ease;
}

/* Competition updates timeline */
.competition-updates-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.competition-updates-timeline::before {
    content: '';
    position: absolute;
    left: calc(0.675rem - 1px);
    top: 0.6rem;
    bottom: 0;
    width: 2px;
    background: #dbdbdb;
}

.competition-update-item {
    position: relative;
    margin-bottom: 1.25rem;
}

.competition-update-item::before {
    content: '';
    position: absolute;
    left: -1.125rem;
    top: 0.3rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #485fc7;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #485fc7;
}

.competition-update-date {
    font-size: 0.75rem;
    color: #7a7a7a;
    margin-bottom: 0.25rem;
}

.competition-update-body {
    background: #f5f5f5;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ── Search Terms — TomSelect overrides ─────────────────────────────────── */

.ts-wrapper.multi {
  min-height: 2.5em;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  background: white;
  cursor: text;
}

.ts-wrapper.multi.focus {
  outline: none;
}

/* Blend into Bulma .field.has-addons (middle position: square all corners) */
.field.has-addons .control .ts-wrapper.multi {
  border-radius: 0;
}

/* On mobile the leading icon addon (.is-hidden-mobile) is hidden, so the
   TomSelect wrapper becomes the leftmost element of .has-addons. Restore
   left-corner rounding to match Bulma's leftmost-addon convention. */
@media screen and (max-width: 768px) {
  .search-form .field.has-addons .control .ts-wrapper.multi {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
}

.field.has-addons .control .ts-wrapper.multi.focus {
  z-index: 1;
}

/* Fixed-height search bar: anchor the row container itself so icon, input,
   and button all match — and stay matched whether TomSelect has hydrated or
   not. Anchoring on .field (instead of relying on the wrapper's height to
   determine the row) prevents a pre-hydration shift: native <select> has a
   UA-default font-size of ~13.33px and the buttons have their own intrinsic
   height (~51px), so without an explicit row height the row collapses by a
   few pixels when TomSelect's 3em wrapper takes over. */
.search-form .field.has-addons {
  align-items: stretch;
  height: 3rem;
}

.navbar .search-form .field.has-addons {
  height: 2.5rem;
}

.search-form .field.has-addons .control .ts-wrapper.multi {
  height: 100%;
  min-height: 0;
}

.search-form .field.has-addons .control .ts-wrapper.multi .ts-control {
  height: 100%;
  overflow-y: auto;
  align-content: center;
}

.search-form .field.has-addons .control .button {
  height: 100%;
}

/* Pre-hydration: hide the bare <select multiple> so the empty native control
   doesn't flash before TomSelect attaches. The row's own height anchors the
   layout, so the select doesn't need to reserve space here. */
.search-form .field.has-addons .control select[multiple]:not(.tomselected) {
  visibility: hidden;
  width: 100%;
  height: 100%;
}

/* Pre-hydration placeholder: render an input-shaped block with the TomSelect
   placeholder text in the same slot, so the search bar looks populated from
   the first paint instead of "appearing" when TomSelect attaches. The :has()
   selector removes it the moment TomSelect inserts its wrapper into the DOM.
   Browsers without :has() support fall back to the previous empty slot —
   no regression. */
.search-form .field.has-addons .control.is-expanded {
  position: relative;
}

.search-form .field.has-addons .control.is-expanded:not(:has(.ts-wrapper)) {
  cursor: text;
}

.search-form .field.has-addons .control.is-expanded:not(:has(.ts-wrapper))::before {
  content: 'Aggiungi ruolo, ente, requisito o regione...';
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: white;
  border: 1px solid #dbdbdb;
  color: #757575;
  font-family: inherit;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Mobile: the icon addon (.is-hidden-mobile) is hidden, so the input becomes
   the leftmost element. Match the wrapper's left-rounded corners (above) and
   use a placeholder that TomSelect's runtime picker would actually choose for
   this width — at typical phone widths (~360–450px) it's the medium one, so
   the long version flashing for a frame is avoided. */
@media screen and (max-width: 768px) {
  .search-form .field.has-addons .control.is-expanded:not(:has(.ts-wrapper))::before {
    content: 'Aggiungi ruolo o regione...';
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }
}

.ts-wrapper.multi .ts-control,
.ts-wrapper.multi.focus .ts-control {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
}

.ts-wrapper.multi .ts-control input {
  font-family: inherit;
  font-size: 1rem;
}

/* A multiple styled-select (e.g. "Tipo di riserva") is one box, like the single one: the wrapper
   carries the border, so Tom Select's own control border and inset shadow, which outrank the
   rule above once the control has items, must go. Focus mirrors the single select's ring. */
.ts-wrapper.multi.styled-select .ts-control,
.ts-wrapper.multi.styled-select.has-items .ts-control,
.ts-wrapper.multi.styled-select.focus .ts-control {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

/* An empty control-input-less multiple shows its placeholder (set as data-placeholder by the controller). */
.ts-wrapper.multi.styled-select:not(.has-items) .ts-control::before {
  content: attr(data-placeholder);
  color: #b5b5b5;
}

.ts-wrapper.multi.styled-select.focus {
  border-color: #485fc7;
  box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.25);
}

.ts-wrapper .ts-dropdown {
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ts-wrapper .ts-dropdown .ts-dropdown-content .option {
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ts-wrapper.multi .ts-dropdown .ts-dropdown-content .option:hover,
.ts-wrapper .ts-dropdown .ts-dropdown-content .option.active {
  background: #eff5fb;
  color: inherit;
}

/* Category badges in dropdown options */
.search-terms-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  border-radius: 10px;
  padding: 1px 8px;
  white-space: nowrap;
}

.search-terms-badge--job_role          { background: #2161aa; }
.search-terms-badge--public_entity     { background: #1a7a47; }
.search-terms-badge--certification_group { background: #8a4800; }
.search-terms-badge--province          { background: #a83264; }
.search-terms-badge--region            { background: #5b2d8a; }
.search-terms-badge--alias      { background: #6b7280; }

/* Chips in the input.
   Selectors are scoped under .ts-wrapper.multi .ts-control to outweigh
   TomSelect's default theme, which paints a blue gradient + shadow on every
   chip via .ts-wrapper.multi .ts-control [data-value] (0,4,0). app.css loads
   before tom-select.css, so the reset block needs (0,5,0) to win on cascade. */
.ts-wrapper.multi .ts-control > .search-terms-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.8rem;
  font-weight: 500;
  margin: 2px;
}

.ts-wrapper.multi .ts-control > .search-terms-chip.item {
  background-image: none;
  text-shadow: none;
  box-shadow: none;
}

.search-terms-chip__label {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ts-wrapper.multi .ts-control > .search-terms-chip--job_role          { background: #eff5fb; color: #2161aa; border: 1px solid #a8cef0; }
.ts-wrapper.multi .ts-control > .search-terms-chip--public_entity     { background: #f0fbf5; color: #1a7a47; border: 1px solid #a0deba; }
.ts-wrapper.multi .ts-control > .search-terms-chip--certification_group { background: #fdf5f0; color: #8a4800; border: 1px solid #f0c89a; }
.ts-wrapper.multi .ts-control > .search-terms-chip--province          { background: #fbf0f5; color: #a83264; border: 1px solid #f0a8c8; }
.ts-wrapper.multi .ts-control > .search-terms-chip--region            { background: #f5f0fb; color: #5b2d8a; border: 1px solid #c8a8f0; }

/* TomSelect remove button inside chips */
.search-terms-chip .remove {
  color: inherit;
  opacity: 0.5;
  font-size: 1rem;
  line-height: 1;
}

/* Bulma sets flex-shrink:0 on .navbar-menu, which prevents it from shrinking when
   TomSelect chip content inflates max-content size, causing the navbar to overflow.
   Override to allow the menu to shrink back to the available width. */
.navbar--search .navbar-menu {
  flex-shrink: 1;
  min-width: 0;
}

/* Navbar search section: expands to fill available space */
.navbar-start-search {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

/* navbar-item: flex-basis:0 so size is fully flex-controlled, not content-driven */
.navbar-start-search .navbar-item.is-expanded {
  flex: 1 1 0;
  min-width: 0;
}

/* On desktop, .navbar-item is display:flex, making .search-form a flex item.
   flex:1 1 0 decouples the form's size from its content (chips cannot push it wider). */
.navbar-start-search .navbar-item.is-expanded > .search-form {
  flex: 1 1 0;
  min-width: 0;
}

/* field.has-addons: block-level flex container — constrain it to its parent's width.
   Required by the collapsing layout so the .control.is-expanded child can shrink
   below its content width and clip overflowing chips. */
.search-form--collapsing .field.has-addons {
  min-width: 0;
  width: 100%;
}

/* flex-basis:0 ensures this column starts at 0 and grows into available space only.
   Without this, the flex item's default min-width:auto lets chip content push the
   wrapper past its parent and trigger horizontal page scroll. */
.search-form--collapsing .field.has-addons .control.is-expanded {
  flex: 1 1 0;
  min-width: 0;
}


/* Collapsed wrapper: full width, clipped overflow. Applies in any context that
   opts into the collapsing layout via the .search-form--collapsing modifier. */
.search-form--collapsing .field.has-addons .control .ts-wrapper.multi {
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
}

/* Focused: wrapper keeps its layout height; chips overflow visually below.
   box-shadow:none removes TomSelect's focus ring which only frames the wrapper. */
.search-form--collapsing .field.has-addons .control .ts-wrapper.multi.focus {
  overflow: visible;
  z-index: 30;
  box-shadow: none;
}

/* Single row layout — applies whenever the wrapper isn't focused-with-overflow.
   Chips that overflow horizontally are clipped, and the overflow count is rendered
   as a +N badge by the controller. */
.search-form--collapsing .field.has-addons .control .ts-wrapper.multi:not(.focus.has-overflow) .ts-control {
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 100%;
  align-content: center;
  align-items: center;
}

.search-form--collapsing .field.has-addons .control .ts-wrapper.multi:not(.focus.has-overflow) .ts-control > .item {
  flex-shrink: 0;
  white-space: nowrap;
}

.search-form--collapsing .field.has-addons .control .ts-wrapper.multi:not(.focus) .ts-control > .item.is-overflow-hidden {
  display: none;
}

/* Expanded panel — only when focused AND there are hidden chips to reveal.
   align-self:flex-start prevents the parent flex layout from stretching the control
   back to the wrapper's collapsed height, which would clip overflowing rows. */
.search-form--collapsing .field.has-addons .control .ts-wrapper.multi.focus.has-overflow .ts-control {
  height: auto;
  align-self: flex-start;
  overflow: visible;
  flex-wrap: wrap;
  align-content: flex-start;
  background: white;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  padding: 0.25rem 0.5rem;
}

/* TomSelect default sets min-width: 7rem on the input — shrink it to 0 instead */
.search-form--collapsing .ts-wrapper.multi .ts-control > input {
  min-width: 0;
}

/* Clicking on .ts-control activates the nearest chip and TomSelect adds the
   .input-hidden class, which moves the input off-screen and hides the placeholder.
   For our search use case the input must stay visible so the user can type
   and read the placeholder on the first click. */
.search-form--collapsing .ts-wrapper.multi.focus.input-hidden .ts-control > input {
  opacity: 1;
  position: relative;
  left: auto;
}

/* Counter badge — visible only when collapsed and items are present.
   Styled to mimic a chip (.search-terms-chip) but with a neutral palette and no
   remove button, to read as an extra read-only entry in the selection. */
.search-navbar-count {
  display: none;
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: #f0f0f0;
  color: #4a4a4a;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  pointer-events: none;
  z-index: 2;
}

.search-form--collapsing .ts-wrapper.multi:not(.focus) .search-navbar-count:not(:empty) {
  display: inline-block;
}

/* TomSelect dropdown renders above page content when inside navbar */
.navbar .ts-wrapper .ts-dropdown {
  z-index: 40;
}

.competition-back-row {
    flex-wrap: wrap;
    gap: 0.5rem 0;
    min-height: 1.75rem;
}

.competition-neighbors {
    min-height: 1.75rem;
}

.competition-neighbors a {
    transition: opacity 200ms ease, transform 200ms ease;
}

.competition-neighbors:not(.is-revealed) a {
    opacity: 0;
    transform: translateY(-4px);
}

.competition-neighbors a[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .competition-neighbors a {
        transition: none;
    }

    .competition-neighbors:not(.is-revealed) a {
        transform: none;
    }
}

/* On mobile, drop prev/next onto their own row with even spacing.
   The .competition-back-row already has flex-wrap; force a full-width
   basis on .competition-neighbors so it wraps, override Bulma's ml-auto
   so it spans the row, and override the prev anchor's mr-3 helper so
   space-between distributes evenly. */
@media screen and (max-width: 768px) {
    .competition-neighbors {
        flex-basis: 100%;
        margin-left: 0 !important;
        justify-content: space-between;
    }

    .competition-neighbors > a {
        margin-right: 0 !important;
    }
}

/* ---- Mobile search actions sticky bar (results page, ≤1023px) ---- */
.search-actions-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fff;
    border-top: 1px solid #dbdbdb;
    padding: 0.625rem 1rem;
    padding-bottom: max(0.625rem, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.search-actions-sticky-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

.search-actions-sticky-bar-inner .button {
    width: 100%;
}

/* Clear room for the sticky bar so the last result + pagination aren't covered.
   Scoped via :has() so only pages that render the sticky bar pay the padding. */
@media screen and (max-width: 1023px) {
    body:has(.search-actions-sticky-bar) .section {
        padding-bottom: 5rem;
    }
}

/* ---- Hero vertical rhythm ----
   The logo block used to hug the search field with all the slack above it. Equal
   space above the logo and below the subtitle centres it between the navbar and
   the field, and because the two values match, the field stays put.
   Specificity beats Bulma's `.hero.is-medium .hero-body`, which loads after this
   file. */
.hero.is-medium.is-link .hero-body {
    padding-top: 5.25rem;
}

.hero.is-link .hero-body .subtitle {
    margin-bottom: 2.5rem;
}

/* ---- Hero promo strip ----
   One quiet line on the hero colour, sitting between the subtitle and the field. */
.hero-promo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2.5rem;
    padding: 0.35rem 0.9rem 0.35rem 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hero-promo:hover,
.hero-promo:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.hero-promo__tag {
    flex-shrink: 0;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #fff;
    color: #485fc7;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-promo__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    font-weight: 600;
}

/* The underline sits on the word, not on the wrapper: a decoration declared on an
   ancestor is painted across every descendant, so `text-decoration: none` on the
   arrow could never lift it. */
.hero-promo__cta-label {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.hero-promo__cta .icon {
    width: auto;
    height: auto;
    font-size: 0.75rem;
}

/* Narrow screens: wrap inside a rounded rectangle rather than a pill — the
   message is the point, so it stays and the shape gives way. */
@media screen and (max-width: 560px) {
    .hero-promo {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 12px;
        font-size: 0.8rem;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-promo {
        transition: none;
    }
}

@media screen and (max-width: 768px) {
    .hero.is-medium.is-link .hero-body {
        padding-top: 3rem;
    }

    .hero.is-link .hero-body .subtitle {
        margin-bottom: 1.5rem;
    }

    .hero-promo {
        margin-bottom: 1.5rem;
    }
}

/* ---- Hero search trigger (mobile) ----
   Looks like the desktop search field but is a button: tapping it opens the
   search modal instead of focusing an input. */
.hero-search-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6em 0.9em;
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
    color: #7a7a7a;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.hero-search-trigger:focus-visible {
    outline: none;
    border-color: var(--bulma-link, #485fc7);
    box-shadow: var(--bulma-focus-shadow-size, 0 0 0 0.125em) var(--bulma-focus-shadow-color, rgba(72, 95, 199, 0.25));
}

/* Font Awesome free has no weight above solid, so the icon reads heavier by
   taking the text's colour instead of the lighter placeholder grey. */
.hero-search-trigger .icon {
    color: inherit;
    flex-shrink: 0;
}

/* One line, ellipsised — the copy is longer than a narrow phone is wide. */
.hero-search-trigger__placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Auth flash banners ----
   Icon column plus message, so the kind of notice reads before the words do.
   Bulma's .notification centres its own padding; the grid handles spacing here. */
/* "Intendevi …@gmail.com?" under the email field (#225). The fix button is a real tap target.
   Two classes, because app.css loads before Bulma: a lone class loses to `.help { display: block }`,
   which would also override the hidden attribute. */
.help.email-typo-hint[hidden] {
    display: none;
}

.help.email-typo-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    color: var(--bulma-text-strong);
}

/* "oppure ignora" reads as part of the sentence; it is still a real button for keyboards. */
.email-typo-hint__ignore {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--bulma-text-weak);
    cursor: pointer;
}

.email-typo-hint__ignore:hover,
.email-typo-hint__ignore:focus-visible {
    text-decoration: underline;
}

@media (pointer: coarse) {
    .email-typo-hint__fix,
    .email-typo-hint__ignore {
        min-height: 44px;
    }
}

.auth-flash {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.auth-flash__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1.1rem;
    opacity: 0.85;
}

.auth-flash__body {
    min-width: 0;
}

.auth-flash__message {
    margin: 0;
    line-height: 1.45;
}

.auth-flash__line {
    display: block;
}

/* A real button rather than an underlined afterthought: it is the escape hatch from a
   dead end, so it should look pressable. */
.auth-flash__action {
    margin-top: 0.75rem;
    border: 1px solid rgba(10, 10, 10, 0.12);
    box-shadow: 0 1px 2px rgba(10, 10, 10, 0.05);
    font-weight: 600;
}

.auth-flash__action:hover {
    border-color: rgba(10, 10, 10, 0.25);
}

/* ---- Sign-in layout ----
   Once the two columns stack, the desktop container's width belongs to neither of them:
   a form and a short list read as a column, not as a full-width band. */
@media screen and (max-width: 1023px) {
    /* .columns sets its own negative gutter margins and bulma.min.css loads after this
       file, so centring needs the extra class to win. */
    .columns.auth-layout,
    .container.is-max-tablet.auth-layout {
        max-width: 34rem;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ---- "Controlla la tua email" (sign-in and sign-up, after the link is sent) ----
   The two ways in on the left; the help column reuses the sign-in benefits styles. */
/* Desktop: title and code on the left, the status card beside both, top-aligned with the title.
   Stacked: title, status, code, in one column the width of a form. */
.auth-sent {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas:
        "header status"
        "main status";
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: 3rem;
}

.auth-sent__header { grid-area: header; }
.auth-sent__main { grid-area: main; }
.auth-sent__status { grid-area: status; }

@media screen and (max-width: 1023px) {
    .auth-sent {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "header"
            "status"
            "main";
        grid-template-rows: none;
        max-width: 34rem;
        margin: 0 auto;
    }

    .auth-sent__status {
        margin-bottom: 1.5rem;
    }
}

.auth-sent__email {
    overflow-wrap: anywhere;
}

/* .input carries Bulma's own font and padding, and bulma.min.css loads after this file. */
.input.auth-sent__code {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5em;
    /* letter-spacing also trails the last digit; the indent puts the group back in the middle. */
    text-indent: 0.5em;
    text-align: center;
}

/* "Codice errato" under the field; Bulma's danger pink is too faint for text on white. */
.auth-sent__code-message {
    color: hsl(var(--bulma-danger-h), var(--bulma-danger-s), 40%);
    font-size: 0.875rem;
    font-weight: 600;
}

/* One dot per digit, in the border grey: shows the shape of the code without reading as one. */
.input.auth-sent__code::placeholder {
    color: var(--bulma-border);
    font-size: 1.1rem;
}

.auth-sent__step {
    padding: 1.5rem 0;
    border-top: 1px solid var(--bulma-border-weak);
}

.auth-sent__step:first-child {
    padding-top: 0;
    border-top: 0;
}

.auth-sent__step-title {
    margin-bottom: 0.25rem;
    color: var(--bulma-text-strong);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.auth-sent__step-text {
    margin-bottom: 1rem;
    color: var(--bulma-text-weak);
    line-height: 1.5;
}

.auth-sent__step:last-child .auth-sent__step-text {
    margin-bottom: 0;
}

/* ---- Sign-in email delivery status (SignInEmailDelivery component) ----
   Three stops: Inviata, In consegna, Consegnata. The fill is scaled, not resized, so a state
   change animates on transform only. */
/* The card clips the full-bleed header to its own rounded corners. */
.delivery-status {
    overflow: hidden;
}

/* Brand band across the top of the card. Box padding is 1.25rem; the negative margins take
   the header to the card's edges. */
.delivery-status__header {
    position: relative;
    height: 5.5rem;
    margin: -1.25rem -1.25rem 1.25rem;
    background: #3A59DD;
    pointer-events: none;
}

/* Each letter's wrapper is as wide as the header, so translateX(100%) is one full crossing.
   The icon inside sits at the left and stops short of the inbox. */
.delivery-letter {
    position: absolute;
    inset: 0 4.5rem 0 1rem;
    opacity: 0;
    color: #fff;
    animation: delivery-letter-fly 2.6s var(--motion-ease-in-out, ease-in-out) infinite;
}

.delivery-letter .fas {
    position: absolute;
    left: 0;
    animation: delivery-letter-bob 1.3s var(--motion-ease-in-out, ease-in-out) infinite alternate;
}

.delivery-letter--1 .fas { top: 1rem; font-size: 1.5rem; }
.delivery-letter--2 { animation-delay: 0.85s; }
.delivery-letter--2 .fas { top: 3.1rem; font-size: 1rem; opacity: 0.7; }
.delivery-letter--3 { animation-delay: 1.7s; }
.delivery-letter--3 .fas { top: 2.1rem; font-size: 1.25rem; opacity: 0.85; }

@keyframes delivery-letter-fly {
    0% {
        opacity: 0;
        transform: translateX(0);
    }

    15%,
    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes delivery-letter-bob {
    from {
        transform: translateY(-0.2rem) rotate(-8deg);
    }

    to {
        transform: translateY(0.25rem) rotate(6deg);
    }
}

/* No answer yet: still flying, just slower. */
.delivery-status--slow .delivery-letter {
    animation-duration: 5.5s;
}

.delivery-status--slow .delivery-letter--2 { animation-delay: 1.8s; }
.delivery-status--slow .delivery-letter--3 { animation-delay: 3.6s; }

/* A final answer: the letters have landed. */
.delivery-status--delivered .delivery-letter,
.delivery-status--failed .delivery-letter {
    display: none;
}

.delivery-status__inbox {
    position: absolute;
    top: 50%;
    right: 1.25rem;
    color: #fff;
    font-size: 2.25rem;
    line-height: 1;
    transform: translateY(-50%);
}

.delivery-status__badge {
    position: absolute;
    top: -0.45rem;
    right: -0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #3A59DD;
    border-radius: 50%;
    background: var(--bulma-success);
    color: #fff;
    font-size: 0.6rem;
    animation: motion-pop 250ms var(--motion-ease-out, ease-out);
}

.delivery-status--failed .delivery-status__badge {
    background: hsl(var(--bulma-danger-h), var(--bulma-danger-s), 45%);
}

.delivery-status--slow .delivery-status__badge {
    background: #e0a800;
}

/* Reduced motion: the end state is just there, one letter halfway across. */
@media (prefers-reduced-motion: reduce) {
    .delivery-letter,
    .delivery-letter .fas,
    .delivery-status__badge {
        animation: none;
    }

    .delivery-letter--1 {
        opacity: 1;
        transform: translateX(50%);
    }
}

.delivery-track {
    position: relative;
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bulma-border-weak);
}

.delivery-track__fill {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    background: var(--bulma-link);
    transform: scaleX(0.5);
    transform-origin: left;
    transition: transform 400ms var(--motion-ease-out, ease-out), background-color 400ms ease;
}

/* In flight: a light sweep across the filled half says "still working" without pretending
   to measure anything. */
.delivery-status--pending .delivery-track__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-100%);
    animation: delivery-track-sweep 1.4s var(--motion-ease-in-out, ease-in-out) infinite;
}

@keyframes delivery-track-sweep {
    to {
        transform: translateX(100%);
    }
}

.delivery-status--delivered .delivery-track__fill {
    background: var(--bulma-success);
    transform: scaleX(1);
}

.delivery-status--failed .delivery-track__fill {
    background: var(--bulma-danger);
    transform: scaleX(1);
}

.delivery-status--slow .delivery-track__fill {
    background: #e0a800;
}

@media (prefers-reduced-motion: reduce) {
    .delivery-track__fill {
        transition: none;
    }

    .delivery-status--pending .delivery-track__fill::after {
        animation: none;
        display: none;
    }
}

/* A grid, not space-between: the middle label has to sit at 50%, where the in-flight fill ends,
   whatever the length of the last one. */
.delivery-track__labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 0.4rem;
    color: var(--bulma-text-weak);
    font-size: 0.75rem;
    font-weight: 600;
}

.delivery-track__labels > :nth-child(2) {
    text-align: center;
}

.delivery-track__labels > :last-child {
    text-align: right;
}

.delivery-status__body {
    margin-top: 1.25rem;
}

.delivery-status__title {
    margin-bottom: 0.25rem;
    color: var(--bulma-text-strong);
    font-weight: 700;
}

.delivery-status__title .fas {
    margin-right: 0.35rem;
    color: var(--bulma-link);
}

.delivery-status--delivered .delivery-status__title .fas {
    color: var(--bulma-success);
}

/* Bulma's danger is a 70% lightness pink: fine as a bar, too faint as text on white. */
.delivery-status--failed .delivery-status__title,
.delivery-status--failed .delivery-status__title .fas {
    color: hsl(var(--bulma-danger-h), var(--bulma-danger-s), 40%);
}

.delivery-status--slow .delivery-status__title .fas {
    color: #e0a800;
}

.delivery-status__text {
    color: var(--bulma-text-weak);
    font-size: 0.9rem;
    line-height: 1.5;
}

.delivery-status__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bulma-border-weak);
    color: var(--bulma-text-weak);
    font-size: 0.8rem;
}

.delivery-status__footer a {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

@media (pointer: coarse) {
    .delivery-status__footer a {
        min-height: 44px;
    }
}

/* Phones: a slim strip, so the bar and the code field fit on one screen. The flying letters,
   the card title and the stop labels go; the status line and its sentence stay. The resend link
   stays only where it is the next step (no answer yet, bounced). */
@media screen and (max-width: 768px) {
    .delivery-status.box {
        padding: 0.9rem 1rem;
    }

    .delivery-status__header,
    .delivery-status > .title,
    .delivery-track__labels {
        display: none;
    }

    .delivery-track {
        height: 0.3rem;
    }

    .delivery-status__body {
        margin-top: 0.65rem;
    }

    .delivery-status__title {
        margin-bottom: 0.1rem;
        font-size: 0.95rem;
    }

    .delivery-status__text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .delivery-status--pending .delivery-status__footer,
    .delivery-status--delivered .delivery-status__footer {
        display: none;
    }

    .delivery-status__footer {
        margin-top: 0.5rem;
        padding-top: 0;
        border-top: 0;
    }

    .delivery-status__footer p {
        display: none;
    }
}

/* ---- Sign-in benefits column ---- */
.auth-benefits {
    background: #fbfbfd;
    border: 1px solid #ededf3;
    box-shadow: none;
}

.auth-benefits__intro {
    margin-bottom: 1.25rem;
    color: #7a7a7a;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-benefits__list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
}

.auth-benefits__item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.auth-benefits__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: #eff2fd;
    color: #485fc7;
}

.auth-benefits__title {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.auth-benefits__text {
    display: block;
    margin-top: 0.15rem;
    color: #7a7a7a;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ---- Homepage list sections (Ultimi Pubblicati, Con Più Posti, Nazionali) ---- */
.list-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.list-section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    white-space: nowrap;
}

.list-section-link:hover > span:first-child {
    text-decoration: underline;
}

/* ---- Homepage quick-search tiles ----
   The square holds the icon; the label sits underneath it, outside the box. */
/* Flex rather than a fixed column count: tiles are a hand-maintained list that
   grows and shrinks, and wrapping keeps the last row centred whatever the count. */
/* Six across or three, never the 5+1 and 4+2 a plain flex wrap produced at
   in-between widths: the row breaks a whole group of three at a time.
   Six tiles need 6 x 7rem + 5 x 1.25rem = 772px, plus the section's own padding. */
.quick-search-tiles {
    display: grid;
    grid-template-columns: repeat(6, 7rem);
    justify-content: center;
    gap: 1.5rem 1.25rem;
}

@media screen and (max-width: 820px) {
    .quick-search-tiles {
        grid-template-columns: repeat(3, 7rem);
    }
}

.quick-search-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--bulma-text-strong, #363636);
    text-align: center;
}

.quick-search-tile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #fff;
    color: #485fc7;
    font-size: 1.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.quick-search-tile:hover .quick-search-tile__icon,
.quick-search-tile:focus-visible .quick-search-tile__icon {
    border-color: #485fc7;
    box-shadow: 0 6px 18px rgba(10, 10, 10, 0.08);
    transform: translateY(-2px);
}

.quick-search-tile:hover,
.quick-search-tile:focus-visible {
    color: #2161aa;
}

.quick-search-tile__label {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

@media screen and (max-width: 480px) {
    .quick-search-tiles {
        grid-template-columns: repeat(3, 6rem);
        gap: 1rem 0.75rem;
    }

    .quick-search-tile__icon {
        width: 3.75rem;
        height: 3.75rem;
        font-size: 1.5rem;
    }

    .quick-search-tile__label {
        font-size: 0.75rem;
    }
}

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

    .quick-search-tile:hover .quick-search-tile__icon,
    .quick-search-tile:focus-visible .quick-search-tile__icon {
        transform: none;
    }
}

/* ---- "Ricerche Rapide" shortcut links ----
   One list, rendered both in the search modal and in the hero focus panel. */
.search-shortcuts__title {
    margin-bottom: 0.5rem;
    color: #7a7a7a;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-shortcuts__title-icon {
    margin-left: 0.55em;
    font-size: 0.9em;
}

.search-shortcuts__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem;
    border-radius: 4px;
    color: var(--bulma-text-strong, #363636);
}

.search-shortcuts__item:hover,
.search-shortcuts__item:focus-visible {
    background-color: #eff5fb;
    color: #2161aa;
}

.search-shortcuts__item .icon {
    color: #485fc7;
    flex-shrink: 0;
}

/* In the modal the list sits under the filters, so it needs a visible break. */
.modify-search-modal__body .search-shortcuts {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ededed;
}

/* Desktop: a dropdown-style card under the hero field. */
.hero-search {
    position: relative;
    /* Narrower than the container it sits in — a full-width field reads as a page
       banner rather than a search box. The panel is anchored to this element, so
       it follows along. */
    max-width: 64rem;
    margin: 0 auto;
}

.hero-search-shortcuts {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.75rem;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(10, 10, 10, 0.15);
    text-align: left;
}

/* ---- Modify search modal ---- */
/* Column layout: header and the Annulla/Applica footer stay put while only the
   fields scroll, so the actions are always reachable on short viewports
   (iPhone SE), where they used to sit below the fold. */
.modify-search-modal .box {
    display: flex;
    flex-direction: column;
    /* The homepage renders this modal inside `.hero.is-link .container.has-text-centered`,
       which would otherwise centre the labels and paint the title in the hero's
       white-on-blue. Reset both here so the modal looks the same on every page. */
    text-align: left;
    max-height: calc(100vh - 4rem);
    max-height: calc(100dvh - 4rem);
    overflow: hidden;
}

.modify-search-modal .modal-content {
    max-width: 480px;
}

/* `.hero.is-link .title` (0,3,0) sets --bulma-title-color on the title element itself,
   and bulma.min.css loads after app.css — so this needs both the same anchor element
   and a higher specificity to win. */
.modal.modify-search-modal .box .title {
    --bulma-title-color: var(--bulma-text-strong);
    --bulma-title-strong-color: var(--bulma-text-strong);
}

/* Rimuovi | Filtri | close, the title centred between two equal columns. */
.modify-search-modal__header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    margin: -1.25rem -1.25rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--bulma-scheme-main-bis, #fafafa);
    border-bottom: 1px solid var(--bulma-border-weak, #ededed);
}
.modify-search-modal__header .delete {
    justify-self: end;
}
.modify-search-modal__clear {
    justify-self: start;
    min-height: 44px;
    padding-left: 0;
    color: var(--bulma-link, #485fc7);
    text-decoration: none;
}

/* Bleed to the box edges so the scrollbar and the focus rings of the fields
   aren't clipped by the box padding, then restore the inset via padding. */
.modify-search-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1.25rem;
    padding: 0 1.25rem;
}

.modify-search-modal__footer {
    flex: 0 0 auto;
    padding-top: 1rem;
    border-top: 1px solid #ededed;
    background: #fff;
}

/* The modal's TomSelect should fill its container (no chip overflow magic
   — let the chips wrap naturally inside the modal). */
.modify-search-modal .ts-wrapper {
    width: 100%;
}

.modify-search-modal .ts-wrapper .ts-control {
    flex-wrap: wrap;
    min-height: 2.5em;
}

/* Modify-search modal accepts the global fullscreen-on-mobile behavior
   but doesn't use a floated .modal-close (its close button lives in the
   box header), so reset the top padding the global rule adds. */
@media screen and (max-width: 768px) {
    .modify-search-modal.modal > .modal-content {
        max-height: 100%;
    }

    /* Beat the global fullscreen rule's min-height:100vh + overflow-y:auto —
       the box must be exactly viewport-tall and let __body do the scrolling,
       otherwise the footer is pushed off-screen again. */
    .modify-search-modal.modal > .modal-content > .box {
        padding-top: 1.25rem;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }
}

/* ---- Styled selects (TomSelect standing in for a native <select>) ----
   Match Bulma's .input chrome so they read as form controls, not as the OS
   picker a bare <select> would open on mobile. */
.ts-wrapper.styled-select .ts-control {
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
    min-height: 2.5em;
    padding: 0.35em 2em 0.35em 0.65em;
}

.ts-wrapper.styled-select.focus .ts-control {
    border-color: var(--bulma-link, #485fc7);
    box-shadow: var(--bulma-focus-shadow-size, 0 0 0 0.125em) var(--bulma-focus-shadow-color, rgba(72, 95, 199, 0.25));
}

/* The default theme paints a grey gradient on single controls — flatten it so
   these read like the white Bulma inputs next to them. */
.ts-wrapper.styled-select.single .ts-control,
.ts-wrapper.styled-select.single.input-active .ts-control {
    background-color: #fff;
    background-image: none;
}

/* TomSelect dropdown when appended to body (dropdownParent='body'),
   used inside the modify-search modal. The default .ts-wrapper .ts-dropdown
   styling rules don't apply here because the dropdown is no longer a
   descendant of .ts-wrapper. Mirror the same styling and bump z-index
   above Bulma's modal (40) so the suggestions render in front. */
body > .ts-dropdown {
    z-index: 50;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
}

body > .ts-dropdown .ts-dropdown-content .option {
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body > .ts-dropdown .ts-dropdown-content .option:hover,
body > .ts-dropdown .ts-dropdown-content .option.active {
    background: #eff5fb;
    color: inherit;
}

/* Cookie consent banner (Layer 1 + Layer 2 preferences) */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    margin: 0 auto;
    max-width: 32rem;
    padding: 1.1rem 1.5rem 1.25rem;
    border: 1px solid rgba(10, 10, 10, 0.06);
    border-radius: 10px;
    background-color: #ffffff;
    color: #4a4f5b;
    box-shadow: 0 10px 28px -8px rgba(66, 88, 255, 0.22), 0 3px 8px rgba(10, 10, 10, 0.06);
    z-index: 1000;
    animation: cookie-banner-in 0.28s ease-out;
}

/* An open modal sits on top: at z-index 1000 the banner covered the bottom of
   modals on phones, so tapping "Applica" in the mobile search hit "Personalizza".
   39 is just under Bulma's .modal (40). */
html:has(.modal.is-active) .cookie-banner {
    z-index: 39;
}

@keyframes cookie-banner-in {
    from { opacity: 0; transform: translateY(0.75rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner { animation: none; }
}

.cookie-banner__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    color: #363636;
}

.cookie-banner__title .icon {
    color: #4258ff;
}

.cookie-banner p a {
    white-space: nowrap;
}

.cookie-banner__prefs {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.cookie-banner__actions {
    margin-top: 0.9rem;
    margin-bottom: 0;
}

/* ============================================================
   Exam simulations (Simulazioni)
   Reuses platform tokens: link #485fc7, teal #00D1B2,
   success #48c78e / #257953, danger #f14668.
   ============================================================ */

/* ---- Page head for public exam pages ----
   Title and subtitle sit on the page like everywhere else on the site; the blue
   gradient panel this replaces was the only one of its kind. From tablet up the
   actions sit on the right, level with the title; on a phone they take the next row. */
.exam-page-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

@media screen and (min-width: 769px) {
    .exam-page-head {
        flex-direction: row;
        justify-content: space-between;
        gap: 1rem 2rem;
    }

    .exam-page-head__actions {
        flex-shrink: 0;
    }
}

.exam-page-head__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin: 0;
}

.exam-page-head__links .list-section-link {
    min-height: 44px;
}

.exam-page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* On a phone the buttons share the row and wrap, instead of sitting in a
   narrow column beside the title. */
@media screen and (max-width: 768px) {
    .exam-page-head__actions {
        width: 100%;
    }

    .exam-page-head__actions > .button {
        flex: 1 1 12rem;
    }
}

/* /simulazioni explainer: icon beside a title and a line of text, flat on the page. */
.exam-explainer-item {
    display: flex;
    gap: 0.75rem;
}

/* ---- Signed-in simulations hub (#199) ----
   Single-line divided rows like the homepage lists, with the replay button beside the row link
   (never inside it). Riprendi is the page's one tint row. */
.exam-hub-resume {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: #eef7fc;
}

.exam-hub-resume__body {
    flex: 1;
    min-width: 0;
}

.exam-hub-resume__eyebrow {
    font-size: 0.75rem;
    color: var(--bulma-text-weak);
}

.exam-hub-resume__title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.exam-hub-resume__bar {
    display: block;
    width: 100%;
    height: 4px;
    margin-top: 0.375rem;
    border: 0;
    border-radius: 2px;
    background: #d6e6f5;
    appearance: none;
}

.exam-hub-resume__bar::-webkit-progress-bar {
    border-radius: 2px;
    background: #d6e6f5;
}

.exam-hub-resume__bar::-webkit-progress-value {
    border-radius: 2px;
    background: var(--bulma-link);
}

.exam-hub-resume__bar::-moz-progress-bar {
    border-radius: 2px;
    background: var(--bulma-link);
}

/* ---- Follow the competition, on the simulation result (#216) ----
   The result page's one tint row, same idiom as the hub's Riprendi: the competition title on
   one line, then the two steps that bring the user back (save + Telegram). */
.exam-follow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: #eef7fc;
}

.exam-follow__body {
    flex: 1 1 18rem;
    min-width: 0;
}

.exam-follow__title {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.exam-follow__title:hover,
.exam-follow__title:focus-visible {
    color: var(--bulma-link);
}

.exam-follow__text {
    font-size: 0.875rem;
    color: var(--bulma-text-weak);
}

.exam-follow__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.exam-hub-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--bulma-border-weak);
}

.exam-hub-tab {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    color: var(--bulma-text-weak);
    cursor: pointer;
}

.exam-hub-tab:hover {
    color: var(--bulma-text-strong);
}

.exam-hub-tab.is-active {
    border-bottom-color: var(--bulma-link);
    color: var(--bulma-link);
}

.exam-hub-tab__count {
    margin-left: 0.125rem;
    font-weight: 500;
    color: var(--bulma-text-weak);
}

.exam-hub-list > li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--bulma-border-weak);
}

.exam-hub-list--ruled {
    border-top: 1px solid var(--bulma-border-weak);
}

.exam-hub-row {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    min-height: 44px;
    padding: 0.625rem 0.5rem;
    color: inherit;
    transition: background-color 0.15s ease;
}

a.exam-hub-row:hover,
a.exam-hub-row:focus-visible {
    background-color: var(--bulma-scheme-main-bis);
    color: inherit;
}

.exam-hub-row__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.exam-hub-row__meta,
.exam-hub-row__date {
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--bulma-text-weak);
}

.exam-hub-row__date {
    min-width: 3.5rem;
    text-align: right;
}

.exam-hub-row__score {
    min-width: 3.5rem;
    text-align: right;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Bulma's success/danger greens and reds fall under 4.5:1 on white at this size. */
.exam-hub-row__score.is-passed {
    color: #257953;
}

.exam-hub-row__score.is-failed {
    color: #cc0f35;
}

/* The house in-row button (is-small is-light, as on the dashboard lists), square. The
   pseudo-element stretches the tap target to 44px without making the button look bigger. */
.exam-hub-row__action {
    position: relative;
    flex-shrink: 0;
    width: 2rem;
    margin-right: 0.25rem;
}

.exam-hub-row__action::after {
    content: "";
    position: absolute;
    inset: -0.625rem -0.375rem;
}

/* "Mostra altre N" under a long tab: fetches the rest into its Turbo Frame in place. */
.exam-hub-more {
    min-height: 44px;
    padding: 0.625rem 0.5rem;
}

.exam-hub-empty {
    padding: 1.25rem 0.5rem;
    color: var(--bulma-text-weak);
}

.exam-hub-cta {
    grid-template-columns: 1fr;
}

/* Never-played user: two doors side by side, stacked on a phone. The ready one is tinted. */
.exam-hub-doors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1rem;
}

.exam-hub-door {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--bulma-border-weak);
    border-radius: 0.5rem;
}

.exam-hub-door--primary {
    border-color: #d6e9f6;
    background: #eef7fc;
}

.exam-hub-door > form,
.exam-hub-door > .button {
    margin-top: auto;
}

.exam-hub-door__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bulma-link);
}

.exam-hub-door__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--bulma-text-strong);
}

.exam-hub-door__meta {
    font-size: 0.875rem;
    color: var(--bulma-text-weak);
}

.exam-hub-door__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: door-step;
}

.exam-hub-door__steps > li {
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: var(--bulma-scheme-main-bis);
    font-size: 0.75rem;
    counter-increment: door-step;
}

.exam-hub-door__steps > li::before {
    content: counter(door-step) " · ";
}

/* On a phone the tabs become pills: three short labels fit one row and read as a filter. */
@media screen and (max-width: 768px) {
    .exam-hub-tabs {
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 0;
    }

    .exam-hub-tab {
        padding: 0.375rem 0.75rem;
        border: 1px solid var(--bulma-border);
        border-radius: 999px;
    }

    .exam-hub-tab.is-active {
        border-color: var(--bulma-link);
        background: var(--bulma-link);
        color: #fff;
    }

    .exam-hub-tab.is-active .exam-hub-tab__count {
        color: inherit;
    }

    .exam-hub-list:not(.exam-hub-list--ruled) {
        border-top: 1px solid var(--bulma-border-weak);
    }
}

/* Topic checkboxes flow into two columns on tablet+ (one on mobile). */
/* ---- Subject picker (custom exam builder) ----
   One fluid grid instead of breakpoint-specific column counts: auto-fill lands on 1 column at
   390px, 2 on a tablet and 3-4 on a wide desktop with no media queries to keep in sync. */
.subject-picker__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* The head owns the spacing below itself; a label's own bottom margin only knocks it
   off-centre against the "N selezionate" tag beside it. Matches Bulma's own
   `.label:not(:last-child)` shape because app.css is served before Bulma, so an
   equally specific rule would lose the tie. */
.subject-picker__head .label:not(:last-child) {
    margin-bottom: 0;
}

.subject-picker__clear {
    border: 0;
    background: none;
    cursor: pointer;
    color: #7a7a7a;
}

.subject-picker__clear:hover,
.subject-picker__clear:focus-visible {
    color: #363636;
}

/* The filter has its own clear button: hide the native one WebKit draws on type="search". */
#builder-topic-filter::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.subject-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    padding: 0.25rem 0.5rem 0.25rem 0.625rem;
    border-radius: 9999px;
    background-color: #eef1fc;
    color: #3a4a9f;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
}

.subject-chip > span {
    overflow-wrap: anywhere;
}

/* The whole catalogue in the page flow: no inner scroll box. A nested scroll region hid how
   much was on offer and fought the page's own scroll, so length is handled by the search field
   at the top of the picker instead. */
.subject-group + .subject-group {
    margin-top: 1.5rem;
}

.subject-group__title {
    margin: 0 0 0.5rem;
    color: #7a7a7a;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---- Custom simulation builder: flat sections ----
   Each step is a fieldset under a rule with a tinted icon square, rather than a .box per step:
   the cards made a long form look longer. The choices inside are divided rows, the subject list
   included, so 80+ subjects read as a list and no longer as a wall of cards. */
.custom-exam-builder .builder-section {
    min-width: 0;
    margin: 0;
    padding: 2rem 0;
    border: 0;
    border-top: 1px solid var(--bulma-border-weak);
}

.custom-exam-builder .builder-section__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0;
}

.builder-section__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: #eef1fc;
    color: var(--bulma-link);
}

.builder-section__title {
    color: var(--bulma-text-strong);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

/* A one-field step puts the field beside its heading once there is room. The floated legend is
   not a rendered legend, so it is an ordinary grid item; its min-height matches the input, so the
   two centre on one line and the help text runs under the input. The field's own label repeats the
   heading there, so it stays for screen readers only. */
@media screen and (min-width: 769px) {
    .custom-exam-builder .builder-section--inline {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        column-gap: 1.5rem;
    }

    .custom-exam-builder .builder-section--inline > .builder-section__head {
        width: auto;
        min-height: 2.5rem;
        margin-bottom: 0;
    }

    .custom-exam-builder .builder-section--inline .builder-section__field-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

.builder-selected-count {
    color: var(--bulma-link);
    font-size: 0.875rem;
    font-weight: 600;
}

.builder-availability {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    color: var(--bulma-link);
    font-weight: 600;
}

.custom-exam-builder .builder-stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.custom-exam-builder .builder-stepper__input {
    width: 4.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.custom-exam-builder .builder-stepper__button {
    min-width: 2.75rem;
    font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 768px) {
    .custom-exam-builder .builder-stepper__input,
    .custom-exam-builder .builder-stepper__button {
        min-height: 2.75rem;
    }
}

.custom-exam-builder .builder-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.5rem;
    margin-bottom: 0.75rem;
}

/* Three classes: Bulma's `.field:not(:last-child)` margin ties with two and Bulma loads later. */
.custom-exam-builder .builder-actions .builder-actions__name {
    flex: 1 1 18rem;
    max-width: 32rem;
    margin-bottom: 0;
}

.custom-exam-builder .builder-actions .buttons {
    margin-bottom: 0;
    margin-left: auto;
}

/* Divided rows in a fluid grid. Every item carries a top and a bottom rule and steps up 1px,
   so the rules of neighbours in one column overlap into one and each column is closed at both
   ends, whatever the column count auto-fill lands on. */
.builder-rows {
    display: grid;
    column-gap: 2rem;
    margin: 0;
    padding-bottom: 1px;
    list-style: none;
}

.builder-rows > li {
    margin-bottom: -1px;
    border-top: 1px solid var(--bulma-border-weak);
    border-bottom: 1px solid var(--bulma-border-weak);
}

/* 20rem keeps the longest subject names ("Ordinamento degli enti locali") on one line next to
   the checkbox and count; min(100%) keeps the track inside a 390px viewport. */
.builder-rows--subjects {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

@media screen and (min-width: 769px) {
    .builder-rows--choices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.builder-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.5rem;
    color: var(--bulma-text-strong);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.builder-row:hover {
    background-color: var(--bulma-scheme-main-bis);
}

.builder-row:has(input:checked) {
    background-color: #eef1fc;
}

.builder-row:has(input:focus-visible) {
    outline: 2px solid var(--bulma-link);
    outline-offset: -2px;
}

.builder-row input {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    accent-color: var(--bulma-link);
}

.builder-row__title {
    display: block;
    font-weight: 600;
}

.builder-row:has(input:checked) .builder-row__title {
    color: var(--bulma-link);
    font-weight: 700;
}

.builder-rows--subjects .builder-row__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* From tablet up a subject is one line: the name ellipsises and the full one is in the label's
   title, which a pointer can hover. A phone has no hover, so there the long names wrap. */
@media screen and (min-width: 769px) {
    .builder-rows--subjects .builder-row__title {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
}

/* The full name of a shortened subject, above its row: on hover where there is a pointer, and on
   keyboard focus. Instant, unlike the native title tooltip, and decorative: the full name is
   already the checkbox's accessible name. */
.builder-row--shortened {
    position: relative;
}

.builder-row--shortened::after {
    content: attr(data-full-name);
    position: absolute;
    bottom: calc(100% - 0.25rem);
    left: 2.3rem;
    z-index: 5;
    max-width: min(26rem, calc(100vw - 3rem));
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: var(--bulma-text-strong);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    pointer-events: none;
    opacity: 0;
    transform: translateY(0.25rem);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

@media (hover: hover) {
    .builder-row--shortened:hover::after {
        opacity: 1;
        transform: none;
    }
}

.builder-row--shortened:has(input:focus-visible)::after {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .builder-row--shortened::after {
        transition: none;
    }
}

.builder-row__meta {
    flex: 0 0 auto;
    color: var(--bulma-text-weak);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* A choice with an explanation aligns its control with the first line, not the middle. */
.builder-row--choice {
    align-items: flex-start;
}

.builder-row--choice input {
    margin-top: 0.2rem;
}

.builder-row__hint {
    display: block;
    margin-top: 0.15rem;
    color: var(--bulma-text-weak);
    font-size: 0.8125rem;
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    .builder-row {
        transition: none;
    }
}

/* ---- Touch targets on the simulation surfaces ----
   Measured at 390px: the runner's "Esci" and "Segnala un problema" came in at 30px tall, the
   prev/next pair at 40 and the question palette at 41 — all under the 44px minimum a thumb
   needs. Bumped on small viewports only; a mouse at desktop width does not need the padding. */
@media screen and (max-width: 768px) {
    .exam-topbar-exit .button,
    .exam-report .button,
    .exam-palette__item {
        min-height: 2.75rem;
        min-width: 2.75rem;
    }

    .exam-report .button {
        /* is-text renders as a link, so grow the hit area without inflating the type. */
        padding-inline: 0.5rem;
    }

    .exam-runner .level .button,
    .custom-exam-builder .buttons .button,
    .exam-result .button {
        min-height: 2.75rem;
    }
}

/* ---- Blueprint cards (catalog) ----
   A .box the whole of which is the link, same idiom and same hover as the
   competition rows, rather than a .card with an "Apri" footer bar of its own. */
.exam-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    color: inherit;
    transition: box-shadow 0.2s ease;
}

.exam-card:hover {
    color: inherit;
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1),
                0 0 0 1px rgba(10, 10, 10, 0.02);
}

.exam-card .tag {
    align-self: flex-start;
}

/* Push the meta to the bottom so cards of different title lengths line up. */
.exam-card .exam-card-meta {
    margin-top: auto;
}

/* "Crea una nuova simulazione" as a tile in the saved-simulations grid. A dashed outline reads as
   an empty slot waiting to be filled, which a pale `is-link is-light` button under the grid did
   not. Full card height so it lines up with its neighbours. */
.exam-card-new {
    height: 100%;
    min-height: 11rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
    border: 2px dashed #b5bdea;
    border-radius: 6px;
    background: #fbfbff;
    color: #485fc7;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.exam-card-new:hover {
    border-color: #485fc7;
    border-style: solid;
    background: #f2f4ff;
    color: #485fc7;
    transform: translateY(-2px);
}

.exam-card-new:focus-visible {
    outline: none;
    border-color: #485fc7;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.3);
}

.exam-card-new__label {
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.3;
}

@media (prefers-reduced-motion: reduce) {
    .exam-card-new,
    .exam-card-new:hover {
        transition: none;
        transform: none;
    }
}

.exam-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    color: #7a7a7a;
    font-size: 0.875rem;
}

.exam-card-meta .icon {
    color: #485fc7;
}

/* ---- Stat cards (landing summary + result summary) ---- */
/* ---- Private-page tables: a table from tablet up, cards on a phone ---- */
/* One markup, two shapes. At phone widths the row drops its table display so each cell stacks as a
   "label: value" line inside a bordered card -- five columns otherwise forced a horizontal scroll to
   read a single row, or cost the phone whole columns to `is-hidden-mobile`. The labels come from each
   cell's data-label, so the header row stays the only place they are written; a cell with no
   data-label (the row's title, the actions) spans the card instead of pairing with a label. */
@media screen and (max-width: 768px) {
    .stacked-table thead {
        display: none;
    }

    .stacked-table,
    .stacked-table tbody,
    .stacked-table tr,
    .stacked-table tbody th,
    .stacked-table td {
        display: block;
        width: 100%;
    }

    .stacked-table tr {
        /* Bulma loads after this file and its .is-striped rule matches at equal specificity, so the
           even-row grey needs !important to lose to the card's own background. */
        background-color: #fff !important;
        border: 1px solid #dbdbdb;
        border-radius: 6px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .stacked-table tr:last-child {
        margin-bottom: 0;
    }

    /* `tbody td`, not `td`: Bulma loads after this file, so a single-class selector loses to its
       `.table td` border and padding. `tbody th` rides along for the same reason -- a row's
       title cell needs the same right-aligned value and the same card divider, not Bulma's own
       `.table th` padding and border colour. */
    .stacked-table tbody th,
    .stacked-table tbody td {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
        /* Lighter than Bulma's #dbdbdb: inside a card these separate lines, they don't frame them. */
        border: 0;
        border-bottom: 1px solid #ededed;
        padding: 0.5rem 0;
    }

    /* display: flex above positions the th's wrapper span but does not align the text inside it --
       unnoticeable for a short topic name (the shrink-to-fit wrapper happens to end at the cell's
       right edge by coincidence) but visible the moment a name wraps: every line, including the
       "N risposte" sub-line, sits left-aligned and short of the edge. */
    .stacked-table tbody th[data-label] {
        text-align: right;
    }

    .stacked-table tbody th:last-child,
    .stacked-table tbody td:last-child {
        border-bottom: 0;
    }

    /* margin-right: auto on the label rather than space-between on the cell: a value made of two
       inline nodes ("1,50" + "/ 7,50") would otherwise be spread to opposite ends of the card. */
    /* A cell with no value at all would otherwise show as a blank line with a divider under it. */
    .stacked-table td:empty {
        display: none;
    }

    .stacked-table td[data-label]::before,
    .stacked-table tbody th[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        margin-right: auto;
        padding-right: 0.5rem;
        font-weight: 600;
        color: #4a4a4a;
    }

    /* A wrapping tag list takes the whole card width, with its label on the line above: squeezed
       into the right-hand half the tags wrap one per line. */
    .stacked-table td:has(.tags) {
        display: block;
    }

    .stacked-table td:has(.tags)[data-label]::before {
        display: block;
        margin-bottom: 0.25rem;
    }

    /* The actions take the card's full width instead of a squeezed right-hand column. flex-end on the
       cell itself so a Bulma .field.has-addons group lands on the right too, not just .buttons. */
    .stacked-table td:last-child {
        justify-content: flex-end;
        padding-top: 0.5rem;
    }

    .stacked-table td:last-child .buttons {
        width: 100%;
        justify-content: flex-end;
    }

    /* The action buttons are Bulma is-small: 28px, fine under a mouse, under the 44px touch target
       guidance on a layout only phones ever see. */
    .stacked-table td:last-child .button {
        min-height: 2.75rem;
        min-width: 2.75rem;
    }

    /* Sortable tables keep their header row, as a sort bar above the cards: the column links are the
       only way to reorder the list, so hiding the header with the rest of thead would take the
       feature away from phones. Only the sortable columns survive, and the row sheds the card
       styling it would otherwise inherit. */
    .stacked-table--sortable thead {
        display: block;
    }

    .stacked-table--sortable thead tr {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.75rem;
        margin: 0 0 0.75rem;
        padding: 0;
        border: 0;
        background-color: transparent !important;
    }

    .stacked-table--sortable thead tr::before {
        content: 'Ordina per:';
        font-weight: 600;
        font-size: 0.8125rem;
        color: #4a4a4a;
    }

    .stacked-table--sortable thead th:not(.sortable-header) {
        display: none;
    }

    .stacked-table--sortable thead th.sortable-header {
        display: block;
        padding: 0;
        border: 0;
        font-size: 0.8125rem;
    }
}

.exam-stat {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.3rem;
    padding: 1.25rem 1rem;
    border: 1px solid #ededed;
    border-radius: 8px;
    background: #fafafa;
}

.exam-stat__icon {
    color: #485fc7;
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
}

.exam-stat__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7a7a7a;
    font-weight: 600;
}

.exam-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #363636;
    line-height: 1.1;
}

/* The maximum in "21/30": smaller, so a pass mark like 78,75/112,5 still fits a phone-width stat. */
.exam-stat__of {
    font-size: 0.65em;
    font-weight: 600;
    color: #7a7a7a;
}

.exam-stat--success {
    background: rgba(72, 199, 142, 0.1);
    border-color: rgba(72, 199, 142, 0.35);
}

.exam-stat--success .exam-stat__value,
.exam-stat--success .exam-stat__icon {
    color: #257953;
}

.exam-stat--danger {
    background: rgba(241, 70, 104, 0.08);
    border-color: rgba(241, 70, 104, 0.3);
}

.exam-stat--danger .exam-stat__value,
.exam-stat--danger .exam-stat__icon {
    color: #f14668;
}

/* ---- Focused runner shell (distraction-free test header) ---- */
.exam-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    box-shadow: 0 2px 8px rgba(10, 10, 10, 0.04);
}

.exam-topbar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto;
    padding: 0.7rem 1rem;
}

.exam-topbar-logo img {
    max-height: 1.6rem;
    display: block;
}

.exam-topbar-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #363636;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-topbar-exit {
    flex-shrink: 0;
}

.exam-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

@media screen and (max-width: 768px) {
    .exam-shell {
        padding: 1rem 0.75rem 3rem;
    }

    .exam-topbar-title {
        font-size: 0.85rem;
    }

    /* keep only the exit affordance + logo legible on phones */
    .exam-topbar-exit .button-text {
        display: none;
    }

    /* Bulma spaces a leading icon for the label after it, which is hidden here: without this the
       X sat off-centre in the square button. */
    .exam-topbar-exit .button .icon:first-child:not(:last-child) {
        margin-inline: 0;
    }
}

/* ---- Runner: sticky progress/timer strip ----
   Flat rather than a shadowed card, with the progress track as its divider. The white fill, padding
   below the track included, keeps the question from running into it while it scrolls underneath. */
.exam-runner__bar {
    position: sticky;
    top: 3.1rem; /* sits below the focused topbar */
    z-index: 20;
    padding: 0.75rem 0;
    background: var(--bulma-scheme-main);
}

.exam-progress-track {
    height: 6px;
    border-radius: 3px;
    background: #ededed;
    overflow: hidden;
    margin-top: 0.6rem;
}

.exam-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #485fc7, #6b7fd4);
    /* scaleX instead of width: no layout per frame. The track rounds and clips the ends. */
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Answer options (runner) ---- */
/* "Segnala un problema" left, "Cancella risposta" right, one row. The clear button keeps the
   right edge even when it wraps under a long label on a narrow screen. */
.exam-question-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.exam-question-actions__clear {
    margin-left: auto;
}

/* The runner's text buttons ("Fonte della domanda", "Segnala un problema", "Cancella risposta")
   underline their label, not the icon beside it. */
.exam-question-source .button.is-text,
.exam-question-actions .button.is-text {
    text-decoration: none;
}

.exam-question-source .button.is-text > span:not(.icon),
.exam-question-actions .button.is-text > span:not(.icon) {
    text-decoration: underline;
}

/* "Fonte della domanda" opens the action row under the options, before "Segnala un problema". */
.exam-question-source {
    display: inline-flex;
}

/* Its popover: placed by source-popover_controller, under the button. */
.exam-question-source__popover {
    position: absolute;
    inset: auto;
    margin: 0;
    max-width: min(24rem, calc(100vw - 1rem));
    padding: 0.75rem 1rem;
    border: 1px solid var(--bulma-border-weak);
    border-radius: 0.5rem;
    background: var(--bulma-scheme-main);
    box-shadow: 0 0.5rem 1.5rem rgba(10, 10, 10, 0.12);
}

/* Without the Popover API (iOS Safari < 17) the popover attribute is ignored: the box above sat
   over the question for good. Show the source inline instead and drop the button that can't open it. */
@supports not selector(:popover-open) {
    .exam-question-source .button {
        display: none;
    }

    .exam-question-source__popover {
        position: static;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: none;
    }
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exam-option {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    text-align: left;
    padding: 0.9rem 1rem;
    border: 1.5px solid #dbdbdb;
    border-radius: 8px;
    background: #fff;
    color: #363636;
    font-size: 1rem;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.exam-option:hover {
    border-color: #485fc7;
    background: #f7f8fd;
}

.exam-option:focus-visible {
    outline: none;
    border-color: #485fc7;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.3);
}

.exam-option.is-selected {
    border-color: #485fc7;
    background: rgba(72, 95, 199, 0.08);
    font-weight: 600;
}

.exam-option__letter {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #4a4a4a;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.exam-option.is-selected .exam-option__letter {
    background: #485fc7;
    color: #fff;
}

.exam-option__text {
    flex: 1;
    min-width: 0;
}

.exam-option__check {
    flex-shrink: 0;
    color: #485fc7;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.exam-option.is-selected .exam-option__check {
    opacity: 1;
}

/* Study-mode reveal: correct option green, a selected-but-wrong option red. */
.exam-option.is-correct {
    border-color: #48c78e;
    background: rgba(72, 199, 142, 0.12);
}

.exam-option.is-correct .exam-option__letter {
    background: #48c78e;
    color: #fff;
}

.exam-option.is-correct .exam-option__check {
    opacity: 1;
    color: #257953;
}

.exam-option.is-wrong {
    border-color: #f14668;
    background: rgba(241, 70, 104, 0.10);
}

.exam-option.is-wrong .exam-option__letter {
    background: #f14668;
    color: #fff;
}

/* ---- Question palette ---- */
/* The question palette: a flat section under a rule, its header carrying the answered count. */
.exam-palette-section {
    padding-top: 1.25rem;
    border-top: 1px solid var(--bulma-border-weak);
}

.exam-palette-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.exam-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
    gap: 0.4rem;
}

.exam-palette__item {
    aspect-ratio: 1 / 1;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    background: #fff;
    color: #4a4a4a;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.exam-palette__item:hover {
    border-color: #485fc7;
}

.exam-palette__item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.3);
}

.exam-palette__item.is-answered {
    background: rgba(72, 199, 142, 0.15);
    border-color: #48c78e;
    color: #257953;
}

.exam-palette__item.is-current {
    background: #485fc7;
    border-color: #485fc7;
    color: #fff;
}

.exam-palette-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.85rem;
    font-size: 0.75rem;
    color: #7a7a7a;
}

.exam-palette-legend__swatch {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 0.3rem;
    border: 1px solid #dbdbdb;
}

.exam-palette-legend__swatch--current {
    background: #485fc7;
    border-color: #485fc7;
}

.exam-palette-legend__swatch--answered {
    background: rgba(72, 199, 142, 0.15);
    border-color: #48c78e;
}

/* ---- Leaderboard ---- */
.exam-leaderboard__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.exam-leaderboard__row:last-child {
    border-bottom: none;
}

.exam-leaderboard__rank {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    background: #f0f0f0;
    color: #4a4a4a;
}

.exam-leaderboard__rank--1 {
    background: #ffd700;
    color: #6b5400;
}

.exam-leaderboard__rank--2 {
    background: #c7ccd1;
    color: #44494d;
}

.exam-leaderboard__rank--3 {
    background: #e0a072;
    color: #5c3410;
}

.exam-leaderboard__score {
    margin-left: auto;
    font-weight: 700;
    color: #363636;
}

/* ---- Simulation landing ---- */
.exam-landing-hero {
    background: linear-gradient(135deg, #f1f4ff 0%, #fbfcff 100%);
    border: 1px solid #e3e8fb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

@media screen and (min-width: 1024px) {
    .exam-landing-hero {
        padding: 2rem 2.5rem;
    }
}

/* The back button sits above the hero; the section gives up the top padding it takes, so the
   hero stays roughly where it was. */
.section.exam-landing {
    padding-top: 1.25rem;
}

.exam-landing-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* ponytail: sized to fit "Tutte le simulazioni" (~145px); a longer label needs a bigger value. */
.exam-landing-nav .button {
    min-width: 9.5rem;
}

.exam-landing-hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bulma-link);
    margin-bottom: 0.35rem;
}

.exam-landing-hero__description {
    color: #4a4a4a;
}

/* The simulation landing is flat throughout, like the homepage lists: sections, figures and the
   start buttons are divided by hairlines, not boxed. The blue start button carries the emphasis. */
.exam-landing-section {
    padding: 1.5rem 0;
}

.exam-landing-section + .exam-landing-section,
.exam-landing-cta + .exam-landing-section {
    border-top: 1px solid var(--bulma-border-weak);
}

/* Grey #7a7a7a is 4.1:1 on the stat tiles' #fafafa; this one clears 4.5:1. */
.exam-landing .exam-stat__label,
.exam-landing .exam-stat__of {
    color: #666;
}

.simulation-landing .exam-stat {
    border: 0;
    border-radius: 0;
    background: none;
}

.simulation-landing .column + .column > .exam-stat,
.simulation-landing .exam-scoring__item + .exam-scoring__item {
    border-left: 1px solid var(--bulma-border-weak);
}

.simulation-landing .exam-landing-cta {
    padding: 1.25rem 0;
}

/* Four figures wrap two per row on phones: the third starts a row, so it gets no divider. */
@media screen and (max-width: 768px) {
    .simulation-landing .is-multiline > .column:nth-child(odd) > .exam-stat,
    .simulation-landing.is-multiline > .column:nth-child(odd) > .exam-stat {
        border-left: 0;
    }
}

.simulation-landing .exam-landing-cta.is-hidden-desktop {
    border-top: 1px solid var(--bulma-border-weak);
}

.simulation-landing .exam-scoring__item {
    border: 0;
    border-radius: 0;
    padding: 0.25rem 1rem;
}

.simulation-landing .exam-scoring__item:first-child {
    padding-left: 0;
}

@media screen and (max-width: 480px) {
    .simulation-landing .exam-scoring__item,
    .simulation-landing .exam-scoring__item:first-child {
        padding: 0.6rem 0;
    }

    .simulation-landing .exam-scoring__item + .exam-scoring__item {
        border-left: 0;
        border-top: 1px solid var(--bulma-border-weak);
    }

    .simulation-landing .exam-scoring {
        gap: 0;
    }
}

/* The attempts' figures (Tentativi, Migliore…) wrap two per row on phones, so a divider would
   land at the start of a row: they stay apart by spacing alone. */
.simulation-landing .exam-history-kpis {
    gap: 0.75rem 1.5rem;
}

.simulation-landing .exam-history-kpi {
    border: 0;
    border-radius: 0;
    padding: 0;
}

.simulation-landing .exam-history-kpi dt,
.simulation-landing .exam-history-kpi__of {
    color: #666;
}

/* Three figures side by side even at 360px. */
.exam-landing .exam-stat {
    padding: 0.9rem 0.4rem;
}

@media screen and (max-width: 768px) {
    .exam-landing .exam-stat__value {
        font-size: 1.25rem;
    }
}

.exam-landing-aside {
    position: sticky;
    top: 1.5rem;
}

.exam-competition-list {
    list-style: none;
    margin: 0;
}

.exam-competition-list > li + li {
    border-top: 1px solid #f0f0f0;
}

.exam-competition-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 8px;
    color: inherit;
    transition: background 0.15s;
}

.exam-competition-row:hover {
    background: #f5f7ff;
    color: inherit;
}

.exam-competition-row:focus-visible {
    outline: 2px solid var(--bulma-link);
    outline-offset: 2px;
}

.exam-competition-row__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.exam-competition-row__entity {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.exam-competition-row__title {
    font-weight: 600;
    color: #363636;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-competition-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.9rem;
    font-size: 0.8rem;
    color: #7a7a7a;
    margin-top: 0.2rem;
}

.exam-competition-row__arrow {
    flex-shrink: 0;
    color: #b5b5b5;
}

.exam-competition-row:hover .exam-competition-row__arrow {
    color: var(--bulma-link);
}

.exam-competition-group + .exam-competition-group {
    margin-top: 1.25rem;
}

.exam-competition-group__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #363636;
    margin-bottom: 0.25rem;
}

.exam-landing-cta__secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.exam-landing-cta__note {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #555;
    text-align: center;
}

/* ---- Simulation landing: the user's attempts ---- */
.exam-history-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.5rem;
}

.exam-history-kpi {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.exam-history-kpi dt {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.exam-history-kpi dd {
    font-size: 1.4rem;
    font-weight: 700;
    color: #363636;
    line-height: 1.2;
}

.exam-history-kpi__delta {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.exam-history-kpi__of {
    font-size: 0.85rem;
    font-weight: 500;
    color: #7a7a7a;
}

.exam-history-chart {
    position: relative;
    height: 220px;
    margin-top: 1rem;
}

.exam-attempt-list {
    list-style: none;
    margin: 0;
}

.exam-attempt-list > li + li {
    border-top: 1px solid #f0f0f0;
}

.exam-attempt-row {
    display: grid;
    grid-template-columns: 9.5rem 3.5rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 8px;
    color: inherit;
    font-size: 0.9rem;
}

.exam-attempt-row:hover {
    background: #f5f7ff;
    color: inherit;
}

.exam-attempt-row:focus-visible {
    outline: 2px solid var(--bulma-link);
    outline-offset: 2px;
}

.exam-attempt-row__date {
    color: #4a4a4a;
}

.exam-attempt-row__percent {
    text-align: right;
    font-size: 1rem;
    color: #363636;
    font-variant-numeric: tabular-nums;
}

.exam-attempt-row__points {
    padding-left: 0.5rem;
    border-left: 1px solid #ededed;
    color: #7a7a7a;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.exam-attempt-row__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
}

@media screen and (max-width: 768px) {
    .exam-attempt-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.25rem 0.5rem;
    }

    .exam-attempt-row__date {
        grid-column: 1 / 3;
        font-size: 0.8rem;
    }

    .exam-attempt-row__percent {
        grid-column: 1;
        grid-row: 2;
        text-align: left;
    }

    .exam-attempt-row__points {
        grid-column: 2;
        grid-row: 2;
    }

    .exam-attempt-row__tags {
        grid-column: 1 / 3;
        grid-row: 3;
        justify-content: flex-start;
    }

    .exam-attempt-row .exam-competition-row__arrow {
        grid-column: 3;
        grid-row: 1 / span 3;
    }
}

/* ---- Simulation landing: subjects ---- */
.exam-subjects__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
}

.exam-subjects {
    list-style: none;
    margin: 0;
}

.exam-subject {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
}

.exam-subjects > .exam-subject + .exam-subject {
    border-top: 1px solid #f0f0f0;
}

.exam-subject__name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #363636;
}

/* A subject with a public page links to it: same look, link blue on hover. */
a.exam-subject__name:hover,
a.exam-subject__name:focus-visible {
    color: var(--bulma-link);
    text-decoration: underline;
}

.exam-subject__count {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #7a7a7a;
}

.exam-subject__share {
    flex-shrink: 0;
    min-width: 2.75rem;
    text-align: right;
    font-weight: 700;
    color: #363636;
    font-variant-numeric: tabular-nums;
}

.exam-subject__accuracy {
    flex-shrink: 0;
    min-width: 6.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media screen and (max-width: 768px) {
    .exam-subject {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.2rem 0.75rem;
    }

    .exam-subject__accuracy {
        grid-column: 1 / -1;
        justify-self: start;
        min-width: 0;
    }
}

.exam-subjects__more {
    margin-top: 0.25rem;
}

.exam-subjects__more > summary {
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--bulma-link);
    padding: 0.4rem 0;
}

.exam-scoring {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.exam-scoring__item {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 0.75rem;
}

.exam-scoring__item dt {
    font-size: 0.8rem;
    color: #666;
}

/* Bulma's success/danger text is 2.1:1 and 2.8:1 on white; these darker tones clear 4.5:1. */
.exam-scoring__points--gain {
    color: #1f7a4d;
}

.exam-scoring__points--loss {
    color: #c41d3f;
}

.exam-scoring__points--none {
    color: #666;
}

.exam-scoring__item dd {
    font-size: 1.35rem;
    font-weight: 700;
}

@media screen and (max-width: 480px) {
    .exam-scoring {
        grid-template-columns: minmax(0, 1fr);
    }

    .exam-scoring__item {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .exam-scoring__item dd {
        font-size: 1.1rem;
    }
}

/* ---- Per-question review (result) ---- */
.exam-review-option {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.35rem 0;
}

.exam-review-option__icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    color: #b5b5b5;
}

.exam-review-option.is-correct {
    color: #257953;
    font-weight: 600;
}

.exam-review-option.is-correct .exam-review-option__icon {
    color: #48c78e;
}

.exam-review-option.is-wrong {
    color: #f14668;
}

.exam-review-option.is-wrong .exam-review-option__icon {
    color: #f14668;
}

/* ---- Preview feedback questionnaire ---- */
/* The esito page is a stack of white boxes, so a sixth white box reads as more results and gets
   skipped. Tint it and mark the edge to make it the one thing on the page that is asking for
   something. */
/* `.box.exam-feedback` rather than `.exam-feedback`: Bulma loads after this file, so a
   single-class rule loses the background to `.box`. */
.box.exam-feedback {
    border-left: 4px solid #485fc7;
    background-color: #f6f7ff;
}

/* Bulma's `.box { display: block }` beats the [hidden] default, so "Non ora" would set the
   attribute and change nothing. */
.box.exam-feedback[hidden] {
    display: none;
}

.exam-feedback__title {
    display: flex;
    align-items: center;
}

/* No max-width: the intro is one sentence pair and reads better on a single line at desktop
   width than boxed into a narrow measure. It wraps naturally on smaller screens. */
.exam-feedback__intro {
    margin-bottom: 1.75rem;
}

.exam-form__field {
    margin-bottom: 1.75rem;
}

/* The question has to outweigh its answers. Bulma's `.label is-small` did the opposite: a 0.75rem
   bold question above 1rem options, which reads as a caption over the content. */
.exam-form__question {
    display: block;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #363636;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.exam-form__optional {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #7a7a7a;
}

.exam-form__options {
    display: grid;
    gap: 0.5rem;
}

/* Two columns once there is room: the scales are short labels, and a single column of four made
   the form look longer than it is. */
@media screen and (min-width: 769px) {
    .exam-form__options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Same selectable-card language as the runner's .exam-option, so answering a form here feels
   like answering a question in a simulation. A bare Bulma .radio line was 20px tall — a poor
   tap target and visually weaker than the question it answers. Shared by the post-simulation
   questionnaire and the custom-simulation builder. */
.exam-form__option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #dbdbdb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.exam-form__option:hover {
    border-color: #485fc7;
    background: #f7f8fd;
}

.exam-form__option:has(input:checked) {
    border-color: #485fc7;
    background: rgba(72, 95, 199, 0.08);
    font-weight: 600;
}

.exam-form__option:has(input:focus-visible) {
    border-color: #485fc7;
    box-shadow: 0 0 0 0.125em rgba(72, 95, 199, 0.3);
}

@media (prefers-reduced-motion: reduce) {
    .exam-form__option {
        transition: none;
    }
}

/* A three-digit duration next to its "minuti" addon: a full-width input reads as if it
   wanted a sentence. */
.exam-form__minutes {
    max-width: 6rem;
}

/* A <legend> is laid out on its fieldset's border edge rather than inside the padding box, so
   it overlaps a card's top padding and a tall caption climbs clean out of the card. Floating it
   drops it back into normal flow; every later sibling clears the float, so nothing rides up beside
   it even when the first one is out of flow (the absolute "?" of Tipo di ente). */
fieldset > legend {
    float: left;
    width: 100%;
}

fieldset > legend ~ * {
    clear: both;
}

/* ---- Keyboard shortcut legend (runner, desktop only) ---- */
.exam-kbd-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid #ededed;
    font-size: 0.8rem;
    color: #7a7a7a;
}

.exam-kbd-legend__title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #4a4a4a;
}

.exam-kbd-legend kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 0.1em 0.4em;
    border: 1px solid #dbdbdb;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fafafa;
    color: #363636;
    font-family: inherit;
    font-size: 0.72rem;
    line-height: 1.5;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .exam-card,
    .exam-card:hover,
    .exam-option,
    .exam-palette__item,
    .exam-progress-fill {
        transition: none;
        transform: none;
    }
}

/* ── Bacheca (#117) ─────────────────────────────────────────────────────── */

/* Full width means up to the section's own padding: Bulma's is-fluid would add 32px more a side,
   which on a phone eats a sixth of the screen. */
.has-profile-bottom-nav > .container.is-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* Soft page tint behind the white cards on Bacheca and the pages built like it (.user-page): the
   cards read as cards instead of as outlines on white. */
html:has(.dashboard, .user-page) {
    background-color: #f5f6fa;
}

/* Page title with the main action on the right (ui.page_header). */
.user-page__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-page__header h1.title {
    margin-bottom: 0;
}

/* Profile fields: label over value, two per row from tablet up. */
.profile-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem 1.5rem;
}

.profile-fields dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5a6072;
}

.profile-fields dd {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.profile-since {
    margin: 1.5rem 0 0.5rem;
    text-align: center;
    color: #5a6072;
}

/* Welcome strip: the only saturated block on the page, so it is where the eye lands first.
   White text on the gradient's lightest stop is 5.2:1. */
.dashboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.75rem;
    border-radius: 1rem;
    color: #ffffff;
    background: linear-gradient(120deg, #4258ff 0%, #2b3dcc 100%);
}

.dashboard-hero .title {
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.dashboard-hero__lead {
    color: #e4e8ff;
}

.dashboard-hero .buttons {
    margin-bottom: 0;
}

/* `.button.is-white.is-outlined` hovers to a white fill with white text in Bulma; keep it legible. */
.dashboard-hero .button.is-white.is-outlined:hover,
.dashboard-hero .button.is-white.is-outlined:focus-visible {
    background-color: #ffffff;
    color: #2b3dcc;
}

/* Tinted icon badge: 10% tint behind a saturated icon. One hue per kind of content. */
.dashboard-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
}

.dashboard-badge.is-blue {
    background-color: #eef0ff;
    color: #2b3dcc;
}

.dashboard-badge.is-teal {
    background-color: #e0f7f4;
    color: #00796b;
}

.dashboard-badge.is-amber {
    background-color: #fff4d6;
    color: #8a5a00;
}

.dashboard-badge.is-grey {
    background-color: #eef0f6;
    color: #5a6072;
}

/* A KPI tile is one link: the whole box is the target, so it reads as a card, not as text.
   `.box.` prefix: Bulma loads after this file and its `.box { display: block }` would win. */
.box.dashboard-kpi {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.box.dashboard-kpi .dashboard-badge {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.15rem;
}

.dashboard-kpi:hover {
    color: inherit;
    box-shadow: 0 0.5em 1em -0.25em rgba(10, 10, 10, 0.15);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .box.dashboard-kpi {
        transition: none;
    }

    .dashboard-kpi:hover {
        transform: none;
    }
}

.dashboard-kpi:focus-visible {
    outline: 2px solid #4258ff;
    outline-offset: 2px;
}

.dashboard-kpi__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: #1f2433;
}

.dashboard-kpi__label {
    display: block;
    font-size: 0.85rem;
    color: #5a6072;
}

/* Cards in a column stack with the column gap between them, not the box's own bottom margin. */
.box.dashboard-card {
    margin-bottom: 0;
}

.dashboard-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dashboard-card__link {
    margin-left: auto;
    white-space: nowrap;
}

.dashboard-subtitle {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6072;
}

.dashboard-empty p {
    color: #5a6072;
    margin-bottom: 0.75rem;
}

/* Timeline: a rail with a dot per update, newest first. */
.dashboard-updates__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid #e4e8ff;
}

.dashboard-updates__list li {
    position: relative;
    padding: 0 0 1.1rem 1.25rem;
}

.dashboard-updates__list li:last-child {
    padding-bottom: 0;
}

.dashboard-updates__list li::before {
    content: "";
    position: absolute;
    left: -0.4rem;
    top: 0.3rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background-color: #4258ff;
    box-shadow: 0 0 0 3px #ffffff;
}

.dashboard-updates__date {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #5a6072;
}

.dashboard-updates__title,
.dashboard-list__title {
    font-weight: 600;
}

/* Updates can run to paragraphs; the full text is one click away on the competition page. */
.dashboard-updates__text {
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #363636;
}

.dashboard-list li {
    padding: 0.7rem 0;
}

.dashboard-list li:first-child {
    padding-top: 0;
}

.dashboard-list li + li {
    border-top: 1px solid #eef0f6;
}

/* Folds (history cards, "Da rivedere"): the whole summary is the toggle, with a chevron on the
   right that turns when open. */
.dashboard-fold > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    cursor: pointer;
}

.dashboard-fold > summary::-webkit-details-marker {
    display: none;
}

.dashboard-fold > summary > * {
    flex: 1 1 auto;
    margin: 0;
}

.dashboard-fold > summary::after {
    content: "\f078";
    flex: none;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.85rem;
    color: #5a6072;
    transition: transform 0.15s ease;
}

.dashboard-fold[open] > summary::after {
    transform: rotate(180deg);
}

.dashboard-history[open] > summary {
    margin-bottom: 1rem;
}

.dashboard-fold > summary:focus-visible {
    outline: 2px solid #4258ff;
    outline-offset: 4px;
    border-radius: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-fold > summary::after {
        transition: none;
    }
}

/* A row is its content plus the eye button pinned top right. */
.dashboard-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.dashboard-item__body {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-view {
    flex: none;
}

/* FAQ folds: question as the toggle, answer under it. */
.faq-item + .faq-item {
    border-top: 1px solid #eef0f6;
}

.faq-item > summary {
    padding: 0.75rem 0;
}

.faq-item__question {
    font-weight: 600;
}

.faq-item__answer {
    padding: 0 0 0.9rem;
    color: #363636;
}

/* Shared pager: "Pagina X di Y" is secondary information, so it reads as muted text rather than
   Bulma's filled current-page button. Three classes to outrank Bulma, which loads after this file. */
.pagination.table-pager .pagination-link.is-current {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #5a6072;
    font-weight: 400;
    cursor: default;
}

/* Ends of the live pager stay focusable (aria-disabled), so they need the disabled look themselves. */
.table-pager .is-disabled {
    cursor: not-allowed;
}

/* "Ordina per" switch above the saved-competitions list. */
.saved-competitions__header {
    flex-wrap: wrap;
}

.saved-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-left: auto;
}

.saved-sort__label {
    font-size: 0.85rem;
    color: #5a6072;
}

.progress-callout {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eef0f6;
    color: #5a6072;
}

/* Right-hand column of a row: a status chip, with its action under it when there is one. */
.dashboard-item__aside {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.dashboard-list__meta {
    font-size: 0.85rem;
    color: #5a6072;
}

.dashboard-to-review li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

/* Radar and bars side by side when the card is wide (Progressi), stacked when it is not (Bacheca's
   sidebar): auto-fit decides, no breakpoint. */
.skill-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    align-items: center;
    gap: 1rem 2rem;
}

.skill-chart {
    position: relative;
    max-width: 320px;
    margin: 0 auto 1rem;
}

/* Per-category bars: the readable form of the radar, and the whole picture below three areas. */
.skill-chart__legend {
    display: grid;
    gap: 0.6rem;
    font-size: 0.875rem;
}

.skill-chart__legend li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.2rem 0.5rem;
}

.skill-chart__legend .progress {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
    height: 0.5rem;
}

.profile-completeness__steps li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

.profile-completeness__steps li + li {
    border-top: 1px solid var(--bulma-border-weak, #ededed);
}

/* Profilo is incomplete (no titolo di studio or no Telegram): shown on the Profilo tab and bottom-bar
   item from every other section. Red to draw the eye; the state also reaches screen readers as text. */
.profile-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: 0.4rem;
    border-radius: 50%;
    background-color: #e5484d;
    vertical-align: super;
}

/* On the bottom bar the dot is pinned to the icon's corner. */
.profile-dot.profile-bottom-nav__dot {
    position: absolute;
    top: -0.15rem;
    right: -0.35rem;
    margin: 0;
}

/* "Segnala un problema" link: Bulma's is-text underlines the whole button, flag icon included.
   Three classes to beat .button.is-text, which loads after this file. */
.competition-report-trigger.button.is-text {
  text-decoration: none;
}

.competition-report-trigger.button.is-text > span:last-child {
  text-decoration: underline;
}

/* "Segnala un problema" dialog on the competition page, and the calendar event dialog (same native <dialog> shell) */
.competition-report-dialog,
.calendar-event-dialog {
  border: none;
  padding: 0;
  /* The reason dropdown can reach past the box's bottom edge: let it, instead of scrolling the dialog. */
  overflow: visible;
  background: transparent;
  width: min(32rem, calc(100vw - 2rem));
}

.calendar-event-dialog {
  width: min(35rem, calc(100vw - 2rem));
}

/* Taller than a short viewport: scroll the box rather than spill out of the dialog. */
.calendar-event-dialog .box {
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

/* Lock the page behind the open dialog: a modal <dialog> makes it inert but does not stop it scrolling. */
html:has(.competition-report-dialog[open]),
html:has(.calendar-event-dialog[open]) {
  overflow: hidden;
}

.competition-report-dialog::backdrop,
.calendar-event-dialog::backdrop {
  background: rgba(10, 10, 10, 0.6);
}

.competition-report-dialog .box,
.calendar-event-dialog .box {
  margin: 0;
}

/* Full-screen on mobile, like the Bulma modals (see "Lead modal" above). */
@media screen and (max-width: 768px) {
  .competition-report-dialog,
  .calendar-event-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
  }

  /* Content is centred vertically: at the top it sat out of thumb reach on tall phones. */
  .competition-report-dialog .box,
  .calendar-event-dialog .box {
    height: 100%;
    max-height: none;
    border-radius: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  }

  /* Auto margins rather than justify-content: center, which would push overflowing content
     (keyboard open on a short phone) above the top, out of scroll reach. */
  .competition-report-dialog .box > :first-child,
  .calendar-event-dialog .box > :first-child {
    margin-top: auto;
  }

  .competition-report-dialog .box > :last-child,
  .calendar-event-dialog .box > :last-child {
    margin-bottom: auto;
  }
}

/* ---- Newsletter survey ---- */
/* Flat like the homepage lists: questions are divided rows, each answer is a full-width row
   that tints on hover like .link-row and takes the Telegram row's tint once picked. Answers
   wrap instead of truncating: they have to be read in full before picking one. */
.survey-header {
    margin-bottom: 1.5rem;
}

.survey-header__eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bulma-link);
}

.survey-header__intro {
    margin-top: 0.75rem;
    color: var(--bulma-text-weak);
}

/* Spacing, not dividers, between questions: the answer rows already carry the lines. */
.survey-questions {
    list-style: none;
    margin: 0;
}

.survey-question + .survey-question {
    margin-top: 2rem;
}

.survey-question__label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--bulma-text-strong);
    line-height: 1.4;
}

.survey-question__note {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--bulma-text-weak);
}

.survey-question.is-invalid .survey-options {
    border-color: var(--bulma-danger);
}

.survey-options {
    border-top: 1px solid var(--bulma-border-weak);
}

.survey-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--bulma-border-weak);
    color: var(--bulma-text-strong);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.survey-option:hover {
    background-color: var(--bulma-scheme-main-bis);
}

.survey-option:has(input:checked) {
    background-color: #eef7fc;
    font-weight: 600;
}

.survey-option:has(input:checked):hover {
    background-color: #e1f1fa;
}

.survey-option:has(input:focus-visible) {
    outline: 2px solid var(--bulma-link);
    outline-offset: -2px;
}

.survey-option > input {
    flex-shrink: 0;
    accent-color: var(--bulma-link);
}

.survey-submit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.5rem;
    margin-top: 2rem;
}

/* Same tint row as the homepage's Telegram link: one thing to do, set apart from the page. */
.survey-optin {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #eef7fc;
    color: var(--bulma-text-strong);
}

.survey-optin__text > p {
    margin-bottom: 0.75rem;
}

.survey-done {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bulma-border-weak);
}

.survey-done__title {
    font-weight: 700;
    color: var(--bulma-text-strong);
    margin-bottom: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .survey-option {
        transition: none;
    }
}

/* ---- Micro-interactions ----
   Only transform and opacity move. Entrances ease out, exits ease in, state changes ease in-out.
   Each entrance is a keyframe animation, so it replays whenever its element goes from
   display: none to shown (a modal or dropdown opening, a tab panel) or is inserted. The
   reduced-motion block at the end stops all of it. */
:root {
    --motion-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --motion-ease-in: cubic-bezier(0.4, 0, 1, 1);
    --motion-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes motion-rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes motion-drop-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes motion-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes motion-pop {
    from {
        transform: scale(0.8);
    }
}

/* Press feedback. Bulma's own transition list, plus transform at a faster 100ms. app.css loads
   before Bulma, so these selectors need the extra class to win. */
.button:not(.is-static) {
    transition-property: background-color, border-color, box-shadow, color, transform;
    transition-duration: var(--bulma-duration), var(--bulma-duration), var(--bulma-duration), var(--bulma-duration), 100ms;
    transition-timing-function: var(--motion-ease-out);
}

.button:active:not([disabled]):not(.is-static):not(.is-loading) {
    transform: scale(0.97);
}

/* Modals: Bulma's `.is-active` and native <dialog open> both show at once, so they ease in. */
.modal.is-active .modal-background,
dialog[open]::backdrop {
    animation: motion-fade-in 200ms var(--motion-ease-out);
}

.modal.is-active .modal-content,
.modal.is-active .modal-card,
dialog[open] {
    animation: motion-rise-in 250ms var(--motion-ease-out);
}

/* Menus opened by click (navbar-dropdown, dropdown controllers). Desktop only: on touch the
   navbar dropdowns are hidden or sit in the burger menu's flow. */
@media screen and (min-width: 1024px) {
    .navbar-item.has-dropdown.is-active > .navbar-dropdown,
    .dropdown.is-active .dropdown-menu {
        animation: motion-drop-in 200ms var(--motion-ease-out);
    }
}

/* Auto-dismissing notices slide in; autodismiss_controller fades them out. */
.notification[data-controller~="autodismiss"] {
    animation: motion-drop-in 250ms var(--motion-ease-out);
}

/* Study mode: the answer's verdict lands on the letter badge the moment it is revealed. */
.exam-option.is-correct .exam-option__letter,
.exam-option.is-wrong .exam-option__letter {
    animation: motion-pop 200ms var(--motion-ease-out);
}

/* Reduced motion, site-wide: animations and transitions finish at once (0.01ms rather than
   none, so animationend and transitionend still fire for code that waits on them). Spinners
   keep turning, slower, since they say something is loading. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after,
    ::backdrop {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    .button:active {
        transform: none !important;
    }

    .button.is-loading::after,
    .control.is-loading::after,
    .select.is-loading::after,
    .loader {
        animation-duration: 1.5s !important;
        animation-iteration-count: infinite !important;
    }
}

/* Calendar page (users/calendar.html.twig): the TUI theme option covers colours, not these. */
.cal-toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-toolbar .cal-range { font-weight: 600; margin: 0 .5rem; min-width: 10rem; }
.cal-canvas { height: 640px; }
.cal-canvas .toastui-calendar-layout { font-family: inherit; }
@media (max-width: 768px) { .cal-canvas { height: 520px; } }

/* Onboarding: one step per page, no profile chrome. */
.onboarding__container {
  max-width: 40rem;
}
.onboarding__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.onboarding__exit {
  border-top: 1px solid var(--bulma-border-weak, #e2e8f0);
  padding-top: 1rem;
  font-size: 0.875rem;
}
.onboarding__list {
  display: grid;
  gap: 0.5rem;
}
.onboarding__list li {
  border: 1px solid var(--bulma-border-weak, #e2e8f0);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
}
.onboarding__cards {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.onboarding__card-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  border: 1px solid var(--bulma-border-weak, #e2e8f0);
  border-radius: 0.375rem;
  padding: 0.75rem;
}
.onboarding__card-link:hover,
.onboarding__card-link:focus-visible {
  border-color: var(--bulma-link, #485fc7);
}
.onboarding h1:focus {
  outline: none;
}

/* Search filters modal: one section of chips per filter. The chips are real radios/checkboxes,
   visually hidden but focusable, so keyboard and screen readers get native group semantics. */
/* .modal sets the variable too and app.css loads before Bulma, hence the double class. */
.modal.search-filters-modal {
    --bulma-modal-content-width: 960px;
}
.search-filters-modal .modal-card-body {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
/* Two columns on wider screens keep the modal short; the borders separate the rows. */
@media screen and (min-width: 769px) {
    .search-filters-modal .modal-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 2rem;
    }
    /* Tipo di riserva and Tipo di ente have the longest labels: each takes a full row, so they sit together after Riserve and Inquadramento. */
    .search-filters-modal #filter-reserve-types,
    .search-filters-modal #filter-entity-category {
        grid-column: 1 / -1;
    }
    .filter-section:nth-last-child(-n + 2) {
        border-bottom: 0;
    }
}
.filter-section:last-child {
    border-bottom: 0;
}
.filter-section {
    border: 0;
    border-bottom: 1px solid var(--bulma-border-weak, #ededed);
    margin: 0;
    padding: 0.75rem 0;
    min-width: 0;
}
.filter-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bulma-text-strong, #363636);
}
.filter-section-title .icon {
    color: var(--bulma-link, #485fc7);
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.filter-chip {
    position: relative;
    cursor: pointer;
}
.filter-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.filter-chip span {
    display: inline-block;
    padding: 0.3em 0.8em;
    border: 1px solid var(--bulma-border, #dbdbdb);
    border-radius: var(--bulma-radius, 0.375rem);
    background: var(--bulma-scheme-main, #fff);
    line-height: 1.5;
    transition: border-color 100ms, background-color 100ms, color 100ms;
}
.filter-chip:hover span {
    border-color: var(--bulma-link, #485fc7);
}
.filter-chip input:checked + span {
    border-color: var(--bulma-link, #485fc7);
    background: color-mix(in srgb, var(--bulma-link, #485fc7) 12%, var(--bulma-scheme-main, #fff));
    color: var(--bulma-link, #485fc7);
}
.filter-chip input:focus-visible + span {
    outline: 2px solid var(--bulma-link, #485fc7);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .filter-chip span {
        transition: none;
    }
}

/* "Tipo di ente" on Cosa cerchi: each chip carries its examples under the label. */
.filter-chips-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.filter-chips-detailed .filter-chip span {
    display: block;
    height: 100%;
}
.filter-chip-examples {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--bulma-text-weak, #6b6b6b);
}
.filter-chip input:checked + span .filter-chip-examples {
    color: inherit;
}

/* "Tipo di ente": the "?" sits at the top right of the section and opens the guide in place. */
.filter-section {
    position: relative;
}
.filter-section .filter-section-guide-toggle {
    position: absolute;
    top: 0.6rem;
    right: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-weight: 600;
}
.filter-section-guide {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--bulma-radius, 0.375rem);
    background: var(--bulma-scheme-main-bis, #fafafa);
}
.entity-category-help dt {
    font-weight: 600;
}
.entity-category-help dd {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--bulma-text-weak, #6b6b6b);
}

/* Mobile sheet: Ordina per and Status are one-line rows that open into chips in place. */
.filter-row {
    border-bottom: 1px solid var(--bulma-border-weak, #ededed);
}
.filter-row__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.filter-row__label {
    font-weight: 600;
    color: var(--bulma-text-strong, #363636);
}
.filter-row__value {
    margin-left: auto;
    color: var(--bulma-text-weak, #6b6b6b);
}
.filter-row__toggle[aria-expanded="true"] .filter-row__value {
    color: var(--bulma-link, #485fc7);
}
.filter-row__chevron {
    color: var(--bulma-text-weak, #6b6b6b);
    transition: transform 150ms var(--motion-ease-out, ease-out);
}
.filter-row__toggle[aria-expanded="true"] .filter-row__chevron {
    transform: rotate(180deg);
}
.filter-row__toggle:focus-visible {
    outline: 2px solid var(--bulma-link, #485fc7);
    outline-offset: 2px;
}
.filter-row__options {
    padding-bottom: 0.75rem;
}
/* .filter-chips sets display: flex, which would beat the hidden attribute. */
.filter-row__options[hidden] {
    display: none;
}
.filter-row__label .icon {
    color: var(--bulma-link, #485fc7);
    margin-right: 0.5rem;
}
/* Touch: every chip in the sheet is a 44px target. */
.modify-search-modal .filter-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
/* On a phone every group is a grid of equal tiles, each label wrapping inside its own tile, so long
   ones (Tipo di ente) don't fall into one chip per line. Two columns; three when a group has exactly
   three options, so Contratto, Orario and Tassa stay on one line. :not([hidden]) keeps closed rows closed. */
.modify-search-modal .filter-chips:not([hidden]) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.modify-search-modal .filter-chips:not([hidden]):has(> .filter-chip:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.modify-search-modal .filter-chip span {
    display: flex;
    height: 100%;
    padding: 0.45em 0.7em;
    line-height: 1.3;
}
.modify-search-modal .filter-chips:not([hidden]):has(> .filter-chip:nth-child(3):last-child) .filter-chip span {
    padding-inline: 0.5em;
}
@media (prefers-reduced-motion: reduce) {
    .filter-row__chevron {
        transition: none;
    }
}

/* ---- Try-out quiz (subject and simulation pages) ----
   Without JavaScript every sample reads as a list with its answer marked and its explanation
   shown. The subject-quiz controller adds .is-enhanced and turns it into the runner's flow.
   Flat like the rest of the page: the options carry the borders, the questions none. */
.subject-quiz__samples {
    list-style: none;
    margin: 0;
}

.subject-quiz:not(.is-enhanced) .subject-quiz__sample + .subject-quiz__sample {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bulma-border-weak);
}

html:not(.js) .subject-quiz .exam-option[data-correct="true"] {
    border-color: #48c78e;
    background: rgba(72, 199, 142, 0.12);
}

/* On a simulation's page the samples span its subjects: each names its own, small and grey. */
.subject-quiz__topic {
    margin-bottom: 0.5rem;
    color: var(--bulma-text-weak);
    font-size: 0.875rem;
    font-weight: 600;
}

.subject-quiz:not(.is-enhanced) .exam-option {
    cursor: default;
}

.subject-quiz.is-enhanced .subject-quiz__sample:not(.is-current) {
    display: none;
}

/* JavaScript is on but the controller has not connected yet: show the first question unanswered
   rather than the full list with every answer marked, which would flash and then collapse. */
.js .subject-quiz:not(.is-enhanced) .subject-quiz__sample:nth-child(n + 2),
.js .subject-quiz:not(.is-enhanced) .subject-quiz__feedback {
    display: none;
}

.subject-quiz.is-enhanced .subject-quiz__sample:not(.is-answered) .subject-quiz__feedback {
    display: none;
}

.subject-quiz .exam-option[disabled] {
    cursor: default;
}

/* The question after the last one: shown faded, not answerable, behind the call to action. */
.locked-q {
    position: relative;
    min-height: 16rem;
}

.locked-q__ghost {
    opacity: 0.35;
    filter: blur(1.5px);
    pointer-events: none;
    user-select: none;
}

.locked-q__ghost .subject-quiz__feedback {
    display: none;
}

.locked-q__cta {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.locked-q.is-unlocked .locked-q__cta {
    position: static;
}

.locked-q__card {
    max-width: 32rem;
    padding: 1.5rem;
    border: 1px solid var(--bulma-border-weak);
    border-radius: 0.5rem;
    background: var(--bulma-scheme-main);
    text-align: center;
}

.locked-q__card .buttons {
    justify-content: center;
}

/* Subject page FAQ: one divided row per question, the answer under it when opened. */
.subject-faq__item {
    border-top: 1px solid var(--bulma-border-weak);
}

.subject-faq__item summary {
    padding: 0.75rem 0;
    font-weight: 600;
    color: var(--bulma-text-strong);
    cursor: pointer;
}

.subject-faq__item summary:hover {
    color: var(--bulma-link);
}

.subject-faq__item p {
    padding-bottom: 0.75rem;
}

/* The page's facts in one sentence, quiet above the source credit. */
.subject-facts {
    margin: 1.5rem 0 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: var(--bulma-scheme-main-bis);
    color: var(--bulma-text-weak);
    font-size: 0.875rem;
}

/* Related subjects in the side card: the subject index's rows, one column. */
.link-grid.subject-related {
    grid-template-columns: 1fr;
}

/* The count keeps one line at 390px; a long subject name wraps instead. */
.subject-related .link-row > :last-child {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Subject page start card: the landing's full-width buttons, one per row. */
.subject-cta__stack {
    flex-direction: column;
    align-items: stretch;
}

.subject-cta__stack > *,
.subject-cta__stack form .button {
    width: 100%;
    margin-right: 0 !important;
}

/* A long label wraps instead of spilling out of a full-width button at 390px. */
.subject-cta__stack .button {
    height: auto;
    white-space: normal;
}

/* Job-role hubs (#183): divided single-line rows, as on the homepage lists. */
.profile-hub ul {
    list-style: none;
    margin: 0;
}

.profile-hub ul > li {
    border-bottom: 1px solid var(--bulma-border-weak);
}

.profile-hub .link-row > .profile-row__title {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The create strip spans both columns, under the hero, divided off like the landing's start
   card. Stacks on touch. */
.profile-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bulma-border-weak);
}

.profile-cta__text {
    flex: 1 1 20rem;
}

.profile-cta__action {
    text-align: center;
}

.profile-row__meta {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Where the columns stack (below 1024px), the open bandi follow the subjects instead of
   closing the page: the main column's cards and the aside share one flow, ordered here. */
@media screen and (max-width: 1023px) {
    .profile-hub .profile-columns {
        display: flex;
        flex-direction: column;
        margin: 0;
    }

    .profile-hub .profile-columns > .column {
        padding: 0;
    }

    .profile-hub .profile-main {
        display: contents;
    }

    .profile-hub .profile-topics-box {
        order: 1;
    }

    .profile-hub .profile-aside {
        order: 2;
        border-top: 1px solid var(--bulma-border-weak);
    }

    .profile-hub .profile-main > :not(.profile-topics-box) {
        order: 3;
    }
}

/* Phones: a one-line row leaves "Simulazione prova scritt…" and nothing else. The title wraps
   (three lines at most) and the grey fact moves under it. */
@media screen and (max-width: 768px) {
    .profile-hub .link-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .profile-hub .link-row > .profile-row__title {
        display: -webkit-box;
        white-space: normal;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }
}
