:root {
    --bg-main: #1b1c1f;
    --bg-panel: #23252a;
    --bg-card: #26282d;

    --bg-header: #000000;

    --text-main: #e5e7eb;
    --text-muted: #9ca3af;

    --accent: #f59e0b;
    --accent-hover: #fbbf24;

    --border: #34363c;

    --status-ready: #065f46;
    --status-processing: #92400e;
    --status-error: #7f1d1d;
    --status-uploaded: #374151;
    --status-selected: #1e3a8a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header {
    background: var(--bg-header);
    color: #fff;
    padding: 14px 0;
    border-bottom: 1px solid #111;
}

.site-header.is-ftp-disabled {
    background: #b91c1c;
    border-bottom-color: #7f1d1d;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
}

.top-nav a {
    color: #ddd;
    text-decoration: none;
    margin-left: 20px;
}

.top-nav a:hover {
    color: var(--accent);
}

.top-nav a.is-active {
    color: var(--accent);
    background: rgba(245, 158, 11, 0.12);
    border-radius: 6px;
    padding: 6px 9px;
    margin-left: 11px;
}

.panel {
    background: transparent;
}

h1 {
    margin-top: 0;
    font-weight: 600;
}

.login-box,
.card,
.photo-card,
.photo-preview-card,
.photo-info-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    box-shadow: none;
    border: 1px solid var(--border);
}

.login-box {
    max-width: 420px;
    margin: 60px auto;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    background: #111;
    color: white;
}

.form button {
    margin-top: 10px;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #000;
    font-weight: bold;
    cursor: pointer;
}

.form button:hover {
    background: var(--accent-hover);
}

.alert-error {
    background: #3f1d1d;
    color: #fca5a5;
    padding: 10px;
    border-radius: 6px;
}

/* FILTERS */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filters select {
    background: #111;
    color: #fff;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
}

.filters button {
    background: var(--accent);
    border: 0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    color: var(--text-main);
    white-space: nowrap;
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
}

/* GRID */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.photo-card {
    padding: 0;
    overflow: hidden;
    transition: 0.15s ease;
}

.photo-card:hover {
    border-color: var(--accent);
}

