:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --blue: #3b82f6;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f97316;
    --yellow: #eab308;
    --input-h: 36px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-y: scroll; }

/* Thin transparent scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }

/* Content protection */
body.protected * { user-select: none; -webkit-user-select: none; }
body.protected input, body.protected select, body.protected textarea { user-select: text; -webkit-user-select: text; }

/* Screenshot blackout */
body.blackout, body.blackout * { background: #000 !important; color: #000 !important; border-color: #000 !important; }
body.blackout img, body.blackout canvas { opacity: 0 !important; }

/* DevTools block overlay */
#devtools-block { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 999999; display: flex; align-items: center; justify-content: center; }
.devtools-popup { background: #fff; border-radius: 16px; padding: 40px 48px; text-align: center; max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.devtools-icon { font-size: 56px; margin-bottom: 16px; }
.devtools-title { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.devtools-msg { font-size: 14px; color: #64748b; line-height: 1.6; }
.devtools-reload { margin-top: 20px; padding: 10px 28px; font-size: 14px; font-weight: 600; color: #fff; background: var(--orange); border: none; border-radius: 8px; cursor: pointer; }
.devtools-reload:hover { opacity: 0.9; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app { width: 100%; margin: 0 auto; padding: 20px 32px; max-width: 1600px; box-sizing: border-box; }
@media (max-width: 1200px) { .app { padding: 16px 24px; } }
@media (max-width: 768px) { .app { padding: 12px 16px; } }
@media (max-width: 480px) { .app { padding: 8px 10px; } }

.header { text-align: center; padding: 20px 0 10px; }
.header h1 { font-size: 22px; letter-spacing: 2px; color: var(--orange); }
.subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (max-width: 480px) {
    .header { padding: 12px 0 6px; }
    .header h1 { font-size: 18px; letter-spacing: 1px; }
    .subtitle { font-size: 11px; }
}

/* Disclaimer */
.disclaimer {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 12px;
    color: #92400e;
    line-height: 1.6;
}
.disclaimer p + p { margin-top: 6px; }
.contact-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact-url { font-family: monospace; font-size: 11px; color: #92400e; background: rgba(0,0,0,.05); padding: 2px 8px; border-radius: 4px; user-select: all; }
.btn-copy { background: var(--blue); color: #fff; border: none; border-radius: 4px; padding: 2px 10px; font-size: 11px; font-weight: 600; cursor: pointer; height: 22px; }
.btn-copy:hover { opacity: .85; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
@media (max-width: 900px) {
    .toolbar .config-input { flex: 0 0 100%; }
}
@media (max-width: 480px) {
    .toolbar { gap: 6px; }
    .toolbar .btn { flex: 1; min-width: 0; }
}
.config-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 14px;
    height: 40px;
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.config-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.input-example { font-size: 11px; color: var(--muted); margin: 4px 0 0 2px; font-family: monospace; }

.btn {
    height: 40px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: #cbd5e1; }

/* Status */
.status-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 8px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.success { background: var(--green); }
.dot.loading { background: var(--yellow); animation: pulse 1s infinite; }
.dot.error { background: var(--red); }
@keyframes pulse { 50% { opacity: .4; } }

/* Filters */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-search { flex: 0 0 220px; }
.filter-search input { width: 100%; }
@media (max-width: 900px) {
    .filter-search { flex: 0 0 100%; }
}
@media (max-width: 580px) {
    .filter-bar { gap: 6px; }
    .filter-search { flex: 0 0 100%; }
    .filter-group { flex: 1; min-width: 0; }
    .filter-group select { flex: 1; min-width: 0; }
    .filter-group label { display: none; }
    .event-count { width: 100%; text-align: center; margin: 4px 0 0; }
}
.filter-group label { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.filter-group input,
.filter-group select,
.filter-bar .btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    height: var(--input-h);
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.filter-group input:focus,
.filter-group select:focus { border-color: var(--blue); }

/* Notice banner */
.notice-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid #93c5fd;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    color: #1e3a5f;
    line-height: 1.6;
}
.notice-icon { font-size: 16px; flex-shrink: 0; }
@media (max-width: 480px) {
    .disclaimer { padding: 10px 12px; font-size: 11px; }
    .contact-line { gap: 6px; }
    .contact-url { font-size: 10px; word-break: break-all; }
    .notice-banner { padding: 10px 12px; font-size: 12px; }
}

.event-count { font-size: 12px; color: var(--muted); margin-left: auto; }

/* Donate */
.disclaimer-sep { color: var(--border); margin: 0 4px; }
.donate-link { color: #d97706; font-weight: 600; text-decoration: none; font-size: 12px; }
.donate-link:hover { text-decoration: underline; }
.donate-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    margin: 16px 0;
    overflow: hidden;
}
.donate-qr { flex: 0 0 auto; background: #fafafa; display: flex; align-items: center; justify-content: center; padding: 20px; border-right: 1px solid var(--border); }
.donate-qr img { width: 220px; height: auto; border-radius: 8px; object-fit: contain; }
.donate-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.donate-bank { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 2px; }
.donate-name { font-size: 18px; font-weight: 700; color: var(--text); }
.donate-account { font-size: 24px; font-weight: 700; color: var(--blue); font-family: 'Courier New', Courier, monospace; letter-spacing: 5px; }
.donate-note { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.donate-cta { font-size: 14px; color: #78350f; background: #fffbeb; border: 1px solid #fbbf24; border-radius: 8px; padding: 12px 16px; line-height: 1.7; text-align: left; }
@media (max-width: 580px) {
    .donate-card { flex-direction: column; }
    .donate-qr { border-right: none; border-bottom: 1px solid var(--border); padding: 16px; }
    .donate-qr img { width: 180px; }
    .donate-info { padding: 16px; }
    .donate-account { font-size: 20px; letter-spacing: 3px; }
}

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
thead th {
    background: var(--surface);
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
}
th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 22px !important; }
th.sortable:hover { color: var(--text); }
th.sortable::after { content: '\21C5'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .35; }
th.sorted-asc { color: var(--blue); }
th.sorted-asc::after { content: '\25B2'; opacity: 1; color: var(--blue); font-size: 10px; }
th.sorted-desc { color: var(--blue); }
th.sorted-desc::after { content: '\25BC'; opacity: 1; color: var(--blue); font-size: 10px; }
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
tbody tr:hover { background: rgba(59,130,246,.06); }
tbody tr.row-expired td { text-decoration: line-through; color: var(--muted); opacity: .6; }
tbody tr.row-expired .tag, tbody tr.row-expired .btn-view, tbody tr.row-expired .btn-dl, tbody tr.row-expired .btn-export, tbody tr.row-expired .btn-copy-sm, tbody tr.row-expired .action-btns { text-decoration: none; opacity: 1; }
td { padding: 10px 12px; vertical-align: middle; font-size: 14px; }
td:nth-child(6), td:nth-child(7) { font-variant-numeric: tabular-nums; letter-spacing: 0.5px; font-weight: 500; }
@media (max-width: 768px) {
    table { table-layout: auto; }
    td, th { padding: 8px 6px; }
    .action-btns { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    td, th { padding: 6px 4px; font-size: 12px; }
    .ev-name { font-size: 12px; }
    .btn-view, .btn-dl, .btn-export { padding: 4px 8px; font-size: 10px; }
}

/* Tags */
.tag { display: inline-block; padding: 4px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-hot { background: #fef2f2; color: #dc2626; }
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-free { background: #f0fdf4; color: #16a34a; }
.tag-sale { background: #fffbeb; color: #d97706; }
.tag-new { background: #faf5ff; color: #7c3aed; }
.tag-active { background: #f0fdf4; color: #16a34a; }
.tag-expired { background: #fef2f2; color: #dc2626; }
.tag-upcoming { background: #eff6ff; color: #2563eb; }
.tag-permanent { background: #f5f5f5; color: #737373; }

.btn-view { background: var(--blue); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-view:hover { opacity: .85; }
.action-btns { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.btn-dl { background: var(--green); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-dl:hover { opacity: .85; }
.btn-dl:disabled { opacity: .5; cursor: not-allowed; }
.btn-export { background: #8b5cf6; color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-export:hover { opacity: .85; }
.btn-export:disabled { opacity: .5; cursor: not-allowed; }
.btn-dl .btn-spinner, .btn-export .btn-spinner, .sidebar-thumb-dl .btn-spinner, .carousel-dl .btn-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
.btn-copy-sm { background: none; border: none; cursor: pointer; font-size: 12px; padding: 2px 6px; opacity: .5; vertical-align: middle; color: var(--blue); border-radius: 3px; }
.btn-copy-sm:hover { opacity: 1; background: rgba(59,130,246,.1); }
.ev-name { font-weight: 600; font-size: 14px; }
.ev-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ev-date { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.month-badge { display: inline-block; background: #eff6ff; color: #2563eb; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-right: 4px; vertical-align: middle; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 100; overflow-y: auto; }
.modal.show { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-dialog { background: var(--surface); border-radius: 12px; width: 95vw; max-width: 1560px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.2); display: flex; flex-direction: column; transition: max-width .3s ease; }
.modal-dialog:has(.modal-fullload) { max-width: 420px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: linear-gradient(135deg, #eff6ff, #eef2ff); border-bottom: 1px solid #93c5fd; }
.modal-header h2 { font-size: 22px; font-weight: 700; color: var(--blue); flex: 1; text-align: center; letter-spacing: 0.5px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 28px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body-wrap { display: flex; gap: 0; }
.modal-banner { position: relative; flex: 1; min-width: 0; }
.modal-banner img { width: 100%; display: block; }
.modal-sidebar { flex: 0 0 400px; padding: 16px 20px; border-left: 1px solid var(--border); overflow-y: auto; max-height: 80vh; }
@media (max-width: 768px) {
    .modal.show { padding: 10px; }
    .modal-dialog { width: 100%; max-height: 90vh; overflow-y: auto; }
    .modal-body-wrap { flex-direction: column; }
    .modal-sidebar { flex: none; border-left: none; border-top: 1px solid var(--border); max-height: none; padding: 12px 14px; }
    .modal-header h2 { font-size: 14px; }
    .modal-header { padding: 10px 14px; }
    .carousel-inner { aspect-ratio: auto; overflow: hidden; }
    .carousel-slide { position: relative; display: none; }
    .carousel-slide.active { display: flex; }
    .carousel-slide img { width: 100%; max-height: none; height: auto; object-fit: cover; }
    .carousel-dots { bottom: 6px; }
    .carousel-counter { top: 6px; right: 6px; font-size: 11px; padding: 2px 8px; }
    .carousel-btn { width: 32px; height: 32px; font-size: 14px; }
    .carousel-prev { left: 4px; }
    .carousel-next { right: 4px; }
}
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 13px; color: var(--muted); font-weight: 600; flex: 0 0 90px; }
.detail-val { font-size: 15px; color: var(--text); flex: 1; }
.detail-row-name .detail-val { font-size: 20px; font-weight: 700; color: var(--text); }
.detail-row-time .detail-val { font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: 0.5px; }

/* Carousel */
.carousel { position: relative; background: var(--surface); border-radius: 4px; overflow: hidden; }
.carousel-watermarks { display: none; }
body.protected .carousel-watermarks { display: block; }
.carousel-wm {
    position: absolute;
    font-weight: 900;
    color: rgba(255,255,255,.15);
    white-space: nowrap;
    transform: rotate(-30deg);
    font-size: 16px;
    letter-spacing: 2px;
}
.carousel-inner { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { max-width: 100%; max-height: 100%; display: block; cursor: zoom-in; object-fit: contain; margin: auto; }
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.3);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    transition: background .2s;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-btn:hover { background: rgba(0,0,0,.5); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.2); cursor: pointer; transition: background .2s; }
.carousel-dot.active { background: var(--blue); }
.carousel-counter { position: absolute; top: 10px; right: 12px; background: rgba(0,0,0,.5); color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; z-index: 2; }
.carousel-dl { position: absolute; bottom: 8px; right: 8px; background: var(--green); color: #fff; border: none; border-radius: 8px; height: 36px; font-size: 13px; font-weight: 600; cursor: pointer; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.carousel-dl:hover { background: #16a34a; }

/* Sidebar thumbnails */
.sidebar-thumbs { margin-top: 16px; }
.sidebar-thumbs-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.sidebar-thumbs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sidebar-thumb-wrap { position: relative; }
.sidebar-thumb-dl { position: absolute; bottom: 3px; right: 3px; background: var(--green); color: #fff; border: none; border-radius: 4px; width: 24px; height: 24px; font-size: 14px; cursor: pointer; line-height: 24px; text-align: center; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.sidebar-thumb-dl:hover { background: #16a34a; }
.sidebar-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; transition: border-color .2s, opacity .2s; opacity: .7; }
.sidebar-thumb:hover { opacity: 1; }
.sidebar-thumb.active { border-color: var(--blue); opacity: 1; }

.loading-text { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.modal-fullload { padding: 60px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 280px; }
.modal-loading { padding: 24px 20px; text-align: center; }
.modal-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-loading-text { font-size: 13px; color: var(--muted); }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 200; align-items: center; justify-content: center; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 32px; cursor: pointer; z-index: 201; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px 0; flex-wrap: wrap; }
.page-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 0 12px; height: var(--input-h); font-size: 13px; cursor: pointer; min-width: 36px; text-align: center; }
.page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-dots { color: var(--muted); font-size: 13px; padding: 0 4px; }
.page-size-sel { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); padding: 0 8px; height: var(--input-h); font-size: 12px; margin-right: 12px; }
@media (max-width: 480px) {
    .pagination { gap: 3px; padding: 10px 0; }
    .page-btn { padding: 0 8px; min-width: 30px; height: 30px; font-size: 12px; }
    .page-size-sel { margin-right: 6px; height: 30px; font-size: 11px; }
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(20px);
    background: var(--green);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    z-index: 300;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.toast.show { opacity: 1; transform: translateX(0); }
@media (max-width: 480px) {
    .toast { left: 10px; right: 10px; top: 10px; transform: translateY(-10px); padding: 10px 16px; font-size: 13px; border-radius: 8px; }
    .toast.show { transform: translateY(0); }
}

/* Downloads list */
.dl-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.dl-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); gap: 12px; cursor: pointer; }
.dl-item:hover { background: var(--bg); }
.dl-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dl-item-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-item-path { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-item-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dl-item-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Confirm dialog */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 400; opacity: 0; transition: opacity .2s; }
.confirm-overlay.show { opacity: 1; }
.confirm-box { background: var(--surface); border-radius: 12px; padding: 24px 28px; min-width: 320px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.confirm-box p { margin: 0 0 20px; font-size: 15px; color: var(--text); font-weight: 500; }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }
.btn-danger { background: #ef4444; color: #fff; border: none; padding: 8px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }
.btn-danger:hover { background: #dc2626; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 16px 0 0; padding: 0 4px; background: var(--border); border-radius: 10px 10px 0 0; padding-top: 4px; }
.tab {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: background .15s, color .15s;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { background: rgba(255,255,255,.5); color: var(--text); }
.tab.active { background: var(--surface); color: var(--blue); box-shadow: 0 -2px 6px rgba(0,0,0,.06); }
.tab-icon { display: inline; font-size: 16px; line-height: 1; }
.tab-badge { display: inline-block; background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 10px; font-weight: 700; margin-left: 4px; min-width: 18px; text-align: center; line-height: 18px; }
.tab-content { padding: 16px; background: var(--surface); border-radius: 0 0 10px 10px; border: 1px solid var(--border); box-sizing: border-box; }
@media (max-width: 768px) {
    .tab { padding: 10px 16px; font-size: 12px; }
    .tab-content { padding: 12px; }
}
@media (max-width: 580px) {
    .tabs { gap: 0; padding: 0; padding-top: 4px; border-radius: 10px 10px 0 0; }
    .tab { flex: 1 1 0; min-width: 0; padding: 10px 6px; font-size: 11px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; min-height: 64px; border-radius: 8px 8px 0 0; }
    .tab-icon { display: block; font-size: 18px; }
    .tab-label { font-size: 10px; white-space: normal; line-height: 1.2; }
    .tab-badge { margin-left: 0; position: absolute; top: 2px; right: 2px; padding: 0 4px; font-size: 9px; min-width: 14px; line-height: 14px; }
    .tab-content { padding: 8px; }
}

/* Guide tab */
.guide { max-width: 100%; }
.guide h3 { font-size: 15px; color: var(--text); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.guide h3:first-child { margin-top: 0; }
.guide p { font-size: 13px; color: var(--text); line-height: 1.7; margin: 6px 0; word-break: break-word; }
.guide p code { word-break: break-all; }
.guide ul { font-size: 13px; color: var(--text); line-height: 1.8; padding-left: 20px; margin: 8px 0; }
.guide-steps { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.guide-step .step-num { margin-top: 2px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.guide-step kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: monospace; color: var(--orange); }
.guide-step code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: monospace; color: var(--green); }
.guide-note { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; font-size: 12px; color: #1e40af; margin: 12px 0; }

/* Shared toolbar (downloads, tracking) */
.log-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.log-info { font-size: 13px; color: var(--muted); }
.log-actions { display: flex; gap: 6px; align-items: center; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11px; }

/* Tracking log */
.tracking-body { max-height: 600px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: #1e293b; padding: 8px; margin-top: 8px; font-family: monospace; font-size: 12px; }
.track-entry { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,.06); align-items: flex-start; }
.track-entry:last-child { border-bottom: none; }
.track-time { color: #64748b; flex-shrink: 0; }
.track-type { font-weight: 700; flex-shrink: 0; min-width: 32px; }
.track-cmd { color: #e2e8f0; font-weight: 600; }
.track-req .track-type { color: #60a5fa; }
.track-ok .track-type { color: #4ade80; }
.track-err .track-type { color: #f87171; }
.track-data { margin: 2px 0 0; padding: 4px 8px; background: rgba(255,255,255,.05); border-radius: 4px; color: #94a3b8; font-size: 11px; white-space: pre-wrap; word-break: break-all; width: 100%; overflow: hidden; }

/* Batch bar */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #1e40af;
    flex-wrap: wrap;
}
@media (max-width: 480px) {
    .batch-bar { padding: 8px 10px; gap: 6px; font-size: 12px; }
    .batch-bar .btn { padding: 0 10px; font-size: 11px; height: 32px; }
}
.batch-bar #batchCount { font-weight: 600; }

/* Checkbox */
thead th:first-child,
tbody td:first-child { text-align: center; vertical-align: middle; }
thead th input[type="checkbox"],
tbody td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--blue);
    vertical-align: middle;
    margin: 0;
}

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state p { font-size: 14px; }

/* Ruffle player in modal */
.ruffle-player-container { width: 100%; height: 500px; background: #000; }
@media (max-width: 768px) { .ruffle-player-container { height: 300px; } }
.ruffle-player-container ruffle-embed,
.ruffle-player-container ruffle-player { width: 100%; height: 100%; }
