:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef2f7;
  --line: #d8dee8;
  --text: #18202f;
  --muted: #637083;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --warning: #b54708;
  --ok: #067647;
  --shadow: 0 14px 40px rgba(24, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

button.secondary {
  background: #e8eef5;
  color: var(--text);
}

button.secondary:hover {
  background: #dce5ef;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #8f1d14;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 20px;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.70), rgba(15, 118, 110, 0.45)),
    url("https://images.unsplash.com/photo-1522778119026-d647f0596c20?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-panel {
  display: grid;
  gap: 22px;
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(18px);
  color: #fff;
}

.login-brand {
  display: grid;
  gap: 6px;
}

.login-brand span {
  width: max-content;
  border-radius: 999px;
  padding: 4px 10px;
  background: #ef4444;
  font-size: 12px;
  font-weight: 900;
}

.login-brand h1 {
  margin: 0;
  font-size: 34px;
}

.login-brand p {
  margin: 0;
  color: #dbeafe;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: #e2e8f0;
}

.session-user {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 18px;
  max-width: 1480px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.auth-box {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  align-items: end;
  gap: 8px;
}

.auth-box label {
  grid-column: 1 / -1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
}

.stream-list-panel,
.dashboard-panel,
.thumbnail-panel,
.create-panel,
.details-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stream-list-panel {
  min-height: 680px;
  overflow: hidden;
}

.main-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3,
.tool-header h3 {
  margin: 0;
}

.panel-header h2 {
  font-size: 18px;
}

.panel-header h3,
.tool-header h3 {
  font-size: 15px;
}

.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
  white-space: nowrap;
}

#dashboardUpdated {
  min-width: max-content;
}

.stream-list {
  display: grid;
  align-content: start;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.stream-group {
  display: grid;
}

.stream-group-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stream-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 88px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.stream-item:hover,
.stream-item.active {
  background: #eef7f6;
}

.stream-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-thumb-wrap {
  position: relative;
  width: 88px;
  height: 56px;
}

.stream-thumb-wrap .mini-status {
  position: absolute;
  left: 5px;
  bottom: 5px;
  min-height: 18px;
  padding: 2px 7px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.22);
  font-size: 10px;
}

.stream-thumb {
  width: 88px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  object-fit: cover;
}

.stream-thumb.empty {
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.stream-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.stream-item span {
  color: var(--muted);
  font-size: 12px;
}

.stream-item-footer {
  display: block;
}

.stream-item-footer > span:first-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  text-align: left;
  pointer-events: auto;
}

.toast:hover {
  background: #fff;
  color: var(--text);
}

.toast.ok {
  border-color: #a9dfca;
  color: var(--ok);
  background: #effaf5;
}

.toast.ok:hover {
  color: var(--ok);
  background: #effaf5;
}

.toast.error {
  border-color: #f1a6a0;
  color: var(--danger);
  background: #fff3f2;
}

.toast.error:hover {
  color: var(--danger);
  background: #fff3f2;
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.dashboard-card {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 16px;
  background: #fff;
}

.dashboard-card.ok {
  box-shadow: inset 0 3px 0 var(--ok);
}

.dashboard-card.warning {
  box-shadow: inset 0 3px 0 var(--warning);
}

.dashboard-card.critical {
  box-shadow: inset 0 3px 0 var(--danger);
}

.dashboard-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-card strong {
  font-size: 28px;
}

.dashboard-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ffmpeg-task-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.ffmpeg-task-heading,
.ffmpeg-task-row,
.ffmpeg-task-empty {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.ffmpeg-task-heading {
  grid-template-columns: 1fr auto;
  width: 100%;
  border: 0;
  background: #f8fafc;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.ffmpeg-task-heading:hover {
  background: #f1f5f9;
}

.ffmpeg-task-heading.has-down {
  background: #fef2f2;
  color: var(--danger);
}

.ffmpeg-task-heading.has-down:hover {
  background: #fee2e2;
}

.ffmpeg-task-heading .chevron {
  display: inline-block;
  min-width: 12px;
  color: var(--text);
}

.ffmpeg-task-body {
  display: grid;
  max-height: 302px;
  overflow-y: auto;
}

.ffmpeg-task-body.collapsed {
  display: none;
}

.ffmpeg-task-row {
  grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(72px, auto)) 30px;
  min-height: 50px;
  border-top: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
}

.ffmpeg-task-row.warning {
  box-shadow: inset 3px 0 0 var(--warning);
}

.ffmpeg-task-row.critical {
  box-shadow: inset 3px 0 0 var(--danger);
}

.ffmpeg-task-row div {
  display: grid;
  min-width: 0;
}

.ffmpeg-task-row strong {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.task-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.12);
}

.task-dot.running {
  background: var(--ok);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.14);
}

.task-dot.down {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.14);
}

.task-dot.error {
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.14);
}

.task-restart-button,
.task-restart-placeholder {
  width: 28px;
  height: 28px;
  justify-self: end;
}

.task-restart-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.task-restart-button:hover {
  border-color: #94a3b8;
  color: var(--text);
  background: #f8fafc;
}

.task-restart-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ffmpeg-task-row strong,
.ffmpeg-task-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ffmpeg-task-row span,
.ffmpeg-task-empty {
  color: var(--muted);
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  justify-content: start;
  gap: 14px;
  padding: 14px;
}

.thumbnail-card {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
  color: var(--text);
  text-align: left;
}

.thumbnail-card:hover,
.thumbnail-card.active {
  border-color: var(--accent);
  background: #eef7f6;
}

.thumbnail-media {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #111827;
}

.thumbnail-media [data-thumbnail] {
  display: block;
}

.thumbnail-media .mini-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.22);
}

