/* ============================================
   TRENORD BIGLIETTO DIGITALE — iOS Native Style
   ============================================ */

:root {
    --green-dark: #2C7F44;
    --green-header: #2C7F44;
    --green-text: #4B8954;
    --green-badge: #418d4d;
    --green-btn: #418d4d;
    --gray-bg: #F2F2F7;
    --gray-label: #8E8E93;
    --gray-sep: #C6C6C8;
    --gray-icon: #C7C7CC;
    --text-primary: #000000;
    --text-secondary: #3C3C43;
    --card-shadow: 0 1px 4px rgba(0,0,0,0.08);
    --card-radius: 7px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: -10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    background: #fff;
}

body {
    font-family: var(--font);
    background: #fff;
    color: var(--text-primary);
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
        height: 100dvh;
    }
}

/* ============================================
   SCREEN SYSTEM
   ============================================ */

.screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    display: none;
    flex-direction: column;
    background: var(--gray-bg);
    z-index: 1;
    max-width: none;
}
.screen.active {
    display: flex;
}

.screen.slide-in {
    display: flex;
    animation: slideUp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.screen.slide-out {
    display: flex;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

/* ============================================
   CONFIG SCREEN
   ============================================ */

.config-header {
    background: linear-gradient(180deg, var(--green-dark) 0%, var(--green-header) 100%);
    padding: var(--safe-top) 16px 0;
    padding-top: var(--safe-top);
    text-align: center;
    flex-shrink: 0;
}
.config-header-title {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

/* Config Tabs (Acquista screen) */
.config-tabs {
    padding: 10px 16px 12px;
}
.config-tab-bar {
    display: flex;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.config-tab {
    flex: 1;
    padding: 7px 4px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.config-tab.active {
    background: #fff;
    color: var(--green-dark);
    font-weight: 600;
}
.config-tab-mxp svg {
    flex-shrink: 0;
}

.config-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px calc(80px + 40px);
}

.form-section-label {
    font-size: 12px;
    color: #A0A0A5;
    text-transform: uppercase;
    padding: 12px 16px 8px;
    letter-spacing: 0.3px;
    font-weight: 400;
}

.form-card {
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 44px;
}
.form-row label {
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}
.form-row input[type="datetime-local"],
.form-row select {
    font-family: var(--font);
    font-size: 16px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    outline: none;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
    max-width: 60%;
}

.form-row-icon-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--text-primary);
}
.form-row-icon {
    width: 22px;
    height: 22px;
    color: var(--gray-label);
    flex-shrink: 0;
}

.form-value-fixed {
    font-size: 16px;
    color: var(--gray-label);
}

.form-divider {
    height: 0.5px;
    background: var(--gray-sep);
    margin-left: 16px;
}

/* ============================================
   ACCORDION SECTIONS
   ============================================ */

.accordion-section {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid #E5E5EA;
    margin-bottom: 0;
    overflow: visible;
}

.accordion-section:first-child {
    margin-top: 0;
    border-top: 1px solid #E5E5EA;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.accordion-title {
    font-size: 20px;
    font-weight: 700;
    color: #1C1C1E;
    flex: 1;
    text-align: left;
}

.accordion-chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.accordion-section.open .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 18px 18px;
    background: #fff;
}

.accordion-intro-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.accordion-intro-text {
    font-size: 14px;
    line-height: 1.45;
    color: #8E8E93;
    margin: 0;
    flex: 1;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-section.open .accordion-body {
    max-height: 2800px;
}

/* ── Search Fields (Da - A) ── */
.search-fields {
    padding: 0 18px 18px;
}

.search-field-wrap {
    margin-bottom: 14px;
    position: relative;
}

.search-label {
    font-size: 12px;
    font-weight: 600;
    color: #8E8E93;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: #F2F2F7;
    border-radius: 10px;
    padding: 0 12px;
    height: 44px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
    border-color: #62A76C;
    background: #fff;
}

.search-input-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #1C1C1E;
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: #C7C7CC;
}

.search-clear-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: none;
    flex-shrink: 0;
}

.search-clear-btn.visible {
    display: block;
}

.search-clear-btn svg {
    width: 20px;
    height: 20px;
}

.search-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-dropdown.open {
    display: block;
}

.search-dropdown-item {
    padding: 12px 16px;
    font-size: 15px;
    color: #1C1C1E;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #F2F2F7;
    -webkit-tap-highlight-color: transparent;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:active {
    background: #F2F2F7;
}

.search-dropdown-item .comune-zone-tag {
    font-size: 12px;
    font-weight: 600;
    color: #62A76C;
    background: #E8F5E9;
    padding: 2px 8px;
    border-radius: 10px;
}

.search-dropdown-empty {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #8E8E93;
}

.search-result-zone {
    background: #E8F5E9;
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
}

.search-result-badge {
    font-size: 15px;
    font-weight: 600;
    color: #62A76C;
}

/* ============================================
   ZONE CARD & MAP
   ============================================ */

.zone-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 16px 18px 0;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.zone-badges-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.2px;
    margin-bottom: 10px;
}

.zone-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: center;
    padding-bottom: 12px;
}

.zone-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 0;
    color: #000;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.zone-badge-first {
    border-radius: 20px 0 0 20px;
}

.zone-badge-last {
    border-radius: 0 20px 20px 0;
}

.zone-badge-middle {
    border-radius: 0;
}

/* Pattern a righe diagonali */
.zone-badge.striped-purple {
    background: repeating-linear-gradient(
        -45deg,
        #BDA3C8,
        #BDA3C8 3px,
        #fff 3px,
        #fff 6px
    ) !important;
}
.zone-badge.striped-red {
    background: repeating-linear-gradient(
        -45deg,
        #A61D27,
        #A61D27 3px,
        #fff 3px,
        #fff 6px
    ) !important;
}

.zone-map-wrap {
    margin: 0 -18px;
    background: #f8f8f8;
    border-top: 0.5px solid var(--gray-sep);
}
.zone-map-wrap img {
    width: 100%;
    display: block;
}

/* ============================================
   ZONE SLIDER (Dual Thumb)
   ============================================ */

.zone-slider-section {
    padding: 20px 10px 8px;
}

.zone-slider-header {
    font-size: 16px;
    font-weight: 400;
    color: #525252;
    margin-bottom: 12px;
}

.zone-slider-min-label {
    font-size: 13px;
    font-weight: 600;
    color: #6CAC6A;
    letter-spacing: 0.3px;
    margin-left: 10px;
}

.zone-slider-wrap {
    position: relative;
    height: 40px;
    margin: 0 8px;
}

.zone-slider-track-bg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 8px;
    background: #D1D1D6;
    border-radius: 4px;
    z-index: 1;
}

.zone-slider-track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 8px;
    background: #6CAC6A;
    border-radius: 4px;
    z-index: 2;
    transition: left 0.1s, width 0.1s;
}

.zone-slider-wrap input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3;
    margin: 0;
    padding: 0;
    outline: none;
}

.zone-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: transparent;
    cursor: pointer;
}

.zone-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -4.5px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #6CAC6A;
    border: 2.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 4;
}

/* Firefox */
.zone-slider-wrap input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
    border: none;
}
.zone-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #6CAC6A;
    border: 2.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    pointer-events: all;
}

.zone-slider-labels {
    display: flex;
    justify-content: space-between;
    padding: 8px 2px 0;
}
.zone-slider-labels span {
    font-size: 13px;
    font-weight: 500;
    color: #AEAEB2;
    text-align: center;
    min-width: 24px;
    transition: color 0.15s, font-weight 0.15s;
}
.zone-slider-labels span.active {
    color: var(--text-primary);
    font-weight: 700;
}

/* ============================================
   TICKET COUNTER
   ============================================ */

.counter-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.counter-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s;
}
.counter-btn svg {
    width: 30px;
    height: 30px;
}
.counter-btn:active {
    opacity: 0.5;
}
.counter-btn:disabled {
    color: var(--gray-sep);
    cursor: default;
}
.counter-btn:disabled:active {
    opacity: 1;
}

/* ============================================
   GENERATE BUTTON
   ============================================ */

.btn-green-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 20px;
    background: #2C7F44;
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 32px;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s;
    margin-bottom: 5px;
}
.btn-green-full:active {
    opacity: 0.7;
}

.btn-genera-zone {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.btn-mostra-qr{
    background: var(--green-btn)!important;
}


/* ============================================
   WALLET SCREEN
   ============================================ */

.wallet-header {
    background: var(--green-dark);
    padding-top: var(--safe-top);
    flex-shrink: 0;
}
.wallet-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 52px;
    padding: 0 8px;
}
.wallet-title {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
}
.wallet-header-right {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
#btn-back-config {
    position: absolute;
    left: 4px;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.15s;
}
.header-icon-btn:active {
    background: rgba(255,255,255,0.15);
}
.header-icon-btn svg,
.header-icon-btn img {
    width: 22px;
    height: 22px;
}

.header-icon-btn .info-icon-img {
    width: 22px;
    height: 22px;
}

/* Wallet Tabs */
.wallet-tabs {
    padding: 8px 16px 12px;
}
.tab-bar {
    display: flex;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}
.tab {
    flex: 1;
    padding: 7px 4px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab.active {
    background: #fff;
    color: var(--green-dark);
    font-weight: 600;
}

/* Wallet Body */
.wallet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(80px + 24px);
}

/* ============================================
   SWIPE TO DELETE
   ============================================ */

.swipe-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--card-radius);
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
}

.swipe-action {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FF3B30;
    z-index: 1;
}

.swipe-delete-btn {
    background: none;
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
}

.swipe-delete-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.swipe-content {
    position: relative;
    z-index: 2;
    background: #fff;
    will-change: transform;
}

/* ============================================
   TICKET CARD
   ============================================ */

.ticket-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 12px;
}
.ticket-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.ticket-type-label {
    font-weight: 500;
    color: var(--green-text);
    font-size: 15px;
    /* font-style: italic;*/
}

.info-icon-gray {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--green-dark);
    padding: 0;
}
.info-icon-gray svg,
.info-icon-gray img {
    width: 24px;
    height: 24px;
}

.info-icon-gray .info-icon-img {
    width: 24px;
    height: 24px;
}

.info-icon-img {
    display: inline-block;
    object-fit: contain;
}

/* Info su sfondo verde */
.info-icon-img-white {
    filter: brightness(0) invert(1);
}

/* Info su sfondo chiaro */
.info-icon-img-green {
    filter: brightness(50%) saturate(100%) invert(35%) sepia(40%) saturate(782%) hue-rotate(89deg) brightness(92%) contrast(90%);
}

.ticket-field {
    margin-bottom: 12px;
}
.ticket-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-label);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 4px;
}
.ticket-value {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.7px;
    font-weight: 300;
}

.ticket-value-zones {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.7px;
    font-weight: 500;
}

.ticket-validita {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    font-weight: 300;
}
.validita-sep {
    color: var(--gray-sep);
    font-weight: 100;
    font-size: 18px;
}

.ticket-row-2col {
    display: flex;
    gap: 24px;
    margin-bottom: 4px;
}
.ticket-row-2col .ticket-field {
    flex: 1;
}

.stibm-badge {
    display: inline-block;
    background: var(--green-badge);
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 100px;
    margin-top: 4px;
    margin-bottom: 16px;
    letter-spacing: 0.9px;
}

