body {
    background:
        radial-gradient(circle at top left, rgba(0, 0, 0, 0.18) 0%, transparent 28%),
        radial-gradient(circle at top right, rgba(245, 197, 66, 0.10) 0%, transparent 24%),
        linear-gradient(180deg, #000 0%, #1a060b 45%, #0f0205 100%);
    color: #f8ecef;
}

.scenario-page {
    max-width: 1820px;
    margin: 0 auto;
    padding: 24px;
}

.scenario-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.scenario-topbar h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.05;
    color: #fff6f8;
    letter-spacing: 0.2px;
    font-family: 'DM Serif Display';
}

.scenario-subtitle {
    margin-top: 8px;
    font-size: 14px;
    color: #d2b1ba;
}

.scenario-season-form {
    background: rgba(33, 7, 14, 0.9);
    border: 1px solid rgba(149, 32, 65, 0.28);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    min-width: 280px;
}

.scenario-season-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #d0abb6;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.scenario-season-form-row {
    display: flex;
    gap: 10px;
}

.scenario-season-form select {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(149, 32, 65, 0.35);
    padding: 0 12px;
    font-size: 14px;
    background: rgba(22, 4, 9, 0.92);
    color: #fff3f6;
}

.scenario-actionbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .2px;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn-buy {
    background: linear-gradient(180deg, #2b6cff 0%, #1841a7 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(40, 87, 211, 0.28);
}

.btn-renewal {
    background: linear-gradient(180deg, #d6a632 0%, #9b6b10 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(165, 121, 24, 0.22);
}

.btn-sale {
    background: linear-gradient(180deg, #2ca86e 0%, #18734b 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(28, 132, 84, 0.24);
}

.btn-ghost {
    background: rgba(33, 7, 14, 0.9);
    color: #fff0f4;
    border-color: rgba(149, 32, 65, 0.28);
}

.money-panel {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 18px;
}

.money-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.money-col-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #d6b2bb;
    font-weight: 800;
}

.money-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
    color: #e9d3d8;
}

.money-row strong {
    font-size: 16px;
    font-weight: 800;
    color: #fff6f8;
    white-space: nowrap;
    font-family: 'Sarabun';
    letter-spacing: 0.5px;
}

td.op-name {
    font-family: 'DM Serif Display';
    font-size: 24px;
}

.money-row strong.positive { color: #73e6a6; }
.money-row strong.negative { color: #ff8fa8; }

.money-row--saldo {
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

.money-row--saldo strong {
    font-size: 22px;
}

.money-row--hero strong {
    font-size: 36px;
    line-height: 1;
}

.money-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d6a632;
    flex-shrink: 0;
}

@media (max-width: 760px) {
    .money-panel {
        flex-direction: column;
        gap: 14px;
    }
    .money-arrow svg {
        transform: rotate(90deg);
    }
    .money-row--hero strong {
        font-size: 30px;
    }
}
.scenario-details > summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.scenario-details > summary::-webkit-details-marker {
    display: none;
}

.scenario-details > summary::marker {
    display: none;
}

.scenario-details > summary h2 {
    margin: 0;
    font-size: 21px;
    color: #fff4f7;
}

.panel-gaming {
    background:
        linear-gradient(180deg, rgba(31, 7, 13, 0.96) 0%, rgba(24, 5, 10, 0.96) 100%);
    border-radius: 20px;
    border: 1px solid rgba(143, 30, 61, 0.24);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    padding: 20px;
        margin-bottom: 20px;
}

.panel-head {
    margin-bottom: 14px;
}

.panel-head h2 {
    margin: 0;
    font-size: 24px;
    color: #fff4f7;
    font-family: 'DM Serif Display';
}

.panel-subtitle {
    margin-top: 6px;
    color: #cda7b1;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(145, 34, 65, 0.24);
    border-radius: 16px;
    background: rgba(19, 4, 8, 0.52);
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.compact-table table {
    min-width: 760px;
}

th,
td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    white-space: nowrap;
    font-size: 13px;
    vertical-align: middle;
}

th {
    background: rgba(255,255,255,0.04);
    color: #f2d7de;
    text-transform: uppercase;
    letter-spacing: .35px;
    font-size: 12px;
}

td {
    color: #f8ecef;
}

th.num,
td.num {
    text-align: right;
}

.table-link {
    color: #ffdce4;
    text-decoration: none;
    font-weight: 700;
}

.table-link:hover {
    color: #fff;
    text-decoration: underline;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    background: rgba(106, 34, 171, 0.22);
    color: #d7bcff;
    font-weight: 700;
}

.pill.off {
    background: rgba(17, 110, 70, 0.22);
    color: #9af0c7;
}

.operation-type-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2px;
}

.operation-sale {
    background: rgba(46, 108, 255, 0.18);
    color: #b9d2ff;
}

.operation-buy {
    background: rgba(36, 168, 110, 0.18);
    color: #9cf3c8;
}

.operation-renewal {
    background: rgba(214, 166, 50, 0.18);
    color: #f4d37c;
}

.impact-positive {
    color: #78efae;
    font-weight: 800;
}

.impact-negative {
    color: #ff98ad;
    font-weight: 800;
}

.empty-row td {
    text-align: center;
    color: #c7a5ae;
    background: rgba(255,255,255,0.02);
}

.remove-op-btn {
    border: 0;
    background: rgba(255, 138, 162, 0.16);
    color: #ffc4d1;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.scenario-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 2, 4, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
    z-index: 1190;
    backdrop-filter: blur(3px);
}

.scenario-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.scenario-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(780px, calc(100vw - 32px));
    transform: translate(-50%, -50%) scale(.96);
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(180deg, rgba(32, 7, 13, 0.98) 0%, rgba(20, 4, 8, 0.98) 100%);
    border-radius: 22px;
    border: 1px solid rgba(167, 34, 70, 0.28);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    z-index: 1200;
    padding: 20px;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.scenario-modal.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.scenario-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.scenario-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #fff4f7;
}

.modal-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(150, 35, 67, 0.35);
    background: rgba(255,255,255,0.03);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.scenario-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field.field-full {
    grid-column: 1 / -1;
}

.field label {
    font-size: 12px;
    color: #d7b6be;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.field input,
.field select {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(149, 32, 65, 0.34);
    padding: 0 12px;
    font-size: 14px;
    background: rgba(19, 4, 8, 0.92);
    color: #fff3f6;
}

.readonly-box {
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(149, 32, 65, 0.26);
    background: rgba(255,255,255,0.04);
    font-size: 14px;
    color: #f8ecef;
}

.scenario-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.is-hidden {
    display: none;
}

@media (max-width: 1350px) {
    .scenario-scenarios-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .scenario-page {
        padding: 16px;
    }

    .scenario-form-grid {
        grid-template-columns: 1fr;
    }

    .scenario-topbar h1 {
        font-size: 30px;
    }

    .score-value {
        font-size: 28px;
    }
}
.expiry-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255,255,255,0.08);
    color: #f8ecef;
}