.photo-card-link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.thumb {
    aspect-ratio: 1 / 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.no-preview {
    width: 100%;
    height: 100%;
    padding: 0;
    background:
        repeating-linear-gradient(
            45deg,
            #111,
            #111 6px,
            #151515 6px,
            #151515 12px
        );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;

    color: transparent;
    font-size: 0;
    line-height: 0;
}

.no-preview::before {
    content: "?";
    color: #777;
    font-size: 42px;
    line-height: 1;
    opacity: 0.65;
}

.no-preview::after {
    content: "NO PREVIEW";
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: #888;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.08em;
    opacity: 0.75;
    white-space: nowrap;
}

.meta {
    padding: 12px;
    font-size: 13px;
}

.file {
    font-weight: bold;
    margin-bottom: 4px;
}

.author {
    color: var(--text-muted);
    margin-bottom: 6px;
}

.time {
    color: #888;
    font-size: 12px;
}

/* STATUS */

.status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-ready {
    background: #064e3b;
    color: #ffffff;
}

.status-processing {
    background: #78350f;
    color: #ffffff;
}

.status-error {
    background: #7f1d1d;
    color: #ffffff;
}

.status-blocked {
    background: #4c0519;
    color: #fecdd3;
    border: 1px solid #be123c;
}

.status-unassigned {
    background: #3f3f46;
    color: #e4e4e7;
}

.status-uploaded {
    background: #374151;
    color: #d1d5db;
}

.status-selected {
    background: #111111;
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.status-published {
    background: #581c87;
    color: #f5d0fe;
    border: 1px solid #c026d3;
}

/* PAGINATION */

.pagination {
    margin-top: 20px;
}

.pagination a {
    padding: 6px 10px;
    margin-right: 5px;
    background: #111;
    border: 1px solid var(--border);
    text-decoration: none;
    color: white;
}

.pagination a.active {
    background: var(--accent);
    color: black;
}

/* DETAIL */

.photo-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.photo-detail-image {
    width: 100%;
    border-radius: 8px;
}

.photo-detail-image-link {
    display: block;
    min-width: 0;
}

.photo-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.photo-detail-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.photo-detail-side-arrow {
    flex: 0 0 42px;
    width: 42px;
    min-height: 86px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 42px;
    line-height: 1;
}

.photo-detail-side-arrow:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.photo-detail-side-arrow.is-disabled {
    opacity: 0.18;
    pointer-events: none;
}

@media (max-width: 720px) {
    .photo-detail-side-arrow {
        flex-basis: 34px;
        width: 34px;
        min-height: 68px;
        font-size: 34px;
    }
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-table th,
.detail-table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-table th {
    width: 170px;
    color: var(--text-muted);
}

.path-cell {
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .photo-detail-grid {
        grid-template-columns: 1fr;
    }
}

.photo-card.selected {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

.photo-actions {
    margin-top: 20px;
    display:flex;
    gap:10px;
}

.btn {
    padding:8px 14px;
    border-radius:6px;
    text-decoration:none;
    font-weight:600;
    display:inline-block;
}

.btn-primary {
    background:#f59e0b;
    color:black;
}

.btn-secondary {
    background:#374151;
    color:white;
}

.status-clickable {
    cursor:pointer;
    text-decoration:none;
    transition:0.15s;
}

.status-clickable:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
    text-decoration: none;
}

.status-selected.status-clickable {
    box-shadow:0 0 0 1px #f59e0b;
}

.btn-download {
    background:#111;
    color:#f59e0b;
    border:1px solid #f59e0b;
}

.btn-download:hover {
    background:#f59e0b;
    color:black;
}

.status-locked {
    background:#111;
}

.btn-disabled {
    background:#111;
    color:#777;
    border:1px solid #333;
    cursor:not-allowed;
}

.status-downloaded {
    background:#1e293b;
    color:#93c5fd;
    border:1px solid #3b82f6;
}

.photo-card.blocked-photo,
.status-photo-card.blocked-photo {
    border-color: rgba(190, 18, 60, 0.75);
}

.bulk-toolbar {
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.photo-count-summary {
    color: var(--text-muted);
    font-size: 13px;
    margin: -8px 0 14px;
}

.photo-count-summary strong {
    color: var(--text-main);
}

.bulk-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.data-table thead th {
    background: #1a1b1f;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
}

.inline-code {
    font-family: monospace;
    font-size: 13px;
    color: #d1d5db;
    background: #111;
    padding: 2px 6px;
    border-radius: 4px;
}

.role-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text-main);
}

.role-superadmin {
    border-color: #ef4444;
    color: #fca5a5;
}

.role-admin {
    border-color: #f59e0b;
    color: #fcd34d;
}

.role-press_operator {
    border-color: #3b82f6;
    color: #93c5fd;
}

.role-journalist {
    border-color: #8b5cf6;
    color: #c4b5fd;
}

.role-photographer {
    border-color: #10b981;
    color: #86efac;
}

.actions-cell {
    white-space: nowrap;
}

.table-action {
    display: inline-block;
    margin-right: 10px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.table-action:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.table-action-danger {
    color: #f87171;
}

.table-action-danger:hover {
    color: #fca5a5;
}

.button {
    display: inline-block;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    background: var(--accent);
    color: #111;
    font-weight: 700;
}

.button:hover {
    background: var(--accent-hover);
}

@media (max-width: 700px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 14px;
    }
}

.user-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.user-form input,
.user-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    background: #111;
    color: white;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
}

@media (max-width: 800px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.password-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-wrap input {
    flex: 1 1 auto;
    margin: 0;
}

.password-wrap .password-toggle {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    margin-top: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #111;
    color: var(--text-main);
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    line-height: 1;
}

.password-wrap .password-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #111;
}

.password-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.form-help {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.field-feedback {
    min-height: 18px;
    margin-top: 6px;
    font-size: 12px;
}

.field-feedback-error {
    color: #fca5a5;
}

.field-feedback-ok {
    color: #86efac;
}

.field-feedback-muted {
    color: var(--text-muted);
}

.form input.field-invalid {
    border-color: #ef4444;
    color: #fecaca;
}

.form input.field-valid {
    border-color: #22c55e;
}

.form input.field-checking {
    border-color: #f59e0b;
}

.photo-card.locked {
    border-color: rgba(234, 179, 8, 0.65);
    box-shadow: none;
    opacity: 0.85;
}

.status-locked {
    color: rgba(234, 179, 8, 0.65);
    border-color: rgba(234, 179, 8, 0.65);
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.lock-owner {
    font-size: 12px;
    color: var(--text-muted);
}

.panel-status {
    max-width: 760px;
    margin: 0 auto;
}

.status-head {
    margin-bottom: 16px;
}

.status-subhead {
    color: var(--text-muted);
    font-size: 14px;
}

.status-photo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-photo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
}

.status-photo-thumb {
    width: 108px;
    height: 108px;
    flex: 0 0 108px;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.status-no-preview {
    width: 100%;
    height: 100%;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-photo-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.status-photo-file {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.status-photo-state {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.status-photo-time {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .wrap {
        padding: 0 12px;
    }

    .status-photo-card {
        gap: 10px;
        padding: 8px;
    }

    .status-photo-thumb {
        width: 100px;
        height: 100px;
        flex-basis: 100px;
    }

    .status-photo-file {
        font-size: 13px;
    }

    .status-photo-time {
        font-size: 11px;
    }
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    height: 28px;
    width: auto;
    display: block;
}

.brand-text {
    font-weight: 600;
    color: var(--text-main);
    font-size: 18px;
}

.site-header.is-ftp-disabled .brand-text {
    color: #ffffff;
}

.site-header.is-ftp-disabled .top-nav a {
    color: #fee2e2;
}

.site-header.is-ftp-disabled .top-nav a:hover,
.site-header.is-ftp-disabled .top-nav a.is-active {
    color: #ffffff;
}

.site-header.is-ftp-disabled .top-nav a.is-active {
    background: rgba(255, 255, 255, 0.16);
}

.login-page {
    min-height: 100vh;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #111214;
    border-right: 1px solid var(--border);
}

.login-hero-inner {
    width: 100%;
    max-width: 560px;
}

.login-hero-logo {
    width: min(100%, 420px);
    height: auto;
    display: block;
    margin-bottom: 32px;
}

.login-hero-title {
    font-size: clamp(32px, 4vw, 64px);
    line-height: 1.05;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.login-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-side .login-box {
    width: 100%;
    max-width: 420px;
    margin: 0;
}

@media (max-width: 900px) {
    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 28px 20px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .login-hero-inner {
        max-width: 420px;
        text-align: center;
    }

    .login-hero-logo {
        margin: 0 auto 20px;
        width: min(100%, 260px);
    }

    .login-hero-title {
        font-size: clamp(24px, 7vw, 40px);
    }

    .login-side {
        padding: 24px 16px 40px;
    }
}

.login-hero-title div:last-child {
    margin-left: 1.4em;
}

@media (max-width: 900px) {
    .login-hero-title div:last-child {
        margin-left: 0;
    }
}

.login-hero-title div:last-child {
    font-weight: 500;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: relative;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
    }

    .top-nav {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: 20px;
        left: 20px;
        margin-left: 0;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 10px;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    }

    .top-nav.is-open {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .top-nav a {
        margin-left: 0;
        padding: 12px 10px;
        border-radius: 8px;
        color: var(--text-main);
    }

    .top-nav a:hover {
        background: rgba(255,255,255,0.04);
        color: var(--accent);
    }

    .top-nav a.is-active {
        margin-left: 0;
        padding: 12px 10px;
    }
}

.ingest-status {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ingest-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.ingest-uploading {
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.ingest-processing {
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.ingest-dots {
    display: inline-flex;
    gap: 1px;
    line-height: 1;
}

.ingest-dots span {
    animation: ingest-dots 1.2s infinite;
    opacity: 0.35;
}

.ingest-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ingest-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ingest-dots {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.ingest-status-inline {
    margin-left: auto;
}

@media (max-width: 900px) {
    .ingest-status-inline {
        margin-left: 0;
        width: 100%;
    }
}

.list-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.list-table th,
.list-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.list-table th {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255,255,255,0.02);
}

.list-table tr:last-child td {
    border-bottom: 0;
}

.firewall-switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.firewall-switch-card h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.firewall-switch-state {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .firewall-switch-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .firewall-switch-state {
        justify-content: flex-start;
    }
}

.event-title-main {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.event-title-sub,
.table-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.event-flags {
    margin-top: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.badge-success {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.10);
}

.badge-warning {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.10);
}

.badge-danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.60);
    background: rgba(185, 28, 28, 0.35);
}

.badge-muted {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.10);
}

.badge-info {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.10);
}

.table-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-grid-span-2 {
    grid-column: 1 / -1;
}

.event-form textarea {
    min-height: 110px;
    resize: vertical;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.event-timezone-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-timezone-field select:disabled {
    opacity: 0.55;
}

.participant-pickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.help-admin-card {
    margin-bottom: 16px;
}

.help-admin-card h2 {
    margin-top: 0;
}

.help-title-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.help-title-cell small {
    color: var(--text-muted);
    font-size: 12px;
}

.help-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.help-inline-form,
.help-rename-form,
.help-replace-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.help-rename-form input[type="text"] {
    width: 180px;
    min-width: 0;
}

.help-replace-form input[type="file"] {
    max-width: 220px;
}

.button-small,
button.button-small {
    padding: 5px 8px;
    font-size: 12px;
}

.help-table th:last-child,
.help-table td:last-child {
    min-width: 420px;
}

.participant-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

.participant-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}

.participant-item strong {
    display: block;
    color: var(--text-main);
}

.participant-item small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .participant-pickers {
        grid-template-columns: 1fr;
    }
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 16px;
}

.dashboard-card {
    min-width: 0;
}

.dashboard-card-main {
    grid-column: 1 / -1;
}

.dashboard-card-people {
    min-width: 0;
}

.dashboard-card-summary {
    min-width: 0;
}

.dashboard-event-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-event-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.dashboard-event-title {
    margin: 0 0 6px;
    font-size: 28px;
}

.dashboard-clock {
    color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.dashboard-clock-zone {
    margin-top: -8px;
    color: var(--text-muted);
    font-size: 12px;
}

.dashboard-beep-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    user-select: none;
}

.dashboard-beep-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.dashboard-event-sub {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dashboard-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dashboard-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.dashboard-subvalue {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.stat-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-table {
    table-layout: fixed;
}

.dashboard-table .col-name {
    width: 54%;
}

.dashboard-table .col-mobile {
    width: 26%;
}

.dashboard-table-photographers .col-mini {
    width: 10%;
}

.dashboard-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.dashboard-name-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-main);
}

.dashboard-num-cell {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.badge-runner {
    flex: 0 0 auto;
    padding: 2px 6px;
    font-size: 11px;
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.14);
}

@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-links {
        grid-template-columns: 1fr;
    }

    .dashboard-table {
        table-layout: auto;
    }
}

@media (max-width: 640px) {
    .dashboard-event-head {
        flex-direction: column;
    }

    .dashboard-event-side {
        align-items: flex-start;
        width: 100%;
    }

    .dashboard-clock {
        font-size: 42px;
    }

    .dashboard-meta-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 22px;
    }
}

.dashboard-value a {
    word-break: break-all;
}

.dashboard-value a {
    color: var(--accent);
    text-decoration: none;
    word-break: break-all;
}

.dashboard-value a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.button-muted {
    background: #111;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.button-muted:hover {
    background: #1a1b1f;
    color: var(--accent);
}

.status-scope-switch {
    margin-top: 12px;
}

.used-photos-panel {
    margin-top: 14px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.used-photos-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.used-photos-summary strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text-main);
    font-size: 14px;
}

.used-photos-summary span,
.used-photos-actions span {
    color: var(--text-muted);
    font-size: 12px;
}

.used-photos-output {
    margin-top: 12px;
}

.used-photos-output textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    box-sizing: border-box;
    padding: 10px;
    color: var(--text-main);
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: 13px/1.5 monospace;
}

.used-photos-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.participant-item-runner {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.participant-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.participant-runner-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 13px;
}

.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #111;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
}

