:root {
  color-scheme: dark;
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #20242d;
  --text: #f4f5f7;
  --muted: #a9afbd;
  --line: #303643;
  --accent: #8bd450;
  --danger: #ff6b6b;
  --warn: #ffd166;
  --info: #68c7ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1220px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.brand h1 { font-size: 24px; margin: 0 0 4px; }
.brand p { margin: 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 14px 44px rgba(0,0,0,.18); }
.grid { display: grid; grid-template-columns: 390px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
input, select, textarea, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #10131a;
  color: var(--text);
  padding: 10px 12px;
}
textarea { min-height: 170px; width: 100%; resize: vertical; }
input[type="checkbox"] { width: auto; }
button, .btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; }
button:hover, .btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn-primary { background: #235c1c; border-color: #367c2d; }
.btn-danger { background: #5c1e28; border-color: #973548; }
.btn-muted { background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.alert.error { border-color: #79333d; color: #ffd6dc; }
.alert.ok { border-color: #3c7335; color: #d9ffd4; }
.alert.warn { border-color: #79692b; color: #fff4c5; }
.alert-dismissible { position: relative; padding-right: 44px; }
.alert-dismiss { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; min-width: 30px; padding: 0; border: 0; background: transparent; color: inherit; opacity: .72; }
.alert-dismiss:hover { opacity: 1; filter: none; }
.toast-region { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: grid; gap: 10px; width: min(390px, calc(100vw - 36px)); pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 14px; background: rgba(23,26,33,.96); box-shadow: 0 16px 46px rgba(0,0,0,.36); padding: 12px 12px; animation: toast-in .18s ease both; }
.toast.is-hiding { animation: toast-out .18s ease both; }
.toast .bi { margin-top: 2px; }
.toast-message { line-height: 1.35; }
.toast-close { width: 28px; height: 28px; min-width: 28px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.toast-close:hover { color: var(--text); filter: none; }
.toast-success { border-color: rgba(139,212,80,.42); }
.toast-success > .bi { color: var(--accent); }
.toast-info { border-color: rgba(104,199,255,.42); }
.toast-info > .bi { color: var(--info); }
.toast-warning, .toast-warn { border-color: rgba(255,209,102,.45); }
.toast-warning > .bi, .toast-warn > .bi { color: var(--warn); }
.toast-error { border-color: rgba(255,107,107,.50); }
.toast-error > .bi { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(6px) scale(.98); } }
.confirm-backdrop { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.64); backdrop-filter: blur(3px); }
.confirm-backdrop[hidden] { display: none; }
.confirm-modal { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 70px rgba(0,0,0,.48); padding: 22px; }
.confirm-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; min-width: 34px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.confirm-close:hover { color: var(--text); filter: none; }
.confirm-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; margin-bottom: 12px; background: rgba(104,199,255,.10); color: var(--info); font-size: 20px; }
.confirm-modal.confirm-danger .confirm-icon { background: rgba(255,107,107,.11); color: var(--danger); }
.confirm-modal h2 { margin: 0 42px 8px 0; font-size: 21px; }
.confirm-modal p { margin: 0; color: var(--muted); line-height: 1.45; }
.confirm-details { display: grid; gap: 0; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.confirm-details[hidden] { display: none; }
.confirm-detail-row { display: grid; grid-template-columns: minmax(100px, 34%) minmax(0, 1fr); gap: 12px; padding: 10px 12px; background: rgba(255,255,255,.025); }
.confirm-detail-row + .confirm-detail-row { border-top: 1px solid var(--line); }
.confirm-detail-row dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.confirm-detail-row dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.confirm-input-wrap { margin-top: 16px; }
.confirm-input-wrap input { width: 100%; margin-top: 6px; }
.confirm-input-wrap input[aria-invalid="true"] { border-color: rgba(255,107,107,.72); box-shadow: 0 0 0 3px rgba(255,107,107,.10); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
body.modal-open { overflow: hidden; }
@media (max-width: 560px) { .toast-region { right: 12px; bottom: 12px; width: calc(100vw - 24px); } .confirm-detail-row { grid-template-columns: 1fr; gap: 3px; } .confirm-actions { flex-direction: column-reverse; } .confirm-actions button { width: 100%; } }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-empty { margin: 8px 0 2px; line-height: 1.45; }
.item { display: block; position: relative; padding: 13px; border: 1px solid var(--line); background: #12161e; border-radius: 12px; color: var(--text); transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.item:hover { text-decoration: none; background: #161b24; border-color: rgba(104,199,255,.38); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.item:focus-visible { outline: 2px solid rgba(104,199,255,.70); outline-offset: 3px; text-decoration: none; }
.item.active { outline: 0; border-color: rgba(139,212,80,.60); background: rgba(139,212,80,.075); box-shadow: inset 3px 0 0 rgba(139,212,80,.72); }
.item.active:hover { border-color: rgba(139,212,80,.74); background: rgba(139,212,80,.10); }
.item-title { font-weight: 700; margin-bottom: 6px; line-height: 1.25; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-2); color: var(--muted); }
.badge.pending_upload { color: #2a2100; background: var(--warn); }
.badge.uploaded { color: #09240a; background: var(--accent); }
.badge.discarded { color: #e7e7e7; background: #626875; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; } }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.field { margin-bottom: 12px; }
.field input, .field select { width: 100%; }
.multi { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #10131a; }
.multi label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 5px; color: var(--text); font-size: 14px; }
.login { max-width: 420px; margin: 12vh auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.label-note { color: var(--muted); font-weight: 400; }
.required-marker { color: var(--danger); font-weight: 800; margin-left: 2px; }
.required-fields-note { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.required-fields-note .required-marker { margin: 0 3px 0 0; }
.hint { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.picker-field { position: relative; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; margin-bottom: 8px; }
.chip,
.chip-empty {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.chip { border-color: #3b4d32; background: rgba(139, 212, 80, .13); color: var(--text); }
.chip-empty { border: 1px dashed var(--line); color: var(--muted); }
.picker-box { border: 1px solid var(--line); border-radius: 12px; background: #10131a; overflow: hidden; }
.picker-box input[type="search"] { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; width: 100%; background: #10131a; }
.picker-options { max-height: 230px; overflow: auto; padding: 7px; display: none; gap: 5px; }
.picker-field.picker-open .picker-options,
.picker-field:focus-within .picker-options { display: grid; }
.picker-field.picker-open .picker-box,
.picker-field:focus-within .picker-box { border-color: rgba(104,199,255,.42); box-shadow: 0 0 0 3px rgba(104,199,255,.07); }
.picker-option { width: 100%; justify-content: flex-start; text-align: left; border-radius: 9px; padding: 8px 10px; background: transparent; border-color: transparent; }
.picker-option:hover { background: var(--panel-2); }
.picker-option.selected { background: rgba(139, 212, 80, .15); border-color: rgba(139, 212, 80, .35); }
.picker-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.js-form-error[hidden] { display: none; }

.manual-form-section { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.018); padding: 14px; margin-bottom: 12px; }
.manual-form-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--text); font-weight: 700; }
.manual-form-section-title .bi { color: var(--info); }
.manual-upload-drop { margin-top: 4px; }
.manual-datetime-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.manual-datetime-grid .field { margin-bottom: 0; }
@media (max-width: 700px) { .manual-datetime-grid { grid-template-columns: 1fr; } }

.section-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.section-title h3 { margin: 0 0 4px; font-size: 18px; }
.upload-panel { margin-top: 18px; }
.upload-drop { border: 1px dashed var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008)), #10131a; padding: 18px; display: grid; gap: 12px; }
.upload-drop input[type="file"] { width: 100%; background: transparent; }
.upload-dropzone { position: relative; overflow: hidden; border-width: 1.5px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.upload-dropzone.is-dragover { border-color: rgba(104,199,255,.70); background: rgba(104,199,255,.08); box-shadow: 0 0 0 4px rgba(104,199,255,.08); transform: translateY(-1px); }
.upload-dropzone.has-file { border-color: rgba(139,212,80,.45); background: rgba(139,212,80,.06); }
.upload-dropzone.has-invalid-file { border-color: rgba(255,91,110,.48); background: rgba(255,91,110,.07); }
.upload-drop-inner { position: relative; z-index: 1; display: grid; gap: 10px; justify-items: center; align-content: center; min-height: 94px; text-align: center; }
.upload-drop-copy strong { display: block; font-size: 16px; margin-bottom: 3px; }
.upload-drop-copy p { margin: 0; }
.upload-file-button { white-space: nowrap; }
.upload-inline-message { margin: 0; text-align: center; }
.upload-inline-message:not([hidden]) { display: block; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.selected-upload-file { display: inline-flex; align-items: center; justify-self: center; max-width: 100%; gap: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.18); border-radius: 12px; padding: 10px 10px 10px 12px; }
.selected-upload-file[hidden] { display: none; }
.selected-upload-file .bi { color: var(--accent); font-size: 1.15rem; }
.upload-dropzone.has-invalid-file .selected-upload-file .bi { color: var(--danger); }
.selected-upload-file span { display: grid; gap: 2px; min-width: 0; }
.selected-upload-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-upload-file small { color: var(--muted); font-size: 12px; }
.selected-upload-clear {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  border-color: rgba(255,255,255,.08);
}
.selected-upload-clear:hover { color: var(--text); background: rgba(255,255,255,.06); }
.upload-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.progress-box { margin-top: 14px; border: 1px solid var(--line); background: #10131a; border-radius: 14px; padding: 14px; }
.progress-box[hidden] { display: none; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.progress-track { height: 13px; border-radius: 999px; background: #07090d; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .18s ease; }
.upload-job-list { display: grid; gap: 10px; margin-top: 10px; }
.upload-job { border: 1px solid var(--line); background: #10131a; border-radius: 12px; padding: 13px; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
@media (max-width: 700px) { .upload-job { align-items: flex-start; flex-direction: column; } }

body.offcanvas-open { overflow: hidden; }
.settings-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.settings-backdrop[hidden] { display: none; }
.settings-offcanvas { position: fixed; z-index: 41; top: 0; right: 0; width: min(560px, 94vw); height: 100vh; transform: translateX(102%); transition: transform .18s ease; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(0,0,0,.35); padding: 18px; overflow: auto; }
.settings-offcanvas.open { transform: translateX(0); }
.settings-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.settings-head h2 { margin: 0 0 4px; font-size: 22px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.settings-content { display: grid; gap: 14px; }
.settings-section { border: 1px solid var(--line); background: #10131a; border-radius: 14px; padding: 14px; }
.settings-section h3 { margin: 0 0 10px; font-size: 16px; }
.settings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.settings-table tr + tr { border-top: 1px solid rgba(255,255,255,.06); }
.settings-table th { width: 38%; color: var(--muted); text-align: left; vertical-align: top; font-weight: 600; padding: 8px 10px 8px 0; }
.settings-table td { color: var(--text); vertical-align: top; padding: 8px 0; word-break: break-word; }
.settings-table code { display: inline-block; max-width: 100%; white-space: normal; background: #07090d; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; color: var(--text); }
.settings-detail { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-pill { display: inline-flex; align-items: center; margin-top: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 3px 8px; border: 1px solid var(--line); color: var(--muted); }
.status-pill.ok { color: var(--accent); border-color: rgba(139,212,80,.35); background: rgba(139,212,80,.10); }
.status-pill.warn { color: #ffd166; border-color: rgba(255,209,102,.35); background: rgba(255,209,102,.10); }
.status-pill.error { color: var(--danger); border-color: rgba(255,91,110,.35); background: rgba(255,91,110,.10); }
.settings-warnings { border: 1px solid rgba(255,209,102,.35); background: rgba(255,209,102,.08); border-radius: 14px; padding: 12px 14px; }
.settings-warnings strong { color: #ffd166; }
.settings-warnings ul { margin: 8px 0 0 18px; padding: 0; color: var(--text); }
.settings-warnings li + li { margin-top: 5px; }
@media (max-width: 700px) { .settings-table th, .settings-table td { display: block; width: 100%; padding: 6px 0; } .settings-table tr { display: block; padding: 8px 0; } }

.settings-form { border: 1px solid var(--line); background: #10131a; border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.settings-inline-control { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.settings-inline-control select { min-width: 170px; }
.settings-save-ok[hidden],
.settings-save-error[hidden] { display: none; }
.settings-save-ok,
.settings-save-error { margin: 10px 0 0; }

.upload-locked { border: 1px solid rgba(255,209,102,.35); background: rgba(255,209,102,.08); border-radius: 14px; padding: 14px; }
.upload-locked p { margin: 6px 0 0; }
.upload-job-main { min-width: 0; flex: 1; }

.settings-form-title { margin: 0 0 8px; font-size: 16px; }

.youtube-status-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; color: var(--text); background: rgba(255,255,255,.035); font-size: 13px; line-height: 1.45; }
.youtube-status-card.ok { border-color: rgba(92, 184, 92, .35); background: rgba(92, 184, 92, .08); }
.youtube-status-card.warn { border-color: rgba(255, 209, 102, .32); background: rgba(255, 209, 102, .08); }
.btn.disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.youtube-job-status { margin-top: 12px; border: 1px solid rgba(104,199,255,.28); background: rgba(104,199,255,.07); border-radius: 12px; padding: 11px 12px; }
.youtube-job-status .progress-track { margin-top: 7px; }
.youtube-job-status code { font-size: 12px; }

.sync-job-status { margin-top: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 10px; padding: 9px 10px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 13px; }
.sync-job-status.uploaded { border-color: rgba(139,212,80,.35); background: rgba(139,212,80,.09); }
.sync-job-status.failed { border-color: rgba(255,91,110,.38); background: rgba(255,91,110,.08); }
.danger-text { color: var(--danger); }


/* UI status/lock sprint */
.alert.info { border-color: #2f5d72; color: #d5f3ff; }
button:disabled,
.btn[disabled],
input:disabled,
select:disabled,
textarea:disabled,
.picker-option:disabled,
.chip:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: none;
}
button:disabled:hover,
.btn[disabled]:hover {
  filter: none;
}
.chip.disabled {
  opacity: .55;
}
.filters select,
.filters input[type="search"] {
  min-width: 0;
}
.filters input[type="search"] {
  flex: 1 1 160px;
}

/* Upload-first stream detail layout */
.stream-detail-card { min-height: 560px; }
.stream-detail-empty-card { display: grid; }
.empty-state {
  min-height: 522px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 36px 24px;
}
.empty-state-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border: 1px solid rgba(104,199,255,.28);
  border-radius: 20px;
  background: rgba(104,199,255,.08);
  color: var(--info);
  font-size: 29px;
}
.empty-state-success .empty-state-icon {
  border-color: rgba(139,212,80,.35);
  background: rgba(139,212,80,.10);
  color: var(--accent);
}
.empty-state h2 { margin: 0 0 9px; font-size: 24px; }
.empty-state p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.55; }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
@media (max-width: 560px) {
  .empty-state { min-height: 360px; padding: 28px 8px; }
  .empty-state-actions { width: 100%; }
  .empty-state-actions .btn,
  .empty-state-actions button { width: 100%; }
}
.stream-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(139,212,80,.09), rgba(104,199,255,.045) 48%, rgba(255,255,255,.02));
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.stream-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.stream-hero h2 { margin: 0; font-size: 25px; line-height: 1.12; min-width: 0; }
.source-pill,
.workflow-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}
.source-pill {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  color: var(--muted);
  padding: 4px 8px;
}
.source-pill.source-manual { color: #d9f4ff; border-color: rgba(104,199,255,.22); background: rgba(104,199,255,.08); }
.workflow-status {
  border: 1px solid rgba(139,212,80,.35);
  background: rgba(139,212,80,.10);
  color: #d9ffd4;
  padding: 5px 9px;
}
.workflow-status.waiting { border-color: rgba(255,210,79,.32); background: rgba(255,210,79,.11); color: #fff4c5; }
.workflow-status.running { border-color: rgba(104,199,255,.42); background: rgba(104,199,255,.11); color: #d9f4ff; }
.workflow-status.ok { border-color: rgba(139,212,80,.38); background: rgba(139,212,80,.12); color: #d9ffd4; }
.workflow-status.failed { border-color: rgba(255,91,110,.42); background: rgba(255,91,110,.11); color: #ffd6dc; }
.workflow-status.discarded { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #e5e7eb; }
.stream-meta-line { margin-top: 8px; align-items: center; }
.stream-hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 96px; }
.stream-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.stream-summary-part { min-width: 0; }
.summary-key { color: var(--text); font-weight: 800; }
.compact-alert { margin: 0 0 12px; }
.upload-primary { margin-top: 0; }

/* Metadata edit offcanvas */
.metadata-backdrop { position: fixed; inset: 0; z-index: 42; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.metadata-backdrop[hidden] { display: none; }
.metadata-offcanvas {
  position: fixed;
  z-index: 43;
  top: 0;
  right: 0;
  width: min(720px, 94vw);
  height: 100vh;
  transform: translateX(102%);
  transition: transform .18s ease;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(0,0,0,.35);
  padding: 18px;
  overflow: auto;
}
.metadata-offcanvas.open { transform: translateX(0); }
.metadata-form-grid { grid-template-columns: 1fr; }
.metadata-form-section textarea { min-height: 135px; }
.metadata-actions { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.metadata-actions-split { display: grid; gap: 14px; }
.metadata-primary-actions { margin-top: 0; }
.metadata-secondary-actions { border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; }
.metadata-secondary-actions p { margin: 0 0 8px; }
.metadata-secondary-actions .btn-row { margin-top: 0; }
.advanced-note { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #10131a; }
.advanced-note summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.advanced-note dl { margin: 12px 0 0; display: grid; gap: 8px; }
.advanced-note dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 8px; }
.advanced-note dt { color: var(--muted); }
.advanced-note dd { margin: 0; word-break: break-word; }

@media (max-width: 900px) {
  .stream-hero { grid-template-columns: 1fr; }
  .stream-hero-actions { align-items: flex-start; }
}

/* UI polish sprint */
.btn-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  line-height: 1;
}
.btn-icon .bi,
.btn .bi,
button .bi {
  font-size: 1.05em;
  line-height: 1;
}
.topbar .btn-row {
  margin-top: 0;
}
.item-title {
  font-size: 14px;
}
.item-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin: -2px 0 8px;
}
.item-meta {
  align-items: center;
}
.meta-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}
.stream-hero-actions .btn-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
}
.upload-primary .section-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Failure UX + retry sprint */
.youtube-job-status.running { border-color: rgba(104,199,255,.38); background: rgba(104,199,255,.08); }
.youtube-job-status.ok { border-color: rgba(139,212,80,.35); background: rgba(139,212,80,.09); }
.youtube-job-status.failed { border-color: rgba(255,91,110,.40); background: rgba(255,91,110,.08); }
.upload-failure-card {
  margin-top: 10px;
  border: 1px solid rgba(255,91,110,.42);
  background: rgba(255,91,110,.08);
  border-radius: 10px;
  padding: 10px 11px;
  display: grid;
  gap: 8px;
}
.upload-failure-card[hidden] { display: none; }
.upload-failure-card strong { color: #ffd9de; display: inline-flex; align-items: center; gap: 7px; }
.upload-failure-card p { margin: 0; color: #ffd9de; }
.sync-job-status .retry-sync-btn { margin-left: auto; }
.retry-youtube-btn,
.retry-sync-btn { white-space: nowrap; }
.retry-sync-btn[hidden] { display: none; }


.worker-log-section {
  margin-top: 1rem;
}

.worker-log-section summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: .6rem;
  justify-content: space-between;
  list-style: none;
}

.worker-log-section summary::-webkit-details-marker {
  display: none;
}

.worker-log-section summary::after {
  color: var(--muted);
  content: "\F282";
  font-family: "bootstrap-icons";
  font-size: .95rem;
  line-height: 1;
  transition: transform .15s ease;
}

.worker-log-section[open] summary::after {
  transform: rotate(180deg);
}

.worker-log-actions {
  align-items: center;
  display: flex;
  gap: .6rem;
  margin-top: .85rem;
}

.worker-log-output {
  background: rgba(0, 0, 0, .26);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: .78rem;
  line-height: 1.45;
  margin: .85rem 0 0;
  max-height: 360px;
  overflow: auto;
  padding: .85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Cleanup + trash sprint */
.stream-action-icons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.inline-action-form {
  margin: 0;
}
.permanent-delete-submit {
  border-color: #b84559;
}

.settings-offcanvas { width: min(760px, 96vw); }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.settings-card-form select { width: 100%; }
.settings-save-row { margin-top: 12px; }
.settings-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.settings-dashboard-card { display: flex; gap: 10px; align-items: flex-start; min-height: 86px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.018)); border-radius: 14px; padding: 12px; }
.settings-dashboard-card.is-ok { border-color: rgba(52, 211, 153, .28); }
.settings-dashboard-card.is-warn { border-color: rgba(255, 209, 102, .34); }
.settings-dashboard-card.is-error { border-color: rgba(255, 99, 132, .38); }
.settings-dashboard-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: rgba(255,255,255,.06); color: var(--text); }
.settings-dashboard-card.is-ok .settings-dashboard-icon { color: #34d399; background: rgba(52,211,153,.10); }
.settings-dashboard-card.is-warn .settings-dashboard-icon { color: #ffd166; background: rgba(255,209,102,.10); }
.settings-dashboard-card.is-error .settings-dashboard-icon { color: #ff6384; background: rgba(255,99,132,.10); }
.settings-dashboard-title { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.settings-dashboard-value { display: block; margin-top: 4px; font-size: 17px; line-height: 1.2; color: var(--text); }
.settings-dashboard-detail { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.25; }
@media (max-width: 900px) { .settings-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings-form-grid { grid-template-columns: 1fr; } }

.push-job-status { margin-top: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 10px; padding: 9px 10px; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; font-size: 13px; }
.push-job-status.ok { border-color: rgba(139,212,80,.35); background: rgba(139,212,80,.09); }
.push-job-status.failed { border-color: rgba(255,91,110,.38); background: rgba(255,91,110,.08); }

/* Runtime state updates added by JS after upload_start / worker polling. */
.badge.waiting { color: #fff4c5; border-color: rgba(255,210,79,.32); background: rgba(255,210,79,.11); }
.badge.running { color: #d9f4ff; border-color: rgba(104,199,255,.42); background: rgba(104,199,255,.11); }
.badge.ok { color: #d9ffd4; border-color: rgba(139,212,80,.38); background: rgba(139,212,80,.12); }
.badge.failed { color: #ffd6dc; border-color: rgba(255,91,110,.42); background: rgba(255,91,110,.11); }
.upload-drop.is-upload-locked { opacity: .62; pointer-events: none; }
.youtube-job-status.waiting { border-color: rgba(255,210,79,.30); background: rgba(255,210,79,.08); }

/* YouTube readiness + thumbnail workflow */
.youtube-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-top: 8px;
}
.youtube-check-actions[hidden] { display: none; }
.thumbnail-job-status {
  margin-top: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.thumbnail-job-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  min-width: 0;
}
.thumbnail-job-status.ok { border-color: rgba(139,212,80,.35); background: rgba(139,212,80,.09); }
.thumbnail-job-status.waiting { border-color: rgba(255,210,79,.30); background: rgba(255,210,79,.08); }
.thumbnail-job-status.running { border-color: rgba(104,199,255,.34); background: rgba(104,199,255,.08); }
.thumbnail-job-status.failed { border-color: rgba(255,91,110,.38); background: rgba(255,91,110,.08); }
.thumbnail-upload-label { cursor: pointer; }
.manual-thumbnail-field input[type="file"] { width: 100%; }
.selected-thumbnail-file { margin-top: 8px; }

/* Push retry and thumbnail polish */
.push-job-status.waiting { border-color: rgba(255,210,79,.30); background: rgba(255,210,79,.08); }
.retry-push-btn[hidden] { display: none; }
.thumbnail-job-status { display: grid; grid-template-columns: 142px minmax(0, 1fr) minmax(220px, 280px); align-items: stretch; }
.thumbnail-preview {
  position: relative;
  min-height: 78px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(104,199,255,.10), rgba(139,212,80,.05)), #10131a;
  display: grid;
  place-items: center;
}
.thumbnail-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-preview-fallback { padding: 10px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.25; }
.thumbnail-preview:not(.is-empty) .thumbnail-preview-fallback { display: none; }
.thumbnail-upload-drop {
  min-height: 78px;
  margin: 0;
  padding: 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
}
.thumbnail-upload-drop span { color: var(--text); font-weight: 700; font-size: 13px; }
.thumbnail-upload-drop small { color: var(--muted); font-size: 12px; }
.thumbnail-upload-drop:hover { border-color: rgba(104,199,255,.52); background: rgba(104,199,255,.06); }
.thumbnail-dropzone { margin-top: 4px; }
@media (max-width: 980px) {
  .thumbnail-job-status { grid-template-columns: 132px minmax(0, 1fr); }
  .thumbnail-upload-drop { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .thumbnail-job-status { grid-template-columns: 1fr; }
  .thumbnail-preview { min-height: 130px; }
}

/* Language and usability polish */
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"],
.picker-box:has(input[aria-invalid="true"]) {
  border-color: rgba(255, 91, 110, .72);
  box-shadow: 0 0 0 3px rgba(255, 91, 110, .10);
}

.settings-technical-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.settings-technical-details > summary::-webkit-details-marker { display: none; }
.settings-technical-details > summary::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  color: var(--muted);
  transition: transform .15s ease;
}
.settings-technical-details[open] > summary::after { transform: rotate(180deg); }
.settings-technical-body { display: grid; gap: 14px; margin-top: 14px; }
.settings-technical-group { border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; }
.settings-technical-group:first-child { border-top: 0; padding-top: 0; }
.settings-technical-group h3 { margin: 0 0 10px; font-size: 15px; }


.field-label {
  display: block;
  margin-bottom: .45rem;
  font-weight: 700;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 2.5rem;
  cursor: pointer;
  user-select: none;
}

.toggle-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  flex: 0 0 auto;
  inline-size: 2.8rem;
  block-size: 1.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  transition: background-color .15s ease, border-color .15s ease;
}

.toggle-thumb {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: .2rem;
  inline-size: 1.05rem;
  block-size: 1.05rem;
  border-radius: 50%;
  background: var(--text);
  transform: translateY(-50%);
  transition: transform .15s ease;
}

.toggle-control input:checked + .toggle-track {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 35%, var(--panel-2));
}

.toggle-control input:checked + .toggle-track .toggle-thumb {
  transform: translate(1.22rem, -50%);
}

.toggle-control input:focus-visible + .toggle-track {
  outline: 2px solid var(--info);
  outline-offset: 3px;
}

.toggle-control input:disabled ~ * {
  opacity: .55;
  cursor: not-allowed;
}

.toggle-label {
  font-weight: 600;
}


/* YouTube connection guard + post-upload workflow redesign */
.youtube-connection-banner {
  margin: 0 0 14px;
  border: 1px solid rgba(255, 209, 102, .38);
  border-radius: 14px;
  background: rgba(255, 209, 102, .08);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.youtube-connection-banner[hidden] { display: none; }
.youtube-connection-banner.is-error { border-color: rgba(255, 91, 110, .42); background: rgba(255, 91, 110, .08); }
.youtube-connection-banner-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.06);
  color: #ffd166;
  font-size: 19px;
}
.youtube-connection-banner.is-error .youtube-connection-banner-icon { color: var(--danger); }
.youtube-connection-banner-copy { min-width: 0; }
.youtube-connection-banner-copy strong { display: block; margin-bottom: 3px; }
.youtube-connection-banner-copy p { margin: 0; color: var(--muted); line-height: 1.4; }
.youtube-connection-banner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.item-scheduled-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff0b1;
  font-size: 11px;
  font-weight: 700;
}
.empty-state-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.empty-state-summary a {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.empty-state-summary a:hover { border-color: rgba(104,199,255,.44); }

.upload-job {
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #10131a;
}
.upload-job-main { min-width: 0; display: grid; gap: 18px; padding: 16px; }
.local-file-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.local-file-summary-copy { min-width: 0; display: grid; gap: 4px; }
.local-file-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.local-file-summary .js-job-filename { overflow-wrap: anywhere; }
.local-file-meta { gap: 6px 12px; }
.local-file-summary .delete-upload-btn { flex: 0 0 auto; white-space: nowrap; }

.youtube-job-status {
  margin: 0;
  padding: 16px;
  border-radius: 13px;
}
.youtube-state-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.youtube-state-head > div { min-width: 0; }
.youtube-state-head strong { font-size: 16px; }
.youtube-state-message {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 65ch;
}
.youtube-state-head .btn-small { white-space: nowrap; }
.youtube-transfer-progress { margin-top: 13px; }
.youtube-transfer-progress[hidden] { display: none; }
.youtube-transfer-progress .progress-head { margin-bottom: 7px; color: var(--muted); font-size: 12px; }

.job-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}
.job-pipeline-step {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  background: rgba(0,0,0,.14);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}
.job-pipeline-step .bi { flex: 0 0 auto; }
.job-pipeline-step.done {
  border-color: rgba(139,212,80,.24);
  background: rgba(139,212,80,.07);
  color: #d9ffd4;
}
.job-pipeline-step.current {
  border-color: rgba(255,210,79,.28);
  background: rgba(255,210,79,.07);
  color: #fff4c5;
}
.job-pipeline-step.skipped {
  border-color: rgba(255,255,255,.09);
  background: rgba(255,255,255,.025);
  color: var(--muted);
}
.youtube-schedule-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.youtube-schedule-controls-copy { display: grid; gap: 3px; min-width: 0; }
.youtube-schedule-controls-actions { flex: 0 0 auto; justify-content: flex-end; }
.youtube-schedule-controls-actions .btn { white-space: nowrap; }
.youtube-check-actions { padding-top: 3px; }

.sync-job-status,
.push-job-status { margin: 0; }

.thumbnail-job-status,
.thumbnail-job-status.ok,
.thumbnail-job-status.waiting,
.thumbnail-job-status.running,
.thumbnail-job-status.failed {
  margin: 0;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  justify-content: stretch;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}
.thumbnail-job-status.failed { border-color: rgba(255,91,110,.38); }
.thumbnail-job-status.running { border-color: rgba(104,199,255,.34); }
.thumbnail-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.thumbnail-section-head strong { display: inline-flex; align-items: center; gap: 7px; }
.thumbnail-section-body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.thumbnail-section-actions {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}
.thumbnail-preview {
  aspect-ratio: 16 / 9;
  min-height: 0;
  width: 100%;
  border-radius: 10px;
}
.thumbnail-upload-drop {
  grid-column: auto;
  grid-area: auto;
  min-height: 112px;
  margin: 0;
  padding: 16px;
  border-radius: 10px;
}
.thumbnail-status-detail {
  display: grid;
  gap: 5px;
  margin: 0;
  min-height: 1em;
  line-height: 1.4;
}
.local-file-delete-error { margin: 2px 0 0; }

@media (max-width: 760px) {
  .youtube-connection-banner { grid-template-columns: auto minmax(0, 1fr); }
  .youtube-connection-banner-actions { grid-column: 1 / -1; justify-content: stretch; }
  .youtube-connection-banner-actions .btn { flex: 1 1 auto; }
  .upload-job-main { gap: 14px; padding: 14px; }
  .local-file-summary { align-items: flex-start; flex-direction: column; }
  .local-file-summary .delete-upload-btn { width: 100%; }
  .youtube-state-head { flex-direction: column; }
  .job-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .youtube-schedule-controls { align-items: stretch; flex-direction: column; }
  .youtube-schedule-controls-actions { justify-content: stretch; }
  .youtube-schedule-controls-actions .btn { flex: 1 1 0; }
  .thumbnail-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .thumbnail-section-body { grid-template-columns: 1fr; gap: 12px; }
  .thumbnail-preview { width: 100%; }
}
.youtube-status-card.error { border-color: rgba(255,91,110,.38); background: rgba(255,91,110,.08); }
.btn-small { padding: 8px 10px; font-size: 12px; min-height: 0; }

/* OBS-panel convenience: give the reload icon a short visual response before navigation. */
[data-reload-page] .bi.spin {
  animation: ku-spin .7s linear infinite;
}

@keyframes ku-spin {
  to { transform: rotate(360deg); }
}

/* M02: paginated stream list */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.list-pagination-meta,
.list-pagination-page {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.list-pagination-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 680px) {
  .list-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .list-pagination-actions {
    justify-content: space-between;
  }
}

/* M03.1 worker health + safe pause/maintenance controls */
.worker-health-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  padding: 14px;
  display: grid;
  gap: 14px;
}
.worker-health-card.is-ok { border-color: rgba(52, 211, 153, .30); }
.worker-health-card.is-warn { border-color: rgba(255, 209, 102, .38); }
.worker-health-card.is-error { border-color: rgba(255, 99, 132, .44); }
.worker-health-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.worker-health-kicker {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.worker-health-title {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}
.worker-health-message {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.worker-health-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,.035);
}
.worker-health-badge.is-ok { color: #86efac; border-color: rgba(52,211,153,.32); background: rgba(52,211,153,.08); }
.worker-health-badge.is-warn { color: #ffe29a; border-color: rgba(255,209,102,.38); background: rgba(255,209,102,.08); }
.worker-health-badge.is-error { color: #ff9aaa; border-color: rgba(255,99,132,.42); background: rgba(255,99,132,.08); }
.worker-health-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.worker-health-metric {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  background: rgba(0,0,0,.12);
  padding: 9px 10px;
}
.worker-health-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.worker-health-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.worker-health-metric.is-ok { border-color: rgba(52,211,153,.18); }
.worker-health-metric.is-warn { border-color: rgba(255,209,102,.26); }
.worker-health-metric.is-error { border-color: rgba(255,99,132,.30); }
.worker-health-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.worker-health-action-hint { margin-left: auto; }
.worker-maintenance-ready {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid rgba(52,211,153,.28);
  border-radius: 10px;
  background: rgba(52,211,153,.07);
  padding: 10px 11px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}
.worker-maintenance-ready > i { color: #86efac; margin-top: 1px; }
@media (max-width: 640px) {
  .worker-health-head { align-items: stretch; flex-direction: column; }
  .worker-health-badge { align-self: flex-start; }
  .worker-health-metrics { grid-template-columns: 1fr; }
  .worker-health-action-hint { flex-basis: 100%; margin-left: 0; }
}
