/* ============================================================
   EasyDL — dark, privacy-first media link extractor
   Layout scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 px
   ============================================================ */

:root {
  --bg-0: #070b16;
  --bg-1: #0b1226;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2ff;
  --muted: #98a4c2;
  --faint: #6b7694;
  --acc-1: #7e8cff;
  --acc-1-hover: #8f9cff;
  --acc-2: #2dd4bf;
  --on-acc: #0a0e1c;
  --danger: #ff7d92;
  --danger-bg: rgba(255, 125, 146, 0.09);
  --ok: #4ade9e;

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  --shadow-1: 0 10px 30px rgba(2, 6, 20, 0.45);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

/* Author display rules must never defeat the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 82% -10%, rgba(109, 124, 255, 0.16), transparent 60%),
    radial-gradient(760px 420px at -12% 6%, rgba(45, 212, 191, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 46%);
  background-attachment: fixed;
}

::selection { background: rgba(109, 124, 255, 0.45); }

button, input { font: inherit; color: inherit; }

a { color: var(--acc-2); }

:focus-visible {
  outline: 2px solid var(--acc-2);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- Header ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 22, 0.72);
  border-bottom: 1px solid var(--stroke);
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
}

.lang-btn {
  min-width: 52px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.is-active {
  background: var(--acc-1);
  color: var(--on-acc);
}

/* ---------------- Page ---------------- */

.page {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) 24px 56px;
  flex: 1 0 auto;
}

.hero { text-align: center; }

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(1.65rem, 4.6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.14;
  color: var(--text);
}

.hero-sub {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.4vw, 1.08rem);
}

/* ---------------- Search ---------------- */

.search {
  margin: clamp(28px, 5vw, 44px) auto 0;
  max-width: 760px;
}

.api-key-bar {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 196, 92, 0.35);
  background: rgba(255, 196, 92, 0.07);
  border-radius: var(--r-md);
}

.api-key-hint { margin: 0 0 10px; font-size: 0.92rem; color: #ffd48a; }

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

.api-key-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-md);
  background: rgba(7, 11, 22, 0.6);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group:focus-within {
  border-color: rgba(126, 140, 255, 0.65);
  box-shadow: var(--shadow-1), 0 0 0 4px rgba(126, 140, 255, 0.13);
}

.input-icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-left: 14px;
  color: var(--faint);
}

.url-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
}

.url-input::placeholder { color: var(--faint); }

.url-input:focus { outline: none; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active { transform: translateY(1px); }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--acc-1);
  color: var(--on-acc);
}

.btn-primary:hover:not([disabled]) { background: var(--acc-1-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--stroke-strong);
  color: var(--text);
}

.btn-ghost:hover:not([disabled]) { background: var(--card-hover); }

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(255, 125, 146, 0.4);
  color: var(--danger);
}

.btn-danger-ghost:hover { background: var(--danger-bg); }

/* ---------------- Supported chips ---------------- */

.supported {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.supported-label { color: var(--faint); font-size: 0.85rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  padding: 4px 12px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------------- Status / errors ---------------- */

.status { max-width: 760px; margin: 0 auto; }

.status-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--acc-2);
  animation: spin 0.8s linear infinite;
  flex: none;
}

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

.error-card {
  max-width: 620px;
  margin: 28px auto 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(255, 125, 146, 0.35);
  border-radius: var(--r-lg);
  background: var(--danger-bg);
}

.error-card .error-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--danger);
  margin: 0;
}

.error-card .error-detail { margin: 0; color: var(--muted); font-size: 0.93rem; word-break: break-word; }

.error-card .btn { height: 44px; }

/* ---------------- Results ---------------- */

.results { margin-top: 34px; }

.result-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  margin-bottom: 22px;
}

.result-platform {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.platform-dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #071018;
  flex: none;
}

.result-title {
  margin: 4px 0 0;
  max-width: 720px;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-author {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--faint);
  font-size: 0.85rem;
}

.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 158, 0.35);
  background: rgba(74, 222, 158, 0.08);
  color: var(--ok);
  font-weight: 700;
}

.engine-chip.server {
  border-color: rgba(109, 124, 255, 0.4);
  background: rgba(109, 124, 255, 0.09);
  color: #aab8ff;
}

.scan-note {
  margin: 6px 0 0;
  max-width: 560px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 196, 92, 0.35);
  border-radius: var(--r-md);
  background: rgba(255, 196, 92, 0.07);
  color: #ffd48a;
  font-size: 0.85rem;
  line-height: 1.5;
}

.result-link {
  color: var(--faint);
  font-size: 0.85rem;
  text-underline-offset: 3px;
}

.result-link:hover { color: var(--muted); }

/* ---------------- Cards grid ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--stroke-strong);
  background: var(--card-hover);
  transform: translateY(-2px);
}

/* Top video: subtle border emphasis only — buttons stay identical across cards. */
.card.primary {
  border-color: rgba(126, 140, 255, 0.55);
}

/* Session-bound media (TikTok video): honest inline note. */
.card-note {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.45;
}

.preview {
  position: relative;
  background: #05080f;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.preview.video, .preview.image { aspect-ratio: 16 / 10; }

.preview.audio { min-height: 180px; }

.preview.media-fill img, .preview.media-fill video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview video, .preview img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.preview img { object-fit: contain; }

.preview audio { width: calc(100% - 28px); margin: 22px 14px; }

.preview .preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 18px;
  color: var(--faint);
  font-size: 0.85rem;
  text-align: center;
}