.help-tip:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.public-dashboard {
    background: #0b0b0b;
    color: #ddd;
}

.public-wrap {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.public-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.public-header img {
    height: 42px;
}

.public-title {
    font-size: 20px;
    font-weight: 600;
}

.public-subtitle {
    color: var(--text-muted);
}

.event-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
    margin: 16px 0;
}

.event-link {
    margin-top: 14px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.summary-box {
    background: #111;
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 8px;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: var(--text-muted);
}

.summary-value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 4px;
}

.login-public-link {
    margin-top: 18px;
    text-align: center;
}

.login-public-link a {
    color: var(--accent);
    text-decoration: none;
}

.login-hero-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.login-ongoing-event {
    margin-top: auto;
    padding-top: 28px;
}

.login-ongoing-event-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

.login-ongoing-event-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.top-nav-public {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.top-nav-public a {
    margin-left: 20px;
    color: #ddd;
    text-decoration: none;
}

.top-nav-public a:hover {
    color: var(--accent);
}

.dashboard-grid-public {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.dashboard-card-summary-public {
    align-self: start;
}

@media (max-width: 1000px) {
    .dashboard-grid-public {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .login-ongoing-event {
        margin-top: 24px;
        padding-top: 0;
        text-align: center;
    }

    .login-ongoing-event-link {
        font-size: 20px;
    }
}

.photo-card.exif-problem {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.55);
}

.photo-card.exif-problem:hover {
    border-color: #ef4444;
}

.photo-warning {
    margin-top: 6px;
    font-size: 12px;
    color: #fca5a5;
}

.detail-exif-problem {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
}

.photo-card.unassigned-event-photo,
.status-photo-card.unassigned-event-photo {
    opacity: 0.48;
    filter: grayscale(0.8);
}

.photo-card.unassigned-event-photo:hover,
.status-photo-card.unassigned-event-photo:hover {
    border-color: var(--border);
}

.photo-warning-unassigned {
    color: #d4d4d8;
}

.detail-unassigned-event-photo {
    opacity: 0.55;
    filter: grayscale(0.8);
}

.detail-problem-value {
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
    border-left: 3px solid #dc2626;
}

.status-photo-card.exif-problem {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.55);
}

.status-photo-card.exif-problem:hover {
    border-color: #ef4444;
}

/* participant picker - new table layout */

.participant-pickers-enhanced {
    grid-template-columns: 1fr;
    gap: 18px;
}

.participant-card-full {
    width: 100%;
}

.participant-picker {
    position: relative;
}

.participant-picker-add-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.participant-add-label {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.participant-picker-search {
    position: relative;
    margin-bottom: 0;
}

.participant-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: #111;
    color: #fff;
}

.participant-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.participant-suggest-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: hidden;
}

