﻿* {
            -moz-box-sizing: border-box;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: Arial, sans-serif;
            background: #0B1220;
            color: #E5EEF9;
            padding: 0;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
            -webkit-tap-highlight-color: transparent;
            line-height: 1.5;
        }

        #installPwaButton {
            display: none;
        }

        #installPwaButton.visible {
            display: flex;
        }

        #desaStartModal {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px 16px;
            background: rgba(3, 9, 18, 0.72);
            -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
            z-index: 50;
        }

        .thank-you-modal[hidden] {
            display: none;
        }

        .thank-you-modal {
            position: fixed;
            inset: 0;
            z-index: 2000;
            display: grid;
            place-items: center;
            padding: 24px 16px;
            background: rgba(10, 16, 12, 0.82);
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }

        .thank-you-card {
            width: min(100%, 440px);
            padding: 28px 24px;
            border: 1px solid #69775E;
            border-radius: 8px;
            background: #252D26;
            color: #E8EBDD;
            text-align: center;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
        }

        .thank-you-card .modal-logo {
            width: 64px;
            height: 78px;
            object-fit: contain;
        }

        .thank-you-card h2 {
            margin: 12px 0;
            color: #D6C68F;
            font-size: 24px;
        }

        .thank-you-card p {
            margin-bottom: 20px;
            color: #E8EBDD;
            font-size: 16px;
        }

        .thank-you-button {
            width: auto;
            min-width: 112px;
            margin: 0;
            padding: 10px 20px;
            border: 1px solid #78856B;
            border-radius: 4px;
            background: #46533F;
            color: #F2F3EC;
        }

        .thank-you-button:hover:not(:disabled) {
            background: #56634E;
        }

        .offline-modal[hidden] {
            display: none;
        }

        .offline-modal {
            position: fixed;
            inset: 0;
            z-index: 3000;
            display: grid;
            place-items: center;
            padding: 24px 16px;
            background: rgba(10, 16, 12, 0.82);
            -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
        }

        .offline-card {
            width: min(100%, 440px);
            padding: 28px 24px;
            border: 1px solid #69775E;
            border-radius: 8px;
            background: #252D26;
            color: #E8EBDD;
            text-align: center;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
        }

        .offline-card p {
            color: #E8EBDD;
            font-size: 16px;
        }

        .container {
            width: 100%;
            max-width: none;
            min-height: 100vh;
            margin: 0;
            background: #202923;
            padding: clamp(12px, 3vw, 28px);
            -moz-border-radius: 0;
            -webkit-border-radius: 0;
            border-radius: 0;
            -webkit-box-shadow: 0 12px 30px rgba(0,0,0,0.35);
            -moz-box-shadow: 0 12px 30px rgba(0,0,0,0.35);
            box-shadow: 0 12px 30px rgba(0,0,0,0.35);
            border: 0;
            border-top: 2px solid #465344;
            border-bottom: 2px solid #465344;
        }
        
        .header-container {
            display: block;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid #29466B;
            position: relative;
            overflow: hidden;
        }

        .header-image-full {
            display: block;
            width: 100%;
            max-width: 100%;
            height: auto;
            margin: 0 auto;
            object-fit: contain;
            border-radius: 10px;
        }

        .header-desa-label {
             position: absolute;
             right: 0;
             bottom: 24px;
             left: 0;
             overflow: hidden;
             color: #FFFFFF;
             font-size: clamp(24px, 4vw, 38px);
             line-height: 1.25;
             font-weight: 700;
             text-align: center;
             text-shadow:
                 0 0 2px #FFFFFF,
                 0 0 5px #FFFFFF,
                 0 2px 3px rgba(0, 0, 0, 0.95),
                 2px 0 3px rgba(0, 0, 0, 0.95),
                 -2px 0 3px rgba(0, 0, 0, 0.95),
                 0 -2px 3px rgba(0, 0, 0, 0.95);
         }

        .header-desa-marquee {
             width: max-content;
             min-width: max-content;
             text-align: left;
             animation: header-desa-slide 12s linear infinite;
         }

        @keyframes header-desa-slide {
             from { transform: translateX(100vw); }
             to { transform: translateX(-100%); }
         }


        @keyframes gentle-logo-float {
            0% {
                transform: translateY(0) scale(1);
                filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
            }
            50% {
                transform: translateY(-4px) scale(1.02);
                filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.3));
            }
            100% {
                transform: translateY(0) scale(1);
                filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
            }
        }

        .modal-logo {
            display: block;
            width: 122px;
            height: 152px;
            object-fit: contain;
            margin: 0 auto 14px;
            animation: gentle-logo-float 2.8s ease-in-out infinite;
            transform-origin: center;
            filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
        }

        #desaStartModal .modal-logo.coordinate-logo-hidden {
            animation: none;
            opacity: 0;
            filter: blur(8px) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
        }

        #desaStartModal .modal-logo.coordinate-logo-revealing {
            animation: none;
            opacity: 1;
            filter: blur(0) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
            -webkit-transition: opacity 1.2s ease, -webkit-filter 1.2s ease;
            transition: opacity 1.2s ease, filter 1.2s ease;
        }

        #printable-area {
            width: 100% !important;
            margin: 0 !important;
            padding: 0 5px;
            font-size: 12px;
        }

        #printable-table {
            width: 100%;
            border-collapse: collapse;
        }

        .status-icon {
            display: inline-block;
            width: 8px;
            height: 8px;
            margin-right: 5px;
            border-radius: 50%;
            vertical-align: middle;
        }

        .status-icon.connected {
            color: #22C55E;
        }

        .status-icon.disconnected {
            color: #F44336;
        }

        .status-icon.connecting {
            color: #FF9800;
        }
        
        label {
            display: block;
            margin-top: 15px;
            font-weight: bold;
            color: #E0EDFF;
        }

        #selectedDesaLabel {
            display: block;
            width: 100%;
            overflow: hidden;
            text-align: center;
            font-size: clamp(20px, 4vw, 28px);
            line-height: 1.25;
            font-weight: 700;
        }

        #selectedDesaLabel.marquee-active {
            display: block;
            width: max-content;
            min-width: 100%;
            text-align: left;
            animation: selected-desa-marquee 10s ease-in-out infinite alternate;
        }

        @keyframes selected-desa-marquee {
            from {
                transform: translateX(0);
            }
            to {
                transform: translateX(var(--marquee-distance));
            }
        }
        
        select, input, textarea {
            width: 100%;
            padding: 12px 18px;
            margin-top: 5px;
            -moz-border-radius: 0;
            -webkit-border-radius: 0;
            border-radius: 0;
            border: 1px solid #BFD5F1;
            background: linear-gradient(180deg, #FFFFFF 0%, #EEF6FF 100%);
            color: #172033;
            font-size: 16px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.06), 0 6px 16px rgba(34, 69, 109, 0.08);
        }

        #selectDesa {
            text-align: left;
            text-align-last: left;
            background: linear-gradient(135deg, #60A5FA 0%, #2563EB 55%, #1E3A8A 100%);
            color: #FFFFFF;
            border-color: #93C5FD;
            box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
        }

        #selectDesa option {
            background: #FFFFFF;
            color: #172033;
        }
        
        input[type="file"] {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        .file-picker-label {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 52px;
            margin-top: 5px;
            padding: 8px 12px;
            border: 1px solid #BFD5F1;
            -moz-border-radius: 999px;
            -webkit-border-radius: 999px;
            border-radius: 999px;
            background: linear-gradient(180deg, #FFFFFF 0%, #EEF6FF 100%);
            color: #172033;
            font-size: clamp(18px, 3vw, 28px);
            font-weight: 600;
            line-height: 1.2;
            text-align: center;
            overflow-wrap: anywhere;
            cursor: pointer;
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
        }

        .file-picker-label:hover {
            background: #E8F1FF;
        }


        .watermark-input {
            border-radius: 0;
            padding: 10px 18px;
        }
        
        textarea {
            min-height: 100px;
            height: 100px;
            resize: none;
            overflow-y: hidden;
            -moz-border-radius: 0;
            -webkit-border-radius: 0;
            border-radius: 0;
        }

        select:focus,
        input:focus,
        textarea:focus,
        .tanggal-input-kustom:focus-within {
            outline: none;
            border-color: #60A5FA;
            background: #E8F1FF;
            box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
        }

        select:active,
        input:active,
        textarea:active,
        .tanggal-input-kustom:active {
            background: #D6E8FF;
            border-color: #2563EB;
        }

        select,
        input,
        textarea,
        .tanggal-input-kustom {
            transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
        }
        
        button {
            margin-top: 20px;
            padding: 12px 15px;
            background: #2563EB;
            color: #FFFFFF;
            border: none;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            cursor: pointer;
            width: 100%;
            font-weight: bold;
            font-size: 16px;
            -webkit-transition: background-color 0.3s ease;
            transition: background-color 0.3s ease;
            -webkit-tap-highlight-color: transparent;
        }
        
        button:hover:not(:disabled) {
            background: #1D4ED8;
        }
        
        button:disabled {
            background: #64748B;
            cursor: not-allowed;
            opacity: 0.7;
        }

        button.is-processing {
            opacity: 0.45;
            filter: grayscale(0.35);
            cursor: wait;
            pointer-events: none;
        }
        
        canvas {
            display: none;
            margin-top: 20px;
            width: 100%;
            height: auto;
            border: 1px solid #29466B;
            background: #08111F;
            -webkit-tap-highlight-color: transparent;
        }
        
        .previewBox {
            font-size: 14px;
            color: #C4D3E6;
            margin-top: 5px;
            min-height: 1em;
            word-wrap: break-word;
        }

        .tanggal-input-kustom {
            position: relative;
            display: flex;
            align-items: stretch;
            width: 100%;
            min-height: 60px;
            height: 60px;
            margin-top: 0;
            cursor: pointer;
            border: 1px solid #BFD5F1;
            border-radius: 999px;
            background: linear-gradient(180deg, #FFFFFF 0%, #EEF6FF 100%);
            overflow: hidden;
            transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        }

        .waktu-input-kustom {
            position: relative;
            display: flex;
            align-items: stretch;
            flex: 1 1 0;
            min-width: 0;
            min-height: 60px;
            height: 60px;
            cursor: pointer;
            border: 1px solid #BFD5F1;
            -moz-border-radius: 0;
            -webkit-border-radius: 0;
            border-radius: 999px;
            background: linear-gradient(180deg, #FFFFFF 0%, #EEF6FF 100%);
            overflow: hidden;
            transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
        }

        #tanggalWaktuDisplay {
            display: none;
        }

        .date-picker-label {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 55px;
            margin-top: 0;
            padding: 10px 8px;
            border: 0;
            -moz-border-radius: inherit;
            -webkit-border-radius: inherit;
            border-radius: inherit;
            background: transparent;
            color: #172033;
            font-size: clamp(18px, 3vw, 28px);
            font-weight: 600;
            line-height: 1.2;
            text-align: center;
            overflow-wrap: anywhere;
            cursor: pointer;
            pointer-events: none;
        }

        .date-picker-trigger {
            position: relative;
            z-index: 1;
            display: flex;
            align-items: stretch;
            flex: 1 1 auto;
            width: 100%;
            min-height: 60px;
            height: 100%;
            margin: 0;
            padding: 0;
            border: 0;
            border-radius: inherit;
            background: transparent;
            color: inherit;
            line-height: normal;
        }

        .date-picker-trigger:hover:not(:disabled),
        .date-picker-trigger:focus-visible {
            background: transparent;
        }

        .image-input-group .file-picker-label {
            border-color: #A9BBAE;
            background: #E7EFE9;
            color: #34483A;
            transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }

        .image-input-group .file-picker-label:hover {
            border-color: #96AD9D;
            background: #DCE8DF;
        }

        .image-input-group .file-picker-label:active {
            border-color: #52755D;
            background: #9DB9A5;
            color: #1F3325;
            box-shadow: 0 0 0 3px rgba(82, 117, 93, 0.24);
            transform: scale(0.98);
        }

        .media-date-row .tanggal-input-kustom {
            border-color: #ACBAC9;
            background: #E7EDF3;
        }

        .media-date-row .tanggal-input-kustom:hover,
        .media-date-row .tanggal-input-kustom:focus-within {
            border-color: #96A8BA;
            background: #DCE5EE;
            box-shadow: 0 0 0 2px rgba(150, 168, 186, 0.22);
        }

        .media-date-row .tanggal-input-kustom:active {
            border-color: #56718A;
            background: #AFC3D6;
            box-shadow: 0 0 0 3px rgba(86, 113, 138, 0.25);
            transform: scale(0.98);
        }

        .media-date-row .tanggal-input-kustom .date-picker-label {
            color: #344656;
        }

        .media-date-row .tanggal-input-kustom:active .date-picker-label {
            color: #293A49;
        }

        .media-date-row .waktu-input-kustom {
            border-color: #C8B9A4;
            background: #F1ECE5;
        }

        .media-date-row .waktu-input-kustom:hover,
        .media-date-row .waktu-input-kustom:focus-within {
            border-color: #B7A68E;
            background: #E9E0D4;
            box-shadow: 0 0 0 2px rgba(183, 166, 142, 0.22);
        }

        .media-date-row .waktu-input-kustom:active {
            border-color: #8A6841;
            background: #D2B995;
            box-shadow: 0 0 0 3px rgba(138, 104, 65, 0.24);
            transform: scale(0.98);
        }

        .media-date-row .waktu-input-kustom .date-picker-label {
            color: #514638;
        }

        .media-date-row .waktu-input-kustom:active .date-picker-label {
            color: #40372D;
        }

        .date-time-modal {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(3, 9, 18, 0.86);
            z-index: 100;
        }

        .date-time-modal.is-open {
            display: flex;
        }

        .date-time-modal-card {
            width: min(100%, 560px);
            padding: 24px;
            border-radius: 18px;
            background: #173F70;
            border: 1px solid #5B8FCC;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
        }

        .date-time-modal-card h2 {
            margin-bottom: 18px;
            color: #FFFFFF;
            text-align: center;
            font-size: clamp(22px, 5vw, 32px);
        }

        .date-time-modal-card label {
            margin: 12px 0 4px;
            color: #DCEBFF;
            font-size: 16px;
        }

        .date-time-modal-card input {
            width: 100%;
            height: 58px;
            margin: 0;
            border-radius: 999px;
            font-size: 20px;
        }

        .date-time-modal-card button {
            margin-top: 22px;
            border-radius: 999px;
        }

        #tanggalWaktu {
            display: none;
        }

        .tanggal-input-kustom input[type="date"],
        .waktu-input-kustom input[type="time"] {
            display: none;
        }

        @media (max-width: 480px) {
            #tanggalWaktuDisplay {
                min-height: 48px;
                height: 48px;
                font-size: 14px;
                line-height: 28px;
            }
        }
        
        .counter-container {
            text-align: center;
            margin: 15px 0;
            padding: 10px;
            background: #17263D;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
        }
        
        .counter-label {
            font-size: 14px;
            color: #BFDBFE;
        }
        
        .counter-value {
            font-size: 24px;
            font-weight: bold;
            color: #A9C7E8;
        }

        .sent-files-section {
            margin: 15px 0;
            padding: 12px;
            border: 1px solid #29466B;
            border-radius: 5px;
            background: #17263D;
        }

        .sent-files-section h3 {
            margin-bottom: 8px;
            color: #BFDBFE;
            font-size: 16px;
        }

        #logTerkirim {
            max-height: 240px;
            overflow-y: auto;
        }

        .log-empty {
            color: #BFDBFE;
            font-size: 13px;
        }
        
        .log-entry {
            background: #1A3152;
            padding: 8px;
            margin: 5px 0;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            font-size: 13px;
        }
        
        .log-time {
            color: #BFDBFE;
            font-size: 12px;
        }
        
        .log-filename {
            font-weight: bold;
            color: #A9C7E8;
            word-wrap: break-word;
        }
        
        .log-status {
            color: #ffcc00;
        }
        
        .log-status.success {
            color: #22C55E;
        }
        
        .log-status.failed {
            color: #f44336;
        }

        .log-status.duplicate {
            color: #FBBF24;
        }

        .log-error {
            margin-top: 4px;
            color: #FCA5A5;
            font-size: 12px;
            overflow-wrap: anywhere;
        }
        
        .notification {
            position: fixed;
            bottom: 20px;
            right: 20px;
            left: 20px;
            padding: 12px 15px;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            z-index: 1000;
            -webkit-transition: opacity 0.5s;
            transition: opacity 0.5s;
            font-size: 14px;
            text-align: center;
            -webkit-box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            -moz-box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }
        
        .notification.success {
            background: #16A34A;
        }
        
        .notification.error {
            background: #DC2626;
        }

        .notification.duplicate {
            background: #D97706;
        }
        
        .notification.warning {
            background: #D97706;
        }

        .notification.notification-plain {
            background: transparent;
            color: #fff;
            font-size: 28px;
            font-weight: 600;
            -moz-border-radius: 0;
            -webkit-border-radius: 0;
            border-radius: 0;
            -webkit-box-shadow: none;
            -moz-box-shadow: none;
            box-shadow: none;
            animation: coordinate-notification-spin 2.6s ease-in-out forwards;
        }

        .notification.coordinate-notification {
            right: auto;
            bottom: auto;
            left: 50%;
            top: 50%;
            width: max-content;
            max-width: calc(100vw - 24px);
            padding: 0;
            z-index: 1100;
            pointer-events: none;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
        }

        @keyframes coordinate-notification-spin {
            0% {
                opacity: 1;
                transform: translate(-50%, -50%) rotate(0deg);
            }
            52% {
                opacity: 1;
                transform: translate(-50%, -50%) rotate(1080deg);
            }
            70% {
                opacity: 1;
                transform: translate(-50%, -50%) rotate(1080deg);
            }
            100% {
                opacity: 0;
                transform: translate(-50%, -50%) rotate(1080deg);
            }
        }
        
        .file-input-container {
            margin-top: 10px;
        }

        .media-date-row {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            align-items: stretch;
            gap: 8px;
            margin-top: 12px;
        }

        .image-input-group,
        .media-date-row .tanggal-input-kustom,
        .media-date-row .waktu-input-kustom {
            position: relative;
            flex: 1 1 0;
            min-width: 0;
        }

        .media-date-row .file-picker-label,
        .media-date-row .date-picker-label {
            box-sizing: border-box;
            min-height: 60px;
            height: 60px;
            margin-top: 0;
            padding: 6px 8px;
            font-size: clamp(12px, 1.8vw, 18px);
            white-space: normal;
            text-align: center;
        }

        .media-date-row .file-picker-label {
            padding: 6px 8px;
            line-height: 1.15;
        }

        .media-date-row .tanggal-input-kustom,
        .media-date-row .waktu-input-kustom {
            margin-top: 0;
        }

        .media-date-row .date-picker-label {
            min-height: 60px;
            height: 60px;
            padding: 6px 8px;
            font-size: clamp(12px, 1.8vw, 18px);
            line-height: 1.2;
            white-space: pre-line;
            overflow-wrap: anywhere;
        }

        .media-date-row .validation-message {
            min-height: 0;
            margin-top: 4px;
            font-size: 12px;
        }

        .media-date-row .waktu-input-kustom .date-picker-label {
            color: #34483A;
        }

        @media (max-width: 480px) {
            .media-date-row {
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 4px;
            }

            .media-date-row .file-picker-label,
            .media-date-row .date-picker-label {
                padding-right: 2px;
                padding-left: 2px;
                font-size: clamp(10px, 3vw, 12px);
            }
        }
        
        .input-section {
            padding: 15px;
            background: #252A2E;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            margin-bottom: 15px;
            border: 1px solid #41474C;
        }

        @media (max-width: 600px) {
            .input-section {
                padding: 12px;
            }

            .header-container {
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: space-between;
                gap: 6px;
                padding-bottom: 10px;
            }

            .header-image-left,
            .header-image-right {
                width: clamp(42px, 11vw, 68px);
                height: auto;
            }

            .header-text {
                flex: 1 1 auto;
                min-width: 0;
            }

            .header-title {
                font-size: clamp(12px, 3vw, 18px);
                white-space: nowrap;
            }

            .header-subtitle {
                font-size: 10px;
                white-space: nowrap;
            }
        }
        
        .mode-description {
            background: rgba(8, 17, 31, 0.35);
            padding: 10px;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            margin-bottom: 15px;
            font-size: 14px;
            border-left: 3px solid #60A5FA;
        }

        .start-mode-description {
            display: block;
            width: 100%;
            margin-top: 12px;
            overflow: hidden;
            white-space: nowrap;
        }

        .marquee-text {
            display: inline-block;
            width: max-content;
            padding: 7px 12px;
            color: #EAF5FF;
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.2px;
            animation: marquee-slide 16s linear infinite;
            text-shadow: 0 1px 0 rgba(0,0,0,0.15);
        }

        @keyframes marquee-slide {
            0% {
                transform: translateX(100%);
            }
            100% {
                transform: translateX(-100%);
            }
        }

        #loadingDesa, #loadingKoordinat {
            display: none;
            color: #D5E6FA;
            font-size: 14px;
            margin-top: 5px;
        }

        .loading-spinner {
            display: inline-block;
            width: 12px;
            height: 12px;
            margin-right: 6px;
            border: 2px solid #D5E6FA;
            border-top-color: transparent;
            border-radius: 50%;
            vertical-align: -2px;
            -webkit-animation: spin 1s linear infinite;
            animation: spin 1s linear infinite;
        }
        
        .combined-button {
            background: #2563EB;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .action-buttons {
            display: flex;
            align-items: stretch;
            gap: 10px;
            margin-top: 20px;
        }

        .action-buttons button {
            margin-top: 0;
            flex: 1 1 0;
            min-width: 0;
        }

        .exit-button {
            background: #B91C1C;
        }

        .exit-button:hover:not(:disabled) {
            background: #991B1B;
        }

        @media (max-width: 480px) {
            .action-buttons {
                gap: 8px;
            }

            .action-buttons button {
                padding-left: 8px;
                padding-right: 8px;
                font-size: 14px;
            }
        }
        
        .refresh-btn {
            background: #315A8A;
            margin-top: 10px;
            padding: 10px;
            display: none;
        }
        
        /* Hidden elements */
        .hidden-text {
            display: none !important;
        }
        
        /* =========== VALIDASI FOTO =========== */
        .validation-message {
            font-size: 12px;
            padding: 5px;
            border-radius: 3px;
            margin-top: 3px;
            display: none;
        }
        
        .validation-success {
            background: rgba(76, 175, 80, 0.1);
            color: #22C55E;
            border-left: 3px solid #22C55E;
            display: block;
        }

        #fileValidation {
            display: none !important;
        }
        
        .validation-error {
            background: rgba(244, 67, 54, 0.1);
            color: #f44336;
            border-left: 3px solid #f44336;
            display: block;
        }
        
        .validation-warning {
            background: rgba(255, 152, 0, 0.1);
            color: #FF9800;
            border-left: 3px solid #FF9800;
            display: block;
        }
        
        .file-info {
            background: rgba(42, 58, 46, 0.3);
            padding: 8px;
            border-radius: 5px;
            margin-top: 5px;
            font-size: 12px;
            border: 1px dashed #54749C;
        }
        
        .file-info-item {
            display: flex;
            justify-content: space-between;
            margin: 3px 0;
        }
        
        .file-info-label {
            color: #BFDBFE;
        }
        
        .file-info-value {
            color: #A9C7E8;
            font-weight: bold;
        }
        
        /* =========== CHAT WIDGET HYBRID =========== */
        #chatToggleBtn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #2563EB, #1E40AF);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            cursor: pointer;
            z-index: 9998;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
            border: 2px solid #60A5FA;
        }
        
        #chatToggleBtn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0,0,0,0.4);
            background: linear-gradient(135deg, #1D4ED8, #1E3A8A);
        }
        
        #chatToggleBtn .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: #DC2626;
            color: white;
            font-size: 12px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }
        
        /* Widget Chat */
        #telegramChatWidget {
            position: fixed;
            bottom: 90px;
            right: 20px;
            width: 450px;
            height: 580px;
            background: #111C2E;
            border: 2px solid #29466B;
            border-radius: 15px;
            z-index: 9999;
            display: none;
            flex-direction: column;
            box-shadow: 0 10px 30px rgba(0,0,0,0.7);
            font-family: Arial, sans-serif;
            overflow: hidden;
        }
        
        .chat-header {
            background: linear-gradient(90deg, #1E40AF, #2563EB);
            color: white;
            padding: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #29466B;
            min-height: 70px;
        }
        
        .chat-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .chat-header-left i {
            font-size: 22px;
        }
        
        .chat-header-text {
            flex: 1;
        }
        
        .chat-title {
            font-weight: bold;
            font-size: 17px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .chat-subtitle {
            font-size: 12px;
            opacity: 0.9;
            margin-top: 2px;
        }
        
        .current-desa-badge {
            background: rgba(96, 165, 250, 0.18);
            border: 1px solid #60A5FA;
            border-radius: 12px;
            padding: 2px 8px;
            font-size: 11px;
            margin-left: 5px;
        }
        
        .chat-user-info {
            background: rgba(23, 38, 61, 0.8);
            padding: 8px 15px;
            font-size: 12px;
            border-bottom: 1px solid #29466B;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .user-info-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .user-desa-badge {
            background: #315A8A;
            padding: 3px 10px;
            border-radius: 10px;
            font-weight: bold;
            font-size: 11px;
        }
        
        .chat-options {
            margin: 10px 15px;
            padding: 10px;
            background: rgba(23, 38, 61, 0.65);
            border-radius: 8px;
            border: 1px solid #29466B;
        }
        
        .chat-option-buttons {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }
        
        .chat-option-btn {
            flex: 1;
            padding: 10px 12px;
            background: #315A8A;
            border: none;
            border-radius: 6px;
            color: white;
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: background 0.3s;
        }
        
        .chat-option-btn:hover {
            background: #3B6EA5;
        }
        
        .chat-option-btn.active {
            background: #2563EB;
            box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
        }
        
        .chat-option-btn i {
            font-size: 14px;
        }
        
        /* Area Pesan */
        #chatMessages {
            flex: 1;
            padding: 15px;
            overflow-y: auto;
            background: #0D1728;
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: calc(100% - 220px);
        }
        
        /* Pesan Chat */
        .chat-message {
            padding: 10px 14px;
            border-radius: 15px;
            position: relative;
            animation: fadeIn 0.3s ease;
            word-wrap: break-word;
            max-width: 85%;
            margin-bottom: 5px;
            line-height: 1.4;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .message-outgoing {
            background: #315A8A;
            color: white;
            align-self: flex-end;
            margin-left: 15%;
            border-bottom-right-radius: 5px;
        }
        
        .message-incoming {
            background: #1A3152;
            color: white;
            align-self: flex-start;
            margin-right: 15%;
            border-bottom-left-radius: 5px;
            border-left: 3px solid #60A5FA;
        }
        
        .message-system {
            background: rgba(255, 193, 7, 0.1);
            color: #FFC107;
            align-self: center;
            text-align: center;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px dashed #FFC107;
            max-width: 90%;
            font-size: 12px;
            margin: 5px 0;
        }
        
        .message-error {
            background: rgba(244, 67, 54, 0.1);
            color: #f44336;
            align-self: center;
            text-align: center;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid #f44336;
            max-width: 90%;
            font-size: 12px;
            margin: 5px 0;
        }
        
        .message-info {
            background: rgba(33, 150, 243, 0.1);
            color: #2196F3;
            align-self: center;
            text-align: center;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid #2196F3;
            max-width: 90%;
            font-size: 12px;
            margin: 5px 0;
        }
        
        .message-sender {
            font-size: 11px;
            color: #BFDBFE;
            margin-bottom: 3px;
            font-weight: bold;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .sender-badge {
            background: rgba(96, 165, 250, 0.18);
            padding: 1px 6px;
            border-radius: 8px;
            font-size: 9px;
            border: 1px solid #60A5FA;
        }
        
        .message-text {
            font-size: 14px;
            line-height: 1.4;
            word-break: break-word;
        }
        
        .message-time {
            font-size: 10px;
            color: #888;
            text-align: right;
            margin-top: 4px;
        }
        
        /* AREA INPUT CHAT */
        .chat-input-container {
            padding: 10px 15px;
            background: #111C2E;
            border-top: 1px solid #29466B;
            height: 80px;
            display: flex;
            align-items: center;
        }
        
        .chat-input-row {
            display: flex;
            gap: 8px;
            align-items: center;
            width: 100%;
        }
        
        #chatInput {
            flex: 1;
            padding: 12px 15px;
            border: 1px solid #54749C;
            border-radius: 20px;
            background: #17263D;
            color: #E5EEF9;
            font-size: 14px;
            min-height: 45px;
            width: calc(100% - 50px);
            transition: all 0.3s ease;
        }
        
        #chatInput:focus {
            outline: none;
            border-color: #60A5FA;
            box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
            background: #1A3152;
        }
        
        #chatInput::placeholder {
            color: #9FB4CE;
        }
        
        .send-btn {
            width: 45px;
            height: 45px;
            padding: 0;
            background: #315A8A;
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }
        
        .send-btn:hover {
            background: #3B6EA5;
            transform: scale(1.05);
        }
        
        .send-btn i {
            font-size: 16px;
        }
        
        /* Scrollbar Custom */
        #chatMessages::-webkit-scrollbar {
            width: 6px;
        }
        
        #chatMessages::-webkit-scrollbar-track {
            background: #0D1728;
        }
        
        #chatMessages::-webkit-scrollbar-thumb {
            background: #315A8A;
            border-radius: 3px;
        }
        
        #chatMessages::-webkit-scrollbar-thumb:hover {
            background: #3B6EA5;
        }
        
        /* Responsive */
        @media (max-width: 480px) {
            .container {
                padding: 15px;
            }
            
            .header-container {
                flex-direction: column;
                text-align: center;
            }
            
            .header-image {
                height: 120px;
                width: 120px;
            }
            
            .header-title {
                font-size: 15px;
            }
            
            .header-subtitle {
                font-size: 11px;
            }
            
            button {
                padding: 10px;
            }
            
            /* Chat Widget Mobile */
            #telegramChatWidget {
                width: calc(100% - 30px);
                right: 15px;
                left: 15px;
                height: 520px;
                bottom: 80px;
                max-width: 400px;
                margin: 0 auto;
            }
            
            #chatToggleBtn {
                bottom: 15px;
                right: 15px;
                width: 50px;
                height: 50px;
                font-size: 20px;
            }
            
            .chat-header {
                padding: 12px;
                min-height: 60px;
            }
            
            .chat-title {
                font-size: 15px;
            }
            
            .chat-subtitle {
                font-size: 11px;
            }
            
            .current-desa-badge {
                font-size: 10px;
                padding: 1px 6px;
            }
            
            #chatInput {
                padding: 10px 12px;
                font-size: 13px;
                min-height: 42px;
                width: calc(100% - 48px);
            }
            
            .send-btn {
                width: 42px;
                height: 42px;
            }
            
            .send-btn i {
                font-size: 14px;
            }
            
            .chat-message {
                padding: 8px 12px;
                max-width: 90%;
            }
            
            .message-text {
                font-size: 13px;
            }
            
            .chat-option-buttons {
                flex-direction: column;
            }
        }
        
        /* Untuk layar sangat kecil */
        @media (max-width: 360px) {
            #telegramChatWidget {
                height: 480px;
                bottom: 70px;
            }
            
            #chatInput {
                font-size: 12px;
                padding: 8px 10px;
            }
            
            .chat-input-container {
                padding: 8px 12px;
            }
        }
        
        /* Animasi */
        @-webkit-keyframes spin {
            0% { -webkit-transform: rotate(0deg); }
            100% { -webkit-transform: rotate(360deg); }
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .dashboard-desa-status {
            display: none;
        }

        #desaStartModal {
            position: fixed;
            z-index: 1000;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(3, 10, 24, 0.82);
        }

        #desaStartModal.hidden {
            display: none;
        }

        .desa-start-card {
            width: min(100%, 430px);
            padding: 22px 20px 18px;
            border: 1px solid rgba(163, 197, 232, 0.65);
            border-radius: 22px;
            background: linear-gradient(180deg, rgba(17, 28, 46, 0.96) 0%, rgba(10, 20, 33, 0.98) 100%);
            box-shadow: 0 24px 55px rgba(0, 0, 0, 0.42), 0 6px 18px rgba(96, 144, 208, 0.18);
            position: relative;
        }

        .desa-start-card::before {
            content: "";
            position: absolute;
            inset: 1px;
            border-radius: 21px;
            background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
            pointer-events: none;
        }

        .desa-start-card .app-modal-title {
            position: relative;
            margin: 0 0 8px;
            color: #F5D889;
            font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
            font-size: 30px;
            font-size: clamp(24px, 7vw, 34px);
            font-weight: 900;
            line-height: 1.15;
            text-align: center;
            text-shadow:
                0 1px 0 #D0A94F,
                0 2px 0 #A98032,
                0 3px 0 #806020,
                0 4px 0 #594315,
                0 5px 8px rgba(0, 0, 0, 0.75);
        }

        .desa-start-card .modal-logo-caption {
            position: relative;
            margin: -14px 0 12px;
            color: #F5D889;
            font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: 3px;
            line-height: 1.2;
            text-align: center;
            text-shadow: 0 1px 0 #A98032, 0 2px 4px rgba(0, 0, 0, 0.8);
        }

        .desa-start-card h2 {
            color: #BFDBFE;
            font-size: 20px;
            margin-bottom: 8px;
        }

        .desa-start-card p {
            color: #C4D3E6;
            margin-bottom: 12px;
        }

        #installPwaButton,
        #selectDesa {
            width: 100%;
            min-height: 48px;
            margin: 0;
        }

        #installPwaButton {
            display: none;
            padding: 9px 14px;
            border: 1px solid #91A083;
            background: #46533F;
            color: #F2F3EC;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
        }

        #installPwaButton.visible {
            display: block;
        }

        #selectDesa[hidden] {
            display: none;
        }

        #installPwaButton:hover:not(:disabled) {
            background: #56634E;
        }

        #installPwaButton:active:not(:disabled) {
            background: #394434;
        }

        /* Tipografi dan aksen emas tua untuk tampilan yang elegan dan mudah dibaca */
        :root {
            --gold-deep: #B89558;
            --gold-soft: #C7AA72;
            --gold-muted: #A98D5A;
        }

        body,
        button,
        input,
        select,
        textarea {
            font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
            font-size: clamp(18px, 3vw, 36px);
        }

        body {
            color: var(--gold-soft);
        }

        .header-title {
            color: var(--gold-deep);
            font-size: 40px;
            line-height: 1.35;
            letter-spacing: 0.02em;
        }

        .header-subtitle {
            color: var(--gold-muted);
            font-size: 30px;
            line-height: 1.4;
        }

        #printable-area {
            font-size: 14px;
        }

        label,
        .desa-start-card h2,
        .section-title,
        .input-section h3 {
            color: var(--gold-deep);
        }

        .desa-start-card h2 {
            font-size: 44px;
        }

        .desa-start-card .app-modal-title {
            font-size: 30px;
            font-size: clamp(22px, 7vw, 32px);
        }

        .desa-start-card p {
            color: var(--gold-muted);
            font-size: 32px;
        }

        button {
            font-weight: 600;
            letter-spacing: 0.01em;
        }

        /* Isi seluruh layar dan sesuaikan ukuran elemen dengan perangkat. */
        html,
        body {
            width: 100%;
            min-width: 0;
            min-height: 100%;
            overflow-x: hidden;
        }

        .container {
            width: 100%;
            min-width: 0;
            min-height: 100vh;
            min-height: 100dvh;
            padding: clamp(12px, 3vw, 28px);
        }

        .header-container {
            gap: 15px;
            padding-bottom: 15px;
        }

        .header-image {
            width: clamp(90px, 20vw, 150px);
            height: clamp(90px, 20vw, 150px);
            flex: 0 0 auto;
        }

        .header-title {
            font-size: clamp(22px, 4.5vw, 32px);
        }

        .header-subtitle {
            font-size: clamp(14px, 2.8vw, 20px);
        }

        .running-file-name {
            overflow: hidden;
            white-space: nowrap;
            text-align: left;
        }

        .running-file-name span {
            display: inline-block;
            min-width: 100%;
            padding-left: 100%;
            animation: fileNameTicker 16s linear infinite;
        }

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

        .input-section {
            padding: 15px;
        }

        #selectedDesaLabel {
            font-size: clamp(30px, 8vw, 60px);
            font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
            letter-spacing: 0.01em;
        }

        .action-buttons {
            gap: 10px;
        }
