@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    font-family: 'DM Sans', system-ui, sans-serif;
    color: #142d32;
    background: #f3f6f4
}

* {
    box-sizing: border-box
}

body {
    margin: 0
}

header {
    padding: 24px 4%;
    display: flex;
    align-items: center;
    gap: 28px;
    background: white;
    border-bottom: 1px solid #dde5e0
}

.brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    text-decoration: none;
    color: #123c38
}

.brand span {
    background: #d6fa6d;
    border-radius: 8px;
    margin: 0 8px;
    padding: 4px
}

header>span {
    color: #677b79;
    font-size: 13px
}

nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px
}

nav a {
    font-size: 14px;
    text-decoration: none;
    color: #294b48
}

nav form {
    margin: 0
}

main {
    max-width: 99%;
    margin: auto
}

h1 {
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -1.5px;
    margin: 12px 0 16px
}

h2 {
    font-size: 22px;
    margin-top: 0
}

p {
    line-height: 1.6;
    color: #526b69
}

.eyebrow {
    color: #447b70;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px
}

.intro {
    font-size: 17px
}

.card {
    background: white;
    border: 1px solid #dce5df;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 5px 20px #163f2d04
}

.columns {
    grid-template-columns: 1.15fr 1fr;
    gap: 24px
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #37564f;
    margin: 0 0 18px
}

input,
select {
    display: block;
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cdd9d2;
    background: #fafcfb;
    border-radius: 9px;
    margin-top: 8px;
    color: #19382e;
    font: inherit
}

label.check-option {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1
}

label.check-option input {
    width: auto;
    margin: 0
}

input:focus,
select:focus {
    outline: 2px solid #b8e781
}

button {
    border: 0;
    background: #174e43;
    color: white;
    font: inherit;
    font-weight: 600;
    padding: 13px 20px;
    border-radius: 9px;
    cursor: pointer
}

button:disabled {
    opacity: .5;
    cursor: wait
}

.subtle {
    background: #ecf3ee;
    color: #245449;
    padding: 9px 14px
}

.danger {
    background: #fff0ed;
    color: #b5382a;
    margin-top: 12px
}

a {
    color: #226451
}

.stats {
    display: flex;
    gap: 20px;
    margin: 10px 0
}

.stats article {
    background: #e7ede6;
    border-radius: 13px;
    padding: 22px;
    flex: 1;
    color: #59716a;
    font-size: 13px
}

.stats strong {
    display: block;
    color: #1e473d;
    font-size: 27px;
    margin-bottom: 8px
}

.ticket-preview {
    margin-top: 30px;
    text-align: center;
    background: #f4f7ec;
    border: 1px dashed #b9ccb0;
    border-radius: 15px;
    padding: 28px
}

.ticket-preview span {
    font-size: 10px;
    letter-spacing: 2px
}

.qr-placeholder {
    font-size: 80px;
    line-height: 1;
    color: #174e43
}

.notice,
.error {
    padding: 18px;
    border-radius: 12px;
    overflow-wrap: anywhere;
    margin-bottom: 20px
}

.notice {
    background: #dff2ca;
    color: #315322
}

.error {
    background: #ffe1dd;
    color: #972f25
}

.check {
    padding: 55px;
    border-radius: 20px;
    text-align: center
}

.green {
    background: #c8edc4
}

.red {
    background: #f7c7c2
}

.login {
    max-width: 500px;
    margin: 30px auto
}

.logo-preview {
    max-width: 180px;
    max-height: 100px
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px
}

th,
td {
    text-align: left;
    padding: 18px 12px;
    border-bottom: 1px solid #e3eae6
}

th {
    font-size: 11px;
    text-transform: uppercase;
    color: #678074
}

td small {
    display: block;
    color: #678074;
    margin-top: 5px
}

.table-wrap {
    overflow: auto
}

td form {
    display: flex;
    gap: 6px;
    margin-top: 10px
}

td select {
    width: 120px;
    margin: 0
}

footer {
    text-align: center;
    color: #82938b;
    font-size: 11px;
    padding: 28px
}

@media(max-width:850px) {
    header {
        flex-wrap: wrap
    }

    header>span {
        display: none
    }

    nav {
        margin: 0;
        flex-wrap: wrap;
        gap: 12px
    }

    .columns,
    .grid {
        grid-template-columns: 1fr
    }

    .stats {
        gap: 8px
    }

    .stats article {
        padding: 14px
    }

    .stats strong {
        font-size: 22px
    }

    main {
        padding: 12px 6px
    }

    .card {
        padding: 22px
    }

    .check {
        padding: 30px 18px
    }
}
.bill-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 0;
}

.bill-header img {
    display: block;
    max-width: 110px;
    max-height: 48px;
    object-fit: contain;
}

.bill-header h1 {
    margin: 0;
    font-size: clamp(17px, 2vw, 22px);
    letter-spacing: .02em;
}

.wa-model-config {
    margin-top: 22px;
    padding: 20px;
    background: #f6f8f6;
    border: 1px solid #dde5e0;
    border-radius: 14px;
}

.wa-model-config h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.wa-model-config p:first-of-type {
    margin-top: 0;
}

#issue-form label {
    font-size: 16px;
    margin-bottom: 22px
}

#issue-form input,
#issue-form select {
    padding: 17px 16px;
    font-size: 19px;
    border-radius: 12px;
    min-height: 60px
}