.thumbnail-card img,
.thumbnail-card .thumbnail-empty {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #111827;
  object-fit: cover;
  overflow: hidden;
  transition: opacity 0.18s ease;
}

.thumbnail-empty {
  display: grid;
  place-items: center;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 800;
}

.thumbnail-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.thumbnail-updated {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wide {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  align-items: end;
}

.details-panel {
  min-height: 380px;
}

.details-panel.empty {
  display: grid;
  place-items: center;
  padding: 40px;
}

.empty-state {
  max-width: 420px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p,
.details-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.details-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-badge,
.mini-status,
.signal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.signal-badge {
  background: #e2e8f0;
  color: var(--muted);
}

.signal-badge.has-signal {
  color: var(--accent-dark);
}

.signal-badge.no-signal {
  color: var(--warning);
}

.status-waiting {
  background: #64748b;
}

.status-online,
.status-recording,
.status-running {
  background: var(--ok);
}

.status-paused,
.status-technical_problem {
  background: var(--warning);
}

.status-offline,
.status-finished,
.status-error,
.status-stopped {
  background: var(--danger);
}

.health-healthy {
  color: var(--ok);
}

.health-warning,
.health-paused {
  color: var(--warning);
}

.health-critical {
  color: var(--danger);
}

.health-finished {
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics-grid div {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 15px 18px;
  background: #fff;
}

.metrics-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics-grid strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.url-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.runtime-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0 18px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.runtime-item {
  display: grid;
  gap: 6px;
  min-height: 66px;
  padding: 12px 14px;
  background: #fff;
}

.runtime-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.runtime-item strong {
  overflow-wrap: anywhere;
}

.runtime-ok {
  color: var(--ok);
}

.runtime-muted {
  color: var(--muted);
}

.runtime-error {
  color: var(--danger);
}

.preflight-panel {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.section-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-header h3 {
  margin: 0;
  font-size: 15px;
}

.preflight-list {
  display: grid;
  padding: 6px 0;
}

.preflight-row {
  display: grid;
  grid-template-columns: 72px minmax(120px, 0.6fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.preflight-row:first-child {
  border-top: 0;
}

.preflight-row span {
  width: max-content;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.preflight-row.ok span {
  background: #dcfce7;
  color: var(--ok);
}

.preflight-row.warn span {
  background: #ffedd5;
  color: var(--warning);
}

.preflight-row.error span {
  background: #fee2e2;
  color: var(--danger);
}

.preflight-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-row em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-panel {
  display: grid;
  gap: 12px;
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #0f172a;
  color: #fff;
}

.preview-panel .tool-header h3 {
  color: #fff;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.preview-box {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: #020617;
  overflow: hidden;
}

.preview-box div {
  display: grid;
  gap: 6px;
  max-width: 380px;
  padding: 20px;
  text-align: center;
}

.preview-box span {
  color: #cbd5e1;
}

.preview-box iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  background: #020617;
}

.preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-links a {
  color: #99f6e4;
  font-weight: 800;
  text-decoration: none;
}

.preview-links a:hover {
  text-decoration: underline;
}

.preview-links .button-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.preview-links .button-link:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.tool-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.tool-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
}

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-header button {
  min-height: 32px;
}

.access-panel {
  border-top: 1px solid var(--line);
}

.timeline-panel {
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(24, 32, 47, 0.06);
}

.access-panel + .timeline-panel {
  margin-top: 24px;
}

.access-list {
  display: grid;
}

.access-group {
  display: grid;
  border-top: 1px solid var(--line);
}

.access-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.access-group-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--text);
}

.access-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
}

.access-group-title + .access-item {
  border-top: 0;
}

.access-item.muted {
  color: var(--muted);
}

.access-url {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.access-url strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-url span {
  color: var(--muted);
  font-size: 12px;
}

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

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  display: grid;
  gap: 0;
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.event-list {
  display: grid;
  max-height: 560px;
  overflow: auto;
}

.event-item,
.event-empty {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.event-item:first-child,
.event-empty:first-child {
  border-top: 0;
}

.event-item.allowed {
  border-left: 4px solid var(--ok);
}

.event-item.denied {
  border-left: 4px solid var(--warning);
}

.event-main,
.event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.event-main span,
.event-meta,
.event-item p,
.event-empty {
  color: var(--muted);
  font-size: 12px;
}

.event-meta {
  justify-content: flex-start;
}

.event-item p {
  margin: 0;
}

.event-empty.error {
  color: var(--danger);
}

.timeline-list {
  display: grid;
}

.timeline-item {
  display: grid;
  gap: 8px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.timeline-item:first-child {
  border-top: 0;
}

.timeline-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-item span,
.timeline-empty {
  color: var(--muted);
  font-size: 12px;
}

.timeline-item code {
  display: block;
  overflow: auto;
  border-radius: 6px;
  padding: 8px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
}

.timeline-more {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.timeline-empty {
  padding: 16px;
}

@media (max-width: 1100px) {
  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .stream-list-panel {
    min-height: unset;
  }

  .stream-list {
    max-height: 360px;
  }

  .create-grid,
  .dashboard-grid,
  .metrics-grid,
  .preflight-row,
  .runtime-panel,
  .url-grid,
  .tool-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ffmpeg-task-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .auth-box,
  .create-grid,
  .dashboard-grid,
  .thumbnail-grid,
  .metrics-grid,
  .preflight-row,
  .runtime-panel,
  .url-grid,
  .tool-grid,
  .copy-row,
  .access-item {
    grid-template-columns: 1fr;
  }

  .ffmpeg-task-row {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: span 1;
  }

  .form-actions,
  .form-actions button,
  .action-row button,
  .preview-actions,
  .preview-actions button,
  .tool-panel button,
  .access-actions button {
    width: 100%;
  }

  .preview-actions {
    display: grid;
  }
}