.btn-qr {
    margin-top: 3px;
}
.btn-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* Expired ticket */
.ticket-card.ticket-expired {
    opacity: 0.5;
}
.ticket-card.ticket-expired .ticket-type-label {
    color: var(--gray-label);
}
.ticket-card.ticket-expired .stibm-badge {
    background: var(--gray-label);
}
.ticket-card.ticket-expired .btn-green-full {
    background: var(--gray-label);
}

/* ============================================
   EXPIRED SECTION
   ============================================ */

.expired-section {
    margin-top: 8px;
    margin-bottom: 16px;
}

.expired-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-label);
    -webkit-user-select: none;
    user-select: none;
}

.expired-chevron {
    width: 18px;
    height: 18px;
    transition: transform 0.3s;
    color: var(--gray-label);
}
.expired-chevron.open {
    transform: rotate(180deg);
}

.expired-list.collapsed {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-label);
    font-size: 15px;
}

/* ============================================
   RICARICAMI CARD
   ============================================ */

.ricaricami-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 12px;
}
.ricaricami-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.ricaricami-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--green-text);
}
.ricaricami-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 16px;
    font-weight: 300;
}

.btn-outline-green {
    width: 100%;
    padding: 8px 20px;
    background: transparent;
    color: var(--green-dark);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    border: 1.5px solid var(--green-dark);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.btn-outline-green:active {
    background: rgba(0, 107, 50, 0.08);
}

/* ============================================
   BOTTOM TAB BAR
   ============================================ */

.bottom-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    background: #fff;
    border-top: 0.5px solid #D1D1D6;
    padding: 6px 0;
    z-index: 100;
}
.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: #8E8E93;
    position: relative;
    flex: 1;
    padding: 2px 0;
}
.tabbar-item svg {
    width: 20px;
    height: 20px;
    transform-origin: center;
}

/* Bilanciamento ottico: il wallet usa un viewBox piu ampio e appare piu piccolo. */
.tabbar-item[data-tab="wallet"] svg {
    transform: scale(1.14);
}
.tabbar-item span {
    font-size: 8px;
    font-weight: 500;
}
.tabbar-item.active {
    color: var(--green-dark);
}
/* Icone filled: i path con fill="#fff" rimangono bianchi,
   quelli con fill="currentColor" ereditano il colore dal parent */

/* Badge */
.tabbar-item.has-badge::after {
    content: attr(data-badge);
    position: absolute;
    top: -2px;
    right: 50%;
    margin-right: -18px;
    background: #FF3B30;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* ============================================
   DETAIL SCREEN (Full-screen Modal)
   ============================================ */

.screen-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200;
    display: none;
    flex-direction: column;
}
.screen-modal.open {
    display: flex;
}

.detail-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.551);
    /* -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px); */
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}
.screen-modal.closing .detail-backdrop {
    animation: fadeOut 0.25s forwards;
}

.detail-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90%;
    max-height: 90%;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: panelUp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}
.screen-modal.closing .detail-panel {
    animation: panelDown 0.3s ease-in forwards;
}

/* Brightness overlay — nascosto */
.brightness-overlay {
    display: none !important;
}

/* Modalità luminosità massima quando QR è aperto */
body.qr-brightness-mode {
    background: #ffffff !important;
}
body.qr-brightness-mode .screen.active {
    filter: brightness(1.15);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes panelUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes panelDown { from { transform: translateY(0); } to { transform: translateY(100%); } }

.detail-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px 20px;
    background: var(--green-dark);
    border-bottom: none;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}
.detail-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    text-align: center;
}
.detail-header-btn {
    position: absolute;
    right: 20px;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
    background: #ffffff;
}

.detail-pnr-section {
    text-align: center;
    padding: 20px 24px 0px;
}
.detail-pnr-label {
    display: block;
    font-size: 12px;
    color: #555556;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}
.detail-pnr-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #555556;
}

.qrcode-wrap {
    display: flex;
    justify-content: center;
    padding: 16px 0 20px;
}
.qrcode-wrap canvas,
.qrcode-wrap img {
    border-radius: 0;
    width: 50% !important;
    height: 50% !important;
}

.detail-ticket-type {
    text-align: center;
    padding: 0 24px 10px;
}
.detail-type-text {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #62A76C;
}
.detail-zone-text {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #62A76C;
    margin-left: 0;
    margin-top: 5px;
}

/* Animated Checkmark */
.animated-check-container {
    display: flex;
    justify-content: center;
    padding: 8px 0 5px;
}
.animated-check {
    width: 7%;
    height: 7%;
    transform-origin: center;
}
/* N1 - Cerchio anello verde scuro */
.check-circle {
    stroke: #62A76C;
    stroke-width: 2.5;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    fill: none;
    transform-origin: center;
    animation: circleN1 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
/* N2 - Cerchio pieno chiaro che riempie */
.check-bg {
    fill: #62A76C;
    opacity: 0;
    transform-origin: center;
    animation: circleN2 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
/* N3 - Cerchio chiaro overlay */
.check-overlay {
    fill: #B8DEC0;
    opacity: 0;
    transform-origin: center;
    animation: circleN3 1.5s ease-in-out infinite;
}
/* Tick - Checkmark bianco */
.check-mark {
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    opacity: 0;
    animation: checkTick 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* N1 - Anello che si disegna, si stringe, si espande, torna normale */
@keyframes circleN1 {
    0% { 
        stroke-dashoffset: 126; 
        transform: scale(1) rotate(-90deg);
        opacity: 1;
    }
    25% { 
        stroke-dashoffset: 0; 
        transform: scale(1) rotate(-90deg);
        opacity: 1;
    }
    30% { 
        stroke-dashoffset: 0; 
        transform: scale(0.82) rotate(-90deg);
        opacity: 1;
    }
    35% { 
        stroke-dashoffset: 0; 
        transform: scale(1.15) rotate(-90deg);
        opacity: 1;
    }
    38% { 
        stroke-dashoffset: 0; 
        transform: scale(1.08) rotate(-90deg);
        opacity: 1;
    }
    55% { 
        stroke-dashoffset: 0; 
        transform: scale(1.15) rotate(-90deg);
        opacity: 1;
    }
    65% { 
        stroke-dashoffset: 0; 
        transform: scale(1.02) rotate(-90deg);
        opacity: 1;
    }
    70% { 
        stroke-dashoffset: 0; 
        transform: scale(1) rotate(-90deg);
        opacity: 1;
    }
    100% { 
        stroke-dashoffset: 0; 
        transform: scale(1) rotate(-90deg);
        opacity: 1;
    }
}

/* N2 - Cerchio pieno che nasce ed espande con N1 */
@keyframes circleN2 {
    0% { 
        opacity: 0; 
        transform: scale(0);
    }
    30% { 
        opacity: 1; 
        transform: scale(0);
    }
    35% { 
        opacity: 1; 
        transform: scale(0.15);
    }
    55% { 
        opacity: 1; 
        transform: scale(1.15);
    }
    65% { 
        opacity: 1; 
        transform: scale(1.02);
    }
    70% { 
        opacity: 1; 
        transform: scale(1);
    }
    100% { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* Tick - Si disegna progressivamente */
@keyframes checkTick {
    0% { 
        stroke-dashoffset: 40; 
        opacity: 0;
    }
    48% { 
        stroke-dashoffset: 40; 
        opacity: 0;
    }
    50% { 
        stroke-dashoffset: 40; 
        opacity: 1;
    }
    70% { 
        stroke-dashoffset: 24; 
        opacity: 1;
    }
    85% { 
        stroke-dashoffset: 0; 
        opacity: 1;
    }
    100% { 
        stroke-dashoffset: 0; 
        opacity: 1;
    }
}

/* N3 - Overlay chiaro che nasce con tick e svanisce */
@keyframes circleN3 {
    0% { 
        opacity: 0; 
        transform: scale(0);
    }
    48% { 
        opacity: 0; 
        transform: scale(0);
    }
    50% { 
        opacity: 0.9; 
        transform: scale(0.2);
    }
    65% { 
        opacity: 0.7; 
        transform: scale(0.6);
    }
    78% { 
        opacity: 0.4; 
        transform: scale(0.85);
    }
    90% { 
        opacity: 0.1; 
        transform: scale(1);
    }
    100% { 
        opacity: 0; 
        transform: scale(1);
    }
}

/* Detail Info Section */
.detail-info-section {
    padding: 0 24px;
}
.detail-info-row {
    margin-bottom: 16px;
}
.detail-info-label {
    display: block;
    font-size: 14px;
    color: #b3b3b4;
    font-weight: 400;
    margin-bottom: 2px;
    font-family: system-ui;
}
.detail-info-value {
    display: block;
    font-size: 14px;
    color: #59596e;
    font-family: system-ui;
    font-weight: 500;
}

/* Norme Link */
.detail-norme-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    margin-top: 20px;
    border-top: 0.5px solid #D1D1D6;
    border-bottom: 0.5px solid #D1D1D6;
    cursor: pointer;
    transition: background 0.15s;
}
.detail-norme-link:active {
    background: #f0f0f0;
}
.detail-norme-link span {
    font-size: 15px;
    color: #3C3C43;
    font-weight: 400;
}
.detail-norme-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.detail-receipt-link {
    margin-top: 0;
    border-top: none;
}

/* ===== DISCLAIMER OBBLIGATORIO ===== */

.disclaimer-mandatory-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.disclaimer-mandatory-overlay.active {
    display: flex;
    animation: disclaimerFadeIn 0.4s ease forwards;
}

.disclaimer-mandatory-overlay.dismiss {
    animation: disclaimerFadeOut 0.5s ease forwards;
}

@keyframes disclaimerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes disclaimerFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.disclaimer-mandatory-card {
    background: #fff;
    border-radius: 20px;
    max-width: 380px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: disclaimerCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes disclaimerCardIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.disclaimer-mandatory-icon {
    text-align: center;
    padding: 24px 0 8px;
}

.disclaimer-mandatory-icon svg {
    width: 40px;
    height: 40px;
}

.disclaimer-mandatory-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1C1C1E;
    margin: 0 0 4px;
}

.disclaimer-mandatory-body {
    padding: 12px 24px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 40vh;
    font-size: 14px;
    color: #3C3C43;
    line-height: 1.55;
}

.disclaimer-mandatory-body p {
    margin: 0 0 10px;
}

.disclaimer-mandatory-body p:last-child {
    margin-bottom: 0;
}

.disclaimer-mandatory-scroll-hint {
    text-align: center;
    font-size: 12px;
    color: #AEAEB2;
    padding: 4px 0;
}

.disclaimer-mandatory-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #585DA4;
    color: #fff;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.disclaimer-mandatory-btn:disabled {
    background: #C7C7CC;
    cursor: not-allowed;
}

.disclaimer-checkboxes {
    padding: 8px 24px 4px;
}

.disclaimer-check-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: #1C1C1E;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.disclaimer-check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2C7F44;
    cursor: pointer;
}

.disclaimer-check-label span {
    line-height: 1.4;
    padding-top: 1px;
}

/* ============================================
   MODAL OVERLAYS (iOS Style Alerts)
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.modal-overlay.open {
    display: flex;
}
.modal-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.747);
    /* -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px); */
    opacity: 0;
    animation: modalBgIn 0.25s forwards;
}
.modal-overlay.closing::before {
    animation: modalBgOut 0.2s forwards;
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalBgOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.modal-card {
    background: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 5px;
    width: 100%;
    /* max-width: 320px; */
    overflow: hidden;
    z-index: 1;
    animation: modalCardIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.modal-card-wide {
    max-width: 360px;
}

.modal-overlay.closing .modal-card {
    animation: modalCardOut 0.2s ease-in forwards;
}

@keyframes modalCardIn {
    from { transform: scale(1.1); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes modalCardOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.95); opacity: 0; }
}

.modal-title {
    font-size: 17px;
    text-align: center;
    padding: 20px 20px 8px;
}
.modal-body {
    padding: 0 20px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    max-height: 55vh;
    overflow-y: auto;
}
.modal-body p {
    margin-bottom: 12px;
}
.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body-home-hint {
    text-align: left;
}

.home-hint-subtitle {
    font-size: 14px;
    color: #6D6D72;
    margin-bottom: 12px;
}

.home-hint-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-hint-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    font-size: 14px;
    color: #1C1C1E;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
}

.home-hint-benefits li:last-child {
    border-bottom: none;
}

.home-hint-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.home-hint-actions {
    display: flex;
    gap: 8px;
}

.home-hint-btn-later {
    color: #8E8E93 !important;
    font-weight: 400 !important;
}

.home-hint-btn-install {
    color: #007AFF !important;
    font-weight: 700 !important;
}

/* Step 2: Visual Guide */
.home-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.home-guide-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #007AFF;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-guide-step-text {
    font-size: 14px;
    color: #1C1C1E;
    line-height: 1.45;
    padding-top: 3px;
}