#issue-form button[type="submit"] {
    width: 100%;
    padding: 18px;
    font-size: 19px
}

.modal {
    width: min(420px, calc(100% - 32px));
    border: 0;
    border-radius: 22px;
    padding: 34px 28px 26px;
    text-align: center;
    color: #142d32;
    background: white;
    box-shadow: 0 24px 60px rgba(18, 60, 56, .25)
}

.modal[open] {
    animation: modal-in .22s ease-out
}

.modal::backdrop {
    background: rgba(20, 45, 50, .45);
    backdrop-filter: blur(3px)
}

.modal h2 {
    margin: 18px 0 8px;
    font-size: 22px
}

.modal p {
    margin: 0 0 12px;
    color: #4d6660;
    line-height: 1.5
}

.modal-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e7ede6
}

.modal-icon svg {
    display: none;
    width: 40px;
    height: 40px
}

.modal[data-state="loading"] .icon-loading,
.modal[data-state="success"] .icon-success,
.modal[data-state="warning"] .icon-warning,
.modal[data-state="error"] .icon-error {
    display: block
}

.icon-loading {
    stroke: #1e473d;
    stroke-dasharray: 90 150;
    animation: modal-spin 1s linear infinite
}

.modal[data-state="success"] .modal-icon {
    background: #d6fa6d
}

.icon-success {
    stroke: #123c38;
    stroke-dasharray: 24;
    animation: modal-draw .4s ease-out both
}

.modal[data-state="warning"] .modal-icon {
    background: #ffe7b8
}

.icon-warning {
    stroke: #9a5b00
}

.modal[data-state="error"] .modal-icon {
    background: #fde0dc
}

.icon-error {
    stroke: #b3261e
}

.modal-detail {
    text-align: left;
    font-size: 13px;
    background: #f3f6f4;
    border-left: 3px solid #b3261e;
    border-radius: 8px;
    padding: 10px 12px;
    word-break: break-word
}

.modal[data-state="warning"] .modal-detail {
    border-left-color: #9a5b00
}

.modal-timer {
    height: 4px;
    border-radius: 4px;
    background: #e7ede6;
    overflow: hidden;
    margin-top: 8px
}

.modal-timer span {
    display: block;
    height: 100%;
    background: #1e473d;
    animation: modal-timer 3s linear forwards
}

.modal button {
    margin-top: 8px;
    min-width: 140px
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.97) }
}

@keyframes modal-spin {
    to { transform: rotate(360deg) }
}

@keyframes modal-draw {
    from { stroke-dashoffset: 24 }
    to { stroke-dashoffset: 0 }
}

@keyframes modal-timer {
    from { width: 100% }
    to { width: 0 }
}

@media (prefers-reduced-motion: reduce) {
    .modal[open],
    .icon-success,
    .icon-loading {
        animation: none
    }
}

.qty-stepper {
    display: flex;
    gap: 10px;
    margin: 8px 0 22px
}

#issue-form .qty-stepper input {
    margin: 0;
    flex: 1;
    min-width: 0;
    text-align: center;
    font-weight: 600
}

#issue-form .qty-stepper button {
    flex: 0 0 60px;
    width: 60px;
    min-height: 60px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    border-radius: 12px
}

#issue-form label[for="issue-quantity"] {
    margin-bottom: 0
}

.fullscreen-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center
}

.fullscreen-toggle[hidden] {
    display: none
}

.header-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px
}

nav + .header-tools {
    margin-left: 0
}

.install-app {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    white-space: nowrap
}

.install-app[hidden] {
    display: none
}

.install-app svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round
}

/* Installata come app il browser non mostra barre: il pulsante schermo intero non serve. */
@media (display-mode: fullscreen), (display-mode: standalone) {
    .fullscreen-toggle,
    .install-app {
        display: none !important
    }
}

.fullscreen-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.icon-compress,
.is-fullscreen .icon-expand {
    display: none
}

.is-fullscreen .icon-compress {
    display: block
}

.header-hotzone {
    display: none
}

.menu-autohide .header-hotzone {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    z-index: 49
}

.menu-autohide header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transform: translateY(-100%);
    transition: transform .25s ease
}

.menu-autohide header.reveal {
    transform: none;
    box-shadow: 0 10px 30px rgba(18, 60, 56, .15)
}

@media (prefers-reduced-motion: reduce) {
    .menu-autohide header {
        transition: none
    }
}

.stats strong.bump {
    animation: stat-bump .6s ease
}

@keyframes stat-bump {
    40% { transform: scale(1.15); color: #2f8a4f }
}

@media (prefers-reduced-motion: reduce) {
    .stats strong.bump {
        animation: none
    }
}

.channel-picker {
    border: 0;
    padding: 0;
    margin: 0 0 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.channel-picker legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #37564f
}

#issue-form .channel-picker label {
    margin: 0;
    position: relative
}

#issue-form .channel-picker input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0
}

.channel-picker span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    padding: 0 16px;
    border: 1px solid #cdd9d2;
    border-radius: 12px;
    background: #fafcfb;
    color: #19382e;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s
}

.channel-picker svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round
}

.channel-picker svg .fill {
    fill: currentColor;
    stroke: none
}

.channel-picker span:hover {
    border-color: #8fb3a2
}

