/* =============================================================
   Downloader UI — layers on top of the shared styles.css.
   Reused across every platform site.
   ============================================================= */

/* ---- Input box (hero) ---- */
.dl-box {
  max-width: none; margin: 26px auto 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; box-shadow: var(--shadow);
}
.dl-row { display: flex; gap: 10px; }
.dl-input {
  flex: 1; min-width: 0; padding: 15px 16px; font-size: 1rem;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 11px; outline: none;
}
.dl-input:focus { border-color: var(--accent); }
.dl-actions { display: flex; gap: 8px; }
.dl-paste, .dl-clear {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 11px; padding: 0 14px; cursor: pointer; font-weight: 600; font-size: .9rem;
}
.dl-paste:hover, .dl-clear:hover { color: var(--text); }
.dl-submit {
  padding: 15px 26px; border: none; border-radius: 11px; cursor: pointer;
  font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.dl-submit:disabled { opacity: .6; cursor: default; }
.dl-hint { font-size: .82rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
@media (max-width: 560px){
  .dl-row { flex-direction: column; }
  .dl-actions { justify-content: space-between; }
  .dl-submit { width: 100%; }
}

/* ---- States ---- */
.dl-status { max-width: none; margin: 16px auto 0; text-align: center; }
.dl-spinner {
  width: 34px; height: 34px; margin: 6px auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: dl-spin .8s linear infinite;
}
@keyframes dl-spin { to { transform: rotate(360deg); } }
.dl-error {
  max-width: none; margin: 16px auto 0; padding: 12px 16px; border-radius: 11px;
  background: color-mix(in srgb, #ff5b5b 12%, var(--card));
  border: 1px solid color-mix(in srgb, #ff5b5b 40%, transparent);
  color: var(--text); font-size: .92rem; text-align: center;
}

/* ---- Result card ---- */
.dl-result {
  max-width: none; margin: 20px auto 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.dl-result-head { display: flex; gap: 16px; padding: 16px; align-items: center; }
.dl-thumb {
  width: 120px; height: 120px; flex: 0 0 120px; border-radius: 12px; object-fit: cover;
  background: var(--bg-2); border: 1px solid var(--line);
}
.dl-meta h3 { font-size: 1.05rem; margin: 0 0 6px; line-height: 1.3; }
.dl-meta p { margin: 0; font-size: .85rem; color: var(--muted); }
.dl-options { border-top: 1px solid var(--line); padding: 8px; display: grid; gap: 8px; }
.dl-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
}
.dl-option .lbl { font-weight: 700; font-size: .92rem; }
.dl-option .lbl span { color: var(--muted); font-weight: 500; margin-left: 8px; font-size: .82rem; }
.dl-option .btn { padding: 9px 18px; font-size: .9rem; }
.dl-option { flex-wrap: wrap; }
.dl-option button.btn:disabled { opacity: .7; cursor: wait; }
.dl-note { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--muted); }
.dl-note:empty { display: none; }
.dl-note.err { color: #b42318; font-weight: 600; }
@media (max-width: 560px){
  .dl-thumb { width: 84px; height: 84px; flex-basis: 84px; }
  .dl-option { flex-direction: column; align-items: stretch; }
}

/* ---- Article body lists (guides) ---- */
main ol, main > .container ol { padding-left: 22px; margin: 10px 0 18px; display: grid; gap: 8px; }
main ol li { color: var(--text); }
main ol li b { color: var(--text); }

/* ---- Content-type sub-sections (H2 with icon) ---- */
.sub-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.sub-block:last-child { margin-bottom: 0; }
.sub-head { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; }
.sub-head .ico {
  width: 56px; height: 56px; flex: 0 0 56px; margin: 0;
  border-radius: 14px; display: grid; place-items: center; font-size: 30px; line-height: 1;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
h2.sub { font-size: 1.3rem; margin: 0; text-align: left; }
.sub-block p { margin: 0 0 .7em; }
.sub-block p:last-child { margin: 0; }
@media (max-width: 560px){
  .sub-head { gap: 12px; }
  .sub-head .ico { width: 46px; height: 46px; flex-basis: 46px; font-size: 24px; }
}

/* ---- Tips list ---- */
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tips li {
  position: relative; padding: 12px 16px 12px 40px;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); font-size: .95rem;
}
.tips li::before {
  content: "→"; position: absolute; left: 16px; color: var(--accent); font-weight: 800;
}

/* ---- Demo badge ---- */
.dl-demo-badge {
  display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 800;
  color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}

/* ---- AEO/GEO: byline, TL;DR, author box ---- */
.byline { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.byline b { color: var(--text); }
.tldr { max-width: 900px; margin: 0 auto; background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px; padding: 20px 24px; }
.tldr-h { font-size: 1.05rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); text-align: left; }
.tldr ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.tldr li { color: var(--text); font-size: .98rem; }
.author-box { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.author-ava { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.author-box p { color: var(--muted); }
