/* Ticketverkauf Scanner Styles */

.tkv-scanner {
    max-width: 680px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tabs (Pill-Bar mit Icons) */
.tkv-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    background: #f1f5f9;
    border-radius: 14px;
}

.tkv-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.tkv-tab-btn .tkv-tab-icon {
    flex-shrink: 0;
}

.tkv-tab-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.tkv-tab-btn:active {
    transform: scale(0.97);
}

.tkv-tab-btn.active {
    background: #A1C518;
    color: #0f1d04;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(161, 197, 24, 0.4);
}

.tkv-tab-btn.active:hover {
    background: #A1C518;
    color: #0f1d04;
}

/* Tab Content */
.tkv-tab-content {
    display: none;
}

.tkv-tab-content.active {
    display: block;
}

/* Buttons */
.tkv-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin: 0 4px;
}

.tkv-btn-primary {
    background: #A1C518;
    color: #fff;
}

.tkv-btn-primary:hover {
    background: #A1C518;
}

.tkv-btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.tkv-btn-secondary:hover {
    background: #cbd5e1;
}

/* Ergebnis-Karte */
.tkv-result {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    border: 2px solid transparent;
}

.tkv-result.valid {
    background: #dcfce7;
    border-color: #16a34a;
    color: #14532d;
}

.tkv-result.already_scanned {
    background: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.tkv-result.cancelled,
.tkv-result.wrong_day {
    background: #fef3c7;
    border-color: #d97706;
    color: #78350f;
}

.tkv-result.invalid,
.tkv-result.error {
    background: #fee2e2;
    border-color: #dc2626;
    color: #7f1d1d;
}

.tkv-result .tkv-result-icon {
    font-size: 24px;
    margin-right: 10px;
}

.tkv-result .tkv-result-details {
    margin-top: 8px;
    font-size: 13px;
    font-weight: normal;
    opacity: 0.85;
}

/* QR-Reader */
#tkv-reader {
    border-radius: 8px;
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

#tkv-reader video {
    border-radius: 8px;
}

/* Manuelle Suche */
.tkv-search-box {
    position: relative;
    margin-bottom: 16px;
}

.tkv-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.tkv-input:focus {
    outline: none;
    border-color: #A1C518;
}

.tkv-search-spinner {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

/* Suchergebnisse als Card-Liste */
.tkv-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tkv-search-item {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tkv-search-item:hover {
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.tkv-search-item:active {
    transform: scale(0.995);
}

.tkv-search-item .tkv-item-info {
    flex: 1;
}

.tkv-search-item .tkv-item-name {
    font-weight: 600;
    font-size: 14px;
    color: #1e293b;
}

.tkv-search-item .tkv-item-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.tkv-search-item .tkv-item-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tkv-status-valid {
    background: #dcfce7;
    color: #14532d;
}

.tkv-status-scanned {
    background: #dbeafe;
    color: #A1C518;
}

.tkv-status-cancelled {
    background: #fef3c7;
    color: #78350f;
}

.tkv-scan-from-search-btn {
    margin-left: 12px;
    padding: 6px 14px;
    font-size: 12px;
    background: #A1C518;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.tkv-scan-from-search-btn:hover {
    background: #A1C518;
}

.tkv-scan-from-search-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Scan-Verlauf */
.tkv-history-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.tkv-history-filter select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
}

/* Tabelle */
.tkv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tkv-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.tkv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.tkv-table tr:last-child td {
    border-bottom: none;
}

.tkv-table tr:hover td {
    background: #f8fafc;
}

/* Pagination */
.tkv-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.tkv-page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.tkv-page-btn:hover,
.tkv-page-btn.active {
    background: #A1C518;
    color: #fff;
    border-color: #A1C518;
}

/* Hints */
.tkv-hint {
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Responsive */
@media (max-width: 480px) {
    .tkv-tabs {
        flex-wrap: wrap;
    }

    /* Search-Item bleibt horizontal — Button rechts wird zu Icon-Square */
    .tkv-search-item {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }
    .tkv-search-item .tkv-item-info {
        gap: 10px;
    }
    .tkv-search-item .tkv-avatar {
        margin-right: 0;
        flex-shrink: 0;
    }
    .tkv-search-item .tkv-item-name {
        font-size: 15px;
    }
    .tkv-search-item .tkv-item-meta {
        font-size: 12.5px;
    }

    .tkv-search-item .tkv-scan-from-search-btn {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .tkv-search-item .tkv-scan-from-search-btn .tkv-btn-label {
        display: none;
    }

    .tkv-table th:nth-child(3),
    .tkv-table td:nth-child(3) {
        display: none;
    }
}

/* Auf Desktop: Icon im Button verstecken, Text wird gezeigt */
@media (min-width: 481px) {
    .tkv-scan-from-search-btn .tkv-btn-icon {
        display: none;
    }
}

/* ─────────────────────────────────────────────
   Scanner UX-Optimierungen
   ───────────────────────────────────────────── */

/* Touch-Target-Mindesthöhe für Pill-Tabs */
.tkv-tab-btn {
    min-height: 56px;
    padding: 14px 16px;
    font-size: 16px;
}
@media (max-width: 480px) {
    .tkv-tab-btn {
        padding: 12px 10px;
        font-size: 15px;
        gap: 6px;
    }
    .tkv-tab-btn .tkv-tab-label {
        font-size: 14px;
    }
}

/* Größere Touch-Targets: Buttons */
.tkv-btn {
    min-height: 56px;
    padding: 16px 28px;
    font-size: 16px;
}
.tkv-scan-from-search-btn {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
}

/* Status-Badge "Entwertet": Farbe lesbar (war grün auf hellblau) */
.tkv-status-scanned {
    background: #fee2e2;
    color: #7f1d1d;
}

/* Manuell-Tab: Event-Filter über der Liste */
.tkv-list-filter {
    margin-bottom: 12px;
}
.tkv-list-filter select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}

/* Liste-Item: kompaktere Zeile, klar lesbarer Name */
.tkv-search-item .tkv-item-name {
    font-size: 16px;
}
.tkv-search-item .tkv-item-meta {
    font-size: 13px;
}

/* Pagination etwas größer */
.tkv-page-btn {
    min-width: 46px;
    min-height: 46px;
    padding: 10px 16px;
    font-size: 15px;
}
.tkv-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 46px;
    color: #94a3b8;
    font-size: 15px;
    user-select: none;
}

/* Status-Banner sticky am unteren Bildschirmrand */
.tkv-result {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px));
    border: none;
    border-top: 4px solid currentColor;
    border-radius: 0;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}