.channel-picker input:checked + span {
    border: 2px solid #174e43;
    background: #eef6ef;
    box-shadow: 0 0 0 3px rgba(23, 78, 67, .12)
}

.channel-picker input:checked + span .icon-whatsapp {
    color: #1fa855
}

.channel-picker input:focus-visible + span {
    outline: 3px solid #b8e781;
    outline-offset: 2px
}

#issue-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px
}

#issue-submit svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round
}

.history-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0 16px;
    align-items: end;
    margin-bottom: 20px
}

.history-filter-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 18px
}

.history-filter-actions button {
    min-height: 46px;
    white-space: nowrap
}

.history-summary {
    margin: 0 0 14px;
    color: #59716a;
    font-size: 14px
}

.history-empty {
    text-align: center;
    color: #59716a;
    padding: 28px 0
}

#history-table.loading {
    opacity: .5;
    transition: opacity .15s
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 20px 0 0
}

.pagination a {
    min-width: 40px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #ecf3ee;
    color: #245449;
    text-align: center;
    text-decoration: none;
    font-weight: 600
}

.pagination a[aria-current="page"] {
    background: #174e43;
    color: white
}

@media(max-width:850px) {
    .history-filters {
        grid-template-columns: 1fr
    }
}

.embed header,
.embed footer,
.embed .header-hotzone {
    display: none
}

.viewer-modal {
    width: min(960px, calc(100% - 32px));
    height: min(88vh, 1100px);
    padding: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    text-align: left
}

.viewer-modal[open] {
    display: flex
}

.viewer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 14px 24px;
    border-bottom: 1px solid #dde5e0
}

.viewer-head h2 {
    margin: 0;
    margin-right: auto;
    font-size: 18px
}

.viewer-modal .viewer-action {
    margin: 0;
    min-width: 0;
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px
}

.viewer-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.viewer-body {
    position: relative;
    flex: 1;
    background: #f3f6f4
}

.viewer-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block
}

.viewer-loading {
    display: none;
    position: absolute;
    inset: 0;
    place-items: center
}

.viewer-loading svg {
    width: 44px;
    height: 44px
}

.viewer-modal.is-loading .viewer-loading {
    display: grid
}

.viewer-modal.is-loading iframe {
    visibility: hidden
}

@media(max-width:600px) {
    .viewer-modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0
    }

    .viewer-action span {
        display: none
    }
}

.history-groups td small {
    display: block
}

.group-row.open td {
    background: #f6faf7
}

.qty-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #e7ede6;
    font-weight: 700;
    color: #1e473d
}

.status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.status {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap
}

.status-valid {
    background: #e2f5d6;
    color: #276b2e
}

.status-used {
    background: #e3ebf5;
    color: #2e4e7a
}

.status-pending {
    background: #ffefcc;
    color: #8a5400
}

.status-expired {
    background: #f1f1f1;
    color: #6b6b6b
}

.group-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center
}

.group-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s
}

.group-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg)
}

.group-detail > td {
    background: #f6faf7;
    padding-top: 0
}

.ticket-list {
    display: grid;
    gap: 8px
}

.ticket-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 12px 14px;
    background: white;
    border: 1px solid #dde5e0;
    border-radius: 12px
}

.ticket-item-info {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px
}

.ticket-item-info small {
    flex-basis: 100%;
    color: #59716a
}

.ticket-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px
}

.ticket-item-actions form {
    display: flex;
    gap: 6px;
    margin: 0
}

.ticket-item-actions select {
    width: auto;
    margin: 0;
    padding: 8px 10px
}

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none
}

a.icon-link {
    background: #ecf3ee;
    color: #245449
}

.icon-link svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.resend-result {
    flex-basis: 100%;
    margin: 0;
    font-size: 14px
}

.group-actions {
    white-space: nowrap
}

.group-actions .resend-form,
.group-actions .group-toggle {
    display: inline-flex;
    vertical-align: middle
}

.group-actions .resend-form {
    gap: 6px;
    margin: 0 6px 0 0
}

.group-actions select {
    width: auto;
    margin: 0;
    padding: 8px 10px
}

.group-actions .resend-result {
    white-space: normal;
    margin-top: 8px;
    max-width: 380px
}

.icon-only {
    width: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center
}

.icon-only svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.resend-form.sending {
    opacity: .6
}

.contact-modal form {
    margin: 0
}

.contact-modal label {
    text-align: left;
    margin-bottom: 20px
}

.contact-modal input {
    font-size: 18px;
    padding: 14px
}

.contact-icon svg {
    fill: none;
    stroke: #1e473d;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.contact-icon .fill {
    fill: #1fa855;
    stroke: none
}

.contact-modal[data-channel="whatsapp"] .icon-whatsapp,
.contact-modal[data-channel="email"] .icon-email {
    display: block
}

.contact-modal[data-channel="whatsapp"] .contact-icon {
    background: #dcf8e6
}

.contact-modal[data-channel="whatsapp"] .icon-whatsapp {
    stroke: #1fa855
}

.contact-buttons {
    display: flex;
    gap: 10px
}

.modal .contact-buttons button {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px
}

.contact-buttons svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

@media (pointer: coarse) {
    .menu-autohide .header-hotzone {
        height: 28px
    }

}

@media (display-mode: fullscreen), (display-mode: standalone) {
    .menu-autohide header {
        padding-top: max(24px, env(safe-area-inset-top))
    }
}