.home-guide-share-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    color: #007AFF;
    margin: 0 3px;
}

.modal-body-info {
    text-align: left;
}

.info-block {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    background: #F2F2F7;
    border-radius: 10px;
    margin-bottom: 10px;
}

.info-block:last-child {
    margin-bottom: 0;
}

.info-block-emoji {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-block-text {
    flex: 1;
}

.info-block-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1C1C1E;
    margin: 0 0 4px;
}

.info-block-text p {
    font-size: 13px;
    color: #3C3C43;
    line-height: 1.4;
    margin: 0;
}

.modal-body strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 8px;
    margin-bottom: 4px;
    text-align: left;
}
.modal-body p {
    text-align: left;
}

.modal-actions {
    border-top: 0.5px solid var(--gray-sep);
}
.modal-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    color: #007AFF;
    cursor: pointer;
    transition: background 0.15s;
}
.modal-btn:active {
    background: rgba(0,0,0,0.06);
}

/* ============================================
   HOME SCREEN
   ============================================ */

.home-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 calc(80px + 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.home-guide-header {
    text-align: center;
    padding: 16px 20px 0;
    margin-bottom: 8px;
    width: 100%;
}

.home-guide-emoji {
    font-size: 48px;
    margin-bottom: 8px;
}

.home-guide-title {
    font-size: 28px;
    font-weight: 700;
    color: #1C1C1E;
    margin-bottom: 6px;
}

.home-guide-subtitle {
    font-size: 15px;
    color: #8E8E93;
    line-height: 1.4;
}

.home-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 20px 6px;
    width: 100%;
    max-width: 500px;
}

.home-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px;
    max-width: 500px;
    width: 100%;
}