.tkv-result .tkv-result-icon {
    font-size: 28px;
    margin-right: 12px;
    vertical-align: middle;
}
.tkv-result .tkv-result-details {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}
/* Damit gescrollter Inhalt nicht endlos hinter dem fixen Banner landet */
#ticketverkauf-scanner {
    padding-bottom: 24px;
}

/* ─────────────────────────────────────────────
   Such-Polish (Tab "Manuelle Suche")
   ───────────────────────────────────────────── */

/* Suchfeld: Pill-Form, größer, Icon links, Clear/Spinner rechts */
.tkv-search-box {
    position: relative;
    margin-bottom: 14px;
}
.tkv-search-box .tkv-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    width: 22px;
    height: 22px;
}
.tkv-search-box .tkv-input[type="search"] {
    height: 56px;
    padding: 0 52px;
    font-size: 16px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.tkv-search-box .tkv-input[type="search"]:hover {
    background: #e6ecf2;
}
.tkv-search-box .tkv-input[type="search"]:focus {
    background: #ffffff;
    border-color: #A1C518;
    box-shadow: 0 0 0 4px rgba(161, 197, 24, 0.18);
    outline: none;
}
/* iOS-Default-Such-X im type=search-Feld unterdrücken (wir bauen unseren eigenen) */
.tkv-input[type="search"]::-webkit-search-cancel-button,
.tkv-input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}
.tkv-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #475569;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.tkv-search-clear:hover { background: #cbd5e1; }
.tkv-search-clear:active { transform: translateY(-50%) scale(0.92); }
.tkv-search-clear[hidden] { display: none; }

.tkv-search-spinner {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #A1C518;
    pointer-events: none;
    animation: tkv-spin 0.9s linear infinite;
}
.tkv-search-spinner[hidden] { display: none; }
@keyframes tkv-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to   { transform: translateY(-50%) rotate(360deg); }
}

/* Result-Count-Header */
.tkv-result-count {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin: 4px 4px 12px;
}
.tkv-result-count[hidden] { display: none; }
.tkv-result-count strong {
    color: #0f172a;
    font-weight: 600;
}