.public-main {
    max-width: 620px;
    padding: 40px 16px 20px
}

.public-brand {
    text-align: center;
    margin-bottom: 22px
}

.public-brand img {
    max-width: 220px;
    max-height: 72px
}

.public-brand strong {
    font-size: 24px;
    color: #123c38;
    letter-spacing: 1px
}

.public-card h1 {
    font-size: clamp(26px, 6vw, 34px);
    letter-spacing: -1px
}

.public-summary {
    font-size: 17px
}

.public-channel {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #eef6ef;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 22px;
    color: #1e473d
}

.public-channel svg {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

#claim-form label {
    font-size: 15px
}

#claim-form input {
    padding: 15px 14px;
    font-size: 17px
}

#claim-form .channel-picker input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0
}

#claim-form .channel-picker label {
    margin: 0;
    position: relative
}

#claim-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    font-size: 18px
}

#claim-submit svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.public-downloads {
    display: grid;
    gap: 8px;
    margin-top: 16px
}

.public-downloads .icon-link {
    justify-content: center;
    padding: 14px
}

.contact-buttons[hidden] {
    display: none
}

.amber {
    background: #ffe7b8
}

.public-page .check {
    padding: 36px 24px 30px;
    margin-bottom: 22px
}

.check-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .6)
}

.check-icon svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round
}

.green .check-icon svg {
    stroke: #276b2e
}

.red .check-icon svg {
    stroke: #b3261e
}

.amber .check-icon svg {
    stroke: #9a5b00
}

.check-details {
    display: grid;
    gap: 10px;
    margin: 22px 0;
    padding: 16px 18px;
    background: rgba(255, 255, 255, .65);
    border-radius: 14px;
    text-align: left
}

.check-details div {
    display: flex;
    justify-content: space-between;
    gap: 16px
}

.check-details dt {
    color: #4d6660
}

.check-details dd {
    margin: 0;
    font-weight: 600;
    text-align: right
}

#validate-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    font-size: 20px
}

#validate-button svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.confirm-option {
    justify-content: center;
    margin: 16px 0 0;
    font-size: 15px;
    cursor: pointer
}

.confirm-option input {
    width: 20px;
    height: 20px;
    accent-color: #174e43
}

.hint-warning {
    background: #fff4dc;
    color: #7a4a00;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px
}

.check-icon .icon-loading {
    stroke: #9a5b00;
    stroke-width: 4;
    stroke-dasharray: 90 150;
    animation: modal-spin 1s linear infinite
}

#fast-status {
    font-weight: 600;
    margin: 0
}

.total-card {
    position: relative
}

.kind-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #ffe7b8;
    color: #8a5400;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase
}

.kind-badge[hidden] {
    display: none
}

.channel-picker:has(input[value="print"]) {
    grid-template-columns: 1fr 1fr 1fr
}

@media(max-width:600px) {
    .channel-picker:has(input[value="print"]) {
        grid-template-columns: 1fr
    }
}

.print-steps {
    padding-left: 20px;
    line-height: 1.7
}

.print-steps li {
    margin-bottom: 6px
}

.copy-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px
}

.copy-row input {
    margin: 0;
    font-family: ui-monospace, monospace;
    font-size: 13px
}

.print-status {
    align-self: center;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px
}

.print-status small {
    display: block;
    color: #59716a
}

.print-status.online {
    background: #e2f5d6;
    color: #276b2e
}

.print-status.offline {
    background: #fff4dc;
    color: #7a4a00
}

.print-steps .icon-link {
    margin: 2px 6px 2px 0
}

.print-hint {
    display: block;
    color: #59716a
}

.channel-picker input:disabled + span {
    opacity: .4;
    cursor: not-allowed;
    background: #f1f1f1
}

.ticket-number {
    display: block;
    font-weight: 800;
    color: #123c38;
    font-size: 15px
}

.reg-table td small {
    display: block;
    color: #59716a
}

#reg-table.loading {
    opacity: .5
}

#reg-filters .icon-link {
    min-height: 46px
}

/* Linguetta con la freccia per aprire e chiudere il menu a scomparsa (tablet e touch). */
.menu-tab {
    display: none
}

.menu-autohide .menu-tab {
    display: grid;
    place-items: center;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 51;
    width: 76px;
    height: 32px;
    padding: 0;
    border-radius: 0 0 16px 16px;
    background: #174e43;
    color: white;
    box-shadow: 0 4px 14px rgba(18, 60, 56, .25);
    transition: top .25s ease
}

.menu-tab svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .25s ease
}

.menu-tab[aria-expanded="true"] svg {
    transform: rotate(180deg)
}

.embed .menu-tab {
    display: none !important
}

@media (prefers-reduced-motion: reduce) {
    .menu-autohide .menu-tab,
    .menu-tab svg {
        transition: none
    }
}

.privacy-text {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px 13px;
    border: 1px solid #cdd9d2;
    border-radius: 9px;
    background: #fafcfb;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical
}

.privacy-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: #226451;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer
}

footer .link-button {
    font-size: inherit;
    font-weight: 400;
    color: inherit
}

.privacy-consent {
    align-items: flex-start;
    margin: 4px 0 20px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    cursor: pointer
}

#claim-form .privacy-consent input {
    position: static;
    opacity: 1;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: #174e43
}

