:root {
  --bg: #0b0d14;
  --bg-2: #12151f;
  --card: #171b28;
  --line: #262b3d;
  --text: #eef0f7;
  --muted: #9099b3;
  --accent: #6d5dfc;
  --accent-2: #8f83ff;
  --ok: #35c77a;
  --err: #ff5d6c;
  --yt: #ff0033;
  --tt: #25f4ee;
  --ig: #e1306c;
  --fb: #1877f2;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(109,93,252,.28), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(37,244,238,.08), transparent 60%),
    var(--bg);
}
a { color: var(--accent-2); }
img { max-width: 100%; }
.wrap { max-width: 880px; margin: 0 auto; padding: 26px 18px 60px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 34px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--text); }
.logo svg { width: 30px; height: 30px; }
nav { display: flex; flex-wrap: wrap; gap: 16px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }

.crumbs { font-size: 13px; color: var(--muted); margin: -14px 0 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

h1 { font-size: clamp(27px, 4.6vw, 42px); line-height: 1.14; letter-spacing: -.02em; margin: 0 0 12px; text-align: center; }
.sub { color: var(--muted); text-align: center; margin: 0 auto 26px; max-width: 620px; }

.platforms { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); transition: .2s; text-decoration: none; }
a.chip:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip.active { color: var(--text); border-color: rgba(255,255,255,.25); background: var(--card); }
.dot.youtube { background: var(--yt); }
.dot.tiktok { background: var(--tt); }
.dot.instagram { background: var(--ig); }
.dot.facebook { background: var(--fb); }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
form { display: flex; gap: 10px; }
.field { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; transition: border-color .15s; }
.field:focus-within { border-color: var(--accent); }
.field > svg { flex: none; color: var(--muted); }
input[type=url] { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 16px; padding: 14px 0; }
input::placeholder { color: #5c6480; }
.btn { border: 0; border-radius: 12px; padding: 0 22px; font-size: 15px; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; transition: .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; }
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); background: rgba(109,93,252,.08); }
.btn.paste { background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); padding: 0 14px; }
.btn.paste:hover { color: var(--text); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 4px 0; }

.msg { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; display: none; }
.msg.err { display: block; background: rgba(255,93,108,.1); border: 1px solid rgba(255,93,108,.3); color: #ffb3ba; }

.result { margin-top: 18px; display: none; }
.result.show { display: block; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.meta { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.title { font-weight: 600; font-size: 17px; line-height: 1.3; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.by { color: var(--muted); font-size: 14px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); }

.formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fmt { text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--text); transition: .15s; font: inherit; }
.fmt:hover { border-color: rgba(255,255,255,.25); }
.fmt.on { border-color: var(--accent); background: rgba(109,93,252,.12); }
.fmt .k { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.fmt .d { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: block; }
.fmt .tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; letter-spacing: .03em; }
.fmt:disabled { opacity: .4; cursor: not-allowed; }

.qual { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qual > span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.q { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer; font: inherit; }
.q.on { border-color: var(--accent); background: rgba(109,93,252,.14); }

.actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions .btn { padding: 13px 22px; }

.progress { margin-top: 16px; display: none; }
.progress.show { display: block; }
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; border-radius: 999px; }
.bar.busy > i { width: 100% !important; background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, var(--accent-2) 12px 24px); background-size: 34px 34px; animation: slide 1s linear infinite; }
@keyframes slide { to { background-position: 34px 0; } }
.pline { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; gap: 10px; }
.done { display: none; margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(53,199,122,.1); border: 1px solid rgba(53,199,122,.3); align-items: center; gap: 12px; flex-wrap: wrap; }
.done.show { display: flex; }
.done b { color: #9df0c0; }
.done .btn { background: var(--ok); color: #05200f; }

.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; display: none; }
.loading .spin { display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

section { margin-top: 54px; }
h2 { font-size: 23px; letter-spacing: -.01em; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 22px 0 6px; }
section > p { color: var(--muted); }
section > p strong, li strong { color: var(--text); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.step b { display: block; margin-bottom: 4px; }
.step .n { color: var(--accent-2); font-weight: 800; font-size: 13px; letter-spacing: .08em; }
.step p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .02em; }
td:first-child { font-weight: 600; }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px 8px; }

ul.plain { color: var(--muted); padding-left: 20px; }
ul.plain li { margin: 7px 0; }

details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); font-size: 14.5px; margin: 8px 0 2px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 18px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--text); transition: .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card b { display: flex; align-items: center; gap: 8px; }
.card p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }

footer { margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; line-height: 1.8; }
footer nav { justify-content: center; margin-bottom: 8px; }

@media (max-width: 640px) {
  form { flex-direction: column; }
  .btn { padding: 13px 18px; }
  .meta { grid-template-columns: 1fr; }
  .thumb { max-width: 320px; }
  header { margin-bottom: 26px; }
}

/* The language links are deliberately not shown. They stay in the DOM as a
   crawlable path between translations and remain available to screen readers. */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- articles */
body.article h1 { text-align: left; font-size: clamp(26px, 4.2vw, 38px); margin-bottom: 10px; }
.post { max-width: 720px; }
.byline { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.lead { font-size: 18px; line-height: 1.6; color: var(--text); margin: 0 0 26px; padding-left: 16px; border-left: 3px solid var(--accent); }
.post h2 { font-size: 24px; margin: 38px 0 10px; scroll-margin-top: 20px; }
.post h3 { font-size: 17.5px; margin: 24px 0 6px; }
.post p { color: var(--muted); }
.post p strong, .post li strong { color: var(--text); }
.post ul.plain, .post ol.plain { color: var(--muted); padding-left: 22px; }
.post ol.plain li { margin: 9px 0; }
.post .note { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; }
.post .tablewrap { margin: 18px 0; }
.post details { margin-bottom: 8px; }

.toc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 0 0 30px; }
.toc b { display: block; margin-bottom: 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 5px 0; }
.toc a { color: var(--text); text-decoration: none; font-size: 14.5px; }
.toc a:hover { color: var(--accent-2); text-decoration: underline; }

.post a { color: var(--accent-2); }
.post a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- touch targets
   On a touch screen the nav links and the Paste button were only 19 to 22px tall,
   well under the ~44px a fingertip needs. Grow the hit area without moving the
   visual design: padding does the work, and negative margin keeps the rows tight. */
@media (max-width: 760px) {
  nav { gap: 4px 14px; }
  nav a {
    padding: 11px 2px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .crumbs { margin-top: -6px; }
  .btn.paste {
    min-height: 40px;
    padding: 0 16px;
  }
  .chip { padding: 10px 14px; }
  footer nav { justify-content: center; }
}

/* Pointer-coarse devices get the same treatment regardless of width, which
   covers tablets in landscape that are wider than the breakpoint above. */
@media (pointer: coarse) {
  .q { min-height: 40px; padding: 8px 13px; }
  .btn.paste { min-height: 40px; }
}
