.tbd-tool {
  --a: #1A73E8;
  --a2: #4285F4;
  --a3: #8AB4F8;
  --line: rgba(148,163,184,.18);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tbd-tool [hidden] { display: none !important; }
.tbd-hero {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 1.2rem 1.25rem; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(900px 180px at 0% -30%, rgba(26,115,232,.28), transparent 55%), radial-gradient(700px 160px at 100% 0%, rgba(66,133,244,.22), transparent 50%), linear-gradient(145deg, rgba(15,23,41,.96), rgba(11,22,34,.9));
}
.tbd-kicker { margin: 0 0 .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a); }
.tbd-title { margin: 0 0 .35rem; font-size: 1.3rem; font-weight: 800; color: #f8fafc; letter-spacing: -.02em; }
.tbd-sub { margin: 0; color: #94a3b8; font-size: .92rem; line-height: 1.5; max-width: 40rem; }
.tbd-badge {
  flex-shrink: 0; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: linear-gradient(145deg, var(--a), var(--a2)); border-radius: 999px; padding: .4rem .75rem;
}
.tbd-card { padding: 1.1rem 1.15rem; border-radius: 16px; border: 1px solid var(--line); background: rgba(15,23,41,.72); }
.tbd-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.tbd-head h3 { margin: 0; font-size: .95rem; font-weight: 800; color: #e2e8f0; }
.tbd-pill { font-size: .72rem; font-weight: 700; color: var(--a3); background: color-mix(in srgb, var(--a) 16%, transparent); border: 1px solid color-mix(in srgb, var(--a) 35%, transparent); border-radius: 999px; padding: .28rem .65rem; }


.tbd-url-row .btn {
    min-height: 46px;
    width: 100%;
    justify-content: center;
}
.tbd-textarea { width: 100%; min-height: 5.5rem; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; }
.tbd-tools { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; justify-content: flex-start; margin-top: .75rem; }
.tbd-tools .btn { min-height: 44px; min-width: 7.5rem; justify-content: center; }
.tbd-mini { appearance: none; border: 1px solid var(--line); background: rgba(30,41,59,.85); color: #cbd5e1; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: .35rem .75rem; cursor: pointer; text-decoration: none; display: inline-flex; }
.tbd-mini:hover { border-color: color-mix(in srgb, var(--a) 50%, transparent); color: #fff; }
.tbd-note { margin: 0; font-size: .78rem; color: #64748b; flex: 1; min-width: 12rem; }
.tbd-progress { margin-top: 1rem; padding: .85rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--a) 30%, transparent); background: color-mix(in srgb, var(--a) 12%, transparent); }
.tbd-progress-head { display: flex; justify-content: space-between; color: #e2e8f0; font-size: .85rem; margin-bottom: .45rem; }
.tbd-progress-track { height: 10px; border-radius: 999px; background: rgba(15,23,41,.85); overflow: hidden; }
.tbd-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--a2), var(--a), var(--a3)); transition: width .2s; }
.tbd-progress-step { margin: .5rem 0 0; font-size: .78rem; color: #94a3b8; }
.tbd-status { margin: .75rem 0 0; min-height: 1.2rem; font-size: .86rem; color: #94a3b8; }
.tbd-status.is-error { color: #fca5a5; }
.tbd-status.is-ok { color: #86efac; }
.tbd-result-grid { display: grid; grid-template-columns: minmax(140px, 210px) 1fr; gap: 1rem; }
.tbd-preview-wrap { border-radius: 14px; overflow: hidden; background: #020617; border: 1px solid var(--line); aspect-ratio: 16/9; position: relative; }
.tbd-preview-wrap.is-playing { box-shadow: 0 0 0 1px color-mix(in srgb, var(--a) 45%, transparent); }
.tbd-preview, .tbd-cover { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tbd-cover { object-fit: cover; }
.tbd-meta { margin: 0 0 .35rem; color: #94a3b8; font-size: .86rem; }
.tbd-result-grid h3 { margin: 0 0 .45rem; color: #f8fafc; font-size: 1.05rem; font-weight: 800; line-height: 1.35; }
.tbd-actions-inline { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.tbd-formats { display: grid; gap: .55rem; }
.tbd-format { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: center; width: 100%; text-align: left; padding: .8rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(2,6,23,.45); color: #e2e8f0; cursor: pointer; }
.tbd-format.is-active { border-color: color-mix(in srgb, var(--a) 60%, transparent); background: color-mix(in srgb, var(--a) 18%, transparent); }
.tbd-format-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; padding: .3rem .45rem; border-radius: 8px; background: color-mix(in srgb, var(--a) 18%, transparent); color: var(--a3); }
.tbd-format strong { display: block; font-size: .9rem; }
.tbd-format span { display: block; font-size: .75rem; color: #94a3b8; margin-top: .15rem; }
.tbd-format-radio {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #64748b; background: transparent;
}
.tbd-format.is-active .tbd-format-radio { border-color: var(--a2); box-shadow: inset 0 0 0 4px var(--a); }
.tbd-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.tbd-filter {
  appearance: none; border: 1px solid var(--line); background: rgba(15,23,41,.8); color: #cbd5e1;
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .4rem .7rem; cursor: pointer; min-height: 36px;
}
.tbd-filter.is-active { border-color: color-mix(in srgb, var(--a) 55%, transparent); background: color-mix(in srgb, var(--a) 18%, transparent); color: #fff; }
.tbd-format.is-rec { border-color: color-mix(in srgb, var(--a) 50%, transparent); }
.tbd-format-badge.is-rec { background: color-mix(in srgb, var(--a) 28%, transparent); color: #fff; }
.tbd-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; align-items: stretch; width: 100%; }
@media (max-width: 900px) {
  .tbd-result-grid { grid-template-columns: 1fr; }
  
}

.tbd-profile-head { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; align-items:flex-start; margin-bottom:1rem; }
.tbd-profile-actions, .tbd-profile-toolbar { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.tbd-profile-toolbar { margin-bottom:1rem; padding:.75rem; border-radius:12px; border:1px solid var(--line); background:rgba(2,6,23,.35); }
.tbd-check-all { display:inline-flex; gap:.4rem; align-items:center; color:#cbd5e1; font-size:.85rem; font-weight:700; }
.tbd-profile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.75rem; }
.tbd-profile-card { position:relative; display:flex; flex-direction:column; gap:.45rem; padding:.55rem; border-radius:14px; border:1px solid var(--line); background:rgba(15,23,41,.75); cursor:pointer; }
.tbd-profile-card.is-checked { border-color:color-mix(in srgb, var(--a) 55%, transparent); box-shadow:0 0 0 1px color-mix(in srgb, var(--a) 35%, transparent); }
.tbd-profile-card input { position:absolute; top:.65rem; left:.65rem; z-index:2; width:1.05rem; height:1.05rem; }
.tbd-profile-thumb { display:block; aspect-ratio:1/1; border-radius:10px; background:#020617 center/cover no-repeat; }
.tbd-profile-meta strong { display:block; font-size:.78rem; color:#e2e8f0; line-height:1.3; max-height:2.5em; overflow:hidden; }
.tbd-profile-meta em { display:block; font-style:normal; font-size:.7rem; color:#94a3b8; }
.tbd-profile-one { appearance:none; border:0; border-radius:8px; background:linear-gradient(145deg, var(--a2), var(--a)); color:#fff; font-size:.72rem; font-weight:800; padding:.4rem .55rem; cursor:pointer; }
@media (max-width: 900px) {
  .tbd-url-row .btn, .tbd-url-row button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
}
@media (max-width: 640px) {
  .tbd-tools {
    justify-content: center;
  }

  .tbd-tools .btn {
    width: 100%;
    max-width: 20rem;
  }
}

/* Mobile: download / profile action buttons full-width */
@media (max-width: 900px) {
  .tbd-actions {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
    align-items: stretch;
  }
  .tbd-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }
  .tbd-actions-inline {
    gap: 0.4rem;
  }
  .tbd-format {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }
  .tbd-format-dl {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .tbd-profile-actions,
  .tbd-profile-toolbar {
    width: 100%;
  }
  .tbd-profile-actions .btn,
  .tbd-profile-toolbar .btn {
    flex: 1 1 100%;
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
}


/* Input stack: row 1 URL | row 2 Paste | row 3 Fetch + Clear */
.tbd-url-stack {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: 100%;
}
.tbd-url-stack--actions { margin-top: .65rem; }
.tbd-url-field { position: relative; min-width: 0; width: 100%; }
.tbd-url-icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none; z-index: 1;
}
.tbd-url-input { padding-left: 2.55rem !important; min-height: 50px; }
.tbd-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; }
.tbd-paste-btn,
.tbd-fetch-btn,
.tbd-clear-btn {
  width: 100%; min-height: 48px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; border-radius: 12px; padding: .7rem 1rem;
}
.tbd-paste-btn { border-style: dashed; }
.tbd-fetch-btn { box-shadow: 0 8px 22px color-mix(in srgb, var(--a, #ff0033) 28%, transparent); }
.tbd-dl {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgba(2, 6, 23, .72); backdrop-filter: blur(8px);
}
.tbd-dl-card {
  width: min(460px, 100%); padding: 1.15rem 1.2rem 1.25rem; border-radius: 20px;
  background: #141414; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.tbd-dl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tbd-dl-head strong { color: #fff; font-size: 1.05rem; font-weight: 800; }
.tbd-dl-x {
  appearance: none; border: 0; background: transparent; color: #94a3b8; font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: .1rem .35rem;
}
.tbd-dl-warn {
  margin: 0 0 1.1rem; padding: .7rem .8rem; border-radius: 12px;
  border: 1px solid rgba(66,133,244,.45); background: rgba(26,115,232,.14);
  color: #d2e3fc; font-size: .82rem; font-weight: 650; line-height: 1.45;
}
.tbd-dl-file { margin: 0 0 .35rem; text-align: center; color: #cbd5e1; font-size: .82rem; font-weight: 700; }
.tbd-dl-pct { margin: 0; text-align: center; font-size: 2.4rem; font-weight: 800; color: #fff; letter-spacing: -.04em; }
.tbd-dl-eta { margin: .2rem 0 .85rem; text-align: center; color: #8ab4f8; font-size: .9rem; font-weight: 700; }
.tbd-dl-track { height: 8px; border-radius: 999px; background: #2a2a2a; overflow: hidden; }
.tbd-dl-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--a2), var(--a)); transition: width .25s ease; }
.tbd-dl-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin: .9rem 0 .75rem; }
.tbd-dl-stats div {
  padding: .6rem .4rem; border-radius: 12px; text-align: center;
  background: #1c1c1c; border: 1px solid rgba(255,255,255,.06);
}
.tbd-dl-stats em { display: block; font-style: normal; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; margin-bottom: .22rem; }
.tbd-dl-stats strong { display: block; color: #fff; font-size: .95rem; font-weight: 800; letter-spacing: -.02em; }
.tbd-dl-stats div:first-child strong { color: #8ab4f8; }
.tbd-dl-stats div:nth-child(2) strong { color: #cbd5e1; }
.tbd-dl-meta { display: flex; justify-content: space-between; gap: .75rem; margin: 0 0 1.1rem; color: #e2e8f0; font-size: .82rem; font-weight: 650; }
.tbd-dl-cancel {
  width: 100%; min-height: 48px; border: 0; border-radius: 12px; cursor: pointer;
  background: #3b1212; color: #fb7185; font-size: .95rem; font-weight: 800;
}
.tbd-dl-ok {
  width: 72px; height: 72px; margin: .4rem auto 1rem; border-radius: 50%;
  display: grid; place-items: center; background: rgba(34,197,94,.14); color: #4ade80;
  font-size: 2rem; font-weight: 800;
}
.tbd-dl-ready-title { margin: 0 0 .4rem; text-align: center; color: #fff; font-size: 1.35rem; font-weight: 800; }
.tbd-dl-ready-copy { margin: 0 0 1.2rem; text-align: center; color: #94a3b8; font-size: .88rem; line-height: 1.5; }
.tbd-dl-ready-actions { display: grid; gap: .65rem; }
.tbd-dl-play {
  width: 100%; min-height: 50px; border: 1px solid color-mix(in srgb, var(--a) 45%, transparent); border-radius: 12px; cursor: pointer;
  background: rgba(26,115,232,.16); color: #d2e3fc; font-size: 1rem; font-weight: 800;
}
.tbd-dl-save {
  width: 100%; min-height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(145deg, var(--a2), var(--a)); color: #fff; font-size: 1rem; font-weight: 800;
}