.privacy-modal {
    width: min(680px, calc(100% - 32px));
    max-height: min(86vh, 900px);
    padding: 0;
    display: none;
    flex-direction: column;
    text-align: left;
    overflow: hidden
}

.privacy-modal[open] {
    display: flex
}

.privacy-head,
.privacy-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 14px 24px;
    border-bottom: 1px solid #dde5e0
}

.privacy-foot {
    border: 0;
    border-top: 1px solid #dde5e0;
    justify-content: flex-end
}

.privacy-head h2 {
    margin: 0;
    margin-right: auto;
    font-size: 19px
}

.modal .privacy-head button {
    margin: 0;
    min-width: 0;
    width: 40px;
    height: 40px;
    padding: 0
}

.modal .privacy-foot button {
    margin: 0
}

.privacy-body {
    overflow-y: auto;
    padding: 6px 24px 18px;
    line-height: 1.6
}

.privacy-body h3 {
    font-size: 16px;
    margin: 18px 0 4px;
    color: #123c38
}

.privacy-body p {
    margin: 0 0 10px;
    color: #37564f
}

.modal[data-state="update"] .modal-icon {
    background: #d6fa6d
}

.modal[data-state="update"] .icon-update {
    display: block;
    fill: none;
    stroke: #123c38;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round
}

.update-hint {
    font-size: 13px
}

.logo-print {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #dde5e0
}

.logo-print h3 {
    margin: 0 0 4px;
    font-size: 16px
}

.logo-print-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 14px
}

.logo-print-preview figure {
    margin: 0
}

.logo-print-preview img {
    display: block;
    max-width: 220px;
    max-height: 110px;
    border: 1px solid #dde5e0;
    border-radius: 8px;
    padding: 8px;
    background: white
}

.receipt-preview img {
    image-rendering: pixelated;
    background: #fbfbf8
}

.logo-print-preview figcaption {
    font-size: 12px;
    color: #59716a;
    margin-top: 4px
}

.logo-box {
    margin-bottom: 6px
}

.logo-empty {
    color: #59716a;
    font-size: 14px
}

.logo-status:empty {
    display: none
}

.logo-status {
    padding: 10px 12px;
    font-size: 14px
}

.logo-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px
}

.home-pick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 7px 12px;
    font-size: 13px;
    background: #ecf3ee;
    color: #245449;
    border: 1px solid #cdd9d2
}

.home-check {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #8fb3a2;
    background: white;
    font-size: 13px;
    font-weight: 800;
    line-height: 1
}

.home-pick.selected {
    background: #d6fa6d;
    border-color: #a8cf3a;
    color: #123c38;
    cursor: default
}

.home-pick.selected .home-check {
    background: #174e43;
    border-color: #174e43;
    color: white
}

.logo-print-preview figure .home-pick {
    display: flex
}

/* Modal di pagamento prima dell'emissione. */
.payment-modal {
    position: relative;
    width: min(460px, calc(100% - 32px))
}

.payment-modal h2 {
    margin-top: 6px
}

.payment-amount {
    font-size: 44px;
    font-weight: 800;
    color: #123c38 !important;
    letter-spacing: -1px;
    margin: 4px 0 2px !important
}

.payment-summary {
    font-size: 15px
}

.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 6px 0 12px
}

.modal .payment-options button {
    margin: 0;
    min-width: 0;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
    border-radius: 14px
}

.payment-options svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.modal .payment-cancel {
    width: 100%;
    min-width: 0
}

.modal .payment-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 0;
    background: #ecf3ee;
    color: #245449
}

.payment-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700
}

.payment-pos {
    background: #e3ebf5;
    color: #2e4e7a
}

.payment-cash {
    background: #e2f5d6;
    color: #276b2e
}

.payment-none {
    background: #f1f1f1;
    color: #6b6b6b
}

.history-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px
}

.history-totals span {
    padding: 8px 12px;
    border-radius: 10px;
    background: #f3f6f4;
    font-size: 14px
}

.history-totals strong {
    color: #123c38
}

@media(min-width:851px) {
    #reg-filters {
        grid-template-columns: 1fr 1fr auto
    }
}

.delete-tickets {
    color: #b3261e
}

.delete-tickets:hover {
    background: #fde0dc
}

.modal .danger-button {
    background: #b3261e;
    color: white
}

.group-actions .delete-tickets {
    display: inline-grid;
    vertical-align: middle;
    height: 42px;
    width: 42px;
    margin-right: 6px
}

.delivery-states {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px
}

.delivery-state {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap
}

.delivery-ok {
    background: #e2f5d6;
    color: #276b2e
}

.delivery-wait {
    background: #f1f1f1;
    color: #59716a
}

.delivery-ko {
    background: #fde0dc;
    color: #b3261e
}

.ticket-item-info .delivery-error {
    color: #b3261e;
    font-weight: 600
}

/* Campo telefono con menu del prefisso internazionale (+39 predefinito). */
.phone-input {
    display: flex;
    gap: 8px;
    align-items: stretch
}

.phone-input .phone-prefix {
    flex: 0 0 auto;
    width: auto;
    max-width: 46%
}

.phone-input input {
    flex: 1;
    min-width: 0
}

.phone-input [hidden] {
    display: none
}

