* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    margin: 0;
    min-height: 100vh;
}

body.narrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.wide .container {
    max-width: 1100px;
    padding: 24px;
    margin: 0 auto;
}

body.fullscreen { display: block; }
body.fullscreen .container {
    max-width: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}
body.fullscreen main { flex: 1; min-height: 0; }

.container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

header h1 {
    text-align: center;
    margin: 0 0 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #f8fafc;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 24px;
    padding: 0 8px;
}
.app-header h1 { margin: 0; font-size: 22px; text-align: left; }
.app-header h1 a { color: #f8fafc; text-decoration: none; }
.topnav {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
}
.topnav a { color: #93c5fd; text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.topnav .who { color: #94a3b8; }
.mode-badge {
    margin: 0;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter .15s;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.mode-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
    box-shadow: 0 0 6px currentColor;
}
.mode-badge:hover { filter: brightness(1.15); }
.mode-badge:disabled { opacity: 0.6; cursor: progress; }
.mode-production .mode-badge::before, .mode-badge.mode-production::before { animation: mode-pulse 2s ease-in-out infinite; }
@keyframes mode-pulse {
    0%, 100% { box-shadow: 0 0 6px currentColor; }
    50%      { box-shadow: 0 0 12px currentColor; }
}
.mode-production {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
    border-color: rgba(22, 163, 74, 0.4);
}
.mode-dev {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}
.inline-logout { margin: 0; display: inline; }
.inline-logout button.link {
    background: none;
    color: #f87171;
    padding: 0;
    width: auto;
    border: 0;
    font-size: 14px;
    margin: 0;
    cursor: pointer;
}

.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card h2 {
    margin: 0 0 20px;
    font-weight: 500;
}

label {
    display: block;
    margin-bottom: 16px;
    font-size: 14px;
    color: #94a3b8;
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 15px;
}

input[type="number"] { width: auto; }

input:focus { outline: none; border-color: #3b82f6; }

button, .button-link {
    display: inline-block;
    padding: 11px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: none;
}

button:hover, .button-link:hover { background: #2563eb; }

button.secondary { background: #475569; }
button.secondary:hover { background: #334155; }

button.link {
    background: none;
    color: #93c5fd;
    padding: 0;
    margin: 0;
    width: auto;
    border: 0;
    font-size: 13px;
    cursor: pointer;
}
button.link.danger { color: #f87171; }

.muted { color: #94a3b8; font-size: 13px; }
.muted a { color: #60a5fa; text-decoration: none; }

.flashes { list-style: none; padding: 0; margin: 0 0 16px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-error { background: #7f1d1d; color: #fecaca; border: 1px solid #991b1b; }
.flash-success { background: #14532d; color: #bbf7d0; border: 1px solid #166534; }

/* ── Модуль повідомлень: дзвіночок, toast-и, модалки ─────────────────── */
.notif-bell { position: relative; display: inline-flex; align-items: center; }
.notif-badge {
    position: absolute; top: -8px; right: -10px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: #dc2626; color: #fff;
    font-size: 11px; line-height: 17px; text-align: center; font-weight: 600;
    display: none;
}
.notif-badge.show { display: block; }

.toast-stack {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 360px; pointer-events: none;
}
.toast {
    pointer-events: auto;
    background: #1e293b; color: #e2e8f0;
    border: 1px solid #334155; border-left-width: 4px;
    border-radius: 8px; padding: 12px 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    font-size: 14px; opacity: 0; transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast .toast-title { font-weight: 600; margin-bottom: 3px; }
.toast--info { border-left-color: #38bdf8; }
.toast--success { border-left-color: #22c55e; }
.toast--warning { border-left-color: #f59e0b; }
.toast--error { border-left-color: #ef4444; }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(2, 6, 23, 0.7);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
    background: #0f172a; color: #e2e8f0;
    border: 1px solid #334155; border-top-width: 4px;
    border-radius: 12px; padding: 22px 24px;
    max-width: 520px; width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-card.level-info { border-top-color: #38bdf8; }
.modal-card.level-success { border-top-color: #22c55e; }
.modal-card.level-warning { border-top-color: #f59e0b; }
.modal-card.level-error { border-top-color: #ef4444; }
.modal-card h3 { margin: 0 0 12px; font-size: 18px; }
.modal-card .modal-body { white-space: pre-wrap; line-height: 1.5; font-size: 15px; }
.modal-card .modal-meta { color: #94a3b8; font-size: 12px; margin-top: 14px; }
.modal-card .modal-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 16px; border-radius: 8px; font-size: 14px; cursor: pointer;
    background: #334155; color: #e2e8f0; border: 1px solid #475569; text-decoration: none;
}
.btn:hover { background: #3f4d63; }
.btn.primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.btn.primary:hover { background: #2563eb; }
.btn.danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Модалка незворотного видалення тренування (/training) */
.modal-body.del-impact { white-space: normal; }
.del-impact .del-group { border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.del-impact .del-danger { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.35); }
.del-impact .del-affect { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.30); }
.del-impact .del-head { font-weight: 600; margin-bottom: 6px; }
.del-impact ul { margin: 4px 0 0; padding-left: 20px; }
.del-impact ul ul { margin: 4px 0; }
.del-impact li { margin: 2px 0; }
.del-impact .del-blocked { color: #fca5a5; font-weight: 600; }
.del-impact .del-confirm-label { margin: 14px 0 6px; }
.del-impact .del-confirm-input {
    width: 100%; padding: 8px 10px; border-radius: 8px;
    background: #0b1220; color: #e2e8f0; border: 1px solid #475569; font-size: 14px;
}
.toast .toast-action {
    display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600;
    color: #93c5fd; text-decoration: none;
}
.toast .toast-action:hover { text-decoration: underline; }

/* закріплення відео (на сторінці відео, для адміна/менеджера) */
.assign-box {
    border: 1px solid #1f2937; border-radius: 10px;
    padding: 12px 14px; margin: 12px 0; background: #111827;
}
.assign-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 600;
}
.assign-head .small { font-weight: 400; }
.assign-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.assign-controls select { width: auto; min-width: 240px; margin: 0; }

/* Бейджі датасетів, до яких закріплене відео (на сторінці відео). */
.ds-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; background: #1e293b; border: 1px solid #334155;
    border-radius: 6px; font-size: 13px;
}
.ds-badge a { text-decoration: none; color: #93c5fd; }
.ds-badge a:hover { text-decoration: underline; }
.ds-remove {
    background: none; border: none; color: #f87171; cursor: pointer;
    font-size: 13px; line-height: 1; padding: 0 2px;
}
.ds-remove:hover { color: #ef4444; }

/* інбокс */
.notif-page { max-width: 760px; margin: 0 auto; }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-item {
    border: 1px solid #1f2937; border-left-width: 4px;
    border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; background: #111827;
}
.notif-item.level-info { border-left-color: #38bdf8; }
.notif-item.level-success { border-left-color: #22c55e; }
.notif-item.level-warning { border-left-color: #f59e0b; }
.notif-item.level-error { border-left-color: #ef4444; }
.notif-item.unread { background: #18233a; }
.notif-item-head { display: flex; align-items: center; gap: 10px; }
.notif-item .notif-title { font-weight: 600; font-size: 15px; }
.notif-item .notif-body { margin-top: 4px; line-height: 1.5; white-space: pre-wrap; }
.notif-item .notif-flag {
    font-size: 11px; font-weight: 600; color: #bfdbfe;
    background: #1d4ed8; border-radius: 999px; padding: 1px 8px;
}
.notif-item .notif-meta {
    color: #94a3b8; font-size: 12px; margin-top: 10px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.notif-pill {
    text-transform: uppercase; letter-spacing: .3px; font-weight: 600;
    border-radius: 999px; padding: 1px 8px; font-size: 11px;
    border: 1px solid currentColor;
}
.notif-pill.level-info { color: #7dd3fc; }
.notif-pill.level-success { color: #86efac; }
.notif-pill.level-warning { color: #fcd34d; }
.notif-pill.level-error { color: #fca5a5; }

.notif-empty { text-align: center; padding: 56px 20px; }
.notif-empty .notif-empty-icon { font-size: 44px; display: block; margin-bottom: 12px; opacity: .5; }
.notif-empty p { margin: 4px 0; font-size: 16px; }
.notif-empty p.muted { font-size: 13px; }

.notif-pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-top: 16px;
}

/* композер повідомлень */
.compose-form fieldset {
    border: 1px solid #1f2937; border-radius: 10px;
    padding: 12px 16px 16px; margin: 0 0 18px;
}
.compose-form legend { padding: 0 6px; color: #94a3b8; font-size: 13px; }
.compose-form .radio-row {
    display: flex; align-items: center; gap: 8px;
    margin: 8px 0; font-size: 14px; color: #e2e8f0; cursor: pointer;
}
.compose-form .radio-row input { width: auto; margin: 0; }
.compose-form select.indent { margin: 0 0 8px 26px; width: calc(100% - 26px); }
.compose-form select[multiple] { height: auto; }
.compose-form .dim { opacity: .45; }
.compose-form textarea {
    width: 100%; margin-top: 6px; padding: 10px 12px;
    background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    color: #e2e8f0; font-size: 15px; font-family: inherit; resize: vertical;
}
.compose-form textarea:focus { outline: none; border-color: #3b82f6; }
.compose-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.compose-field { flex: 1; min-width: 200px; margin-bottom: 14px; }
.compose-field > label { display: block; color: #94a3b8; font-size: 13px; }
.compose-field input, .compose-field select { margin-top: 6px; }
.compose-actions { margin-top: 6px; }

/* breadcrumb */
.breadcrumb {
    list-style: none;
    margin: 0 0 16px;
    padding: 8px 14px;
    background: #1e293b;
    border: 1px solid #1f2937;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    align-items: center;
}
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
}
.breadcrumb li + li::before {
    content: "›";
    color: #475569;
    margin: 0 2px;
}
.breadcrumb a { color: #93c5fd; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .current { color: #e2e8f0; font-weight: 500; }
body.fullscreen .breadcrumb {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin: 0;
    background: #0b1220;
}

/* dashboard */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.dash-hero-text h2 { margin: 0 0 4px; font-size: 24px; }
.dash-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button-link.primary { background: #3b82f6; }
.button-link.primary:hover { background: #2563eb; }

.account-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 24px;
    margin: 0;
}
.account-info dt { color: #94a3b8; font-size: 13px; }
.account-info dd { margin: 0; color: #e2e8f0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(59,130,246,0.12), transparent 60%);
    pointer-events: none;
}
.stat-icon { font-size: 22px; opacity: 0.8; }
.stat-num { font-size: 32px; font-weight: 600; color: #f8fafc; line-height: 1.1; }
.stat-label { color: #94a3b8; font-size: 13px; }

.dash-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.dash-col { padding: 20px 22px; }
/* /test-model master-detail: вузька колонка списку + гнучка деталь.
   Перекриває рівні колонки .dash-cols; min-width:0 + overflow-x не дають
   широкій таблиці історії розпирати сторінку (CSS-grid blowout). */
.tm-cols { grid-template-columns: minmax(220px, 300px) 1fr; align-items: start; }
.tm-cols > .dash-col { min-width: 0; }
#model-detail { overflow-x: auto; }
@media (max-width: 720px) { .tm-cols { grid-template-columns: 1fr; } }
.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.card-head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.card-head a.muted { font-size: 13px; }

.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-item {
    padding: 10px 0;
    border-bottom: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.recent-item:last-child { border-bottom: 0; }
.recent-name {
    font-weight: 500;
    color: #e2e8f0;
    text-decoration: none;
}
.recent-name:hover { color: #93c5fd; }
.recent-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    align-items: center;
    flex-wrap: wrap;
}
.job-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.job-row progress { width: 120px; height: 8px; }
.job-kind { color: #cbd5e1; font-weight: 500; font-size: 13px; }
.job-msg { font-size: 12px; }

.empty-block { padding: 16px 0; text-align: center; }
.empty-block p { margin: 0 0 12px; }

.dash-tips { padding: 22px 26px; }
.dash-tips h3 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
}
.steps li {
    counter-increment: step;
    padding: 8px 0 8px 40px;
    position: relative;
    color: #cbd5e1;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #1d4ed8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.logout-bottom { text-align: center; margin-top: 12px; }
.logout-bottom button { width: auto; min-width: 120px; }

/* videos list */
.upload-form { display: flex; align-items: end; gap: 12px; margin-bottom: 12px; }
.upload-form label { flex: 1; margin-bottom: 0; }
.dropzone {
    flex: 1;
    border: 2px dashed #475569;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 0;
    background: #0b1220;
}
.dropzone:hover, .dropzone.hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    color: #cbd5e1;
}
.dropzone.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
}
.dropzone input[type="file"] { display: none; }

#upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 8px;
}
#upload-progress progress { flex: none; width: 240px; }
#upload-text { font-weight: 500; }
#upload-info { font-size: 12px; }
.videos-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.videos-table th, .videos-table td { text-align: left; padding: 10px; border-bottom: 1px solid #334155; }
.videos-table th { color: #94a3b8; font-weight: 500; font-size: 13px; }
.badge { padding: 3px 8px; border-radius: 6px; font-size: 12px; background: #334155; }
.badge-ready { background: #14532d; color: #bbf7d0; }
.badge-extracting { background: #1e3a8a; color: #bfdbfe; }
.badge-failed { background: #7f1d1d; color: #fecaca; }
.badge-uploaded { background: #475569; }
.inline { display: inline-block; margin: 0; }

/* ---- Videos list page ("Ваші відео") polish ---- */
/* White section heading */
.card:has(#upload-form) > h2 { color: #ffffff; }

/* Filename / frame links — light text, padded pill, soft light hover */
.card:has(#upload-form) .videos-table td a {
    display: inline-block;
    color: #f1f5f9;
    font-weight: 500;
    text-decoration: none;
    padding: 3px 9px;
    border-radius: 7px;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.card:has(#upload-form) .videos-table td a:hover {
    background: rgba(186, 199, 218, 0.16);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(186, 199, 218, 0.22);
}
.card:has(#upload-form) .videos-table td a:active {
    background: rgba(186, 199, 218, 0.26);
}
.card:has(#upload-form) .videos-table td a:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

/* video detail */
.video-player {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 0 20px;
    max-height: 60vh;
    display: flex;
    justify-content: center;
}
.video-player video {
    width: 100%;
    max-height: 60vh;
    display: block;
    background: #000;
}

.extract-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }
.extract-form label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.actions-row { display: flex; gap: 12px; align-items: center; margin: 16px 0; }

/* ── grouped toolbar (video detail) ── */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    margin: 18px 0 6px;
}
.toolbar-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #0f172a;
    border: 1px solid #1f2937;
    border-radius: 12px;
}
.toolbar-group[data-label]::before {
    content: attr(data-label);
    position: absolute;
    top: -9px;
    left: 12px;
    padding: 0 6px;
    background: #0f172a;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 4px;
    pointer-events: none;
}
.tbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    margin: 0;
    transition: background .12s, border-color .12s, transform .05s, box-shadow .12s;
}
.tbtn:hover { background: #273449; border-color: #3b82f6; box-shadow: 0 2px 10px rgba(59,130,246,.15); }
.tbtn:active { transform: translateY(1px); }
.tbtn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.tbtn .tico { font-size: 16px; line-height: 1; }
.tbtn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.tbtn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.tbtn.danger { background: #7f1d1d; border-color: #991b1b; color: #fecaca; }
.tbtn.danger:hover { background: #991b1b; border-color: #ef4444; box-shadow: 0 2px 10px rgba(239,68,68,.2); }
.toolbar .export-group select {
    margin: 0;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    cursor: pointer;
}
.toolbar-status {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 18px;
    margin: 2px 0 6px;
}
.toolbar-status:empty { display: none; }
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 16px;
}
.thumb {
    display: block;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    text-align: center;
}
.thumb img { width: 100%; height: 90px; object-fit: cover; display: block; }
.thumb span { display: block; padding: 4px; font-size: 11px; color: #94a3b8; }

#extract-progress, #export-progress { margin: 12px 0; display: flex; gap: 12px; align-items: center; }
progress { width: 240px; }

/* frames grid (dedicated page) */
.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.frame-card {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .12s, border-color .12s;
}
.frame-card:hover { border-color: #3b82f6; transform: translateY(-1px); }
.frame-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #000; }
.frame-meta {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 12px;
    color: #94a3b8;
}
.frame-num { font-weight: 600; color: #e2e8f0; }

/* frame mass-selection */
.frame-card { position: relative; }
.frame-checkbox { display: none; }
body.frames-select-mode .frames-grid .frame-card { cursor: pointer; }
body.frames-select-mode .frame-checkbox {
    display: block;
    position: absolute;
    top: 8px;
    left: 8px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 2px solid #cbd5e1;
    background: rgba(15, 23, 42, 0.7);
    z-index: 2;
    pointer-events: none;
}
body.frames-select-mode .frame-card.selected { border-color: #3b82f6; }
body.frames-select-mode .frame-card.selected img { opacity: 0.65; }
body.frames-select-mode .frame-card.selected .frame-checkbox {
    background: #3b82f6;
    border-color: #3b82f6;
}
body.frames-select-mode .frame-card.selected .frame-checkbox::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0 0; }

/* annotation editor */
.editor-shell {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 0;
    height: 100vh;
    background: #0f172a;
}
.editor-side {
    background: #111827;
    border-right: 1px solid #1f2937;
    padding: 16px;
    overflow-y: auto;
}
.editor-side.right { border-right: 0; border-left: 1px solid #1f2937; }
.editor-side h3 { margin: 0 0 8px; font-size: 13px; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
#class-list, #annotation-list { list-style: none; padding: 0; margin: 0 0 16px; }
#class-list li, #annotation-list li {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
}
/* Рядок анотації має багато елементів (клас-селект, pending, автор, кнопки) —
   у вузькій правій панелі вони не вміщались і «наповзали»/обрізались. Дозволяємо
   перенос на новий рядок і даємо селекту змогу стискатись. */
#annotation-list li, #annotation-list summary { flex-wrap: wrap; }
#annotation-list .anno-class-sel { min-width: 0; flex: 1 1 96px; }
#annotation-list summary > span[style*="flex:1"],
#annotation-list summary > span[style*="flex: 1"] { min-width: 0; }
#class-list li.active { background: #1f2937; }
#class-list li:hover { background: #1f2937; }
#class-list li.is-mask { background: repeating-linear-gradient(45deg, transparent, transparent 4px, #1f293730 4px, #1f293730 6px); }

/* AI panel in annotation editor */
.ai-panel {
    background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(16,185,129,0.10));
    border: 1px solid #1d4ed8;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}
.ai-panel select {
    width: 100%;
    padding: 6px 8px;
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid #1f2937;
    border-radius: 6px;
    font-size: 13px;
}
.ai-panel button {
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
}
.ai-panel #ai-result { word-break: break-word; }

/* camera live view */
.camera-viewer {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.camera-viewer img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.camera-placeholder { padding: 60px 20px; text-align: center; color: #94a3b8; }

/* live host metrics */
.host-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.metric-card {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 12px 14px;
}
.metric-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-size: 24px; font-weight: 600; color: #f8fafc; line-height: 1.2; margin: 2px 0 6px; }
.metric-bar { height: 6px; background: #1f2937; border-radius: 3px; overflow: hidden; }
.metric-bar-fill { height: 100%; transition: width .3s, background .3s; background: #16a34a; }
#gpu-cards { grid-column: 1 / -1; padding: 0; background: transparent; border: 0; }
.metric-card-inner {
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.gpu-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 6px;
}
.gpu-stats .metric-value { font-size: 18px; }

/* training presets */
.preset-btn {
    background: #1f2937;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin: 0;
    transition: background .12s, border-color .12s;
}
.preset-btn:hover {
    background: #334155;
    border-color: #475569;
}
.preset-btn.active {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: #f8fafc;
}
.preset-hint { color: #93c5fd; }

/* prediction review cards */
.pred-card { position: relative; transition: outline .15s; }
.pred-card.reviewed-correct { outline: 2px solid #16a34a; }
.pred-card.reviewed-fp { outline: 2px solid #dc2626; opacity: 0.7; }
.pred-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 4px 0;
    background: #0b1220;
    border-top: 1px solid #1f2937;
}
.pred-actions button {
    margin: 0;
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
}

.mask-badge {
    background: #7c2d12;
    color: #fed7aa;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.hot { color: #6b7280; font-size: 11px; width: 18px; }
.class-form { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.class-form input[type="text"] { margin: 0; padding: 6px 8px; }
.class-form input[type="color"] { width: 32px; height: 32px; padding: 0; border: 0; background: none; }
.class-form button { margin: 0; padding: 6px 10px; font-size: 13px; }

.editor-main { display: flex; flex-direction: column; min-width: 0; }

/* ── Toolbar (grouped) ───────────────────────────────────────────────────
   Groups of related controls separated by subtle vertical dividers.
   Pending group is anchored to the right; groups wrap as units on narrow
   viewports (each group stays internally tight). */
.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 8px;
    column-gap: 0;
    padding: 8px 12px;
    background: #0b1220;
    border-bottom: 1px solid #1f2937;
}
.tb-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-right: 1px solid #1e293b;
    min-width: 0;
}
.tb-group:last-child { border-right: 0; }
.tb-group:first-child { padding-left: 0; }
.tb-group-pending { margin-left: auto; }

/* Кнопки */
.editor-toolbar button.tb-btn {
    background: #1f2937;
    color: #e2e8f0;
    padding: 6px 10px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.2;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.editor-toolbar button.tb-btn:hover { background: #334155; }
.editor-toolbar button.tb-btn-ghost {
    background: transparent;
    border-color: #334155;
}
.editor-toolbar button.tb-btn-ghost:hover { background: #1f2937; }
.editor-toolbar button.tb-btn-icon { padding: 4px 8px; }
.editor-toolbar button.tb-btn-danger {
    background: transparent;
    color: #ef4444;
    border-color: #7f1d1d;
}
.editor-toolbar button.tb-btn-danger:hover { background: #2a0d0d; }
.editor-toolbar button.tb-btn-confirm {
    background: #ec4899;
    color: #fff;
    border-color: #db2777;
}
.editor-toolbar button.tb-btn-confirm:hover { background: #db2777; }
/* Armed: кадр A інтерполяції зафіксовано, чекаємо на кадр B. */
.editor-toolbar button.tb-btn.armed {
    background: #f59e0b;
    color: #1f2937;
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}
.editor-toolbar button.tb-btn-reject {
    background: transparent;
    color: #cbd5e1;
    border-color: #475569;
}
.editor-toolbar button.tb-btn-reject:hover { background: #1f2937; }

/* Індикатор кадру */
.tb-indicator {
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    min-width: 130px;
    text-align: center;
}

/* Input для переходу за номером */
.tb-input {
    width: 70px;
    background: #0f172a;
    color: #cbd5e1;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
}

/* Zoom group */
.tb-group-zoom { gap: 8px; }
.tb-group-zoom input[type="range"] { width: 140px; }
.tb-zoom-value {
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Pending badge */
.tb-pending-badge {
    color: #ec4899;
    font-size: 13px;
    white-space: nowrap;
}

.active-class-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: white;
    background: #475569;
}

.canvas-wrapper {
    flex: 1;
    background: #020617;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    padding: 16px;
}
#annot-canvas {
    background: #000;
    cursor: crosshair;
    box-shadow: 0 0 0 1px #1f2937;
    /* margin:auto центрує canvas коли є вільне місце, але колапсує в 0 при overflow —
       тоді canvas прилипає до start, а scrollTop=0 = верх canvas (без letterbox-смуги
       над зображенням). */
    margin: auto;
}


/* dataset/training/models additions */
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row input, .form-row select { padding: 6px 8px; background: #0b1220; color: #e2e8f0; border: 1px solid #1f2937; border-radius: 6px; }
.form-row label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #94a3b8; }
.form-stack { display: flex; flex-direction: column; gap: 8px; }
.form-stack input, .form-stack select { padding: 6px 8px; background: #0b1220; color: #e2e8f0; border: 1px solid #1f2937; border-radius: 6px; }
.checkbox-row { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #94a3b8; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid #1f2937; vertical-align: middle; text-align: left; }
.data-table th { color: #94a3b8; font-weight: 500; font-size: 12px; text-transform: uppercase; }
.data-table tr:hover { background: #0b1220; }
.thumb-mini { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; background: #000; cursor: pointer; transition: outline .12s; }
.thumb-mini:hover { outline: 2px solid #3b82f6; }
.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: #93c5fd; text-decoration: underline; }
.small { font-size: 11px; }
.card.danger { border: 1px solid #7f1d1d; }
.run-row { display: flex; gap: 12px; align-items: center; }
.run-row progress { flex: 1; height: 12px; }
.split-select { padding: 4px 6px; background: #0b1220; color: #e2e8f0; border: 1px solid #1f2937; border-radius: 4px; }
.class-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.class-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.badge-pending, .badge-building, .badge-running { background: #1e3a8a; color: #bfdbfe; }
.badge-ready, .badge-done { background: #14532d; color: #bbf7d0; }
.badge-failed, .badge-cancelled { background: #7f1d1d; color: #fecaca; }

.note-block {
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #cbd5e1;
}
.note-block strong { color: #e2e8f0; }

/* dataset membership manager */
.membership-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0;
}
.membership-toolbar input[type="search"] {
    flex: 1;
    min-width: 240px;
    padding: 8px 12px;
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid #1f2937;
    border-radius: 8px;
    font-size: 14px;
}
.membership-toolbar select {
    padding: 8px 10px;
    background: #0b1220;
    color: #e2e8f0;
    border: 1px solid #1f2937;
    border-radius: 8px;
    font-size: 13px;
    width: auto;
}
.membership-bulk {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: #0b1220;
    border: 1px solid #1f2937;
    border-radius: 8px;
}
.membership-bulk button {
    margin: 0;
    padding: 8px 14px;
    font-size: 13px;
}
.membership-bulk button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
button.secondary.danger { background: #7f1d1d; color: #fecaca; }
button.secondary.danger:hover { background: #991b1b; }
.membership-table-wrap {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #1f2937;
    border-radius: 8px;
}
#mem-table th { position: sticky; top: 0; background: #1e293b; z-index: 1; }
#mem-table td { padding: 6px 10px; }
#mem-table button.link { padding: 2px 6px; }
#mem-pager { margin: 12px 0; }
#mem-pager a { cursor: pointer; }
#membership-status { margin-top: 8px; }

/* --- Per-user activity / hourly-pay panel (admin dashboard) --- */
.section-title { margin: 22px 0 10px; color: #e2e8f0; font-size: 18px; }
.pay-panel {
    border-top: 1px solid #334155;
    margin-top: 12px;
    padding-top: 14px;
}
.pay-rate { gap: 10px; align-items: center; margin-bottom: 14px; }
.pay-rate label { color: #94a3b8; font-size: 14px; }
.pay-rate input {
    background: #0f172a; border: 1px solid #334155; border-radius: 8px;
    color: #f8fafc; padding: 6px 8px; margin-left: 6px;
}
.pay-grid { margin-bottom: 4px; }
.pay-headline { border-color: #2563eb; }
.pay-headline .stat-num { color: #60a5fa; }

/* --- Video analysis timeline (pre-extraction drone analysis) --- */
#analyze-timeline {
    position: relative; height: 28px;
    background: linear-gradient(#0f172a, #1e293b);
    border: 1px solid #334155; border-radius: 5px; cursor: crosshair;
}
/* Мітки — суто візуальні: НЕ перехоплюють кліки, щоб клік завжди влучав у
   доріжку й перемотував у ТОЧНУ позицію курсора (а не на початок сегмента). */
.tl-marker {
    position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px;
    background: #94a3b8; opacity: 0.8; pointer-events: none;
}
.tl-marker.drone { background: #22c55e; width: 4px; box-shadow: 0 0 6px #22c55e; opacity: 0.95; z-index: 2; }

/* Playhead cursor on the analysis timeline — shows current video position. */
.tl-playhead {
    position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
    background: #f8fafc; box-shadow: 0 0 5px rgba(248,250,252,0.9);
    pointer-events: none; z-index: 4;
}
/* Hover indicator — line + time bubble at the cursor, for precise seeking. */
.tl-hover {
    position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -1px;
    background: rgba(248,250,252,0.5); pointer-events: none; z-index: 3;
}
.tl-hovertime {
    position: absolute; top: -22px; transform: translateX(-50%);
    background: #0b1220; border: 1px solid #334155; border-radius: 4px;
    padding: 1px 6px; font-size: 12px; color: #e2e8f0; white-space: nowrap;
    pointer-events: none; z-index: 5;
}

/* Selection bands for "densify frames" — drawn over the timeline when the
   user is picking segments to extract every frame from. */
#analyze-timeline.selecting { cursor: cell; }
.tl-select {
    position: absolute; top: 0; bottom: 0; z-index: 3;
    background: rgba(96,165,250,0.30); border-left: 1px solid #60a5fa;
    border-right: 1px solid #60a5fa; pointer-events: none;
}
#analyze-timeline.selecting .tl-select { pointer-events: auto; cursor: pointer; }
#analyze-timeline.selecting .tl-select:hover { background: rgba(239,68,68,0.35); }
.tl-select.live { background: rgba(96,165,250,0.45); pointer-events: none; }
#densify-select-toggle.active { background: #2563eb; color: #f8fafc; border-color: #2563eb; }

/* --- Virtual-folder Finder (shared: videos page + dataset selector) --- */
.folder-crumb { text-decoration: none; padding: 2px 6px; border-radius: 4px; }
.folder-card { transition: border-color .12s; }
.folder-card:hover { border-color: #475569; }
.drop-hover { outline: 2px dashed #38bdf8; outline-offset: 2px; background: #15324a !important; }
#mem-table tr.video-row[draggable] { cursor: grab; }
#mem-table tr.video-row[draggable]:active { cursor: grabbing; }

/* ── Механізм «Знайшли помилку — повідомте» ──────────────────────────── */
#bug-fab {
    position: fixed; right: 16px; bottom: 16px; z-index: 900;
    background: #7f1d1d; color: #fecaca; border: 1px solid #b91c1c;
    border-radius: 24px; padding: 10px 16px; font-size: 14px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
#bug-fab:hover { background: #991b1b; }

.bug-modal-backdrop {
    position: fixed; inset: 0; z-index: 1000; background: rgba(2,6,23,0.7);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.bug-modal {
    background: #0f172a; border: 1px solid #334155; border-radius: 12px;
    width: 100%; max-width: 560px; padding: 18px 20px; max-height: 90vh; overflow: auto;
}
.bug-modal-head { display: flex; justify-content: space-between; align-items: center; }
.bug-modal-head h3 { margin: 0; }
.bug-modal-x { background: none; border: none; color: #94a3b8; font-size: 24px; cursor: pointer; }
.bug-field { display: block; margin: 12px 0; }
.bug-field > span { display: block; color: #94a3b8; font-size: 13px; margin-bottom: 4px; }
.bug-field input, .bug-field textarea { width: 100%; box-sizing: border-box; }

.bug-reply-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.bug-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bug-thumb { position: relative; }
.bug-thumb img { height: 72px; border-radius: 6px; border: 1px solid #334155; display: block; }
.bug-thumb-x {
    position: absolute; top: -8px; right: -8px; width: 20px; height: 20px;
    border-radius: 50%; background: #7f1d1d; color: #fff; border: none; cursor: pointer; line-height: 1;
}

.bug-crop-overlay {
    position: fixed; inset: 0; z-index: 1100; background: rgba(2,6,23,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.bug-crop-hint { color: #e2e8f0; font-size: 14px; }
.bug-crop-stage { position: relative; line-height: 0; }
.bug-crop-stage canvas { border: 1px solid #475569; cursor: crosshair; max-width: 92vw; max-height: 78vh; }
.bug-crop-sel { position: fixed; display: none; border: 2px solid #38bdf8; background: rgba(56,189,248,0.15); pointer-events: none; z-index: 1101; }
.bug-crop-bar { display: flex; gap: 10px; }

.bug-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bug-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bug-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 12px 14px;
}
.bug-item-main { display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit; flex: 1; }
.bug-item-title { font-weight: 600; color: #f1f5f9; }
.bug-status { padding: 3px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; background: #334155; color: #e2e8f0; }
.bug-status-new { background: #1e3a8a; color: #bfdbfe; }
.bug-status-in_progress { background: #78350f; color: #fde68a; }
.bug-status-fixed { background: #14532d; color: #bbf7d0; }
.bug-status-rejected { background: #7f1d1d; color: #fecaca; }

.bug-status-bar { display: flex; align-items: center; gap: 12px; }
.bug-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bug-msg { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 10px 14px; max-width: 85%; }
.bug-msg.mine { align-self: flex-end; }
.bug-msg.staff { border-color: #1d4ed8; }
.bug-msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.bug-msg-head .small { margin-left: auto; white-space: nowrap; }
.bug-msg-body { overflow-wrap: anywhere; }
.bug-msg-body { white-space: pre-wrap; color: #e2e8f0; }
.bug-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bug-shot-thumb { height: 110px; border-radius: 6px; border: 1px solid #334155; display: block; }
.bug-reply { border-top: 1px solid #334155; padding-top: 12px; }
.bug-reply textarea { width: 100%; box-sizing: border-box; }

/* ── Стилізовані сторінки помилок (404 / 403 / 500) ──────────────────── */
.error-page {
    max-width: 560px; margin: 8vh auto; text-align: center; padding: 32px 24px;
    background: #1e293b; border: 1px solid #334155; border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.error-emoji { font-size: 56px; line-height: 1; margin-bottom: 6px; }
.error-code {
    font-size: 92px; font-weight: 800; line-height: 1;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: 2px;
}
.error-title { margin: 8px 0 6px; font-size: 22px; color: #f1f5f9; }
.error-msg { font-size: 15px; max-width: 420px; margin: 0 auto 22px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