.participant-suggest-item {
    width: 100%;
    display: block;
    text-align: left;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-main);
    cursor: pointer;
}

.participant-suggest-item:last-child {
    border-bottom: 0;
}

.participant-suggest-item:hover {
    background: rgba(255,255,255,0.04);
}

.participant-suggest-item strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
}

.participant-suggest-item small {
    display: block;
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.participant-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.participant-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.01);
}

.participant-table th,
.participant-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.participant-table thead th {
    background: #1a1b1f;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.participant-table tbody tr[data-index="0"] {
    background: rgba(255,255,255,0.025);
}

.participant-table tbody tr[data-index="1"] {
    background: rgba(255,255,255,0.055);
}

.participant-table tbody tr:last-child td {
    border-bottom: 0;
}

.participant-name-wrap strong {
    display: block;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.35;
}

.participant-name-wrap small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
}

.participant-phone-cell {
    color: var(--text-main);
    font-size: 14px;
    white-space: nowrap;
}

.participant-col-runner,
.participant-runner-cell {
    width: 90px;
    text-align: center !important;
}

.participant-col-action,
.participant-action-cell {
    width: 110px;
    text-align: right !important;
    white-space: nowrap;
}

.participant-runner-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.participant-remove-btn {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111;
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
}

.participant-remove-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.participant-remove-btn-small {
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1.2;
}

