* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #17181c;
  background: #f3f5f7;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  color: #fff;
  background: #1d4f91;
  cursor: pointer;
}

button:hover {
  background: #173f74;
}

button.secondary {
  color: #1c2734;
  background: #dce3ea;
}

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

button.danger {
  background: #a83232;
}

button.danger:hover {
  background: #862929;
}

label {
  display: block;
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid #c8d1da;
  border-radius: 6px;
  padding: 9px 10px;
  color: #17181c;
  background: #fff;
}

textarea {
  resize: vertical;
}

pre {
  overflow: auto;
  max-height: 280px;
  border: 1px solid #d5dde5;
  border-radius: 6px;
  padding: 12px;
  background: #f7f9fb;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px;
  color: #fff;
  background: #161b22;
}

.topbar h1,
.topbar p {
  margin: 0;
}

.topbar h1 {
  font-size: 24px;
}

.topbar p {
  margin-top: 4px;
  color: #b9c2ce;
}

main {
  padding: 24px;
}

.panel {
  margin-bottom: 18px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.narrow {
  max-width: 420px;
  margin: 40px auto;
}

.layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.sidebar {
  flex: 0 0 310px;
}

.content {
  min-width: 0;
  flex: 1 1 auto;
}

.content-header,
.button-row,
.assets-row,
.preferences,
.form-grid {
  display: flex;
  gap: 12px;
}

.content-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.content-header h2 {
  margin: 0;
}

.button-row {
  flex-wrap: wrap;
  margin: 4px 0 12px;
}

.form-grid > label,
.preferences > label {
  flex: 1 1 180px;
}

.assets-row {
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 12px;
}

.assets-row form {
  flex: 1 1 280px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 12px;
}

.message {
  margin-bottom: 14px;
  border-radius: 6px;
  padding: 10px 12px;
  color: #10243b;
  background: #d7ebff;
}

.message.error {
  color: #4c1111;
  background: #ffe1e1;
}

.video-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.video-card {
  display: flex;
  gap: 18px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.poster-frame {
  position: relative;
  flex: 0 0 160px;
  width: 160px;
  height: 235px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #26313f, #536579);
}

.poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  color: #dfe7ef;
  font-size: 14px;
  text-align: center;
  transform: translateY(-50%);
}

.video-main {
  min-width: 0;
  flex: 1 1 auto;
}

.video-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-title-row h3 {
  margin: 0;
  font-size: 20px;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  color: #10243b;
  background: #d9e8f8;
  font-size: 12px;
  font-weight: 700;
}

.status.risky,
.status.unknown,
.status.failed_to_probe {
  color: #57370b;
  background: #ffe8b8;
}

.meta,
.notes {
  margin: 5px 0 12px;
  color: #5a6572;
}

.notes {
  color: #744f0b;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce3ea;
}

.progress > div {
  width: 0;
  height: 100%;
  background: #1d4f91;
}

.small-list {
  margin-top: 12px;
  color: #5a6572;
  font-size: 13px;
}

@media (max-width: 900px) {
  .layout,
  .video-card,
  .topbar {
    display: block;
  }

  .sidebar {
    width: auto;
  }

  .poster-frame {
    margin-bottom: 14px;
  }

  .topbar button {
    margin-top: 14px;
  }
}
