/* YouTube downloader — responsive tool layout */

.yt-board {
  margin-bottom: 28px;
}

.yt-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .yt-form__row {
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }
}

.yt-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.yt-input:focus {
  border-color: var(--theme);
}

.yt-extract-btn {
  min-height: 48px;
  min-width: 120px;
  justify-content: center;
}

.yt-status {
  min-height: 1.35em;
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.yt-status.is-error {
  color: #be123c;
}

.yt-status.is-ok {
  color: var(--theme-deep);
}

.yt-result {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.yt-result[hidden] {
  display: none !important;
}

.yt-overview {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  align-items: start;
}

@media (min-width: 720px) {
  .yt-overview {
    grid-template-columns: minmax(0, 30%) minmax(0, 70%);
    gap: 18px;
  }
}

.yt-thumb-wrap {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.yt-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.yt-thumb[hidden],
.yt-thumb-dl[hidden] {
  display: none !important;
}

.yt-thumb-dl {
  width: 100%;
  justify-content: center;
}

.yt-overview__meta {
  min-width: 0;
}

.yt-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--theme-dim);
  color: var(--theme-deep);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yt-badge[hidden] {
  display: none !important;
}

.yt-title {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.yt-channel,
.yt-stats {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Compact download controls */
.yt-download {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.yt-download[hidden] {
  display: none !important;
}

.yt-download__heading {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.yt-download__grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 720px) {
  .yt-download__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.yt-download__field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.yt-download__field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

.yt-download__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.yt-select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
}

.yt-select:focus {
  border-color: var(--theme);
}

.yt-dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  min-width: 148px;
  padding: 0 16px;
  white-space: nowrap;
}

.yt-dl-btn__spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yt-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.yt-dl-btn.is-loading {
  pointer-events: none;
}

.yt-dl-btn.is-loading .yt-dl-btn__spin {
  display: inline-block;
}

.yt-dl-btn__label {
  font-variant-numeric: tabular-nums;
}

@keyframes yt-spin {
  to {
    transform: rotate(360deg);
  }
}

.yt-progress {
  display: grid;
  gap: 6px;
}

.yt-progress[hidden] {
  display: none !important;
}

.yt-progress__track {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.yt-progress__bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--theme);
  transition: width 0.15s linear;
}

.yt-progress.is-indeterminate .yt-progress__bar {
  width: 35%;
  animation: yt-indeterminate 1.1s ease-in-out infinite;
}

@keyframes yt-indeterminate {
  0% {
    margin-left: 0;
    width: 20%;
  }
  50% {
    margin-left: 40%;
    width: 35%;
  }
  100% {
    margin-left: 80%;
    width: 20%;
  }
}

.yt-progress__text {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.yt-section__head .btn.is-copied {
  background: var(--theme-dim);
  border-color: var(--theme);
  color: var(--theme-deep);
}

.yt-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.yt-section[hidden] {
  display: none !important;
}

.yt-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.yt-section__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.yt-section__hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

.yt-copybox {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-soft);
  word-break: break-word;
}

.yt-copybox--pre {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  font-family: var(--font-display);
}