.participant-empty {
    margin-top: 10px;
    padding: 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13px;
    background: rgba(255,255,255,0.01);
}

@media (max-width: 900px) {
    .participant-picker-add-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .participant-add-label {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .participant-table thead {
        display: none;
    }

    .participant-table,
    .participant-table tbody,
    .participant-table tr,
    .participant-table td {
        display: block;
        width: 100%;
    }

    .participant-table tr {
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
    }

    .participant-table td {
        border: 0;
        padding: 4px 0;
        text-align: left !important;
    }

    .participant-phone-cell::before {
        content: "Telefon: ";
        color: var(--text-muted);
        font-size: 12px;
    }

    .participant-runner-cell::before {
        content: "Runner: ";
        color: var(--text-muted);
        font-size: 12px;
        margin-right: 6px;
    }

    .participant-action-cell {
        padding-top: 8px !important;
    }
}
.alert-success {
    background: #153b2b;
    color: #a7f3d0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-info {
    background: #1e293b;
    color: #bfdbfe;
    padding: 10px;
    border-radius: 6px;
}

.btn-danger {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #b91c1c;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
}

.btn-danger:hover {
    background: #991b1b;
    color: #ffffff;
}
.event-form textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

/* custom confirm modal */

body.modal-open {
    overflow: hidden;
}

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

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
}