.home-step-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.home-step-number {
    background: linear-gradient(135deg, #2C7F44 0%, #62A76C 100%);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.home-step-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.home-step-icon-wrap svg {
    width: 20px;
    height: 20px;
}
.home-step-icon-green  { background: linear-gradient(135deg, #2C7F44, #62A76C); }
.home-step-icon-blue   { background: linear-gradient(135deg, #3478F6, #5AC8FA); }
.home-step-icon-orange { background: linear-gradient(135deg, #E37603, #FFB74D); }
.home-step-icon-purple { background: linear-gradient(135deg, #585DA4, #9C27B0); }
.home-step-icon-teal   { background: linear-gradient(135deg, #00897B, #4DB6AC); }
.home-step-icon-red    { background: linear-gradient(135deg, #D32F2F, #EF5350); }

.home-step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #F2F2F7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-step-icon svg {
    width: 24px;
    height: 24px;
}

.home-step-title {
    font-size: 16px;
    font-weight: 700;
    color: #1C1C1E;
    margin: 0;
}

.home-step-text {
    font-size: 14px;
    color: #8E8E93;
    line-height: 1.5;
    margin: 0;
}

.home-step-text strong {
    color: #2C7F44;
    font-weight: 600;
}

.home-tip-card {
    background: #FFFDE7;
    border: 1px solid #FFF9C4;
}

.home-tip-emoji {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-welcome-text strong {
    color: var(--green-dark);
    font-weight: 600;
}

/* ============================================
   CHANGELOG (Gite Screen)
   ============================================ */

.changelog-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0 80px;
}

.changelog-header {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid #E5E5EA;
    margin-bottom: 20px;
}

.changelog-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2C7F44 0%, #62A76C 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.changelog-icon svg {
    width: 28px;
    height: 28px;
    stroke: #fff;
}

.changelog-title {
    font-size: 28px;
    font-weight: 700;
    color: #1C1C1E;
    margin: 0 0 6px;
}

.changelog-subtitle {
    font-size: 14px;
    color: #8E8E93;
    margin: 0;
}

.changelog-list {
    padding: 0 16px;
}

.changelog-loading,
.changelog-empty,
.changelog-error {
    text-align: center;
    padding: 40px 20px;
    color: #8E8E93;
    font-size: 15px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E5EA;
    border-top-color: #62A76C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

.changelog-date-divider {
    font-size: 13px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 4px 8px;
    margin-top: 8px;
}

.changelog-item {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.changelog-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.changelog-emoji {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.changelog-item-title-wrap {
    flex: 1;
    min-width: 0;
}

.changelog-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1C1C1E;
    line-height: 1.4;
    display: block;
    margin-bottom: 6px;
}

.changelog-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #8E8E93;
}

.changelog-sha {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    background: #F2F2F7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #62A76C;
}

.changelog-dot {
    color: #C7C7CC;
}

.changelog-author,
.changelog-date {
    color: #8E8E93;
    visibility: hidden;
}

.changelog-item-description {
    font-size: 14px;
    color: #3C3C43;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #F2F2F7;
    white-space: pre-wrap;
}

/* ============================================
   PLACEHOLDER SCREENS (Profilo)
   ============================================ */

.placeholder-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px calc(80px + 40px);
    color: var(--gray-label);
}

.placeholder-icon {
    margin-bottom: 16px;
}
.placeholder-icon svg {
    width: 48px;
    height: 48px;
}

.placeholder-text {
    font-size: 17px;
    font-weight: 500;
    color: var(--gray-label);
}

/* ============================================
   UTILITY / RESPONSIVE
   ============================================ */

/* Desktop container */
@media (min-width: 768px) {
    .screen, .screen-modal {
        max-width: 428px;
        left: 50%;
        transform: translateX(-50%);
    }
    .screen.slide-in {
        animation: slideUpDesktop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    }
    .screen.slide-out {
        animation: slideDownDesktop 0.35s cubic-bezier(0.4, 0, 0.6, 1) forwards;
    }
    @keyframes slideUpDesktop {
        from { transform: translateX(-50%) translateY(100%); }
        to { transform: translateX(-50%) translateY(0); }
    }
    @keyframes slideDownDesktop {
        from { transform: translateX(-50%) translateY(0); }
        to { transform: translateX(-50%) translateY(100%); }
    }
    .bottom-tabbar {
        max-width: 428px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Hide scrollbar */
.wallet-body::-webkit-scrollbar,
.detail-body::-webkit-scrollbar,
.config-body::-webkit-scrollbar {
    display: none;
}
.wallet-body,
.detail-body,
.config-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
/* ===== TECH DOCUMENTATION STYLES ===== */
.tech-doc-container {
    padding: 20px 16px 100px 16px;
    overflow-y: auto;
    height: calc(100vh - 44px - 60px);
}

.tech-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tech-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tech-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.tech-section-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1C1C1E;
}

.tech-description {
    font-size: 14px;
    line-height: 1.5;
    color: #3C3C43;
    margin: 0 0 12px 0;
}

.tech-note {
    font-size: 13px;
    line-height: 1.4;
    color: #8E8E93;
    margin: 8px 0 0 0;
    font-style: italic;
}

.formula-box {
    background: #F2F2F7;
    border-radius: 8px;
    padding: 12px;
}

.formula-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 14px;
}

.formula-item:not(:last-child) {
    border-bottom: 1px solid #E5E5EA;
}

.formula-label {
    font-weight: 600;
    color: #1C1C1E;
    min-width: 70px;
}

.formula-item code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #62A76C;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    flex: 1;
}

.code-block {
    background: #1C1C1E;
    border-radius: 8px;
    overflow: hidden;
    margin: 12px 0;
}

.code-header {
    background: #2C2C2E;
    padding: 8px 12px;
    font-size: 12px;
    color: #8E8E93;
    font-weight: 500;
    border-bottom: 1px solid #3A3A3C;
}

.code-block pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #31D158;
    display: block;
}

.tech-description code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #E37603;
    background: #F2F2F7;
    padding: 2px 6px;
    border-radius: 4px;
}

.tech-footer {
    background: linear-gradient(135deg, #62A76C 0%, #2C7F44 100%);
    color: #fff;
    text-align: center;
}

.tech-version {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.tech-version-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version-label {
    font-size: 16px;
    font-weight: 600;
}

.version-date {
    font-size: 14px;
    opacity: 0.8;
}

.btn-check-updates {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-check-updates:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-check-updates:active {
    transform: scale(0.95);
}

.btn-check-updates.rotating svg {
    animation: rotate-refresh 1s ease-in-out;
}

@keyframes rotate-refresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.disclaimer-text {
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    opacity: 0.9;
}

/* ── Credits Section ── */
.tech-credits {
    background: #fff;
    text-align: center;
}

.credits-text {
    font-size: 15px;
    color: #3C3C43;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.credits-text strong {
    color: #1C1C1E;
}

.credits-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.credits-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    background: #F2F2F7;
    text-decoration: none;
    color: #1C1C1E;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, transform 0.15s;
}

.credits-link:active {
    transform: scale(0.96);
    background: #E5E5EA;
}

.credits-link svg {
    flex-shrink: 0;
}

/* ===== MAP VIEWER MODAL ===== */
.map-viewer-overlay {
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.map-viewer-overlay.active {
    display: flex;
}

.map-viewer-image {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    position: relative;
    z-index: 10001;
    touch-action: none;
    transform-origin: center;
    transition: transform 0.1s ease-out;
}

.map-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.2s;
}

.map-viewer-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.map-viewer-close svg {
    width: 24px;
    height: 24px;
}

.zone-map-wrap img {
    cursor: zoom-in;
}

.ticket-type-with-icon {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ticket-type-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== FLY TO WALLET ANIMATION ===== */

.fly-ticket {
    position: fixed;
    z-index: 10001;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: none;
}

.fly-ticket-inner {
    background: #fff;
    border-radius: 12px;
    padding: 16px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    text-align: center;
    min-width: 140px;
}

.fly-ticket-zone {
    font-size: 14px;
    font-weight: 700;
    color: #585DA4;
    margin-bottom: 4px;
}

.fly-ticket-price {
    font-size: 18px;
    font-weight: 800;
    color: #1C1C1E;
}

.wallet-pulse {
    animation: walletPulse 0.5s ease;
}

@keyframes walletPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* ===== QR ASSEMBLY ANIMATION ===== */

.qr-assembly-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0a0e14;
    display: none;
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
}
.qr-assembly-modal.active {
    display: flex;
}

.qr-asm-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
    padding-top: calc(env(safe-area-inset-top, 20px) + 16px);
    gap: 16px;
}

/* ── Terminal ── */
.qr-terminal {
    flex: 1;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1e26;
    border: 1px solid #2a3040;
    box-shadow: 0 0 40px rgba(98, 167, 108, 0.1);
    display: flex;
    flex-direction: column;
}

.qr-terminal-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #161a22;
    border-bottom: 1px solid #2a3040;
}

.qr-terminal-dots {
    display: flex;
    gap: 6px;
}
.qr-terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.qr-terminal-dots span:nth-child(1) { background: #ff5f56; }
.qr-terminal-dots span:nth-child(2) { background: #ffbd2e; }
.qr-terminal-dots span:nth-child(3) { background: #27c93f; }

.qr-terminal-title {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 11px;
    color: #636b78;
    flex: 1;
    text-align: center;
}

.qr-terminal-body {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: #c5cdd9;
    -webkit-overflow-scrolling: touch;
}

.t-green { color: #62A76C; }
.t-cyan { color: #56b6c2; }
.t-yellow { color: #e5c07b; }
.t-red { color: #e06c75; }
.t-magenta { color: #c678dd; }
.t-gray { color: #636b78; }
.t-white { color: #fff; font-weight: 600; }
.t-orange { color: #d19a66; }

.t-line {
    opacity: 0;
    animation: termLineIn 0.15s ease-out forwards;
    white-space: pre-wrap;
    word-break: break-all;
}

@keyframes termLineIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.t-cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: #62A76C;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.t-spinner {
    display: inline-block;
    animation: spinChar 0.6s steps(4) infinite;
}
@keyframes spinChar {
    0% { content: '|'; }
    25% { content: '/'; }
    50% { content: '-'; }
    75% { content: '\\'; }
}

/* ── Bottom: QR Grid + Stats ── */
.qr-asm-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0 8px;
    flex-shrink: 0;
}

.qr-asm-qr-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.qr-asm-grid {
    width: 120px;
    height: 120px;
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    gap: 0px;
    padding: 3px;
    background: rgba(98, 167, 108, 0.08);
    border: 1px solid rgba(98, 167, 108, 0.3);
    border-radius: 6px;
}

.qr-asm-grid-label {
    font-family: 'SF Mono', monospace;
    font-size: 9px;
    color: #636b78;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.qr-px {
    border-radius: 0;
    transition: background 0.2s, box-shadow 0.2s;
}

.qr-px.on {
    background: var(--green-header);
}

.qr-px.off {
    background: rgba(255, 255, 255, 0.03);
}

.qr-px.finder {
    background: var(--green-text);
}

.qr-px.glow {
    background: var(--gray-sep);
    box-shadow: 0 0 4px rgba(98, 167, 108, 0.8);
}

.qr-asm-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-asm-pct {
    font-family: 'SF Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: #62A76C;
    line-height: 1;
    text-shadow: 0 0 20px rgba(98, 167, 108, 0.4);
}

.qr-asm-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.qr-asm-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #62A76C, #4CAF50, #62A76C);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.3s ease-out;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.qr-asm-status {
    font-family: 'SF Mono', monospace;
    font-size: 10px;
    color: #636b78;
    letter-spacing: 0.5px;
}

/* ── Success Overlay ── */
.qr-success-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 14, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.qr-success-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.qr-success-circle {
    width: 90px;
    height: 90px;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qr-success-overlay.visible .qr-success-circle {
    transform: scale(1);
}

.qr-success-check {
    width: 100%;
    height: 100%;
}

.qr-success-check circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    transition: stroke-dashoffset 0.6s ease 0.2s;
}

.qr-success-overlay.visible .qr-success-check circle {
    stroke-dashoffset: 0;
}

.qr-success-check polyline {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    transition: stroke-dashoffset 0.4s ease 0.6s;
}

.qr-success-overlay.visible .qr-success-check polyline {
    stroke-dashoffset: 0;
}

.qr-success-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease 0.8s, transform 0.4s ease 0.8s;
}

.qr-success-overlay.visible .qr-success-text {
    opacity: 1;
    transform: translateY(0);
}

/* ── Modal Fadeout ── */
.qr-assembly-modal.fadeout {
    animation: modalFadeOut 0.6s ease forwards;
}

@keyframes modalFadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.03); }
}

/* ============================================
   TAP & GO MODAL
   ============================================ */

.tapgo-title {
    padding: 24px 24px 16px;
    font-size: 17px;
    line-height: 1.4;
}

.tapgo-actions {
    border-top: none;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tapgo-btn {
    width: 100%;
    padding: 8px 20px;
    font-family: var(--font);
    font-size: 17px;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.15s;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.tapgo-btn:active {
    opacity: 0.7;
}

.tapgo-btn-confirm {
    background: #6CAC6A;
    color: #fff;
}

.tapgo-btn-cancel {
    background: transparent;
    color: #2C7F44;
    border: 1.5px solid #2C7F44;
}

/* ============================================
   QR DATA VIEWER (Detail Screen)
   ============================================ */

.qr-data-section {
    margin-top: 16px;
    padding: 0 18px;
}

.qr-data-block {
    margin-bottom: 14px;
}

.qr-data-label {
    font-size: 12px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.qr-data-pre {
    background: #1C1C1E;
    color: #A8F0B0;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 10px;
    line-height: 1.5;
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.qr-data-info {
    font-size: 13px;
    color: #3C3C43;
    line-height: 1.5;
}

.qr-data-info strong {
    color: #1C1C1E;
}

.qr-data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid #E5E5EA;
}

.qr-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.qr-data-table th {
    background: #F2F2F7;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #8E8E93;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.qr-data-table td {
    padding: 8px 10px;
    border-top: 0.5px solid #E5E5EA;
    color: #1C1C1E;
}

.qr-data-table code {
    background: #F2F2F7;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 11px;
    color: #585DA4;
}

/* ============================================
   EPIC UPDATE SCREEN
   ============================================ */

.update-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(145deg, #0a1a0f 0%, #0f2918 30%, #143d20 60%, #0a1a0f 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.update-screen.active {
    display: flex;
    animation: updateScreenIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.update-screen.fadeout {
    animation: updateScreenOut 0.6s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes updateScreenIn {
    0% { opacity: 0; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes updateScreenOut {
    0% { opacity: 1; transform: scale(1); filter: brightness(1); }
    50% { filter: brightness(2.5); }
    100% { opacity: 0; transform: scale(0.9); filter: brightness(0); }
}

/* ── Grid Background ── */
.update-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(78, 204, 120, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78, 204, 120, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridDrift 8s linear infinite;
}

@keyframes gridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-40px, -40px); }
}

/* ── Particles ── */
.update-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.update-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ── Content Container ── */
.update-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 0 40px;
    width: 100%;
    max-width: 360px;
}

/* ── Logo with Orbiting Rings ── */
.update-logo-ring {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.update-logo-img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    position: relative;
    z-index: 2;
    animation: logoPulse 2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(78, 204, 120, 0.4), 0 0 60px rgba(78, 204, 120, 0.15);
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(78, 204, 120, 0.4), 0 0 60px rgba(78, 204, 120, 0.15); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(78, 204, 120, 0.6), 0 0 80px rgba(78, 204, 120, 0.25); }
}

.update-logo-ring-orbit {
    position: absolute;
    inset: 0;
    border: 1.5px solid transparent;
    border-top-color: rgba(78, 204, 120, 0.6);
    border-right-color: rgba(78, 204, 120, 0.2);
    border-radius: 50%;
    animation: orbitSpin 2s linear infinite;
}

.update-orbit-2 {
    inset: -10px;
    border-top-color: rgba(74, 234, 177, 0.4);
    border-right-color: transparent;
    border-left-color: rgba(74, 234, 177, 0.15);
    animation-duration: 3s;
    animation-direction: reverse;
}

.update-orbit-3 {
    inset: -20px;
    border-top-color: rgba(255, 215, 0, 0.3);
    border-right-color: transparent;
    border-bottom-color: rgba(255, 215, 0, 0.1);
    animation-duration: 4.5s;
}

@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Text Area ── */
.update-text-area {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.update-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(78, 204, 120, 0.3); }
    50% { text-shadow: 0 0 40px rgba(78, 204, 120, 0.6), 0 0 80px rgba(78, 204, 120, 0.2); }
}

.update-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    transition: opacity 0.3s ease;
    min-height: 20px;
}

/* ── Progress Bar ── */
.update-progress-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.update-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.update-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2C7F44, #4ecc78, #4AEAB1);
    border-radius: 3px;
    transition: width 0.15s linear;
    position: relative;
}

.update-progress-glow {
    position: absolute;
    top: -4px;
    left: 0;
    width: 0%;
    height: 14px;
    background: radial-gradient(ellipse at right, rgba(78, 204, 120, 0.5), transparent 70%);
    border-radius: 7px;
    transition: width 0.15s linear;
    filter: blur(3px);
}

.update-progress-pct {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* ── Train Animation ── */
.update-train-track {
    width: 100%;
    position: relative;
    height: 40px;
    margin-top: 4px;
}

.update-track-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(78, 204, 120, 0.3) 0px, rgba(78, 204, 120, 0.3) 12px, transparent 12px, transparent 20px);
    animation: trackScroll 0.8s linear infinite;
}

@keyframes trackScroll {
    0% { background-position: 0 0; }
    100% { background-position: -20px 0; }
}

.update-train {
    position: absolute;
    left: -90px;
    bottom: 2px;
    width: 80px;
    animation: trainCross 5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    filter: drop-shadow(0 0 10px rgba(78, 204, 120, 0.4));
}

.update-train svg {
    width: 100%;
    height: auto;
}

@keyframes trainCross {
    0% { left: -90px; }
    15% { left: 10%; }
    85% { left: 70%; }
    100% { left: calc(100% + 90px); }
}

/* ── Version Badge ── */
.update-version-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(78, 204, 120, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: badgeFadeIn 0.6s 0.5s ease both;
}

@keyframes badgeFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.update-ver-old {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 100, 100, 0.5);
}

.update-ver-arrow {
    width: 18px;
    height: 18px;
    color: #4ecc78;
    animation: arrowBounce 1.5s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

.update-ver-new {
    font-size: 14px;
    font-weight: 700;
    color: #4AEAB1;
    text-shadow: 0 0 12px rgba(74, 234, 177, 0.5);
}

/* ============================================
   SPLASH SCREEN
   ============================================ */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: linear-gradient(160deg, #061208 0%, #0d2415 35%, #15412a 65%, #0a1a0f 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.splash-screen.active {
    display: flex;
}

.splash-screen.dismiss {
    animation: splashDismiss 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashDismiss {
    0% { opacity: 1; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1.08); pointer-events: none; }
}

/* ── Background Grid ── */
.splash-bg-grid {
    position: absolute;
    inset: -40px;
    background-image:
        linear-gradient(rgba(78, 204, 120, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78, 204, 120, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: splashGridDrift 12s linear infinite;
    opacity: 0;
    animation: splashGridFadeIn 1s 0.2s ease forwards, splashGridDrift 12s linear infinite;
}

@keyframes splashGridFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes splashGridDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(0deg); }
}

/* ── Radial glow ── */
.splash-radial {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(44, 127, 68, 0.25) 0%, transparent 70%);
    animation: splashRadialPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes splashRadialPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* ── Particles ── */
.splash-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.splash-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: splashParticleRise linear forwards;
}

@keyframes splashParticleRise {
    0% { transform: translateY(0) scale(0); opacity: 0; }
    15% { opacity: 0.8; transform: scale(1); }
    85% { opacity: 0.6; }
    100% { transform: translateY(-120vh) scale(0.5); opacity: 0; }
}

/* ── Content ── */
.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    width: 100%;
    max-width: 320px;
    padding: 0 32px;
}

/* ── Logo with Rings ── */
.splash-logo-container {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashLogoEntry 1s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashLogoEntry {
    0% { opacity: 0; transform: scale(0.3) rotate(-10deg); }
    60% { transform: scale(1.05) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.splash-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    position: relative;
    z-index: 3;
    box-shadow:
        0 0 40px rgba(78, 204, 120, 0.5),
        0 0 80px rgba(78, 204, 120, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4);
    animation: splashLogoPulse 2.5s 1.3s ease-in-out infinite;
}

@keyframes splashLogoPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(78, 204, 120, 0.5), 0 0 80px rgba(78, 204, 120, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 0 60px rgba(78, 204, 120, 0.7), 0 0 120px rgba(78, 204, 120, 0.3), 0 8px 32px rgba(0, 0, 0, 0.4); }
}

.splash-logo-glow {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 22px;
    background: rgba(78, 204, 120, 0.15);
    filter: blur(20px);
    z-index: 1;
    animation: splashGlowPulse 2.5s 1.3s ease-in-out infinite;
}

@keyframes splashGlowPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

.splash-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid transparent;
}

.splash-ring-1 {
    inset: 10px;
    border-top-color: rgba(78, 204, 120, 0.6);
    border-right-color: rgba(78, 204, 120, 0.15);
    animation: splashRingSpin 2.5s linear infinite;
    opacity: 0;
    animation: splashRingReveal 0.6s 0.8s ease forwards, splashRingSpin 2.5s linear infinite;
}

.splash-ring-2 {
    inset: -2px;
    border-bottom-color: rgba(74, 234, 177, 0.45);
    border-left-color: rgba(74, 234, 177, 0.1);
    animation: splashRingSpin 3.5s linear infinite reverse;
    opacity: 0;
    animation: splashRingReveal 0.6s 1s ease forwards, splashRingSpin 3.5s linear infinite reverse;
}

.splash-ring-3 {
    inset: -14px;
    border-top-color: rgba(255, 215, 0, 0.25);
    border-left-color: rgba(255, 215, 0, 0.08);
    animation: splashRingSpin 5s linear infinite;
    opacity: 0;
    animation: splashRingReveal 0.6s 1.2s ease forwards, splashRingSpin 5s linear infinite;
}

@keyframes splashRingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes splashRingReveal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ── Text ── */
.splash-text-group {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: splashTextEntry 0.8s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes splashTextEntry {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-app-name {
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: 0 0 30px rgba(78, 204, 120, 0.4);
}

.splash-plus {
    color: #4AEAB1;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(74, 234, 177, 0.6);
}

.splash-tagline {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: splashTaglineFade 0.8s 1s ease both;
}

@keyframes splashTaglineFade {
    0% { opacity: 0; letter-spacing: 6px; }
    100% { opacity: 1; letter-spacing: 2px; }
}

/* ── Loader ── */
.splash-loader {
    width: 100%;
    animation: splashLoaderEntry 0.6s 1.2s ease both;
}

@keyframes splashLoaderEntry {
    0% { opacity: 0; transform: scaleX(0.5); }
    100% { opacity: 1; transform: scaleX(1); }
}

.splash-loader-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.splash-loader-fill {
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #4ecc78, #4AEAB1, transparent);
    border-radius: 2px;
    animation: splashLoaderSlide 1.4s 1.4s ease-in-out infinite;
}

@keyframes splashLoaderSlide {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* ── Train ── */
.splash-train-wrapper {
    width: 100%;
    position: relative;
    height: 36px;
    margin-top: -8px;
    animation: splashTrainEntry 0.6s 1.4s ease both;
}

@keyframes splashTrainEntry {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.splash-track-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg,
        rgba(78, 204, 120, 0.2) 0px, rgba(78, 204, 120, 0.2) 12px,
        transparent 12px, transparent 22px);
    animation: splashTrackScroll 0.9s linear infinite;
}

@keyframes splashTrackScroll {
    0% { background-position: 0 0; }
    100% { background-position: -22px 0; }
}

.splash-train {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    filter: drop-shadow(0 0 12px rgba(78, 204, 120, 0.35));
    animation: splashTrainBob 1.5s ease-in-out infinite;
}

.splash-train svg {
    width: 100%;
    height: auto;
}

@keyframes splashTrainBob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-2px); }
}

/* ── Footer ── */
.splash-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: 20px;
    text-align: center;
    z-index: 2;
    animation: splashFooterEntry 0.8s 1.6s ease both;
}

@keyframes splashFooterEntry {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.splash-footer-text {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ============================================
   SUB-SCREEN SYSTEM (iOS-style slide navigation)
   ============================================ */

.sub-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    display: none;
    flex-direction: column;
    background: var(--gray-bg);
    z-index: 150;
}

.sub-screen.active {
    display: flex;
    animation: slideInRight 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.sub-screen.closing {
    display: flex;
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@media (min-width: 768px) {
    .sub-screen {
        max-width: 428px;
        left: 50%;
        transform: translateX(-50%);
    }
    .sub-screen.active {
        animation: slideInRightDesktop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    }
    .sub-screen.closing {
        animation: slideOutRightDesktop 0.3s cubic-bezier(0.4, 0, 0.6, 1) forwards;
    }
    @keyframes slideInRightDesktop {
        from { transform: translateX(calc(-50% + 100vw)); }
        to { transform: translateX(-50%); }
    }
    @keyframes slideOutRightDesktop {
        from { transform: translateX(-50%); }
        to { transform: translateX(calc(-50% + 100vw)); }
    }

    #screen-ricevuta.sub-screen {
        max-width: min(100vw, 980px);
    }
}

.sub-screen-header {
    background: var(--green-dark);
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: calc(44px + var(--safe-top));
    flex-shrink: 0;
}

.sub-screen-back {
    position: absolute;
    left: 4px;
    display: flex;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 12px;
    -webkit-tap-highlight-color: transparent;
}

.sub-screen-back:active {
    opacity: 0.6;
}

.sub-screen-back svg {
    width: 22px;
    height: 22px;
}

.sub-screen-back-label {
    font-size: 17px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-screen-title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.sub-screen-header-right {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
}

.sub-screen-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 40px;
}

.sub-screen-body::-webkit-scrollbar {
    display: none;
}

.sub-screen-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   PROFILO SCREEN (Redesigned)
   ============================================ */

/* Green header background that extends behind user card */
.profilo-header-bg {
    display: none;
}

.profilo-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 calc(80px + 40px);
    min-height: 0;
    overscroll-behavior: contain;
}

.profilo-body::-webkit-scrollbar {
    display: none;
}

.profilo-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.profilo-user-card {
    background: #fff;
    margin: 16px 16px 0;
    position: relative;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.profilo-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profilo-user-avatar svg {
    width: 32px;
    height: 32px;
}

.profilo-user-info {
    flex: 1;
}

.profilo-user-greeting {
    font-size: 14px;
    color: #8E8E93;
    margin-bottom: 1px;
}

.profilo-user-name {
    font-size: 18px;
    font-weight: 700;
    color: #1C1C1E;
    line-height: 1.2;
}

.profilo-user-email {
    font-size: 13px;
    color: #AEAEB2;
    margin-top: 2px;
}

.profilo-user-chevron {
    color: #C7C7CC;
    flex-shrink: 0;
}

/* Section titles — flat style like Trenord app */
.profilo-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1C1C1E;
    text-transform: none;
    letter-spacing: 0;
    padding: 24px 20px 10px;
}

/* Flat list without card wrappers — like Trenord screenshot */
.profilo-list-flat {
    margin: 0;
    padding: 0;
}

.profilo-item-flat {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    gap: 10px;
    background: transparent;
    border-bottom: 0.5px solid #E5E5EA;
}

.profilo-item-flat:last-child {
    border-bottom: none;
}

.profilo-item-flat:active {
    background: rgba(0,0,0,0.04);
}

.profilo-item-icon-flat {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #8E8E93;
}

.profilo-item-icon-flat svg {
    width: 20px;
    height: 20px;
}

.profilo-icon-red {
    color: #D32F2F;
}

.profilo-item-label-flat {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: #1C1C1E;
}

.profilo-item-label-flat.text-red {
    color: #D32F2F;
}

.profilo-item-chevron-flat {
    color: #C7C7CC;
    flex-shrink: 0;
}

.profilo-item-chevron-flat svg {
    width: 16px;
    height: 16px;
}

/* Keep old profilo-group/profilo-item for backward compat if needed */
.profilo-group {
    background: #fff;
    margin: 0 16px 0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.profilo-item {
    display: flex;
    align-items: center;
    padding: 13px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    gap: 14px;
}

.profilo-item:active {
    background: #F2F2F7;
}

.profilo-item + .profilo-item {
    border-top: 0.5px solid #E5E5EA;
}

.profilo-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #8E8E93;
}

.profilo-item-icon svg,
.profilo-item-icon img {
    width: 20px;
    height: 20px;
}

/* Bilanciamento ottico delle nuove icone con viewBox differenti */
.profilo-item-icon .profilo-icon-billing {
    transform: scale(1.3);
}

.profilo-item-icon .profilo-icon-euro {
    transform: scale(1.18);
}

.profilo-item-icon .info-icon-img {
    width: 20px;
    height: 20px;
}

/* Icons are now all plain grey — color classes removed */

.profilo-item-label {
    flex: 1;
    font-size: 16px;
    font-weight: 400;
    color: #1C1C1E;
}

.profilo-item-label.text-red {
    color: #D32F2F;
}

.profilo-item-chevron {
    color: #C7C7CC;
    flex-shrink: 0;
}

.profilo-item-chevron svg {
    width: 16px;
    height: 16px;
}

.profilo-footer {
    text-align: center;
    padding: 32px 16px 16px;
}

.profilo-footer-version {
    font-size: 13px;
    color: #8E8E93;
    margin-bottom: 4px;
}

.profilo-footer-credits {
    font-size: 12px;
    color: #AEAEB2;
}

.profilo-footer-credits a {
    color: #62A76C;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   BILLING FORM
   ============================================ */

.billing-form {
    padding: 20px 16px;
}

.billing-field {
    margin-bottom: 20px;
}

.billing-label {
    font-size: 12px;
    font-weight: 700;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.billing-input {
    width: 100%;
    padding: 14px 16px;
    background: #F2F2F7;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 16px;
    color: #1C1C1E;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.billing-input:focus {
    border-color: #62A76C;
    background: #fff;
}

.billing-input::placeholder {
    color: #C7C7CC;
}

.billing-row-2col {
    display: flex;
    gap: 12px;
}

.billing-row-2col .billing-field {
    flex: 1;
}

.billing-random-btn {
    width: 100%;
    padding: 12px;
    background: #F2F2F7;
    color: #585DA4;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    border: 1.5px dashed #585DA4;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 12px;
    -webkit-appearance: none;
    appearance: none;
    transition: background 0.15s;
}

.billing-random-btn:active {
    background: #E5E5EA;
}

.billing-submit {
    width: 100%;
    padding: 8px;
    background: #6CAC6A;
    color: #fff;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 8px;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s;
}

.billing-submit:active {
    opacity: 0.7;
}

.billing-saved-card {
    background: #fff;
    margin: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.billing-saved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.billing-saved-label {
    font-size: 11px;
    font-weight: 700;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.billing-saved-check {
    width: 28px;
    height: 28px;
    background: #E8F5E9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.billing-saved-check svg {
    width: 16px;
    height: 16px;
    color: #2C7F44;
}

.billing-saved-name {
    font-size: 18px;
    font-weight: 700;
    color: #1C1C1E;
    padding: 0 16px 4px;
}

.billing-saved-cf {
    font-size: 15px;
    font-weight: 500;
    color: #3C3C43;
    padding: 0 16px 4px;
}

.billing-saved-address {
    font-size: 14px;
    color: #8E8E93;
    padding: 0 16px 14px;
}

.billing-saved-edit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 0.5px solid #E5E5EA;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.billing-saved-edit:active {
    background: #F2F2F7;
}

.billing-saved-edit span {
    font-size: 15px;
    font-weight: 500;
    color: #2C7F44;
}

.billing-saved-edit svg {
    width: 16px;
    height: 16px;
    color: #C7C7CC;
}

/* Tabs Privato/Azienda */
.billing-tabs {
    display: flex;
    margin: 16px;
    background: #E5E5EA;
    border-radius: 8px;
    padding: 2px;
}

.billing-tab {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: #3C3C43;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
}

.billing-tab.active {
    background: #fff;
    color: #2C7F44;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ============================================
   STORICO ACQUISTI
   ============================================ */

.storico-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--green-dark);
    flex-shrink: 0;
}

.storico-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.storico-date-range svg {
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,0.7);
}

.storico-filter-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
}

.storico-filter-icon:active {
    background: rgba(255,255,255,0.25);
}

.storico-filter-icon svg {
    width: 18px;
    height: 18px;
}

.storico-list {
    padding: 0;
    background: #fff;
}

.storico-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8E8E93;
    font-size: 15px;
}

.order-card {
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 16px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
    border-bottom: 0.5px solid #E5E5EA;
}

.order-card:active {
    background: #F9F9F9;
}

.order-card-icon {
    width: 42px;
    height: 42px;
    background: #EFEFF4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-card-icon svg {
    width: 30px;
    height: 30px;
}

.order-card-ticket-icon {
    display: block;
}

.order-card-info {
    flex: 1;
    min-width: 0;
}

.order-card-id {
    font-size: 15px;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-card-date {
    font-size: 13px;
    color: var(--gray-label);
    margin-bottom: 8px;
}

.order-card-items {
    font-size: 13px;
    color: var(--gray-label);
    margin-bottom: 8px;
}

.order-card-status {
    font-size: 12px;
    font-weight: 400;
    color: var(--green-text);
}

.order-card-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.order-card-price {
    font-size: 17px;
    color: #62A76C;
    line-height: 1;
}

.order-card-chevron {
    color: #727272;
    display: flex;
    align-items: center;
}

.order-card-chevron svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   DETTAGLIO ORDINE
   ============================================ */

.order-detail-section {
    padding: 20px 16px;
}

.order-detail-id {
    font-size: 15px;
    font-weight: 700;
    color: #1C1C1E;
    margin-bottom: 8px;
}

.order-detail-date {
    font-size: 14px;
    color: var(--gray-label);
    margin-bottom: 8px;
}

.order-detail-payment {
    font-size: 14px;
    color: var(--gray-label);
    margin-bottom: 10px;
}

.order-detail-payment strong {
    font-weight: 600;
    color: #666666;
    font-size: 15px;
}

.order-detail-badge {
    display: inline-block;
    background: #e0f0e1;
    color: var(--green-text);
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.order-detail-items-title {
    font-size: 12px;
    font-weight: 500;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.order-detail-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #afa9a9;
}

.order-detail-item-desc {
    flex: 1;
}

.order-detail-item-name {
    font-size: 16px;
    color: #666666;
    margin-bottom: 2px;
}

.order-detail-item-zone {
    font-size: 13px;
    color: #666666;
}

.order-detail-item-price {
    font-size: 16px;
    font-weight: 500;
    color: #666666;
    flex-shrink: 0;
}

.order-detail-total {
    display: flex;
    justify-content: flex-end;
    padding: 14px 0;
    font-size: 18px;
    font-weight: 500;
    color: #666666;
}

.order-detail-actions {
    padding: 0 16px 20px;
}

.order-detail-receipt-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 1.5px solid #2C7F44;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    color: #2C7F44;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.15s;
}

.order-detail-receipt-btn:active {
    opacity: 0.7;
}

.order-detail-receipt-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   RICEVUTA (Invoice/Receipt)
   ============================================ */

.receipt-container {
    background: #f1f1f1;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.receipt-paper {
    background: #fff;
    width: min(100%, 762px);
    aspect-ratio: 210 / 297;
    padding: 52px 56px 44px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #111;
    line-height: 1.4;
    box-sizing: border-box;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.18);
}

/* Header */
.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.receipt-logo-image {
    width: 195px;
    max-width: 42%;
    height: auto;
    display: block;
}

.receipt-company-info {
    font-size: 11px;
    line-height: 1;
    color: var(--text-secondary);
    text-align: left;
}

/* Unified main table (intestatario + meta + inoltro) */
.receipt-main-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 22px;
    table-layout: fixed;
    font-size: 12px;
    margin-top: 20px;
    border: 0;
}

.receipt-main-table td {
    padding: 6px 8px;
    text-align: left;
    color: #111;
    vertical-align: top;
    font-size: 12px;
    line-height: 1.4;
    border: 0;
    border-top: 1px solid #e3e3e3;
    border-left: 1px solid #e3e3e3;
}

.receipt-main-table td:last-child {
    border-right: 1px solid #e3e3e3;
}

.receipt-main-table tr:last-child td {
    border-bottom: 1px solid #e3e3e3;
}

.receipt-main-table td.r-invis {
    border: none;
    padding: 4px 0;
}

.receipt-main-table strong {
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

/* Items table */
.receipt-items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 12px;
    border: 0;
}

.receipt-items-table th,
.receipt-items-table td {
    padding: 6px 8px;
    text-align: left;
    color: #111;
    border: 0;
    border-top: 1px solid #e3e3e3;
    border-left: 1px solid #e3e3e3;
    vertical-align: top;
    font-size: 12px;
    line-height: 1.4;
}

.receipt-items-table tr > *:last-child {
    border-right: 1px solid #e3e3e3;
}

.receipt-items-table tr:last-child > * {
    border-bottom: 1px solid #e3e3e3;
}

/* Merge effect for first two columns across last item row + total row */
.receipt-items-table tr:nth-last-child(2) td:nth-child(-n+2) {
    border-bottom: 0;
}

.receipt-items-table .receipt-total-row td.total-empty {
    border-top: 1px solid #e3e3e3;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
}

.receipt-items-table th {
    font-weight: 700;
}

.receipt-items-table .text-right {
    text-align: center;
}

.receipt-total-row td.total-label,
.receipt-total-row td.total-amount {
    font-weight: 500!important;
    text-align: center;
}

/* Column widths */
.receipt-main-table col:nth-child(1) { width: 17%; }
.receipt-main-table col:nth-child(2) { width: 15%; }
.receipt-main-table col:nth-child(3) { width: 21%; }
.receipt-main-table col:nth-child(4) { width: 19%; }
.receipt-main-table col:nth-child(5) { width: 28%; }

.receipt-items-table th:nth-child(1),
.receipt-items-table td:nth-child(1) { width: 16%; }
.receipt-items-table th:nth-child(2),
.receipt-items-table td:nth-child(2) { width: 44%; }
.receipt-items-table th:nth-child(3),
.receipt-items-table td:nth-child(3) { width: 12%; }
.receipt-items-table th:nth-child(4),
.receipt-items-table td:nth-child(4) { width: 14%; }
.receipt-items-table th:nth-child(5),
.receipt-items-table td:nth-child(5) { width: 14%; }

@media (max-width: 767px) {
    .receipt-container {
        padding: 14px 3px 20px;
    }

    .receipt-paper {
        padding: 30px 30px;
    }

    .receipt-header {
        margin-bottom: 14px;
    }

    .receipt-logo-image {
        width: 105px;
    }

    .receipt-company-info {
        font-size: 8px;
    }

    .receipt-main-table td,
    .receipt-items-table th,
    .receipt-items-table td {
        font-size: 7px;
        padding: 4px 3px;
    }

    .receipt-main-table {
        margin-bottom: 22px;
    }
}

.receipt-share-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid #E5E5EA;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1C1C1E;
}

.receipt-share-btn:active {
    background: #F2F2F7;
}

.receipt-share-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   AGGIORNA SCREEN
   ============================================ */

.aggiorna-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px;
    text-align: center;
}

.aggiorna-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.aggiorna-icon svg {
    width: 40px;
    height: 40px;
    color: #2C7F44;
}

.aggiorna-title {
    font-size: 22px;
    font-weight: 700;
    color: #1C1C1E;
    margin-bottom: 8px;
}

.aggiorna-version {
    font-size: 15px;
    color: #8E8E93;
    margin-bottom: 24px;
}

.aggiorna-status {
    font-size: 15px;
    color: #2C7F44;
    font-weight: 500;
    margin-bottom: 24px;
}

.aggiorna-btn {
    padding: 14px 40px;
    background: #6CAC6A;
    color: #fff;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.aggiorna-btn:active {
    opacity: 0.7;
}

/* ============================================
   ELIMINA DATI MODAL
   ============================================ */

.delete-data-warning {
    color: #D32F2F;
    font-weight: 600;
}

/* ============================================
   BILLING REQUIRED MODAL
   ============================================ */

#billing-required-modal .modal-card {
    max-width: 340px;
}

/* ============================================
   CHANGELOG / NOTIFICHE
   ============================================ */

.changelog-date-divider {
    padding: 10px 16px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.changelog-item {
    background: #fff;
    border-radius: 12px;
    margin: 6px 16px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.changelog-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.changelog-emoji {
    font-size: 22px;
    line-height: 1.2;
    flex-shrink: 0;
}

.changelog-item-title-wrap {
    flex: 1;
    min-width: 0;
}

.changelog-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1C1C1E;
    display: block;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.changelog-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    color: #8E8E93;
}

.changelog-sha {
    font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
    background: #F2F2F7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.changelog-dot {
    color: #C7C7CC;
}

.changelog-item-description {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0.5px solid #E5E5EA;
    font-size: 13px;
    color: #3C3C43;
    line-height: 1.5;
    word-wrap: break-word;
}

.changelog-empty,
.changelog-error {
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
    color: #8E8E93;
}

.changelog-error {
    color: #D32F2F;
}

/* ============================================
   STORICO EMPTY STATE
   ============================================ */

.storico-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 15px;
    color: #8E8E93;
}

/* ============================================
   BILLING TABS
   ============================================ */

.billing-tabs {
    display: flex;
    margin: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #E5E5EA;
}

.billing-tab {
    flex: 1;
    padding: 10px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #8E8E93;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

/* old billing-tab / icon-indigo removed */

/* ============================================
   BILLING HEADER TABS (green bar)
   ============================================ */

.billing-header-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px 12px;
    background: var(--green-dark);
    flex-shrink: 0;
}

.billing-header-tab {
    flex: 1;
    padding: 9px 0;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s;
}

.billing-header-tab:first-child {
    border-radius: 8px 0 0 8px;
}

.billing-header-tab:last-child {
    border-radius: 0 8px 8px 0;
}

.billing-header-tab.active {
    background: #fff;
    color: #2C7F44;
    font-weight: 600;
}

/* ============================================
   AUTOCOMPLETE DROPDOWN
   ============================================ */

.billing-autocomplete-field {
    position: relative;
}

.billing-autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.billing-autocomplete-dropdown.open {
    display: block;
}

.billing-ac-item {
    padding: 12px 16px;
    font-size: 15px;
    color: #1C1C1E;
    cursor: pointer;
    border-bottom: 0.5px solid #F2F2F7;
    -webkit-tap-highlight-color: transparent;
}

.billing-ac-item:active {
    background: #F2F2F7;
}

.billing-ac-item:last-child {
    border-bottom: none;
}

.billing-ac-item .ac-highlight {
    font-weight: 700;
    color: #2C7F44;
}

/* ============================================
   PROFILO UTENTE (sub-screen)
   ============================================ */

.profilo-utente-content {
    padding: 30px 16px;
}

.profilo-utente-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.profilo-utente-avatar-big {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #E8F5E9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profilo-utente-avatar-big svg {
    width: 50px;
    height: 50px;
}

.profilo-utente-fields {
    margin-bottom: 40px;
}

.profilo-utente-field {
    margin-bottom: 20px;
}

.profilo-utente-label {
    font-size: 12px;
    font-weight: 700;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.profilo-utente-value {
    padding: 14px 16px;
    background: #F2F2F7;
    border-radius: 10px;
    font-family: var(--font);
    font-size: 16px;
    color: #1C1C1E;
}

.profilo-delete-account-btn {
    width: 100%;
    padding: 16px;
    background: none;
    border: 1.5px solid #D32F2F;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    color: #D32F2F;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.15s;
}

.profilo-delete-account-btn:active {
    opacity: 0.7;
    background: #FFF5F5;
}

/* ============================================
   DATE FILTER MODAL
   ============================================ */

.modal-card-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px 0;
    max-height: 80vh;
    max-width: 100% !important;
    overflow-y: auto;
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.date-filter-title {
    font-size: 17px;
    font-weight: 600;
    color: #1C1C1E;
    text-align: center;
    margin-bottom: 20px;
}

/* Drum Picker Tabs */
.drum-tabs {
    display: flex;
    margin: 0 16px 16px;
    background: #E8E8ED;
    border-radius: 9px;
    padding: 2px;
}

.drum-tab {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #8E8E93;
    padding: 8px 0;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.drum-tab.active {
    background: var(--green-dark);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Drum Picker Container */
.drum-picker {
    position: relative;
    display: flex;
    height: 220px;
    margin: 0 16px 20px;
    overflow: hidden;
    border-radius: 12px;
}

.drum-highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 22px);
    height: 44px;
    background: rgba(44, 127, 68, 0.12);
    border-radius: 10px;
    pointer-events: none;
}

.drum-fade-top,
.drum-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 3;
    pointer-events: none;
}

.drum-fade-top {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
}

.drum-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
}

.drum-col {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 88px;
    padding-bottom: 88px;
    position: relative;
    z-index: 1;
}

.drum-col::-webkit-scrollbar {
    display: none;
}

.drum-item {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 500;
    color: #1C1C1E;
    scroll-snap-align: center;
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================
   FAQ
   ============================================ */

.faq-container {
    padding: 16px;
}

.faq-intro {
    font-size: 14px;
    color: #8E8E93;
    margin-bottom: 16px;
    padding: 0 4px;
}

.faq-item {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1C1C1E;
    line-height: 1.4;
}

.faq-question span {
    flex: 1;
}

.faq-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #C7C7CC;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: #2C7F44;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 16px;
    font-size: 14px;
    color: #3C3C43;
    line-height: 1.6;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 16px 16px;
}

/* ============================================
   DEVELOPER OPTIONS
   ============================================ */

.dev-container {
    padding: 16px;
}

.dev-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 10px;
    overflow: hidden;
}