/* Pill-Filter (für ≤ 5 Events) */
.tkv-pill-filter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tkv-pill-filter::-webkit-scrollbar { display: none; }
.tkv-pill {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 10px 18px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.tkv-pill:hover { background: #e2e8f0; color: #0f172a; }
.tkv-pill.active {
    background: #A1C518;
    color: #0f1d04;
    box-shadow: 0 1px 2px rgba(161, 197, 24, 0.4);
}

/* Match-Highlight in Suchergebnissen */
.tkv-match {
    background: rgba(161, 197, 24, 0.25);
    color: inherit;
    font-weight: 700;
    padding: 0 1px;
    border-radius: 2px;
}

/* Avatar-Initialen */
.tkv-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 12px;
}

/* Listen-Item: Avatar + Info nebeneinander */
.tkv-search-item {
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
}
.tkv-search-item .tkv-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.tkv-search-item .tkv-item-text {
    flex: 1;
    min-width: 0;
}
.tkv-search-item .tkv-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
}
.tkv-search-item .tkv-item-meta {
    font-size: 13px;
    color: #475569;
    line-height: 1.3;
    margin-top: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tkv-search-item .tkv-item-meta--date {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.tkv-search-item .tkv-item-meta--id {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tkv-search-item .tkv-scan-from-search-btn {
    flex-shrink: 0;
}

/* Verlauf-Liste als Card-Stack (gleicher Look wie Such-Liste) */
#tkv-history-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tkv-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.tkv-history-item:hover {
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.tkv-history-item--revertable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tkv-history-item--revertable:hover {
    background: rgba(161, 197, 24, 0.08);
    border-color: #A1C518;
}
.tkv-history-item--revertable:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(161, 197, 24, 0.35);
}
.tkv-history-item--revertable:active {
    transform: scale(0.995);
}
@media (prefers-reduced-motion: reduce) {
    .tkv-history-item--revertable:active {
        transform: none;
    }
}
.tkv-history-item .tkv-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 10px;
}
.tkv-history-item .tkv-avatar {
    margin-right: 0;
    flex-shrink: 0;
}
.tkv-history-item .tkv-item-text {
    flex: 1;
    min-width: 0;
}
.tkv-history-item .tkv-item-name {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tkv-history-item .tkv-item-meta {
    font-size: 13px;
    color: #475569;
    line-height: 1.3;
    margin-top: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tkv-history-item .tkv-item-meta--id {
    font-family: monospace;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tkv-history-time {
    flex: 0 0 auto;
    text-align: right;
    font-size: 13px;
    color: #475569;
    font-variant-numeric: tabular-nums;
}
.tkv-history-time strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}
.tkv-history-time small {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Revert-Button im Verlauf */
.tkv-revert-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 16px;
    margin-left: 8px;
    background: #fff;
    color: #5d7d05;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tkv-revert-btn:hover {
    background: rgba(161, 197, 24, 0.12);
    border-color: #A1C518;
    color: #475d04;
}
.tkv-revert-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(161, 197, 24, 0.35);
}
.tkv-revert-btn:active {
    transform: scale(0.97);
}
.tkv-revert-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .tkv-revert-btn .tkv-revert-label {
        display: none;
    }
    .tkv-revert-btn {
        min-width: 44px;
        padding: 10px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tkv-revert-btn {
        transition: none;
    }
    .tkv-revert-btn:active {
        transform: none;
    }
}

/* Mobile-Tuning für Verlauf-Cards (analog Such-Cards) */
@media (max-width: 480px) {
    .tkv-history-item {
        gap: 8px;
        padding: 10px 12px;
    }
    .tkv-history-item .tkv-item-info {
        gap: 10px;
    }
    .tkv-history-item .tkv-item-name {
        font-size: 15px;
    }
    .tkv-history-item .tkv-item-meta {
        font-size: 12.5px;
    }
    .tkv-history-time strong {
        font-size: 14px;
    }
    .tkv-history-time small {
        max-width: 80px;
    }
}

/* ------------------------------------------------------------------
   html5-qrcode-Library Overrides
   Die Lib (#tkv-reader) injiziert eigene Buttons/Selects mit
   Inline-Styles und festen IDs. Wir überschreiben sie hier, damit sie
   zum Plugin-Brand passen (Brand-Grün #A1C518, Pill/Card-Look).
   ------------------------------------------------------------------ */

#tkv-reader {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: none !important;
    padding: 0 !important;
}

/* Dashboard-Container (alles unterhalb des Video-Frames) */
#tkv-reader__dashboard {
    padding: 14px 0 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    margin-top: 14px !important;
}

