* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000000;
  color: #f4f4f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: #0d0d11;
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  padding: 28px;
  border: 1px solid #202028;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

h1 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: #8e8ea0;
  margin-bottom: 20px;
}

.url-row {
  display: flex;
  gap: 10px;
}

input[type="text"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #262630;
  border-radius: 16px;
  font-size: 14px;
  outline: none;
  background: #15151b;
  color: #f4f4f5;
  transition: border-color 0.15s;
}

input[type="text"]::placeholder {
  color: #6b6b7b;
}

input[type="text"]:focus,
select:focus {
  border-color: #2563eb;
}

button {
  padding: 12px 18px;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}

button:hover:not(:disabled) {
  background: #3b82f6;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

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

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 18px;
}

.error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #1f1014;
  color: #fca5a5;
  font-size: 13px;
  border: 1px solid #4c1d24;
  display: none;
}

.video-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #1f1f27;
  display: none;
}

.video-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
  background: #15151b;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid #22222c;
}

.thumb {
  width: 104px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
  background: #1f1f27;
  flex-shrink: 0;
}

.meta-text {
  min-width: 0;
}

.video-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-sub {
  font-size: 12px;
  color: #8e8ea0;
  margin-top: 4px;
}

.field {
  margin-bottom: 14px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #c4c4d0;
}

.hint {
  font-weight: 400;
  color: #60a5fa;
  font-size: 12px;
}

.format-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tab-btn {
  background: #15151b;
  color: #a1a1aa;
  border: 1px solid #262630;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 16px;
}

.tab-btn:hover:not(:disabled) {
  background: #1c1c24;
  color: #f4f4f5;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.estimate-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #15151b;
  border: 1px solid #22222c;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  color: #a1a1aa;
  margin-bottom: 14px;
}

.estimate-bar strong {
  color: #f4f4f5;
  font-weight: 600;
}

.clip-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #d4d4d8;
  cursor: pointer;
  user-select: none;
  padding: 4px 2px;
}

.clip-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  cursor: pointer;
}

.clip-box {
  margin-top: 10px;
  padding: 14px;
  background: #15151b;
  border: 1px solid #22222c;
  border-radius: 18px;
  display: none;
}

.clip-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.clip-inputs label {
  display: block;
  font-size: 12px;
  color: #8e8ea0;
  margin-bottom: 6px;
}

.clip-duration-note {
  font-size: 12px;
  color: #8e8ea0;
  margin-top: 8px;
}

.progress-wrap {
  margin-top: 18px;
  background: #15151b;
  border: 1px solid #22222c;
  border-radius: 18px;
  padding: 14px;
  display: none;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-pct {
  font-variant-numeric: tabular-nums;
  color: #60a5fa;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #23232e;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8e8ea0;
  margin-top: 8px;
}

.save-link {
  display: none;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.save-link a {
  color: #60a5fa;
  font-weight: 500;
  text-decoration: none;
}

.save-link a:hover {
  text-decoration: underline;
}

.privacy-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #1a1a22;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #71717a;
  gap: 8px;
}

.wipe-btn {
  background: #15151b;
  color: #a1a1aa;
  border: 1px solid #262630;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 12px;
}

.wipe-btn:hover:not(:disabled) {
  background: #1f1f27;
  color: #ffffff;
}

@media (max-width: 520px) {
  body {
    padding: 14px;
    align-items: flex-start;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .card {
    padding: 20px;
    border-radius: 22px;
  }

  .url-row {
    flex-direction: column;
  }

  input[type="text"],
  select {
    font-size: 16px;
    min-height: 46px;
  }

  button {
    min-height: 46px;
    width: 100%;
  }

  .wipe-btn {
    width: auto;
    min-height: 34px;
  }

  .video-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .estimate-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
