.marlat-scanner-wrap,
.marlat-scanner-wrap * {
    box-sizing: border-box;
}

.marlat-scanner-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 10px;
    font-family: Arial, sans-serif;
    color: #f5f5f5;
}

.marlat-box {
    background: #111;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.marlat-box h2 {
    color: #ffffff;
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 20px;
    line-height: 1.2;
}

#reader {
    width: 100%;
    min-height: 320px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

#reader video {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 420px !important;
    object-fit: contain !important;
    border-radius: 12px;
}

#reader__scan_region,
#reader__dashboard {
    border-radius: 12px;
}

#reader__dashboard_section_csr button,
#reader button {
    background: #f5c542 !important;
    color: #111 !important;
    border-radius: 8px !important;
    border: 0 !important;
    padding: 8px 12px !important;
    font-weight: bold !important;
}

#ticket-result {
    min-height: 180px;
}

.searching {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    font-size: 23px;
    font-weight: bold;
    color: #f5c542;
    animation: marlatPulseText 1s infinite ease-in-out;
}

@keyframes marlatPulseText {
    0% { opacity: 0.35; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.35; transform: scale(0.98); }
}

.valid {
    background: #103d22;
    color: #38e678;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 24px;
    text-align: center;
    margin: 0 0 8px 0;
}

.used {
    background: #471111;
    color: #ff5b5b;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 24px;
    text-align: center;
    margin: 0 0 8px 0;
}

.error {
    background: #471111;
    color: #ffb3b3;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    text-align: center;
    margin: 0 0 8px 0;
}

.ticket-row {
    background: #1b1b1b;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    padding: 9px 10px;
    margin-bottom: 7px;
    color: #eaeaea;
    line-height: 1.25;
    word-break: break-word;
}

.ticket-row strong {
    color: #ffffff;
}

.priority-info {
    font-size: 16px;
}

.extra-info {
    margin-top: 8px;
}

.marlat-main-button {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: #f5c542;
    color: #111;
    font-size: 17px;
    font-weight: bold;
    margin: 5px 0 8px 0;
}

.marlat-main-button:hover {
    background: #ffd95f;
}

.marlat-scan-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: #c8c8c8;
    text-align: center;
    line-height: 1.35;
}

.marlat-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.marlat-secondary-button,
.marlat-file-button {
    flex: 1 1 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1b1b1b;
    color: #f5c542;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}

.marlat-file-button input {
    display: none;
}

.manual-box {
    margin-top: 10px;
    border-top: 1px solid #333;
    padding-top: 10px;
}

.manual-box summary {
    cursor: pointer;
    color: #f5c542;
    font-weight: bold;
}

.manual-box input {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #050505;
    color: #fff;
}

.marlat-points-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    border: 1px solid #333;
}

.marlat-points-box h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 18px;
}

.marlat-points-box input {
    width: 100%;
    max-width: 260px;
    padding: 10px;
    margin: 8px 8px 8px 0;
    border-radius: 8px;
    border: 1px solid #333;
    background: #fff;
    color: #111;
}

.marlat-points-button {
    background: #f5c400;
    color: #000;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.marlat-points-message {
    margin: 8px 0 0 0;
    font-weight: bold;
    color: #f5c542;
}

@media (max-width: 800px) {
    .marlat-scanner-wrap {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 4px auto;
        padding: 0 6px;
    }

    .marlat-box {
        padding: 9px;
        border-radius: 12px;
    }

    .marlat-box h2 {
        font-size: 15px;
        margin-bottom: 5px;
    }

    #reader {
        min-height: 280px;
    }

    #reader video {
        max-height: 360px !important;
        object-fit: contain !important;
    }

    #ticket-result {
        min-height: auto;
    }

    .searching {
        min-height: 70px;
        font-size: 20px;
    }

    .valid,
    .used {
        font-size: 19px;
        padding: 8px;
        margin-bottom: 5px;
    }

    .ticket-row {
        padding: 6px 8px;
        margin-bottom: 4px;
        font-size: 14px;
    }

    .priority-info {
        font-size: 15px;
    }

    .marlat-main-button {
        padding: 11px 12px;
        font-size: 16px;
        margin: 5px 0;
    }

    .extra-info {
        margin-top: 6px;
    }
}