/* Header-Texte ("Kamera wählen", "Kamera-Scan") */
#tkv-reader__header_message,
#tkv-reader__dashboard_section_csr > div:first-child,
#tkv-reader__dashboard_section_swaplink {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-align: center !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
}

/* Library-Footer (Powered-by / GitHub-Link) ausblenden */
#tkv-reader__scan_region img[alt*="qrcode" i],
#tkv-reader a[href*="github.com"],
#tkv-reader__dashboard > div:last-child:has(a[href*="github"]) {
    display: none !important;
}

/* Camera-Select-Region: spaltenweise Anordnung mit definitivem Abstand
   zwischen allen Direct-Children (Header, Select, Start/Stop-Row, Torch-Row).
   Wir nutzen margin statt gap, weil die Lib die Container asynchron befüllt
   und :has() in älteren WebKit-Versionen nicht greift. */
#tkv-reader__dashboard_section_csr {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    text-align: center !important;
}

#tkv-reader__dashboard_section_csr > * {
    display: block !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    text-align: center !important;
}

#tkv-reader__dashboard_section_csr > *:last-child {
    margin-bottom: 0 !important;
}

/* Zoom-Slider verstecken — funktioniert auf iOS-WebKit nicht zuverlässig
   und ist auf Android selten nützlich. */
#html5-qrcode-input-range-zoom,
#tkv-reader input[type="range"] {
    display: none !important;
}

/* Select (Kamera-Auswahl) */
#tkv-reader select {
    width: 100%;
    min-height: 52px;
    padding: 14px 38px 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #0f172a;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#tkv-reader select:focus-visible {
    outline: none;
    border-color: #A1C518;
    box-shadow: 0 0 0 3px rgba(161, 197, 24, 0.25);
}

/* Buttons — Default-Style (Sekundär, neutral).
   margin rechts/unten erzeugt sichere Abstände zwischen Buttons, egal
   ob die Lib sie inline-block oder per separater Wrapper-Divs gruppiert. */
#tkv-reader button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 52px;
    padding: 14px 22px !important;
    margin: 0 5px 10px 5px !important;
    font-size: 15.5px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #334155 !important;
    background: #f1f5f9 !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    transition: background-color 0.18s ease, color 0.18s ease,
                box-shadow 0.18s ease, transform 0.12s ease !important;
}

#tkv-reader button:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

#tkv-reader button:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(161, 197, 24, 0.35) !important;
}

#tkv-reader button:active {
    transform: scale(0.97);
}

#tkv-reader button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary-Buttons: "Scan starten" + "Kamera-Zugriff erlauben".
   html5-qrcode nutzt globale IDs (kein reader-id-Prefix). */
#html5-qrcode-button-camera-start,
#html5-qrcode-button-camera-permission {
    background: #A1C518 !important;
    color: #0f1d04 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08),
                0 1px 2px rgba(161, 197, 24, 0.4) !important;
}

#html5-qrcode-button-camera-start:hover,
#html5-qrcode-button-camera-permission:hover {
    background: #b3d525 !important;
    color: #0f1d04 !important;
}

/* Stop-Button: neutraler Card-Look mit klarer Border */
#html5-qrcode-button-camera-stop {
    background: #fff !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

#html5-qrcode-button-camera-stop:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

/* Torch-Button — dunkler Akzent gegen die Kamera-Vorschau */
#html5-qrcode-button-torch {
    background: #0f172a !important;
    color: #fff !important;
}

#html5-qrcode-button-torch:hover {
    background: #1e293b !important;
}

#html5-qrcode-button-torch.html5-qrcode-button-torch-on {
    background: #A1C518 !important;
    color: #0f1d04 !important;
}

/* Zoom-Slider, falls eingeblendet */
#tkv-reader input[type="range"] {
    width: 100%;
    accent-color: #A1C518;
    margin-top: 8px;
    height: 24px;
}

/* Permission-/Error-Texte */
#tkv-reader__status_span,
#tkv-reader__dashboard_section_fsr {
    font-size: 13px !important;
    color: #475569 !important;
    margin-top: 8px !important;
}

/* Reduced-Motion respektieren */
@media (prefers-reduced-motion: reduce) {
    #tkv-reader button,
    #tkv-reader select {
        transition: none !important;
    }
    #tkv-reader button:active {
        transform: none !important;
    }
}

/* ------------------------------------------------------------------
   FAQ / Hilfe-Akkordeon unter dem Scanner
   ------------------------------------------------------------------ */

