:root {
  color-scheme: light;
  --text: #111;
  --muted: #555;
  --line: #ddd;
  --fill: #f7f7f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 980px;
  padding: 16px;
  line-height: 1.45;
  background: #fff;
  color: var(--text);
}

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

.app-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.workspace {
  display: grid;
  gap: 8px;
}

h1,
h2,
h3 {
  margin: 1.2em 0 0.5em;
  letter-spacing: 0;
  font-size: 1.1rem;
}

h1 {
  margin-top: 0;
  font-size: 1.3rem;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 0.95rem;
}

p,
pre {
  margin: 0.5em 0;
}

.drop-zone {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  position: relative;
}

.drop-zone.is-dragging {
  background: var(--fill);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-copy {
  display: grid;
  gap: 2px;
}

.drop-copy strong {
  font-size: 0.95rem;
}

.drop-copy span,
.panel-heading span,
.status-line,
.download-link {
  color: var(--muted);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel,
.controls,
.status-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--line);
  object-fit: contain;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

select,
input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 3px 6px;
  background: #fff;
  color: var(--text);
}

button,
.download-link {
  min-height: 30px;
  border-radius: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--fill);
  color: var(--text);
}

.primary {
  background: #eaeaea;
  color: var(--text);
}

.primary:hover:not(:disabled) {
  background: #ddd;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary,
.download-link {
  background: var(--fill);
  border-color: var(--line);
  color: var(--text);
}

.status-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}

progress {
  width: 100%;
  height: 14px;
  accent-color: #444;
}

pre {
  min-height: 80px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.meta {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .preview-grid,
  .controls,
  .drop-zone {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .panel-heading,
  .status-line {
    flex-direction: column;
  }
}