.confirm-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100vw - 32px));
    margin: 10vh auto 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    padding: 22px 22px 18px;
}

.confirm-modal-dialog h3 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.2;
    color: var(--text-main);
}

.confirm-modal-message {
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 18px;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.confirm-modal-actions .button,
.confirm-modal-actions .btn-danger {
    margin-top: 0;
}

@media (max-width: 640px) {
    .confirm-modal-dialog {
        margin-top: 6vh;
        padding: 18px 16px 16px;
    }

    .confirm-modal-dialog h3 {
        font-size: 20px;
    }

    .confirm-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .confirm-modal-actions .button,
    .confirm-modal-actions .btn-danger {
        width: 100%;
        text-align: center;
    }
}
.dashboard-event-description {
    margin-top: 6px;
    font-size: 16px;
    line-height: 1.45;
    color: var(--text-main);
    max-width: 900px;
}
.photos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
    align-items: start;
}

.photos-main {
    min-width: 0;
}

.chat-sidebar {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.chat-sidebar.is-collapsed {
    width: 58px;
    min-width: 58px;
}

.chat-sidebar.is-collapsed .event-chat-messages,
.chat-sidebar.is-collapsed .event-chat-form {
    display: none;
}

.chat-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

@media (max-width: 1100px) {
    .photos-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
    }
}

/* ===== CHAT KOMPONENTA ===== */

.event-chat-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 70vh;
}

.event-chat-head {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.event-chat-messages {
    flex: 1 1 auto;
    min-height: 320px;
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
}

.event-chat-message {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    box-sizing: border-box;
}

.event-chat-message.is-mine {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.event-chat-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.event-chat-meta strong {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
}

.event-chat-text {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
    color: var(--text-main);
    font-size: 14px;
}

.event-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-chat-form textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #111;
    color: #fff;
    font: inherit;
    box-sizing: border-box;
}

/* sidebar na photos */
.chat-sidebar .event-chat-messages {
    max-height: calc(100vh - 180px);
    min-height: 260px;
}

/* mobilni stranka chatu */
@media (max-width: 900px) {
    .event-chat-page {
        min-height: auto;
    }

    .event-chat-messages {
        min-height: 45vh;
        max-height: none;
        padding: 2px 0;
    }

    .event-chat-message {
        border-radius: 14px;
        padding: 10px 12px;
        margin: 0;
    }

    .event-chat-meta {
        flex-wrap: wrap;
        gap: 4px 10px;
    }

    .event-chat-text {
        font-size: 15px;
        line-height: 1.5;
    }

    .event-chat-form textarea {
        min-height: 96px;
        font-size: 16px;
    }
}
/* ===== CHAT IKONA V HLAVICCE ===== */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-chat-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #111;
    color: var(--text-main);
    text-decoration: none;
    position: relative;
    flex: 0 0 auto;
}

.header-chat-indicator:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.header-chat-icon {
    font-size: 16px;
    line-height: 1;
}

.header-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}

.header-chat-badge[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .brand {
        gap: 8px;
        min-width: 0;
    }

    .brand-link {
        min-width: 0;
    }

    .brand-text {
        font-size: 16px;
    }

    .header-chat-indicator {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
    }

    .header-chat-icon {
        font-size: 15px;
    }

    .header-chat-badge {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
        padding: 0 5px;
    }
}
.event-chat-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.event-chat-history-link {
    text-decoration: none;
}

.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .mobile-only {
        display: flex;
    }
}
.form-actions-danger {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
/*
body::after {
    content: "css-v4";
    position: fixed;
    right: 6px;
    bottom: 6px;
    z-index: 99999;
    background: #b91c1c;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    opacity: 0.85;
    pointer-events: none;
}
*/
.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px;
    border: 2px dashed #4b5563;
    border-radius: 8px;
    background: #15171b;
    color: var(--text-main);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--accent);
    background: #1d1f24;
}

