[hidden] {
  display: none !important;
}

/* Estilos nativos, sin frameworks. */
:root {
  --bg: #0f1115;
  --surface: #181b22;
  --border: #272b34;
  --text: #e6e8ec;
  --muted: #9aa1ac;
  --accent: #4f8cff;
  --ok: #35c486;
  --bad: #e5534b;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.app {
  width: 100%;
  max-width: 640px;
}

.app__header {
  margin-bottom: 1.75rem;
  text-align: center;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}

.app__subtitle {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card__title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}

.tabs__btn {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11141a;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tabs__btn[aria-selected="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(79, 140, 255, 0.12);
}

.tabs__btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.form__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.form__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.form__input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11141a;
  color: var(--text);
  font-size: 1rem;
}

.form__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form__select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11141a;
  color: var(--text);
  font-size: 1rem;
}

.form__select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form__button {
  margin-top: 0.4rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.form__button:disabled {
  background: #2c3340;
  color: var(--muted);
  cursor: not-allowed;
}

.progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.progress__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: none;
}

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

.result {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--ok);
  border-radius: 8px;
  background: rgba(53, 196, 134, 0.08);
}

.result p {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

.result__link {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  background: var(--ok);
  color: #04130c;
  font-weight: 600;
  text-decoration: none;
}

.preview {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11141a;
}

.preview__title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--text);
}

.preview__video {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #000;
}

.error {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--bad);
  border-radius: 8px;
  background: rgba(229, 83, 75, 0.08);
  color: #ffb4ae;
  font-size: 0.9rem;
}

.note {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.history__empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.history__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #11141a;
}

.history__title {
  margin: 0;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history__info {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.history__error {
  margin: 0;
  font-size: 0.8rem;
  color: #ffb4ae;
}

.history__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history__btn {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #181b22;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.history__btn--link {
  border-color: var(--ok);
  color: var(--ok);
}

.history__btn--danger {
  border-color: var(--bad);
  color: var(--bad);
}

.storage__info {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.status__dot[data-state="ok"] {
  background: var(--ok);
}

.status__dot[data-state="bad"] {
  background: var(--bad);
}