.dev-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #1C1C1E;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dev-section-header .dev-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.dev-section.open .dev-section-header .dev-chevron {
    transform: rotate(180deg);
}

.dev-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.dev-section-body.open,
.dev-section.open .dev-section-body {
    max-height: 2000px;
}

.dev-section-body > * {
    padding: 0 16px;
}

.dev-section-body > *:last-child {
    padding-bottom: 16px;
}

.dev-badge {
    background: #E8F5E9;
    color: #2C7F44;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.dev-badge-red {
    background: #FFEBEE;
    color: #D32F2F;
}

.dev-storage-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 16px 16px !important;
}

.dev-storage-item {
    background: #F2F2F7;
    border-radius: 10px;
    overflow: hidden;
}

.dev-storage-key {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dev-storage-key-name {
    font-size: 13px;
    font-weight: 600;
    color: #585DA4;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    word-break: break-all;
}

.dev-storage-key-size {
    font-size: 11px;
    color: #AEAEB2;
    flex-shrink: 0;
    margin-left: 8px;
}

.dev-storage-value {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dev-storage-item.open .dev-storage-value {
    max-height: 600px;
}

.dev-storage-value-inner {
    padding: 0 14px 12px;
    overflow-x: auto;
}

.dev-storage-value pre {
    font-size: 11px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    color: #3C3C43;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
}

.dev-info-list {
    padding: 0 16px 16px !important;
}

.dev-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 0.5px solid #E5E5EA;
    gap: 12px;
}

.dev-info-row:last-child {
    border-bottom: none;
}

.dev-info-label {
    font-size: 13px;
    color: #8E8E93;
    flex-shrink: 0;
}

.dev-info-value {
    font-size: 13px;
    color: #1C1C1E;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}

.dev-console {
    background: #1C1C1E;
    border-radius: 10px;
    padding: 12px !important;
    max-height: 300px;
    overflow-y: auto;
    min-height: 100px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.6;
    margin: 0 16px;
}

.dev-console-line {
    color: #fff;
    padding: 1px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.dev-console-line.warn {
    color: #FFD60A;
}

.dev-console-line.error {
    color: #FF453A;
}

.dev-console-line .dev-console-time {
    color: #8E8E93;
    margin-right: 6px;
}

.dev-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 10px 16px 10px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #F2F2F7;
    color: #1C1C1E;
    -webkit-tap-highlight-color: transparent;
}

.dev-action-btn.dev-action-green {
    background: #E8F5E9;
    color: #2C7F44;
}

.dev-action-btn.dev-action-blue {
    background: #E3F2FD;
    color: #1565C0;
    cursor: pointer;
}

.dev-action-btn.dev-action-red {
    background: #FFEBEE;
    color: #D32F2F;
}

.dev-reset-warning {
    font-size: 13px;
    color: #8E8E93;
    line-height: 1.5;
    padding: 0 16px;
}

.dev-import-area {
    margin-top: 6px;
}

/* ============================================
   DISCLAIMER
   ============================================ */

.disclaimer-container {
    padding: 24px 20px 40px;
}

.disclaimer-icon {
    text-align: center;
    margin-bottom: 12px;
}

.disclaimer-icon svg {
    width: 48px;
    height: 48px;
}

.disclaimer-title {
    font-size: 24px;
    font-weight: 700;
    color: #1C1C1E;
    text-align: center;
    margin-bottom: 24px;
}

.disclaimer-section {
    margin-bottom: 20px;
}

.disclaimer-section h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1C1C1E;
    margin: 0 0 6px;
}

.disclaimer-section p {
    font-size: 14px;
    color: #3C3C43;
    line-height: 1.6;
    margin: 0;
}

.disclaimer-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 0.5px solid #E5E5EA;
    margin-top: 24px;
}