/* Campi email, telefono e prefisso più grandi per il tablet (emissione e recapito); la registrazione dei clienti resta compatta per il telefono. */
#issue-form input[name="email"],
#issue-form input[name="phone"],
#issue-form .phone-prefix,
.contact-modal #contact-input,
.contact-modal .phone-prefix {
    min-height: 88px;
    padding: 20px 22px;
    font-size: 28px;
    font-weight: 600;
    border-radius: 16px
}

#issue-form .phone-prefix,
.contact-modal .phone-prefix {
    padding-right: 12px;
    font-size: 24px;
    max-width: 40%
}

#issue-form label:has(input[name="email"]),
#issue-form label:has(input[name="phone"]) {
    font-size: 19px
}

/* Pulsanti dei giochi (colori scelti in Giochi e tariffe) e scelta della tariffa. */
.game-picker,
.kind-picker {
    border: 0;
    padding: 0;
    margin: 0 0 22px;
    min-width: 0
}

.game-picker legend,
.kind-picker legend {
    padding: 0;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #37564f
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px
}

.game-button {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 84px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--game-bg, #174e43);
    color: var(--game-fg, #ffffff);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
    text-align: left;
    line-height: 1.2
}

.game-button strong {
    font-size: 19px
}

.game-button small {
    font-size: 13px;
    opacity: .85
}

#issue-form .game-option {
    position: relative;
    margin: 0;
    cursor: pointer
}

#issue-form .game-option input,
#issue-form .kind-picker input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0
}

.game-option .game-button {
    transition: transform .12s, box-shadow .12s
}

.game-option input:checked + .game-button {
    box-shadow: 0 0 0 4px #ffffff, 0 0 0 7px #123c38;
    transform: translateY(-1px)
}

.game-option input:checked + .game-button::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: #123c38;
    font-weight: 800;
    font-size: 14px
}

.game-option input:focus-visible + .game-button {
    outline: 3px solid #b8e781;
    outline-offset: 4px
}

.game-option input:disabled + .game-button {
    opacity: .3;
    cursor: not-allowed
}

.kind-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

#issue-form .kind-picker label {
    margin: 0;
    position: relative
}

.kind-picker span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    padding: 0 18px;
    border: 1px solid #cdd9d2;
    border-radius: 12px;
    background: #fafcfb;
    color: #19382e;
    font-size: 19px;
    font-weight: 600;
    cursor: pointer
}

.kind-picker strong {
    font-size: 20px
}

.kind-picker input:checked + span {
    border: 2px solid #174e43;
    background: #eef6ef;
    box-shadow: 0 0 0 3px rgba(23, 78, 67, .12)
}

.kind-picker input[value="discount"]:checked + span {
    border-color: #a86a00;
    background: #fff4dc
}

.kind-picker input:disabled + span {
    opacity: .4;
    cursor: not-allowed;
    background: #f1f1f1
}

/* Pagina Giochi e tariffe. */
.type-hint {
    font-size: 14px;
    color: #59716a;
    margin: -6px 0 16px
}

#type-form input[type="color"] {
    height: 52px;
    padding: 4px;
    cursor: pointer
}

.game-preview {
    max-width: 260px;
    margin-bottom: 18px
}

.game-list {
    display: grid;
    gap: 12px;
    align-content: start
}

.game-card {
    margin: 0
}

.game-card p {
    margin: 12px 0 0;
    color: #4d6660
}

.game-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px
}

.game-card-actions form {
    margin: 0
}

.game-card-actions .danger {
    margin: 0
}

.game-card .game-button {
    max-width: 320px
}

.type-add {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 15px 24px;
    font-size: 18px;
    border-radius: 12px
}

.type-add[hidden],
#type-form-card[hidden] {
    display: none
}

.type-add svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round
}

.type-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.game-button.bump {
    animation: game-bump .25s ease
}

@keyframes game-bump {
    50% { transform: scale(1.05) }
}

@media (prefers-reduced-motion: reduce) {
    .game-button.bump {
        animation: none
    }
}
/* Registrazione: email e telefono già indicati alla cassa non si modificano. */
.public-page input[readonly],.public-page select:disabled{background:#eef2f0;color:#4a5f59;cursor:not-allowed}

/* Emissione: tariffe (Intero/Ridotto) a destra dei giochi, nella stessa riga. */
.pick-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: start;
    margin-bottom: 22px
}

.pick-row .game-picker,
.pick-row .kind-picker {
    margin: 0
}

.pick-row .kind-picker {
    grid-template-columns: 1fr
}

@media(max-width:700px) {
    .pick-row {
        grid-template-columns: 1fr
    }

    .pick-row .kind-picker {
        grid-template-columns: 1fr 1fr
    }
}

/* Login: icona per vedere la password mentre la si scrive. */
.password-input {
    position: relative;
    display: block
}

.password-input input {
    width: 100%;
    padding-right: 52px
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #59716a;
    cursor: pointer
}

.password-toggle:hover {
    background: transparent;
    color: #174e43
}

.password-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
    display: none
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block
}

/* Emissione: quantità sotto le tariffe, nella colonna a destra dei giochi. */
.pick-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0
}

.pick-side .kind-picker {
    margin-bottom: 12px
}

.pick-side .qty-stepper {
    margin-bottom: 0
}

/* Emissione: etichette "Tariffa" e "Quanti biglietti?" più piccole. */
.pick-side .kind-picker legend,
.pick-side .qty-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #59716a;
    margin-bottom: 4px
}

