:root {
  --bg: #f2f2f2;
  --card: #171a21;
  --card-border: #d7d7dc;
  --text: #706b6b;
  --muted: #9aa2b1;
  --accent: #2a11ff;
  --accent-hover: #4573e6;
  --danger: #ff6b6b;
  --warning: #f5b342;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(#e6e4e4 1px, #0000 1px), radial-gradient(#e6e4e4 1px, #0000 1px);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
  flex-direction: column;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 0 24px;
  margin-bottom: 48px;
}

.wrap {
  margin: 0 auto;
  padding: 24px 24px 24px;
}

.card {
  border: 2px dotted var(--card-border);
  border-radius: var(--radius);
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  width: 260px;
}

@media (min-width: 600px) {
  .logo {
    width: 320px;
  }
}

.dropzone {
  min-height: 80vh;
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 600px) {
  .dropzone {
    min-height: 85vh;
  }
}

@media (min-width: 1100px) {
  .dropzone {
    min-height: 90vh;
  }
}

.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.06);
  outline: none;
}

.dropzone-content p {
  margin: 6px 0;
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--text);
  margin-bottom: 8px;
}

.or {
  color: var(--text);
  font-size: 0.85rem;
  margin: 10px 0 !important;
}

.file-info {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.file-info video {
  width: 220px;
  max-width: 45%;
  border-radius: 8px;
  background: #000;
}

.file-meta {
  flex: 1;
  min-width: 0;
}

.file-meta p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--text);
  font-size: 0.9rem;
}

.small {
  font-size: 0.8rem;
}

.options {
  margin-top: 28px;
  border-top: 1px solid var(--card-border);
  padding-top: 24px;
}

.options h2 {
  font-size: 1.05rem;
  margin: 0 0 16px;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 8px;
}

.option-group:last-child {
  grid-column: 1 / -1;
  max-width: 200px;
}

.option-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.segmented {
  display: inline-flex;
  /* background: #1e222b; */
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 3px;
  width: 100%;
}

.segmented-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.segmented-btn.active {
  background: var(--accent);
  color: #fff;
}

.select {
  width: 100%;
  padding: 8px 10px;
  /* background: #1e222b; */
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.9rem;
}

.spec-note {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin: 16px 0;
}

.spec-note.estimate {
  color: var(--accent);
}

.hint {
  /* max-width: 320px; */
  padding: 1rem 0;
  font-size: .95rem;
  line-height: 1.8;
}

@media (min-width: 600px) {
  .hint {
    max-width: 600px;
  }
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  text-decoration: none;
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: #333844;
  color: #6b7280;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--accent);
}

.btn-text {
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  text-decoration: underline;
  font-size: 0.85rem;
}

.progress-section {
  margin-top: 24px;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}

.progress-bar {
  background: #1e222b;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.result-section {
  margin-top: 24px;
  border-top: 1px solid var(--card-border);
  padding-top: 20px;
}

.result-section video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  margin-bottom: 10px;
}

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.result-actions .btn {
  flex: 1;
}

.warning {
  color: var(--warning);
  font-size: 0.85rem;
  background: rgba(245, 179, 66, 0.1);
  border: 1px solid rgba(245, 179, 66, 0.3);
  padding: 10px 12px;
  border-radius: 8px;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

#site-footer {
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.85;
}

#site-footer a {
  color: #2A11FF;
  text-decoration: none;
  border-bottom: 1px dotted #2A11FF;
}

#site-footer a:hover {
  color: #e60e56;
  text-decoration: none;
  border-bottom: 1px dotted #e60e56;
}

#site-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
  .option-group:last-child {
    max-width: none;
  }
  .file-info {
    flex-direction: column;
  }
  .file-info video {
    width: 100%;
    max-width: 100%;
  }
}