.preview .preview-fallback svg { width: 34px; height: 34px; opacity: 0.6; }

.badge-float {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--stroke-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.badge-float.tone-hd {
  background: var(--acc-1);
  color: var(--on-acc);
  border-color: transparent;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 16px;
  flex: 1 1 auto;
}

.card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-info .sep { color: var(--faint); }

.card-info .ext {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
  text-transform: uppercase;
}

.card-info .dims { font-variant-numeric: tabular-nums; }

.best-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid rgba(74, 222, 158, 0.35);
  border-radius: 999px;
  background: rgba(74, 222, 158, 0.08);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: auto;
}

.card-actions .btn { height: 44px; padding: 0 14px; font-size: 0.9rem; }

.card-actions .btn svg { width: 17px; height: 17px; flex: none; }

.btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.standalone-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.standalone-badge.ok {
  border-color: rgba(74, 222, 158, 0.35);
  color: var(--ok);
}

.server-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}

.server-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.server-switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--stroke-strong);
  transition: background 0.18s ease, border-color 0.18s ease;
  flex: none;
}

.server-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.server-toggle input:checked + .server-switch {
  background: var(--acc-1);
  border-color: transparent;
}

.server-toggle input:checked + .server-switch::after {
  transform: translateX(14px);
  background: var(--on-acc);
}

.server-toggle input:focus-visible + .server-switch {
  outline: 2px solid var(--acc-2);
  outline-offset: 2px;
}

/* ---------------- Guide dialog ---------------- */

.guide-open {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.row-sep { color: var(--faint); font-size: 0.82rem; }

.guide-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(84vh, 720px);
  padding: 0;
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-lg);
  background: var(--bg-1);
  color: var(--text);
}

.guide-dialog::backdrop { background: rgba(4, 7, 14, 0.62); }

.guide-box {
  padding: 18px 20px 20px;
  max-height: min(84vh, 720px);
  overflow: auto;
  text-align: left;
}

.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-head h2 { margin: 0; font-size: 1.05rem; }

.guide-close {
  height: 32px;
  min-width: 32px;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.guide-close:hover { color: var(--text); border-color: var(--acc-1); }

.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.guide-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.guide-tab svg { width: 15px; height: 15px; flex: none; }

.guide-tab:hover { color: var(--text); }

.guide-tab.is-active {
  color: var(--text);
  border-color: var(--acc-1);
  background: rgba(126, 140, 255, 0.12);
}

.guide-panel { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

.guide-intro { margin: 0 0 8px; color: var(--text); }

.guide-panel ol { margin: 6px 0; padding-left: 22px; }
.guide-panel li { margin: 5px 0; }

.help-title {
  margin: 14px 0 4px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.88rem;
}

.guide-dialog a { color: var(--acc-2); }

.guide-dialog code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: rgba(7, 11, 22, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 1px 6px;
  word-break: break-all;
}

.copyable {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
}

.copyable code {
  flex: 1 1 auto;
  min-width: 0;
}

.copy-btn {
  flex: none;
  height: 30px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--stroke-strong);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.copy-btn:hover { color: var(--text); border-color: var(--acc-1); }

.help-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 0.8rem;
  font-style: italic;
}

/* ---------------- History ---------------- */

.history {
  max-width: 760px;
  margin: 26px auto 0;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.history-clear {
  height: 34px;
  padding: 0 14px;
  font-size: 0.8rem;
  border-radius: 999px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.history-item:hover {
  border-color: var(--stroke-strong);
  background: var(--card-hover);
}

.history-item .platform-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.history-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-line {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  color: var(--faint);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-note {
  margin: 10px 0 0;
  max-width: 560px;
  color: var(--faint);
  font-size: 0.82rem;
  line-height: 1.5;
}

.standalone-row { margin: 0; }

.standalone-link {
  color: var(--faint);
  font-size: 0.82rem;
  text-underline-offset: 3px;
}

.standalone-link:hover { color: var(--muted); }

/* ---------------- Skeletons ---------------- */

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.skel {
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  background: var(--card);
  overflow: hidden;
  position: relative;
}

.skel-preview { aspect-ratio: 16 / 10; }

.skel-lines { padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; }

.skel-line { height: 14px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.skel-line.short { width: 55%; }
.skel-line.btnline { height: 40px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.055) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------------- Footer ---------------- */

.footer {
  margin-top: auto;
  border-top: 1px solid var(--stroke);
  background: rgba(5, 8, 15, 0.55);
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom));
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.privacy {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.privacy-badge {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 158, 0.35);
  color: var(--ok);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

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

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 0);
  z-index: 50;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(12, 18, 34, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, -6px); }

.toast[hidden] { display: none; }

/* ---------------- Responsive ---------------- */

@media (max-width: 680px) {
  .topbar-inner { padding: 10px 16px; }

  .page { padding-left: 16px; padding-right: 16px; }

  .search { margin-top: 26px; }

  .input-group {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: var(--r-xl);
  }

  .input-icon { display: none; }

  .url-input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    text-align: left;
  }

  .input-group .btn { width: 100%; }

  .supported { flex-direction: column; gap: 10px; }

  .grid, .skeleton-grid { grid-template-columns: 1fr; gap: 14px; }

  .result-head { margin-bottom: 18px; }

  .card-actions .btn { font-size: 0.95rem; }

  .footer { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 1.05rem; }
  .lang-btn { min-width: 44px; padding: 0 10px; }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