.disclaimer-footer p {
    font-size: 12px;
    color: #AEAEB2;
    margin: 0;
}

/* ============================================
   STATISTICHE VIAGGIO
   ============================================ */

.stats-container {
    padding: 20px 16px 40px;
}

.stats-header {
    text-align: center;
    margin-bottom: 24px;
}

.stats-header-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.stats-header-icon svg {
    width: 32px;
    height: 32px;
}

.stats-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1C1C1E;
    margin: 0 0 4px;
}

.stats-header p {
    font-size: 14px;
    color: #8E8E93;
    margin: 0;
}

.stats-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stats-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 16px;
    text-align: center;
}

.stats-card-value {
    font-size: 28px;
    font-weight: 800;
    color: #2C7F44;
    line-height: 1.2;
}

.stats-card-label {
    font-size: 12px;
    color: #8E8E93;
    margin-top: 4px;
    font-weight: 500;
}

.stats-card.stats-card-wide {
    grid-column: 1 / -1;
}

.stats-card.stats-card-wide .stats-card-value {
    font-size: 32px;
}

.stats-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 10px;
}

.stats-zone-bar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 14px 16px;
    margin-bottom: 6px;
}

.stats-zone-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-zone-label {
    font-size: 13px;
    font-weight: 600;
    color: #1C1C1E;
    width: 36px;
    flex-shrink: 0;
}

