:root { --primary: #1e293b; --accent: #2563eb; --safe: #22c55e; --warning: #f59e0b; --danger: #ef4444; }
        body { font-family: 'Sarabun', sans-serif; background-color: #f8fafc; margin: 0; padding: 0; }
        header { background: var(--primary); color: white; padding: 1.2rem; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
        main { display: flex; justify-content: center; padding: 2rem; gap: 2rem; flex-wrap: wrap; }
        .panel { background: white; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); width: 420px; }
        
        .counter-container { margin-bottom: 1.5rem; text-align: left; }
        .status-bar-bg { background: #e2e8f0; height: 6px; border-radius: 3px; margin-top: 5px; overflow: hidden; }
        #status-bar-fill { background: var(--safe); height: 100%; width: 0%; transition: 0.3s; }
        .counter-label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: bold; }

        #capture-area { background: white; padding: 40px; border-radius: 8px; text-align: center; border: 1px solid #f1f5f9; }
        #qrcode { position: relative; display: inline-block; padding: 15px; background: #fff; }
        #logo-preview { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 50px; height: 50px; background: white; padding: 3px; border-radius: 50%; display: none; z-index: 10; border: 1px solid #eee; }
        #qr-footer-text { margin-top: 20px; font-size: 1.25rem; font-weight: 800; color: #0f172a; }

        input, .btn { width: 100%; padding: 0.8rem; margin: 0.4rem 0; border-radius: 8px; border: 1px solid #cbd5e1; box-sizing: border-box; font-size: 1rem; transition: 0.2s; }
        .btn { cursor: pointer; font-weight: bold; border: none; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-primary:hover { transform: translateY(-1px); background: #1d4ed8; }
        .btn-group { display: flex; gap: 10px; margin-top: 10px; }
        .btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
        .btn-secondary:hover { background: #e2e8f0; }
/* เมื่อปุ่มถูก Disabled จะเปลี่ยนสีและเปลี่ยนเคอร์เซอร์ */
.btn:disabled {
    background-color: #cbd5e1 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
 footer {
            background: white;
            border-top: 1px solid #e2e8f0;
            padding: 1rem;
            text-align: center;
            color: #94a3b8;
            font-size: 0.8rem;
        }

        @media (max-width: 850px) {
            .container { grid-template-columns: 1fr; width: 100%; }
        }