.tkv-faq {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.tkv-faq-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.tkv-faq-toggle::-webkit-details-marker {
    display: none;
}

.tkv-faq-toggle .tkv-faq-icon {
    flex-shrink: 0;
    color: #64748b;
}

.tkv-faq-toggle > span {
    flex: 1;
}

.tkv-faq-toggle .tkv-faq-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.18s ease;
}

.tkv-faq[open] > .tkv-faq-toggle .tkv-faq-chevron {
    transform: rotate(180deg);
}

.tkv-faq-toggle:hover {
    background: #f1f5f9;
}

.tkv-faq-toggle:focus-visible {
    outline: 2px solid #A1C518;
    outline-offset: -2px;
}

.tkv-faq-body {
    padding: 4px 6px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.tkv-faq-item {
    border-bottom: 1px solid #f1f5f9;
}

.tkv-faq-item:last-child {
    border-bottom: none;
}

.tkv-faq-item > summary {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14.5px;
    font-weight: 600;
    color: #1e293b;
    list-style: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.tkv-faq-item > summary::-webkit-details-marker {
    display: none;
}

.tkv-faq-item > summary::after {
    content: "+";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1;
    transition: transform 0.18s ease;
}

.tkv-faq-item[open] > summary::after {
    content: "−";
    color: #A1C518;
}

.tkv-faq-item > summary:hover {
    background: #f8fafc;
}

.tkv-faq-item > summary:focus-visible {
    outline: 2px solid #A1C518;
    outline-offset: -2px;
    border-radius: 6px;
}

.tkv-faq-answer {
    padding: 0 14px 14px;
    font-size: 14px;
    line-height: 1.55;
    color: #475569;
}

.tkv-faq-answer p {
    margin: 0 0 8px;
}

.tkv-faq-answer ul {
    margin: 4px 0 0;
    padding-left: 20px;
}

.tkv-faq-answer li {
    margin-bottom: 6px;
}

.tkv-faq-answer li:last-child {
    margin-bottom: 0;
}

.tkv-faq-answer strong {
    color: #0f172a;
}

@media (prefers-reduced-motion: reduce) {
    .tkv-faq-toggle .tkv-faq-chevron,
    .tkv-faq-item > summary::after {
        transition: none;
    }
}

/* ------------------------------------------------------------------
   Bulk-Entwertungs-Modal (Bottom-Sheet auf Mobile, zentriert auf Desktop)
   ------------------------------------------------------------------ */

.tkv-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    padding: 0;
    animation: tkv-backdrop-in 0.18s ease;
}

.tkv-modal-backdrop[hidden] {
    display: none !important;
}

.tkv-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 24px 22px calc(22px + env(safe-area-inset-bottom)) 22px;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.2);
    animation: tkv-modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 600px) {
    .tkv-modal-backdrop {
        align-items: center;
        padding: 24px;
    }
    .tkv-modal {
        border-radius: 16px;
        padding: 28px 26px;
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    }
}

.tkv-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
}

.tkv-modal-icon-success {
    background: rgba(161, 197, 24, 0.18);
    color: #5d7d05;
}

.tkv-modal-title {
    margin: 0 0 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

/* Hero-Counter: große Zahl + Caption */
.tkv-modal-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 14px 0 18px;
    line-height: 1;
}

.tkv-modal-counter-number {
    font-size: 56px;
    font-weight: 800;
    color: #5d7d05;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tkv-modal-counter-success .tkv-modal-counter-number {
    color: #A1C518;
}

.tkv-modal-counter-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tkv-modal-body {
    margin: 0 0 22px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
    color: #475569;
}

.tkv-modal-body[hidden] {
    display: none !important;
}

.tkv-modal-body strong {
    color: #0f172a;
    font-weight: 600;
}

.tkv-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tkv-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 16px 24px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16.5px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.tkv-modal-btn:active {
    transform: scale(0.98);
}

.tkv-modal-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(161, 197, 24, 0.35);
}

.tkv-modal-btn-primary {
    background: #A1C518;
    color: #0f1d04;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(161, 197, 24, 0.4);
}

.tkv-modal-btn-primary:hover {
    background: #b3d525;
}

.tkv-modal-btn-secondary {
    background: #fff;
    color: #334155;
    border-color: #cbd5e1;
}

.tkv-modal-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

@keyframes tkv-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes tkv-modal-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tkv-modal-backdrop,
    .tkv-modal {
        animation: none;
    }
    .tkv-modal-btn {
        transition: none;
    }
    .tkv-modal-btn:active {
        transform: none;
    }
}