.stats-zone-track {
    flex: 1;
    height: 8px;
    background: #F2F2F7;
    border-radius: 4px;
    overflow: hidden;
}

.stats-zone-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #62A76C, #2C7F44);
    transition: width 0.8s ease;
}

.stats-zone-count {
    font-size: 12px;
    color: #8E8E93;
    width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.stats-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8E8E93;
}

.stats-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.stats-empty p {
    font-size: 15px;
    margin: 0;
}

/* Stats eco cards */
.stats-eco-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 4px 0;
    margin-bottom: 10px;
}

.stats-eco-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
    border-bottom: 0.5px solid #F2F2F7;
}

.stats-eco-row:last-child {
    border-bottom: none;
}

.stats-eco-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.stats-eco-label {
    flex: 1;
    font-size: 14px;
    color: #1C1C1E;
}

.stats-eco-value {
    font-size: 14px;
    font-weight: 600;
    color: #1C1C1E;
    flex-shrink: 0;
}

.stats-eco-green {
    color: #2C7F44;
}

.stats-eco-highlight {
    background: #E8F5E9;
    border-radius: 0 0 14px 14px;
    border-bottom: none;
}

.stats-info-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 16px 4px;
    font-size: 11px;
    color: #AEAEB2;
    line-height: 1.5;
}

.stats-info-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.stats-settings-btn {
    display: block;
    width: 100%;
    background: #F2F2F7;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #585DA4;
    cursor: pointer;
    margin-top: 8px;
    -webkit-tap-highlight-color: transparent;
}

.stats-settings-form {
    padding: 4px 0 0;
}

