:root {
  color-scheme: light;
  --video-frame-background: #f4f6f8;
  --video-frame-surface: #ffffff;
  --video-frame-surface-muted: #f6f8fa;
  --video-frame-border: #d0d7de;
  --video-frame-text: #1f2328;
  --video-frame-muted: #57606a;
  --video-frame-accent: #0969da;
  --video-frame-accent-hover: #0757b5;
  --video-frame-success: #1a7f37;
  --video-frame-warning: #9a6700;
  --video-frame-danger: #cf222e;
  --video-frame-info-background: #ddf4ff;
  --video-frame-info-border: #b6e3ff;
  --video-frame-shadow: 0 14px 36px rgba(31, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--video-frame-text);
  background: var(--video-frame-background);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

main.video-frame-page {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
}

.video-frame-page header {
  margin-bottom: 18px;
}

.video-frame-page h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.video-frame-page header p {
  margin: 8px 0 0;
  color: var(--video-frame-muted);
  line-height: 1.7;
}

.video-frame-page .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--video-frame-muted);
  font-size: 0.9rem;
}

.video-frame-page a {
  color: var(--video-frame-accent);
  font-weight: 700;
  text-decoration: none;
}

.video-frame-page a:hover,
.video-frame-page a:focus-visible {
  text-decoration: underline;
}

.video-frame-notice,
.video-frame-panel {
  margin-bottom: 16px;
  background: var(--video-frame-surface);
  border: 1px solid var(--video-frame-border);
  border-radius: 12px;
  box-shadow: var(--video-frame-shadow);
}

.video-frame-notice {
  padding: 12px 14px;
  color: #0550ae;
  background: var(--video-frame-info-background);
  border-color: var(--video-frame-info-border);
  line-height: 1.65;
}

.video-frame-panel {
  padding: 18px;
}

.video-frame-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.video-frame-panel h3 {
  margin: 0;
  font-size: 0.95rem;
}

.video-frame-row,
.video-frame-toolbar,
.video-frame-actions,
.video-frame-settings,
.video-frame-summary,
.video-frame-file-info,
.video-frame-result-actions,
.video-frame-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.video-frame-toolbar {
  justify-content: space-between;
}

.video-frame-page button,
.video-frame-page select,
.video-frame-page input {
  min-height: 38px;
  color: var(--video-frame-text);
  background: var(--video-frame-surface);
  border: 1px solid var(--video-frame-border);
  border-radius: 8px;
  font: inherit;
}

.video-frame-page button,
.video-frame-page select {
  padding: 7px 12px;
}

.video-frame-page button {
  background: var(--video-frame-surface-muted);
  cursor: pointer;
  font-weight: 700;
}

.video-frame-page button.primary {
  color: #ffffff;
  background: var(--video-frame-accent);
  border-color: var(--video-frame-accent);
}

.video-frame-page button.primary:hover,
.video-frame-page button.primary:focus-visible {
  background: var(--video-frame-accent-hover);
}

.video-frame-page button.danger {
  color: var(--video-frame-danger);
}

.video-frame-page button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.video-frame-page input[type="number"] {
  width: 118px;
  padding: 7px 9px;
}

.video-frame-page input[type="range"] {
  width: 150px;
  min-height: 24px;
  border: 0;
}

.video-frame-page input[type="color"] {
  width: 52px;
  padding: 3px;
}

.video-frame-page label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--video-frame-muted);
  font-weight: 700;
}

.video-frame-drop-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-top: 14px;
  padding: 28px;
  color: var(--video-frame-muted);
  background: var(--video-frame-surface-muted);
  border: 2px dashed #8c959f;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}

.video-frame-drop-zone strong {
  display: block;
  margin-bottom: 7px;
  color: var(--video-frame-text);
  font-size: 1.05rem;
}

.video-frame-drop-zone small {
  display: block;
  margin-top: 8px;
}

.video-frame-drop-zone.is-dragging {
  color: var(--video-frame-accent);
  background: var(--video-frame-info-background);
  border-color: var(--video-frame-accent);
}