.upload-dropzone-title {
    font-size: 22px;
    font-weight: 700;
}

.upload-dropzone-subtitle,
.upload-dropzone-files {
    margin-top: 8px;
    color: var(--text-muted);
}

.upload-dropzone-files {
    font-size: 13px;
}

.upload-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.upload-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.upload-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #111;
    border: 1px solid var(--border);
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.15s ease;
}

.upload-result-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.upload-result {
    padding: 10px;
    border-radius: 6px;
}

.upload-result-paired {
    background: #153b2b;
    color: #a7f3d0;
}

.upload-result-unpaired {
    background: #3b2a13;
    color: #fcd34d;
}

.ftp-replacement-panel .page-head {
    border-bottom: 1px solid rgba(45, 212, 191, 0.28);
}

.ftp-replacement-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(45, 212, 191, 0.25);
    border-radius: 8px;
    background: #102220;
}

.ftp-replacement-intro > div {
    flex: 1 1 280px;
}

.ftp-replacement-intro p {
    margin: 4px 0 0;
    color: var(--text-muted);
}

.ftp-replacement-card {
    border-color: rgba(45, 212, 191, 0.28);
}

.ftp-replacement-dropzone {
    border-color: #2dd4bf;
    background: #0d1f1d;
}

.ftp-replacement-dropzone:hover,
.ftp-replacement-dropzone.is-dragover {
    border-color: #5eead4;
    background: #12312d;
}

.ftp-replacement-progress-bar {
    background: #2dd4bf;
}

.ftp-upload-result-ok {
    background: #12312d;
    color: #99f6e4;
}

.gallery-access-card {
    margin-bottom: 16px;
    border-color: rgba(45, 212, 191, 0.28);
}