.expiry-badge.expiring {
    background: rgba(179, 32, 71, 0.22);
    color: #ffb3c4;
}

.sim-badge {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    border-radius: 999px;
    padding: 0;
    font-size: 10px;
    font-weight: 800;
    background: var(--rm-garnet-900);
    color: orange;
    font-family: 'Sarabun';
    height: 25px;
    width: 25px;
    justify-content: center;
    font-family: Oswald;
    font-size: 14px;
}

.sim-badge-renewal {
    background: rgba(214, 166, 50, 0.18);
    color: #f4d37c;
}

.sim-badge-sale {
    background: rgba(36, 168, 110, 0.18);
    color: #9cf3c8;
}
.op-detail-cell {
    white-space: normal;
    min-width: 320px;
}

.op-detail-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 2px 0;
}

.op-detail-line + .op-detail-line {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.op-detail-label {
    font-size: 12px;
    color: #d2aeb7;
    font-weight: 700;
}

.op-detail-value {
    font-size: 13px;
    color: #fff0f4;
    font-weight: 800;
    text-align: right;
    font-family: 'Sarabun';
}
.scenario-storage-bar {
    display: flex;
justify-content: flex-start;
    align-items: end;
    gap: 16px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.scenario-storage-left {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.field-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-inline label {
    font-size: 12px;
    color: #d7b6be;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.field-inline input {
    width: 320px;
    max-width: calc(100vw - 48px);
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(149, 32, 65, 0.34);
    padding: 0 12px;
    font-size: 14px;
    background: rgba(19, 4, 8, 0.92);
    color: #fff3f6;
}

.scenario-meta {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(149, 32, 65, 0.26);
    color: #f8ecef;
    font-size: 13px;
    font-weight: 700;
}

.scenario-storage-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.scenario-saved-panel {
    margin-bottom: 18px;
}

.scenario-scenarios-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
    align-items: start;
}

.scenario-community-panel {
    display: flex;
    flex-direction: column;
}

.scenario-community-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.community-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(149, 32, 65, 0.22);
}

.community-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-title {
    font-size: 13.5px;
    font-weight: 800;
    color: #fff4f7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-author {
    font-size: 12px;
    color: #c9a3ac;
}

.community-saldo {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.community-saldo.positive { color: #73e6a6; }
.community-saldo.negative { color: #ff8fa8; }

.community-empty {
    color: #c9a3ac;
    font-size: 13.5px;
    padding: 14px 4px;
    text-align: center;
    list-style: none;
}

.scenario-saved-list-wrap {
    overflow-x: auto;
    border: 1px solid rgba(145, 34, 65, 0.24);
    border-radius: 16px;
    background: rgba(19, 4, 8, 0.52);
}

.saved-scenario-title {
    font-weight: 800;
    color: #fff4f7;
}

.saved-scenario-action-btn {
    border: 0;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    background: rgba(46, 108, 255, 0.18);
    color: #b9d2ff;
}

.saved-scenario-action-btn:hover {
    filter: brightness(1.08);
}
.saved-scenario-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    background: rgba(214, 166, 50, 0.18);
    color: #f4d37c;
}

.saved-scenario-link-btn:hover {
    filter: brightness(1.08);
}
.scenario-top-actions {
    margin-top: 14px;
}

.scenario-lineup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #fff8f1;
    background: linear-gradient(135deg, #8f1438 0%, #641027 100%);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.scenario-lineup-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.scenario-lineup-btn.is-hidden {
    display: none;
}

.scenario-lineup-btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: .55;
}
.scenario-guest-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scenario-guest-title {
    font-weight: 700;
    font-size: 15px;
}

.scenario-guest-subtitle {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.82;
}

.scenario-actionbar-guest {
    align-items: stretch;
}
.community-panel-public-only {
    margin-top: 18px;
}

.community-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.community-item:last-child {
    border-bottom: 0;
}

.community-rank {
    font-weight: 700;
    opacity: 0.8;
}

.community-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.community-title {
    font-weight: 700;
}

.community-author {
    font-size: 13px;
    opacity: 0.75;
}

.community-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.community-load-btn {
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 760px) {
    .community-item {
        grid-template-columns: 28px 1fr;
    }

    .community-side {
        grid-column: 2;
        align-items: flex-start;
    }
}
.scenario-manager {
    margin-top: 18px;
}

.scenario-manager-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.scenario-manager-title {
    margin: 0 0 4px;
    font-size: 22px;
    line-height: 1.1;
}

.scenario-manager-subtitle {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.78;
}

.scenario-manager-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
    align-items: start;
}

.scenario-manager-grid--guest {
    grid-template-columns: 1fr;
}

.community-panel-public-only {
    min-width: 0;
}

@media (max-width: 980px) {
    .scenario-manager-grid {
        grid-template-columns: 1fr;
    }
}

.community-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.community-item:last-child {
    border-bottom: 0;
}

.community-rank {
    font-weight: 700;
    font-size: 14px;
    opacity: 0.78;
}

.community-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.community-title {
    font-weight: 700;
    line-height: 1.3;
}

.community-author {
    font-size: 13px;
    opacity: 0.72;
}

.community-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.community-load-btn {
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 760px) {
    .community-item {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .community-side {
        grid-column: 2;
        align-items: flex-start;
    }
}

 /* ===== CLASSIFICA COMMUNITY PUBLIC ===== */

.community-panel-public-only,
.community-panel {
    padding: 28px;
    border-radius: 28px;
}

.community-panel-public-only .panel-head,
.community-panel .panel-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    margin-bottom: 22px;
}

.community-panel-public-only .panel-head h2,
.community-panel .panel-head h2 {
    margin: 0;
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.community-panel-public-only .panel-subtitle,
.community-panel .panel-subtitle {
    font-size: 15px;
    line-height: 1.45;
    opacity: 0.82;
    max-width: 760px;
}

.community-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.community-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.community-item:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
}

.community-rank {
    width: 30px;
    height: 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.community-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-title {
    font-size: 16px;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.community-author {
    font-size: 15px;
    line-height: 1.2;
    opacity: 0.68;
    margin: 0;
}

.community-side {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.community-saldo {
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.community-saldo.positive {
    color: #6ef0b1;
}

.community-saldo.negative {
    color: #ff8b9c;
}

.community-load-btn {
    min-width: 140px;
    height: 31px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.community-load-btn:hover {
    background: rgba(255,255,255,0.11);
    border-color: rgba(255,255,255,0.2);
}

.community-load-btn:active {
    transform: scale(0.98);
}

.community-empty {
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    opacity: 0.72;
}

/* ===== MOBILE ===== */

@media (max-width: 900px) {
    .community-panel-public-only,
    .community-panel {
        padding: 20px;
        border-radius: 22px;
    }

    .community-panel-public-only .panel-head h2,
    .community-panel .panel-head h2 {
        font-size: clamp(24px, 7vw, 36px);
    }

    .community-item {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 14px;
        padding: 18px;
    }

    .community-rank {
        width: 46px;
        height: 46px;
        font-size: 22px;
        border-radius: 14px;
    }

    .community-title {
        font-size: 20px;
    }

    .community-side {
        grid-column: 2;
        min-width: 0;
        align-items: flex-start;
        gap: 10px;
    }

    .community-saldo {
        font-size: 20px;
    }

    .community-load-btn {
        min-width: 0;
        width: 100%;
    }
}
span.sim-badge-rinnovo {
    font-family: 'Sarabun';
    font-size: 10px;
    margin-left: 10px;
    background: var(--rm-garnet-900);
    padding: 2px 8px 3px;
    color: orange;
}
.community-ops-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.community-ops-total {
    font-size: 13px;
    line-height: 1.2;
    opacity: 0.9;
}
.community-ops-total strong {
    font-weight: 800;
}
.community-ops-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.community-ops-breakdown {
    font-size: 12px;
    opacity: 0.78;
}
.scenario-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 20px;
    justify-content: space-between;
}

.scenario-section-btn {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.86);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
    flex:1;
}

.scenario-section-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.16);
    color: #fff;
}

.scenario-section-btn.is-active {
    background: linear-gradient(180deg, var(--rm-garnet-900), #2a0710);
    border-color:  #2a0710;
    color: orange;
    box-shadow: 0 8px 24px  #2a0710;
}

.scenario-switch-panel {
    display: none;
}

.scenario-switch-panel.is-active {
    display: block;
    position:relative;
}
.operations-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.operations-column {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
    border-radius: 22px;
    padding: 18px;
    min-width: 0;
}

.operations-column-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.operations-column-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.operations-column-title-wrap h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
}

.operations-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    font-size: 13px;
    font-weight: 800;
}

.operations-column-saldo {
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.operations-column-saldo.positive {
    color: #6ef0b1;
}

.operations-column-saldo.negative {
    color: #ff8b9c;
}

.operations-column-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operation-card {
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 14px;
}

.operation-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.operation-card-name {
    font-weight: 800;
    font-size: 16px;
}

.operation-card-role {
    font-size: 12px;
    opacity: 0.75;
}

.operation-card-impact {
    font-weight: 800;
    white-space: nowrap;
}

.operation-card-impact.positive {
    color: #6ef0b1;
}

.operation-card-impact.negative {
    color: #ff8b9c;
}

.operation-card-detail {
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.82;
}

.operation-card-remove {
    margin-top: 10px;
}

@media (max-width: 1100px) {
    .operations-board {
        grid-template-columns: 1fr;
    }
}
.operations-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.operations-column {
    border-radius: 22px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.operations-column-buy {
    background:
        linear-gradient(180deg, rgba(84, 22, 36, 0.92), rgba(52, 10, 20, 0.94));
    border-color: rgba(255, 120, 150, 0.18);
}

.operations-column-renewal {
    background:
        linear-gradient(180deg, rgba(70, 46, 14, 0.92), rgba(48, 30, 9, 0.94));
    border-color: rgba(255, 210, 90, 0.18);
}

.operations-column-sale {
    background:
        linear-gradient(180deg, rgba(17, 58, 36, 0.92), rgba(10, 38, 23, 0.94));
    border-color: rgba(90, 255, 170, 0.18);
}

.operations-column-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.operations-column-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.operations-column-title-wrap h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1;
}

.operations-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.operations-column-saldo {
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
}

.operations-column-saldo.positive {
    color: #72f2b0;
}

.operations-column-saldo.negative {
    color: #ff97a8;
}

.operations-column-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.operation-card {
    border-radius: 18px;
    padding: 16px 16px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    box-shadow: 0 6px 18px rgba(0,0,0,0.16);
}

.operation-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}

.operation-card-player {
    min-width: 0;
}

.operation-card-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.operation-card-name {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    font-family: 'DM Serif Display';
}

.operation-card-impact {
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
}

.operation-card-impact.positive {
    color: #72f2b0;
}

.operation-card-impact.negative {
    color: #ff97a8;
}

/* .operation-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
}

.role-badge-por {
    background: linear-gradient(180deg, #4aa3ff, #266dd3);
}

.role-badge-dif {
    background: linear-gradient(180deg, #33c28a, #14865d);
}

.role-badge-est {
    background: linear-gradient(180deg, #eaa743, #bf7410);
}

.role-badge-cen {
    background: linear-gradient(180deg, #9a7bff, #6c47d8);
}

.role-badge-att {
    background: linear-gradient(180deg, #ff7a7a, #d74242);
} */

.operation-card-subrole {
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.78;
}

.operation-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.op-detail-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.op-detail-line:last-child {
    border-bottom: 0;
}

.op-detail-label {
    font-size: 12px;
    color: rgba(255,255,255,0.68);
}

.op-detail-value {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-align: right;
}

.operation-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.operation-action-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.operation-action-btn:hover {
    background: rgba(255,255,255,0.12);
}

.operation-action-btn.is-edit {
    border-color: rgba(79, 143, 255, 0.26);
    background: rgba(79, 143, 255, 0.14);
}

.operation-action-btn.is-remove {
    border-color: rgba(255, 115, 140, 0.22);
    background: rgba(255, 115, 140, 0.12);
}

.operation-insert-card {
    margin-top: 4px;
    border: 1px dashed rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.03);
    border-radius: 18px;
    padding: 18px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: 0.18s ease;
}