.video-frame-selected {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.video-frame-source-preview {
  display: grid;
  place-items: center;
  min-height: 230px;
  overflow: hidden;
  background: #111820;
  border: 1px solid var(--video-frame-border);
  border-radius: 10px;
}

.video-frame-source-preview video,
.video-frame-source-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.video-frame-file-details {
  align-self: start;
  min-width: 0;
  padding: 14px;
  background: var(--video-frame-surface-muted);
  border: 1px solid var(--video-frame-border);
  border-radius: 10px;
}

.video-frame-file-name {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.video-frame-file-info {
  align-items: stretch;
}

.video-frame-file-info span {
  flex: 1 1 150px;
  padding: 10px;
  color: var(--video-frame-muted);
  background: var(--video-frame-surface);
  border: 1px solid var(--video-frame-border);
  border-radius: 8px;
  font-size: 0.86rem;
}

.video-frame-file-info strong {
  display: block;
  margin-top: 3px;
  color: var(--video-frame-text);
}

.video-frame-settings {
  align-items: flex-end;
  margin-top: 14px;
}

.video-frame-setting {
  display: grid;
  gap: 6px;
}

.video-frame-setting > label {
  font-size: 0.84rem;
}

.video-frame-setting-group {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.video-frame-setting-note {
  margin: 14px 0 0;
  color: var(--video-frame-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.video-frame-estimate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  padding: 11px 12px;
  color: var(--video-frame-muted);
  background: var(--video-frame-surface-muted);
  border: 1px solid var(--video-frame-border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.video-frame-estimate strong {
  color: var(--video-frame-text);
}

.video-frame-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  margin-top: 14px;
}

.video-frame-page progress {
  width: 100%;
  height: 16px;
  accent-color: var(--video-frame-accent);
}

.video-frame-message {
  grid-column: 1 / -1;
  color: var(--video-frame-muted);
  font-size: 0.9rem;
}

.video-frame-message.is-warning {
  color: var(--video-frame-warning);
}

.video-frame-message.is-error {
  color: var(--video-frame-danger);
}

.video-frame-results-summary {
  margin: 14px 0 0;
  color: var(--video-frame-muted);
  font-size: 0.9rem;
}

.video-frame-results-summary strong {
  color: var(--video-frame-text);
}

.video-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 13px;
  margin-top: 14px;
}

.video-frame-card {
  min-width: 0;
  overflow: hidden;
  background: var(--video-frame-surface);
  border: 1px solid var(--video-frame-border);
  border-radius: 10px;
}

.video-frame-card-image {
  display: grid;
  place-items: center;
  min-height: 155px;
  padding: 8px;
  background: repeating-conic-gradient(var(--video-frame-border) 0 25%, var(--video-frame-surface) 0 50%) 50% / 18px 18px;
  border-bottom: 1px solid var(--video-frame-border);
}

.video-frame-card-image img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: contain;
}

.video-frame-card-body {
  display: grid;
  gap: 8px;
  padding: 11px;
}

.video-frame-card-title {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
  font-weight: 800;
}

.video-frame-card-meta {
  color: var(--video-frame-muted);
  font-size: 0.78rem;
}

.video-frame-result-actions {
  justify-content: space-between;
}

.video-frame-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  color: #ffffff !important;
  background: var(--video-frame-success);
  border-radius: 7px;
}

.video-frame-download:hover {
  text-decoration: none !important;
  filter: brightness(0.95);
}

.video-frame-empty {
  padding: 34px 12px;
  color: var(--video-frame-muted);
  text-align: center;
}

.video-frame-pagination {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

.video-frame-page-jump-row,
.video-frame-page-navigation {
  display: flex;
  flex: 0 0 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.video-frame-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--video-frame-text);
  font-variant-numeric: tabular-nums;
}

.video-frame-page .video-frame-page-jump input[type="number"] {
  width: 72px;
  min-height: 38px;
  padding: 6px 8px;
  text-align: center;
}

.video-frame-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.video-frame-license {
  color: var(--video-frame-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.video-frame-page [hidden] {
  display: none !important;
}

@media (max-width: 780px) {
  main.video-frame-page {
    width: min(100% - 20px, 1220px);
    padding: 22px 0;
  }

  .video-frame-selected {
    grid-template-columns: 1fr;
  }

  .video-frame-settings,
  .video-frame-setting-group {
    align-items: stretch;
  }

  .video-frame-setting {
    flex: 1 1 140px;
  }

  .video-frame-setting select,
  .video-frame-setting input[type="number"] {
    width: 100%;
  }
}