.stats-settings-desc {
    font-size: 13px;
    color: #8E8E93;
    margin: 0 0 16px;
    line-height: 1.4;
}

.stats-settings-field {
    margin-bottom: 14px;
}

.stats-settings-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 4px;
}

.stats-settings-hint {
    font-size: 11px;
    color: #AEAEB2;
    margin-bottom: 6px;
    line-height: 1.4;
}

.stats-settings-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E5EA;
    border-radius: 10px;
    font-size: 15px;
    color: #1C1C1E;
    background: #F9F9F9;
    box-sizing: border-box;
    -webkit-appearance: none;
}

/* Footer repo link */
.profilo-footer-repo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8E8E93;
    text-decoration: none;
    margin-top: 8px;
}

.profilo-footer-repo:hover {
    color: #62A76C;
}

/* ============================================
   EXPIRY NOTIFICATION BANNER
   ============================================ */

.expiry-banner {
    position: fixed;
    top: calc(8px + var(--safe-top, 0px));
    left: 12px;
    right: 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    z-index: 10000;
    animation: expiry-slide-in 0.4s ease;
}

@keyframes expiry-slide-in {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.expiry-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.expiry-banner-text {
    flex: 1;
    font-size: 13px;
    color: #1C1C1E;
    line-height: 1.4;
}

.expiry-banner-text strong {
    font-weight: 700;
    color: #E37603;
}

.expiry-banner-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #AEAEB2;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   GUIDE STEP DEMOS (Animazioni interattive)
   ============================================ */

.home-step-demo {
    background: #F8F8FB;
    border-radius: 16px;
    padding: 20px 16px 12px;
    margin: -4px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.home-step-demo.visible {
    opacity: 1;
    transform: translateY(0);
}

.demo-phone {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 16px;
    width: 100%;
    max-width: 280px;
    overflow: hidden;
}

/* -- Demo: Billing form auto-fill -- */
.demo-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #F2F2F7;
}

.demo-label {
    font-size: 11px;
    color: #8E8E93;
    font-weight: 600;
    text-transform: uppercase;
}

.demo-value {
    font-size: 13px;
    color: #1C1C1E;
    font-weight: 500;
}

.demo-btn {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 10px;
}

.demo-btn-confirm {
    background: #E8F5E9;
    color: #2C7F44;
}

.demo-btn-generate {
    background: #2C7F44;
    color: #fff;
}

.demo-btn-tapgo {
    background: #E8F5E9;
    color: #2C7F44;
    font-size: 12px;
    padding: 6px 12px;
    display: inline-block;
    border-radius: 8px;
    margin-top: 6px;
}

.demo-btn-use {
    background: #2C7F44;
    color: #fff;
    padding: 8px 20px;
    display: inline-block;
    border-radius: 10px;
}

/* Typing animation — JS-driven typewriter */
.demo-type {
    min-width: 20px;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    transition: border-color 0.2s;
}

.demo-type.typing-active {
    border-right-color: #2C7F44;
    animation: demo-blink-caret 0.6s step-end infinite;
}

.demo-type.typing-done {
    border-right-color: transparent;
}

@keyframes demo-blink-caret {
    50% { border-color: transparent; }
}

/* Pulse animation */
.home-step-demo.visible .demo-pulse {
    animation: demo-pulse 1s ease 4.5s 2;
}

.home-step-demo.visible .demo-pulse-delay {
    animation: demo-pulse 1s ease 3s 2;
}

@keyframes demo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 4px 16px rgba(44,127,68,0.25); }
}

/* Press animation */
.home-step-demo.visible .demo-press {
    animation: demo-press 0.6s ease 2s 1;
}

@keyframes demo-press {
    0% { transform: scale(1); }
    40% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Tap animation */
.home-step-demo.visible .demo-tap-anim {
    animation: demo-tap 0.8s ease 1.5s 1;
}

@keyframes demo-tap {
    0% { transform: scale(1); }
    30% { transform: scale(0.92); background: #C8E6C9; }
    100% { transform: scale(1); }
}

/* -- Demo: Zone slider -- */
.demo-zones {
    text-align: center;
}

.demo-zone-badges {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.demo-zone-badge {
    background: #F2F2F7;
    color: #8E8E93;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
}

.demo-zone-badge.active {
    background: #2C7F44;
    color: #fff;
}

.demo-slider-track {
    position: relative;
    height: 6px;
    background: #E5E5EA;
    border-radius: 3px;
    margin: 8px 0;
}

.demo-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #2C7F44;
    border-radius: 3px;
    width: 20%;
    transition: width 0.8s ease;
}

.home-step-demo.visible .demo-slider-fill {
    animation: demo-slider-grow 3s ease-in-out infinite;
}

@keyframes demo-slider-grow {
    0%, 100% { width: 20%; }
    50% { width: 60%; }
}

.demo-slider-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #2C7F44;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.demo-slider-thumb-left {
    left: 0%;
}

.demo-slider-thumb-right {
    left: 20%;
}

.home-step-demo.visible .demo-slider-thumb-right {
    animation: demo-thumb-move 3s ease-in-out infinite;
}

@keyframes demo-thumb-move {
    0%, 100% { left: 20%; }
    50% { left: 60%; }
}

.demo-zone-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #AEAEB2;
    font-weight: 600;
}

/* -- Demo: Generate button -- */
.demo-generate {
    text-align: center;
}

.demo-ticket-preview {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #F8F8FB;
    border-radius: 8px;
    margin-bottom: 8px;
}

.demo-tp-zone {
    font-size: 13px;
    font-weight: 700;
    color: #2C7F44;
}

.demo-tp-price {
    font-size: 13px;
    font-weight: 600;
    color: #1C1C1E;
}

.demo-success-check {
    font-size: 28px;
    color: #2C7F44;
    opacity: 0;
    margin-top: 8px;
}

.home-step-demo.visible .demo-success-check {
    animation: demo-check-appear 0.5s ease 2.8s forwards;
}

@keyframes demo-check-appear {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* -- Demo: Tap & Go -- */
.demo-tapgo {
    text-align: center;
}

.demo-ticket-mini {
    background: #F8F8FB;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.demo-tm-status {
    font-size: 10px;
    font-weight: 700;
    color: #E37603;
    letter-spacing: 0.5px;
}

.demo-tm-zone {
    font-size: 16px;
    font-weight: 800;
    color: #1C1C1E;
    margin: 4px 0;
}

.demo-tapgo-confirm {
    opacity: 0;
    text-align: center;
    font-size: 13px;
    color: #3C3C43;
}

.home-step-demo.visible .demo-tapgo-confirm {
    animation: demo-fade-in 0.5s ease 2.5s forwards;
}

@keyframes demo-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -- Demo: QR Code -- */
.demo-qr {
    text-align: center;
}

.demo-qr-grid {
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    background:
        repeating-conic-gradient(#1C1C1E 0% 25%, transparent 0% 50%) 0 0 / 10px 10px;
    border-radius: 6px;
    opacity: 0;
}

.home-step-demo.visible .demo-qr-grid {
    animation: demo-qr-assemble 1.5s ease 0.5s forwards;
}

@keyframes demo-qr-assemble {
    0% { opacity: 0; transform: scale(0.6) rotate(-5deg); filter: blur(4px); }
    60% { opacity: 0.7; transform: scale(1.05) rotate(1deg); filter: blur(1px); }
    100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

.demo-qr-label {
    font-size: 11px;
    font-weight: 600;
    color: #2C7F44;
}

.demo-qr-timer {
    font-size: 20px;
    font-weight: 800;
    color: #1C1C1E;
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

/* ===== FLIP CARD 3D DEMO ===== */

.demo-flip-card {
    perspective: 600px;
    width: 100%;
}

.demo-flip-inner {
    position: relative;
    width: 100%;
    min-height: 180px;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.home-step-demo.visible .demo-flip-inner {
    transform: rotateY(180deg);
    transition-delay: 1s;
}

.demo-flip-front,
.demo-flip-back {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.demo-flip-front {
    background: linear-gradient(135deg, #585DA4 0%, #7B80C9 100%);
    color: #fff;
}

.demo-flip-back {
    background: #fff;
    transform: rotateY(180deg);
    text-align: center;
}

.demo-flip-status {
    font-size: 11px;
    font-weight: 700;
    color: #6BF09C;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.demo-flip-route {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
}

.demo-flip-type {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.demo-flip-price {
    font-size: 18px;
    font-weight: 700;
}

.demo-flip-hint {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 12px;
}

/* ============================================
   TUTORIAL INTERATTIVO (Modal Popup)
   ============================================ */

.tutorial-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: tutorialFadeIn 0.3s ease forwards;
}

@keyframes tutorialFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tutorial-modal-card {
    background: #fff;
    border-radius: 20px;
    max-width: 340px;
    width: 100%;
    padding: 28px 24px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: tutorialCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-align: center;
}

@keyframes tutorialCardIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tutorial-modal-step {
    font-size: 12px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.tutorial-modal-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.tutorial-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #1C1C1E;
    margin-bottom: 8px;
}

.tutorial-modal-text {
    font-size: 14px;
    color: #3C3C43;
    line-height: 1.55;
    margin-bottom: 20px;
}

.tutorial-modal-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 18px;
}

.tutorial-modal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #D1D1D6;
    transition: all 0.3s;
}

.tutorial-modal-dot.active {
    background: #2C7F44;
    width: 18px;
    border-radius: 4px;
}

.tutorial-modal-dot.done {
    background: #A8D5A2;
}

.tutorial-modal-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
    background: #2C7F44;
    color: #fff;
}

.tutorial-modal-btn:active {
    opacity: 0.7;
}

.tutorial-modal-skip {
    display: block;
    margin: 10px auto 0;
    background: none;
    border: none;
    color: #8E8E93;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    padding: 6px 12px;
    -webkit-tap-highlight-color: transparent;
}

.tutorial-modal-skip:active {
    color: #636366;
}

.tutorial-modal-overlay.tutorial-modal-out {
    animation: tutorialFadeOut 0.3s ease forwards;
}

@keyframes tutorialFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Welcome step animation */
.tutorial-welcome-icon {
    font-size: 52px;
    animation: tutorialWave 1.2s ease-in-out 0.3s 2;
    transform-origin: 70% 80%;
}

@keyframes tutorialWave {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-8deg); }
    45% { transform: rotate(14deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(10deg); }
    100% { transform: rotate(0deg); }
}

/* ============================================
   TUTORIAL CELEBRATION
   ============================================ */

.tutorial-celebration {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: tutorialFadeIn 0.4s ease forwards;
    overflow: hidden;
}

.celebration-content {
    text-align: center;
    animation: celebrationPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes celebrationPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

.celebration-emoji {
    font-size: 72px;
    animation: celebrationBounce 0.8s ease 0.4s 2;
}

@keyframes celebrationBounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
}

.celebration-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 12px 0 8px;
}

.celebration-text {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.celebration-out {
    animation: tutorialFadeOut 0.5s ease forwards;
}

/* Confetti particles */
.confetti-particle {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
    opacity: 0.9;
}

@keyframes confettiFall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   STATS HELP BUTTON
   ============================================ */

.stats-help-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #2C7F44;
    background: transparent;
    color: #2C7F44;
    font-size: 15px;
    font-weight: 800;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.stats-help-btn:active {
    background: #2C7F44;
    color: #fff;
}

.stats-header {
    position: relative;
}