.operation-insert-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.28);
    transform: translateY(-1px);
}

.operation-insert-plus {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    flex: 0 0 auto;
}

.operation-insert-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.operation-insert-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.operation-insert-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.66);
}

@media (max-width: 1100px) {
    .operations-board {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   OPERAZIONI: AZIONI NASCOSTE FINO ALL'HOVER
   ========================================================= */

.operation-card {
    position: relative;
}

.operation-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    max-height: 0;
    margin-top: 0;
    overflow: hidden;

    opacity: 0;
    transform: translateY(-5px);
    pointer-events: none;

    transition:
        max-height 0.2s ease,
        margin-top 0.2s ease,
        opacity 0.18s ease,
        transform 0.18s ease;
}

.operation-card:hover .operation-card-actions,
.operation-card:focus-within .operation-card-actions {
    max-height: 60px;
    margin-top: 12px;

    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.operation-action-btn {
    flex: 1 1 auto;
    min-width: 90px;
}

/*
 * Sui dispositivi touch non esiste un vero hover:
 * i pulsanti devono quindi restare visibili.
 */
@media (hover: none), (pointer: coarse) {
    .operation-card-actions {
        max-height: 60px;
        margin-top: 12px;

        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}


/* =========================================================
   OPERAZIONI: VISTA COMPATTA
   ========================================================= */

.operations-board.is-compact .operation-card {
    padding: 12px 14px;
    border-radius: 14px;
}

.operations-board.is-compact .operation-card-top {
    align-items: center;
    margin-bottom: 0;
}

.operations-board.is-compact .operation-card-grid {
    display: none;
}

.operations-board.is-compact .operation-card-name-row {
    gap: 7px;
}

.operations-board.is-compact .operation-card-name {
    font-size: 22px;
}

.operations-board.is-compact .operation-role-badge {
    height: 21px;
    min-width: 36px;
    padding: 0 8px;
    font-size: 10px;
}

.operations-board.is-compact .operation-card-impact {
    font-size: 14px;
}

.operations-board.is-compact .operations-column-body {
    gap: 8px;
}

/* Anche il pulsante di inserimento diventa più compatto */
.operations-board.is-compact .operation-insert-card {
    padding: 10px 12px;
    border-radius: 14px;
}

.operations-board.is-compact .operation-insert-plus {
    width: 36px;
    height: 36px;
    font-size: 22px;
}

.operations-board.is-compact .operation-insert-subtitle {
    display: none;
}

/* Pulsante cambio vista */

.operations-view-toggle {
    margin-top: 14px;
    padding: 9px 14px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.05);
    color: #fff;

    font: inherit;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.operations-view-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.operations-view-toggle:active {
    transform: scale(0.98);
}

.operations-view-toggle[aria-pressed="true"] {
    background: rgba(78, 128, 255, 0.16);
    border-color: rgba(78, 128, 255, 0.36);
}
/* =========================================================
   INPUT MONETARI
   ========================================================= */

.currency-input-wrap {
    position: relative;
    width: 100%;
}

.currency-input-wrap .js-currency-input {
    width: 100%;
    padding-right: 54px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.currency-input-symbol {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);

    color: rgba(255, 255, 255, 0.72);
    font-size: 16px;
    font-weight: 800;

    pointer-events: none;
    user-select: none;
}

.currency-input-wrap:focus-within .currency-input-symbol {
    color: #fff;
}
/* =========================================================
   OPERAZIONI UFFICIALI / SIMULATE
   ========================================================= */

.operation-card.is-official {
    border-left: 3px solid rgba(77, 155, 255, 0.85);
    background:
        linear-gradient(
            135deg,
            rgba(47, 107, 190, 0.11),
            rgba(255, 255, 255, 0.035)
        );
}

.operation-card.is-simulated {
    border-left: 3px solid rgba(230, 180, 58, 0.72);
}

.operation-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 22px;
    padding: 3px 8px;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.06em;
    line-height: 1;
}

.operation-source-badge.is-official {
    color: #a9ceff;
    background: rgba(67, 137, 235, 0.14);
    border: 1px solid rgba(89, 158, 255, 0.28);
}

.operation-source-badge.is-simulated {
    color: #f2cf68;
    background: rgba(220, 168, 34, 0.12);
    border: 1px solid rgba(229, 178, 45, 0.25);
}

.operation-override-badge {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 8px;

    border-radius: 999px;

    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.operation-card.is-overridden {
    opacity: 0.58;
}

.operation-card.is-overridden:hover {
    opacity: 0.82;
}

/*
 * Nella visualizzazione compatta restano solamente
 * nome, ruolo e saldo, come richiesto.
 */
.operations-board.is-compact .operation-source-badge,
.operations-board.is-compact .operation-override-badge {
    display: none;
}

.operations-board.is-compact
.operation-card.is-overridden
.operation-card-name::after {
    content: " · sostituita";
    margin-left: 6px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.52);
}
