* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f6f8;
    margin: 0;
    padding: 0;
    color: #222;
}
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}
header {
    text-align: center;
    margin-bottom: 24px;
}
header h1 {
    margin: 0;
    font-size: 28px;
    color: #1a237e;
}
header p {
    margin: 6px 0 0;
    color: #555;
}
.form-section, .leads-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
h2 {
    margin-top: 0;
    font-size: 20px;
    color: #333;
}
label {
    display: block;
    margin-top: 14px;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}
input[type="text"], input[type="email"], input[type="date"], textarea, input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
textarea { resize: vertical; }
.camera-area {
    background: #fafafa;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    margin-top: 8px;
}
video, img#preview {
    width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: cover;
    background: #000;
}
.camera-buttons {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
/* Snap ready — glowing blue when browser camera is live */
#btnSnap.btn-snap-ready,
.btn-snap-ready {
    background: linear-gradient(145deg, #3b82f6, #1d4ed8) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.5),
        0 0 14px rgba(59, 130, 246, 0.8),
        0 0 28px rgba(37, 99, 235, 0.45);
    animation: snapGlowBlue 1.4s ease-in-out infinite;
    transform: scale(1.04);
}
#btnSnap.btn-snap-ready:hover,
.btn-snap-ready:hover {
    background: linear-gradient(145deg, #60a5fa, #2563eb) !important;
    box-shadow:
        0 0 0 3px rgba(96, 165, 250, 0.6),
        0 0 20px rgba(59, 130, 246, 0.95),
        0 0 36px rgba(37, 99, 235, 0.55);
}
#btnSnap:disabled {
    opacity: 0.45;
    animation: none;
    box-shadow: none;
    transform: none;
}
@keyframes snapGlowBlue {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(59, 130, 246, 0.45),
            0 0 12px rgba(59, 130, 246, 0.6),
            0 0 22px rgba(37, 99, 235, 0.35);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(96, 165, 250, 0.7),
            0 0 22px rgba(59, 130, 246, 0.95),
            0 0 40px rgba(37, 99, 235, 0.55);
    }
}
[data-boost="1"] #btnSnap.btn-snap-ready,
[data-boost="1"] .btn-snap-ready {
    animation: none !important;
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.55),
        0 0 12px rgba(59, 130, 246, 0.65);
}
.hint {
    font-size: 13px;
    color: #666;
    margin: 10px 0 6px;
}
.photo-status {
    font-size: 14px;
    font-weight: 600;
    color: #dc3545;
    margin: 8px 0;
}
.photo-status.attached {
    color: #28a745;
}
.camera-error {
    font-size: 13px;
    color: #b00020;
    background: #fdecea;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 8px 0;
    text-align: left;
}
video {
    width: 100%;
    max-height: 320px;
    background: #000;
    border-radius: 8px;
    object-fit: cover;
}
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-submit, .btn-wipe {
    display: inline-block;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    margin: 4px 2px;
}
.btn-primary { background: #1a73e8; }
.btn-secondary { background: #6c757d; }
.btn-success { background: #28a745; }
.btn-danger { background: #dc3545; }
.btn-wipe { background: #e65100; }
.btn-wipe:hover { background: #bf360c; }

.disclaimer {
    background: linear-gradient(180deg, #fff8e1 0%, #fff3e0 100%);
    border: 2px solid #ef6c00;
    border-radius: 12px;
    padding: 16px 18px 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(239, 108, 0, 0.12);
}
.disclaimer-badge {
    display: inline-block;
    background: #e65100;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.disclaimer-lead {
    margin: 0 0 10px;
    font-size: 16px;
    color: #bf360c;
    line-height: 1.35;
}
.disclaimer-list {
    margin: 0 0 10px;
    padding-left: 1.15em;
    font-size: 13px;
    line-height: 1.5;
    color: #4e342e;
}
.disclaimer-list li {
    margin-bottom: 6px;
}
.disclaimer-en {
    margin: 0;
    padding-top: 8px;
    border-top: 1px dashed #ffcc80;
    font-size: 12px;
    color: #6d4c41;
    line-height: 1.45;
}

.mode-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.mode-section h2 { margin-top: 0; font-size: 18px; }
.mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 560px) {
    .mode-cards { grid-template-columns: 1fr; }
}
.mode-card {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
}
.mode-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.mode-keep { background: #e8f0fe; border: 1px solid #c5d8fc; }
.mode-wipe { background: #fff3e0; border: 1px solid #ffcc80; }
.hint-top { font-size: 13px; color: #555; margin: 0 0 12px; }
.disclaimer-foot {
    font-size: 12px;
    color: #6d4c41;
    background: #fff8e1;
    border-left: 3px solid #ef6c00;
    padding: 8px 10px;
    margin: 0 0 12px;
    border-radius: 0 8px 8px 0;
    line-height: 1.4;
}
.session-id {
    margin: 10px 0 0;
    font-size: 11px;
    color: #795548;
}
.session-id code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}
.lead-time {
    font-weight: 600;
    color: #37474f !important;
    font-variant-numeric: tabular-nums;
}
input[type="datetime-local"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
.net-status {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
}
.net-status.online {
    background: #e8f5e9;
    color: #1b5e20;
}
.net-status.offline {
    background: #fff3e0;
    color: #e65100;
}
.batch-actions button.btn-batch {
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
}
.leads-header { display: flex; align-items: center; gap: 10px; }
.leads-header h2 { margin: 0; }
.badge {
    display: inline-block;
    background: #1a237e;
    color: #fff;
    font-size: 13px;
    padding: 2px 10px;
    border-radius: 999px;
    vertical-align: middle;
}
.batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 16px;
}
.btn-batch {
    flex: 1 1 160px;
    text-align: center;
    padding: 14px 12px;
    font-weight: 600;
    font-size: 14px;
}
.btn-excel {
    display: inline-block;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    margin: 4px 2px;
    background: #0f766e;
}
.btn-excel:hover { background: #0d9488; }
.btn-excel-wipe {
    display: inline-block;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    color: #fff;
    margin: 4px 2px;
    background: #115e59;
}
.et-hide-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}
.btn-hide-section,
.btn-hide-disclaimer {
    border: 1px solid rgba(201, 162, 39, 0.45);
    background: rgba(15, 36, 58, 0.6);
    color: inherit;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-hide-section:hover,
.btn-hide-disclaimer:hover {
    filter: brightness(1.08);
}
#btnToggleHero {
    border-color: rgba(59, 130, 246, 0.5);
}
[data-theme="light"] .btn-hide-section,
[data-theme="light"] .btn-hide-disclaimer {
    background: #fff;
    border-color: rgba(15, 61, 104, 0.2);
    color: #0f3d68;
}
[data-theme="light"] #btnToggleHero {
    border-color: rgba(37, 99, 235, 0.35);
    color: #1d4ed8;
}
@media (max-width: 520px) {
    .et-hide-bar {
        justify-content: stretch;
    }
    .btn-hide-section,
    .btn-hide-disclaimer {
        flex: 1 1 auto;
        text-align: center;
        font-size: 12px;
        padding: 8px 10px;
    }
}
.disclaimer-block.hidden,
.disclaimer-block[hidden] {
    display: none !important;
}
.btn-camera {
    display: block;
    background: #28a745;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    padding: 16px 20px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 12px;
}
.btn-submit {
    width: 100%;
    background: #1a237e;
    margin-top: 20px;
    font-size: 17px;
    font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.leads-list { display: flex; flex-direction: column; gap: 12px; }
.lead-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.lead-info { display: flex; flex-direction: column; }
.lead-info strong { font-size: 16px; color: #1a237e; }
.lead-info span { font-size: 13px; color: #666; margin-top: 3px; }
.lead-info .has-photo { color: #28a745; font-weight: 600; }
.lead-info .no-photo { color: #999; }
.btn-small { padding: 8px 12px; font-size: 13px; }
.empty { color: #777; text-align: center; }
@media (max-width: 480px) {
    .container { padding: 12px; }
    header h1 { font-size: 24px; }
    .lead-card { flex-direction: column; align-items: flex-start; }
    .lead-actions { width: 100%; display: flex; flex-wrap: wrap; }
}
