.xh-tool {
  --a: #F3550C;
  --a2: #FF7A3D;
  --a3: #FFC4A8;
  --line: rgba(148,163,184,.18);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.xh-tool [hidden] { display: none !important; }
.xh-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(243,85,12,.32), transparent 55%), radial-gradient(700px 160px at 100% 0%, rgba(255,122,61,.18), transparent 50%), linear-gradient(145deg, rgba(15,23,41,.96), rgba(11,22,34,.9));
}
.xh-kicker { margin: 0 0 .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a); }
.xh-title { margin: 0 0 .35rem; font-size: 1.3rem; font-weight: 800; color: #f8fafc; letter-spacing: -.02em; }
.xh-sub { margin: 0; color: #94a3b8; font-size: .92rem; line-height: 1.5; max-width: 42rem; }
.xh-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;
}
.xh-card { padding: 1.1rem 1.15rem; border-radius: 16px; border: 1px solid var(--line); background: rgba(15,23,41,.72); }
.xh-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .8rem; }
.xh-head h3 { margin: 0; font-size: .95rem; font-weight: 800; color: #e2e8f0; }
.xh-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; }
.xh-hint { margin: 0 0 .75rem; font-size: .82rem; line-height: 1.45; color: #94a3b8; }
.xh-url-stack { display: flex; flex-direction: column; gap: .6rem; width: 100%; }
.xh-url-input { min-height: 50px; }
.xh-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; }
.xh-paste-btn, .xh-fetch-btn, .xh-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;
}
.xh-paste-btn { border-style: dashed; }
.xh-fetch-btn { box-shadow: 0 8px 22px color-mix(in srgb, var(--a) 28%, transparent); }
.xh-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; }
.xh-mini:hover { border-color: color-mix(in srgb, var(--a) 50%, transparent); color: #fff; }
.xh-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); }
.xh-progress-head { display: flex; justify-content: space-between; color: #e2e8f0; font-size: .85rem; margin-bottom: .45rem; }
.xh-progress-track { height: 10px; border-radius: 999px; background: rgba(15,23,41,.85); overflow: hidden; }
.xh-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--a2), var(--a), var(--a3)); transition: width .2s; }
.xh-progress-step { margin: .5rem 0 0; font-size: .78rem; color: #94a3b8; }
.xh-status { margin: .75rem 0 0; min-height: 1.2rem; font-size: .86rem; color: #94a3b8; }
.xh-status.is-error { color: #fca5a5; }
.xh-status.is-ok { color: #86efac; }
.xh-result-grid { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 1.15rem; align-items: center; }
.xh-preview-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #020617; border: 1px solid var(--line); aspect-ratio: 16/9; }
.xh-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.xh-result-info { min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.xh-result-kicker { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a3); }
.xh-result-info h3 { margin: 0; color: #f8fafc; font-size: 1.12rem; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; }
.xh-creator { margin: 0; color: #cbd5e1; font-size: .88rem; font-weight: 600; }
.xh-stat-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.xh-stat { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; color: #e2e8f0; background: rgba(15,23,41,.9); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .65rem; }
.xh-meta { margin: 0 0 .35rem; color: #94a3b8; font-size: .86rem; }
.xh-actions-inline { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.xh-format-head { margin-top: 1rem; }
.xh-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.xh-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;
}
.xh-filter.is-active { border-color: color-mix(in srgb, var(--a) 55%, transparent); background: color-mix(in srgb, var(--a) 18%, transparent); color: #fff; }
.xh-formats { display: grid; gap: .55rem; }
.xh-format {
  display: grid; grid-template-columns: auto 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;
}
.xh-format.is-active { border-color: color-mix(in srgb, var(--a) 60%, transparent); background: color-mix(in srgb, var(--a) 18%, transparent); }
.xh-format-radio {
  width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid #64748b;
  display: inline-block; position: relative; flex-shrink: 0;
}
.xh-format.is-active .xh-format-radio { border-color: var(--a2); }
.xh-format.is-active .xh-format-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--a);
}
.xh-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); }
.xh-format-badge.is-rec { background: color-mix(in srgb, var(--a) 28%, transparent); color: #fff; }
.xh-format strong { display: block; font-size: .9rem; }
.xh-format em { display: block; font-style: normal; font-size: .75rem; color: #94a3b8; margin-top: .15rem; }
.xh-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; align-items: stretch; width: 100%; }
.xh-actions .btn { width: 100%; min-height: 48px; justify-content: center; }
.xh-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);
}
.xh-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);
}
.xh-dl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.xh-dl-head strong { color: #fff; font-size: 1.05rem; font-weight: 800; }
.xh-dl-x {
  appearance: none; border: 0; background: transparent; color: #94a3b8; font-size: 1.4rem;
  line-height: 1; cursor: pointer; padding: .1rem .35rem;
}
.xh-dl-warn {
  margin: 0 0 1.1rem; padding: .7rem .8rem; border-radius: 12px;
  border: 1px solid rgba(243,85,12,.45); background: rgba(243,85,12,.12);
  color: #ffd7c2; font-size: .82rem; font-weight: 650; line-height: 1.45;
}
.xh-dl-file { margin: 0 0 .35rem; text-align: center; color: #cbd5e1; font-size: .82rem; font-weight: 700; }
.xh-dl-pct { margin: 0; text-align: center; font-size: 2.4rem; font-weight: 800; color: #fff; letter-spacing: -.04em; }
.xh-dl-eta { margin: .2rem 0 .85rem; text-align: center; color: #fb923c; font-size: .9rem; font-weight: 700; }
.xh-dl-track { height: 8px; border-radius: 999px; background: #2a2a2a; overflow: hidden; }
.xh-dl-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--a2), var(--a)); transition: width .25s ease; }
.xh-dl-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem;
  margin: .9rem 0 .75rem;
}
.xh-dl-stats div {
  padding: .6rem .4rem; border-radius: 12px; text-align: center;
  background: #1c1c1c; border: 1px solid rgba(255,255,255,.06);
}
.xh-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; }
.xh-dl-stats strong { display: block; color: #fff; font-size: .95rem; font-weight: 800; letter-spacing: -.02em; }
.xh-dl-stats div:first-child strong { color: #fb923c; }
.xh-dl-stats div:nth-child(2) strong { color: #cbd5e1; }
.xh-dl-meta { display: flex; justify-content: space-between; gap: .75rem; margin: 0 0 1.1rem; color: #e2e8f0; font-size: .82rem; font-weight: 650; }
.xh-dl-cancel {
  width: 100%; min-height: 48px; border: 0; border-radius: 12px; cursor: pointer;
  background: #3b1212; color: #fb7185; font-size: .95rem; font-weight: 800;
}
.xh-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;
}
.xh-dl-ready-title { margin: 0 0 .4rem; text-align: center; color: #fff; font-size: 1.35rem; font-weight: 800; }
.xh-dl-ready-copy { margin: 0 0 1.2rem; text-align: center; color: #94a3b8; font-size: .88rem; line-height: 1.5; }
.xh-dl-save {
  width: 100%; min-height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  background: #22c55e; color: #fff; font-size: 1rem; font-weight: 800;
}
.xh-note { margin: 0; font-size: .78rem; color: #64748b; }
.xh-profile-head { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; align-items:flex-start; margin-bottom:1rem; }
.xh-profile-actions, .xh-profile-toolbar { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.xh-profile-toolbar { margin-bottom:1rem; padding:.75rem; border-radius:12px; border:1px solid var(--line); background:rgba(2,6,23,.35); }
.xh-check-all { display:inline-flex; gap:.4rem; align-items:center; color:#cbd5e1; font-size:.85rem; font-weight:700; }
.xh-profile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:.75rem; }
.xh-profile-card { appearance:none; 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); color:inherit; text-align:left; cursor:pointer; width:100%; }
.xh-profile-card.is-checked { border-color:color-mix(in srgb, var(--a) 55%, transparent); }
.xh-profile-card .xh-format-radio { position:absolute; top:.65rem; left:.65rem; z-index:2; }
.xh-profile-thumb { display:block; aspect-ratio:16/10; border-radius:10px; background:#020617 center/cover no-repeat; }
.xh-profile-meta strong { display:block; font-size:.78rem; color:#e2e8f0; line-height:1.3; max-height:2.5em; overflow:hidden; }
.xh-profile-meta em { display:block; font-style:normal; font-size:.7rem; color:#94a3b8; }
.xh-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) {
  .xh-result-grid { grid-template-columns: 1fr; }
  .xh-actions { display: grid; grid-template-columns: 1fr; }
  .xh-actions .btn { width: 100%; min-height: 48px; justify-content: center; }
  .xh-format { grid-template-columns: auto auto minmax(0,1fr); }
}