/* Emissione: etichette e campi di tariffa e quantità leggermente più piccoli. */
.pick-side .kind-picker legend,
.pick-side .qty-label {
    font-size: 11px
}

.pick-side .kind-picker span {
    min-height: 46px;
    padding: 0 14px;
    font-size: 16px
}

.pick-side .kind-picker strong {
    font-size: 18px
}

#issue-form .pick-side .qty-stepper input {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 18px
}

#issue-form .pick-side .qty-stepper button {
    flex-basis: 44px;
    width: 44px;
    min-height: 44px;
    font-size: 24px
}

/* Emissione: la quantità è un riquadro con il numero, cambiato solo con + e −. */
.qty-label {
    display: block;
    margin-top: 2px
}

.qty-value {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cdd9d2;
    border-radius: 12px;
    background: #fff;
    font-size: 24px;
    font-weight: 700;
    color: #142d32;
    user-select: none
}

/* Storico: riepilogo "Raggruppa per biglietto". */
.history-groupby {
    margin: 0;
    align-self: center
}

.history-bygame {
    width: 100%;
    border-collapse: collapse
}

.history-bygame th,
.history-bygame td {
    padding: 14px 12px;
    border-bottom: 1px solid #dfe7e2;
    text-align: left
}

.history-bygame th:nth-child(n+3),
.history-bygame td:nth-child(n+3) {
    text-align: right;
    white-space: nowrap
}

.history-bygame .bygame-qty {
    width: 90px;
    font-size: 20px;
    font-weight: 700
}

.history-bygame .kind-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff4dc;
    color: #8a5600;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase
}

.history-bygame .bygame-total td {
    border-bottom: 0;
    border-top: 2px solid #174e43;
    font-weight: 700
}

/* Configurazione: "Salva" sempre visibile, fisso in basso a destra. */
.settings-form {
    padding-bottom: 90px
}

.settings-save {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 26px;
    border-radius: 999px;
    font-size: 17px;
    box-shadow: 0 10px 28px rgba(18, 60, 56, .35)
}

.settings-save svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

@media(max-width:600px) {
    .settings-save {
        right: 16px;
        bottom: 16px;
        padding: 14px 20px
    }
}

/* Modal di emissione: tasto "Annulla stampa" mentre si attende la stampante. */
.modal-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px
}

.modal-cancel[hidden] {
    display: none
}

.modal-cancel svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round
}

/* Storico: tasto "Annulla" accanto a "Invio in corso…". */
.resend-cancel {
    display: inline-block;
    margin: 0 0 0 6px;
    padding: 4px 12px;
    min-height: 0;
    font-size: 13px;
    border-radius: 8px;
    vertical-align: middle
}

/* Storico: biglietti annullati e comandi Annulla / Ripristina nella tendina. */
.status-cancelled {
    background: #fde2df;
    color: #972f25;
    text-decoration: line-through
}

.void-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-bottom: 4px
}

.void-tickets {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #972f25
}

.void-tickets[data-mode="restore"] {
    color: #174e43
}

.void-tickets svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

/* Emissione: il riquadro del totale è il "carrello": cliccandolo si svuota il form (con conferma). */
#cart-card {
    cursor: pointer;
    transition: box-shadow .15s, transform .15s
}

#cart-card:hover,
#cart-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(23, 78, 67, .18);
    outline: none
}

#cart-card:active {
    transform: scale(.98)
}

.cart-icon {
    position: absolute;
    top: -2px;
    left: -2px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #174e43
}

.cart-icon svg,
.cart-modal-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.cart-modal-icon svg {
    display: block;
    width: 36px;
    height: 36px;
    color: #8a5400
}

/* Carrello vuoto: nessuna icona e nessuna azione al clic. */
#cart-card.cart-empty {
    cursor: default
}

#cart-card.cart-empty:hover,
#cart-card.cart-empty:active {
    box-shadow: none;
    transform: none
}

#cart-card.cart-empty .cart-icon {
    display: none
}

/* Giochi e tariffe: pulsanti disposti a griglia; il modulo (quando aperto) sta sopra, a tutta larghezza. */
.columns:has(> .game-list) {
    display: grid;
    grid-template-columns: 1fr
}

.game-list {
    /* Almeno 3 per fila: la colonna minima non supera mai un terzo della larghezza. */
    grid-template-columns: repeat(auto-fill, minmax(min(240px, calc((100% - 32px) / 3)), 1fr));
    gap: 16px
}

@media(max-width:600px) {
    .game-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px
    }
}

.game-list > p.card {
    grid-column: 1 / -1
}

.game-card {
    display: flex;
    flex-direction: column
}

.game-card .game-card-actions {
    margin-top: auto;
    padding-top: 12px
}

/* Storico: ingressi usati per i biglietti con più obliterazioni. */
.uses-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e3ebf5;
    color: #2e4e7a;
    font-size: 12px;
    font-weight: 700
}

/* Emissione: pulsanti dei giochi leggermente più compatti, per stare in una sola pagina. */
#issue-form .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px
}

#issue-form .game-button {
    min-height: 66px;
    padding: 10px 12px;
    border-radius: 12px;
    gap: 3px
}

#issue-form .game-button strong {
    font-size: 17px
}

#issue-form .game-button small {
    font-size: 12px
}

/* Emissione: nome del gioco sempre centrato, in orizzontale e in verticale. */
#issue-form .game-button {
    align-items: center;
    justify-content: center;
    text-align: center
}