.gallery-access-output {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: flex-start;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.gallery-access-url {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0 8px;
}

.gallery-access-url input {
    flex: 1 1 auto;
    min-width: 220px;
}

.gallery-access-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gallery-access-qr img {
    width: 160px;
    height: 160px;
    padding: 8px;
    border-radius: 6px;
    background: #fff;
}

.gallery-access-regenerate-form {
    margin-top: 12px;
}

.gallery-access-empty {
    margin-top: 14px;
}

.public-gallery-wrap {
    padding-top: 24px;
    padding-bottom: 40px;
}

.public-gallery-login h2 {
    margin-top: 0;
}

@media (max-width: 800px) {
    .gallery-access-output {
        grid-template-columns: 1fr;
    }

    .gallery-access-qr {
        align-items: flex-start;
    }

    .gallery-access-url {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery-access-url input {
        min-width: 0;
    }
}

.published-time {
    margin-top: 6px;
    color: #fcd34d;
    font-size: 12px;
    line-height: 1.3;
}

.detail-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.timing-table td,
.published-detail-table td {
    line-height: 1.5;
}

.mini-publish {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-sidebar.is-collapsed .mini-publish {
    display: none;
}

.mini-publish-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
}

.mini-publish-head a {
    color: var(--accent);
    font-size: 12px;
    text-decoration: none;
}

.mini-publish-dropzone {
    min-height: 82px;
    padding: 12px;
    border: 2px dashed #4b5563;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.mini-publish-dropzone:hover,
.mini-publish-dropzone.is-dragover {
    border-color: var(--accent);
    background: #1d1f24;
}

.mini-publish-dropzone span {
    font-weight: 700;
    font-size: 13px;
}

.mini-publish-dropzone small {
    max-width: 100%;
    color: var(--text-muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-publish-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mini-publish-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-publish-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 11px;
}

.mini-publish-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #111;
    border: 1px solid var(--border);
}

.mini-publish-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.15s ease;
}

.mini-publish button {
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #111;
    font-weight: 700;
    cursor: pointer;
}

.mini-publish button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.mini-publish-result {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mini-publish-message {
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
}

.mini-publish-ok {
    background: #153b2b;
    color: #a7f3d0;
}

.mini-publish-warning {
    background: #3b2a13;
    color: #fcd34d;
}

.mini-publish-error {
    background: #3f1d1d;
    color: #fca5a5;
}

.chat-sidebar {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    gap: 14px;
    min-height: 0;
}

.chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 440px;
    max-height: calc(100vh - 40px);
}

.chat-sidebar.is-collapsed {
    padding-left: 0;
    padding-right: 0;
}

.chat-sidebar.is-collapsed .chat-panel {
    width: 58px;
    min-width: 58px;
    padding-left: 8px;
    padding-right: 8px;
}

.mini-publish {
    padding: 12px;
    background: #211d16;
    border: 1px solid rgba(245, 158, 11, 0.38);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mini-publish-dropzone {
    border-radius: 12px;
    border-color: rgba(245, 158, 11, 0.55);
    background: #15120d;
}

.mini-publish-dropzone:hover,
.mini-publish-dropzone.is-dragover {
    background: #241b10;
}

.side-panel-toggle-row {
    display: flex;
    justify-content: flex-end;
}

.side-panel-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #111;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
}

.side-panel-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chat-sidebar.is-collapsed .side-panel-toggle-row {
    justify-content: center;
}

.chat-sidebar.is-collapsed .side-panel-toggle-icon {
    transform: rotate(180deg);
}

.side-panel-toggle-icon {
    display: block;
    transform: translateX(-1px);
    transition: transform 0.15s ease;
}

.chat-sidebar-head {
    justify-content: flex-start;
}

.chat-sidebar.is-collapsed .chat-sidebar-head strong {
    display: none;
}

.side-panel-collapsed-icons {
    display: none;
}

.side-panel-collapsed-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.side-panel-collapsed-label {
    display: none !important;
}

.chat-sidebar.is-collapsed .chat-panel {
    align-items: center;
    gap: 12px;
}

.chat-sidebar.is-collapsed .chat-sidebar-head {
    display: none;
}

.chat-sidebar.is-collapsed .side-panel-collapsed-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 6px 0;
}

.chat-sidebar.is-collapsed .side-panel-collapsed-icon {
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
}

.chat-sidebar.is-collapsed .side-panel-collapsed-icon:hover {
    color: var(--accent);
}

.published-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.published-page-head {
    margin-bottom: 18px;
}

.published-page-head h1 {
    margin-bottom: 8px;
}

.published-event-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.published-event-description {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    max-width: 900px;
}

.published-license-note {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    max-width: 980px;
}

.published-license-note a {
    color: var(--accent-hover);
}

.published-work-note {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin: 10px 0 0;
    padding: 8px 11px;
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.published-work-note strong {
    color: var(--accent-hover);
    font-size: 18px;
    font-weight: 800;
}

.published-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.published-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.published-card.is-downloaded-session {
    border-color: rgba(16, 185, 129, 0.55);
}

.published-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid var(--border);
}

.published-thumb-link {
    display: block;
    aspect-ratio: 3 / 2;
    background: #111;
    overflow: hidden;
}

.published-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.published-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    font-size: 13px;
}

.published-download-button {
    align-self: flex-start;
    margin-top: 4px;
}

.published-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.published-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.published-detail-preview {
    position: relative;
    min-height: 420px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.published-detail-preview img {
    width: 100%;
    max-height: calc(100vh - 210px);
    object-fit: contain;
    display: block;
}

.published-detail-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    text-decoration: none;
    font-size: 42px;
    line-height: 1;
}

.published-detail-arrow:hover {
    color: var(--accent);
}

.published-detail-arrow-prev {
    left: 0;
}

.published-detail-arrow-next {
    right: 0;
}

.published-detail-info h1 {
    font-size: 20px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .published-detail-layout {
        grid-template-columns: 1fr;
    }

    .published-detail-preview {
        min-height: 260px;
    }
}

.top-nav a.nav-logout {
    position: relative;
}

.nav-logout-tooltip {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 20;
    display: block;
    min-width: max-content;
    max-width: 260px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease;
    white-space: nowrap;
}

.top-nav a.nav-logout:hover .nav-logout-tooltip,
.top-nav a.nav-logout:focus .nav-logout-tooltip,
.top-nav a.nav-logout:focus-visible .nav-logout-tooltip {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .nav-logout-tooltip {
        right: auto;
        left: 10px;
        top: calc(100% + 4px);
    }
}