/* Emissione: carrello con più giochi. */
.cart-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    min-height: 44px
}

.cart-add svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.cart-lines {
    display: grid;
    gap: 6px;
    margin-top: 10px
}

.cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #dce5df;
    border-radius: 10px;
    background: #fafcfb;
    font-size: 14px
}

.cart-line-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.cart-line-sub {
    color: #59716a
}

#issue-form .cart-remove {
    width: 30px;
    height: 30px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1
}

/* Carrello: il gioco appena premuto è l'ultima riga, evidenziata. */
.cart-line-current {
    border-color: #174e43;
    background: #eef6ef
}

/* Testo solo per i lettori di schermo (es. "Gioco" sopra i pulsanti dell'emissione). */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0
}

/* Modal del carrello: grande, per gestire comodamente le righe. */
.modal.cart-modal {
    width: min(880px, 94vw);
    max-width: none;
    text-align: left
}

.cart-modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.cart-modal-head h2 {
    margin: 0;
    font-size: 26px
}

.cart-modal-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ecf3ee;
    color: #174e43
}

.cart-modal-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.cart-modal-kind {
    position: static;
    margin-left: 4px
}

.cart-modal-kind.kind-full {
    background: #ecf3ee;
    color: #174e43
}

.cart-modal-close {
    margin-left: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 18px
}

.cart-modal-lines {
    display: grid;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto
}

.cart-modal-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #dce5df;
    border-radius: 14px;
    background: #fafcfb
}

.cart-modal-name {
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere
}

.cart-modal-name small {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #59716a
}

.cart-modal-step {
    display: flex;
    align-items: center;
    gap: 10px
}

.cart-modal-step strong {
    min-width: 34px;
    text-align: center;
    font-size: 22px
}

.cart-modal-step button,
.cart-modal-remove {
    width: 48px;
    height: 48px;
    min-height: 0;
    padding: 0;
    margin: 0;
    font-size: 22px;
    border-radius: 12px
}

.cart-modal-remove {
    color: #972f25
}

.cart-modal-sub {
    min-width: 90px;
    text-align: right;
    font-size: 18px
}

.cart-modal-empty {
    padding: 24px;
    text-align: center;
    color: #59716a
}

.cart-modal-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 18px 0 6px;
    padding-top: 14px;
    border-top: 2px solid #174e43;
    font-size: 18px
}

.cart-modal-total strong {
    font-size: 30px
}

#cart-ok.armed {
    background: #972f25;
    color: #fff
}

@media(max-width:600px) {
    .cart-modal-line {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px
    }

    .cart-modal-sub {
        text-align: left
    }
}

/* Modal del carrello: pulsanti quadrati (gli stili generali dei modal li allargano). */
#cart-modal .cart-modal-step button,
#cart-modal .cart-modal-remove,
#cart-modal .cart-modal-close {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    flex: none;
    padding: 0;
    margin: 0
}

#cart-modal .cart-modal-name {
    overflow-wrap: normal;
    word-break: normal
}

#cart-modal .cart-modal-close {
    margin-left: auto
}

/* Carrello in alto: numero di biglietti grande e in grassetto. */
#issue-total-label {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #142d32
}

/* Carrello: scorrimento quando le righe sono tante, avviso del limite di biglietti. */
.cart-modal-lines {
    overscroll-behavior: contain;
    padding-right: 4px
}

#cart-modal-count.bump {
    animation: cart-limit .5s;
    color: #972f25;
    font-weight: 700
}

@keyframes cart-limit {
    0%, 100% { transform: translateX(0) }
    25% { transform: translateX(-6px) }
    75% { transform: translateX(6px) }
}

#cart-modal-count {
    display: inline-block
}

/* Modal di invio: destinatario (email o WhatsApp) ben visibile mentre si invia. */
.modal[data-state="loading"] .modal-detail {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #142d32;
    border-left: 0;
    border: 1px solid #cdd9d2;
    background: #eef6ef;
    overflow-wrap: anywhere
}

/* Modal di invio: canale usato (Email, WhatsApp o Stampa) con la sua icona. */
.send-channel {
    display: flex;
    justify-content: center;
    margin: 14px 0 4px
}

.send-channel > span {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700
}

.send-channel[data-ch="email"] > [data-ch="email"],
.send-channel[data-ch="whatsapp"] > [data-ch="whatsapp"],
.send-channel[data-ch="print"] > [data-ch="print"] {
    display: inline-flex
}

.send-channel [data-ch="email"] {
    background: #e3ebf5;
    color: #2e4e7a
}

.send-channel [data-ch="whatsapp"] {
    background: #dcf8e4;
    color: #127a3a
}

.send-channel [data-ch="print"] {
    background: #ecf3ee;
    color: #174e43
}

.send-channel svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.send-channel svg .fill {
    fill: currentColor;
    stroke: none
}

.send-channel[hidden] {
    display: none
}

/* Stampa senza internet: avviso fisso in basso a sinistra con i biglietti da registrare. */
.offline-pill {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 60;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 999px;
    background: #174e43;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(18, 60, 56, .3)
}

.offline-pill.offline-now {
    background: #a86a00
}

.offline-pill[hidden] {
    display: none
}

/* Storico: biglietti stampati senza internet. */
.offline-badge {
    background: #ffefcc;
    color: #8a5400
}
