/* ════════════════════════════════════════════════════════════════
   FilePort design system — v2 "Manifest"
   The port metaphor: files arrive, get routed, leave.
   Palette grounded in the file ecosystem's own colors:
   Word blue · Excel green · PDF red · image amber · media magenta
   ════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:   #F4F6F8;
  --surface: #FFFFFF;
  --ink:     #171A1F;
  --ink-2:   #14171C;
  --mid:     #5B6472;
  --muted:   #8B94A1;
  --line:    #E3E7EC;
  --line-strong: #CBD2DA;

  --doc:     #2456A6;  --doc-t:   #E9EFF8;
  --sheet:   #1E7145;  --sheet-t: #E6F2EB;
  --pdf:     #C2382E;  --pdf-t:   #FAEAE8;
  --img:     #B45309;  --img-t:   #F8EEDF;
  --media:   #B5307A;  --media-t: #F8E8F1;
  --qr:      #171A1F;  --qr-t:    #EAECEF;
  --tg:      #1E88C7;  --tg-t:    #E1F1FA;   /* Telegram blue */

  --display: 'Bricolage Grotesque', sans-serif;
  --body:    'Public Sans', sans-serif;
  --mono:    'IBM Plex Mono', monospace;

  --radius:  16px;
  --shadow:  0 1px 2px rgba(23,26,31,.04), 0 8px 28px rgba(23,26,31,.06);
  --shadow-lift: 0 2px 4px rgba(23,26,31,.05), 0 14px 40px rgba(23,26,31,.10);

  /* The manifest strip — the five file colors as the port's flag. */
  --manifest: linear-gradient(90deg,
      var(--doc) 0 20%, var(--sheet) 20% 40%, var(--pdf) 40% 60%,
      var(--img) 60% 80%, var(--media) 80% 100%);

  --ease-out: cubic-bezier(.22, .7, .3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

::selection { background: var(--ink); color: #fff; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 40px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* The port's flag: five file colors across the top of every page. */
.site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--manifest);
}

.wordmark {
  font-family: var(--display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.wordmark .wm-arrow {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--pdf);
  transition: transform .2s var(--ease-out);
  display: inline-block;
}

.wordmark:hover .wm-arrow { transform: translateX(4px); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--mid);
}

.header-nav a {
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 99px;
  transition: color .15s, background .15s;
}

.header-nav a:hover { color: var(--ink); background: var(--qr-t); }

.header-nav a.is-active {
  color: var(--ink);
  background: var(--qr-t);
  font-weight: 600;
}

/* ── Conversion tag — the signature element ─────────────────── */
.convtag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 600;
}

.ext {
  font-size: .74rem;
  letter-spacing: .03em;
  padding: 4px 10px;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(23,26,31,.05);
}

.convarrow {
  color: var(--muted);
  font-size: .85rem;
  transition: transform .2s var(--ease-out), color .2s;
}

.convtag-lg .ext { font-size: 1rem; padding: 7px 14px; border-radius: 9px; }
.convtag-lg .convarrow { font-size: 1.15rem; }

.ext-doc   { background: var(--doc-t);   color: var(--doc); }
.ext-sheet { background: var(--sheet-t); color: var(--sheet); }
.ext-pdf   { background: var(--pdf-t);   color: var(--pdf); }
.ext-img   { background: var(--img-t);   color: var(--img); }
.ext-media { background: var(--media-t); color: var(--media); }
.ext-qr    { background: var(--qr-t);    color: var(--qr); }
.ext-tg    { background: var(--tg-t);    color: var(--tg); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  padding: 84px 40px 44px;
  position: relative;
}

/* Soft harbor-light atmosphere in the ecosystem tints. */
.hero::before {
  content: '';
  position: absolute;
  inset: -120px -20% 0;
  background:
    radial-gradient(560px 300px at 18% 8%,  var(--doc-t) 0%, transparent 70%),
    radial-gradient(520px 300px at 78% 0%,  var(--pdf-t) 0%, transparent 70%),
    radial-gradient(480px 280px at 50% 30%, var(--sheet-t) 0%, transparent 75%);
  opacity: .55;
  pointer-events: none;
  z-index: -1;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-eyebrow::before {
  content: '';
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--manifest);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -0.035em;
  max-width: 680px;
  margin-bottom: 26px;
  text-wrap: balance;
}

/* The route line: a dashed shipping lane carrying the cycling tag. */
.hero-cycle {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 560px;
}

.route-line {
  flex: 1;
  height: 2px;
  background-image: linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
  background-size: 12px 2px;
  background-repeat: repeat-x;
  animation: route-drift 1.2s linear infinite;
}

@keyframes route-drift { to { background-position-x: 12px; } }

.hero-cycle .convtag { transition: opacity .25s var(--ease-out), transform .25s var(--ease-out); }
.hero-cycle .convtag.is-out { opacity: 0; transform: translateY(8px); }

.hero-sub {
  color: var(--mid);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 500px;
  margin-top: 24px;
}

/* True facts as cargo tags — informative, not decorative. */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--mid);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px;
  box-shadow: 0 1px 2px rgba(23,26,31,.04);
}

.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Page-load sequence (one orchestrated moment) ───────────── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow { animation: rise-in .55s var(--ease-out) .05s backwards; }
.hero h1      { animation: rise-in .55s var(--ease-out) .12s backwards; }
.hero-cycle   { animation: rise-in .55s var(--ease-out) .20s backwards; }
.hero-sub     { animation: rise-in .55s var(--ease-out) .28s backwards; }
.hero-badges  { animation: rise-in .55s var(--ease-out) .36s backwards; }

.tool-section:nth-of-type(1) { animation: rise-in .6s var(--ease-out) .30s backwards; }
.tool-section:nth-of-type(2) { animation: rise-in .6s var(--ease-out) .42s backwards; }
.tool-section:nth-of-type(3) { animation: rise-in .6s var(--ease-out) .54s backwards; }

/* ── Tool sections & grid ───────────────────────────────────── */
.tools-wrap {
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 40px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  align-items: start;
}

/* Convert spans the full row; Create + Download berth side by side. */
.tools-wrap > #convert { grid-column: 1 / -1; }

.tool-section { margin-top: 48px; }

.section-eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s var(--ease-out), border-color .2s, box-shadow .2s;
}

/* Destination-colored berth line: reveals where the file will land. */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tc, var(--ink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease-out);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}

.tool-card:hover::before { transform: scaleX(1); }
.tool-card:hover .convarrow { transform: translateX(4px); color: var(--ink); }

.tool-card h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 6px;
}

.tool-card p {
  font-size: .82rem;
  color: var(--mid);
  line-height: 1.55;
}

/* ── Tool page ──────────────────────────────────────────────── */
.tool-page {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  padding: 44px 40px 100px;
  flex: 1;
  position: relative;
}

/* Faint echo of the hero atmosphere on inner pages. */
.tool-page::before {
  content: '';
  position: absolute;
  inset: -60px -30% auto;
  height: 340px;
  background:
    radial-gradient(480px 240px at 25% 0%, var(--doc-t) 0%, transparent 70%),
    radial-gradient(440px 240px at 80% 0%, var(--media-t) 0%, transparent 72%);
  opacity: .38;
  pointer-events: none;
  z-index: -1;
}

.crumb {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  color: var(--mid);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-left: -12px;
  border-radius: 99px;
  transition: color .15s, background .15s;
}

.crumb:hover { color: var(--ink); background: var(--qr-t); }

.tool-head { margin: 24px 0 30px; }

.tool-head h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 18px 0 10px;
}

.tool-head p { color: var(--mid); font-size: .95rem; line-height: 1.6; max-width: 540px; }

.crumb     { animation: rise-in .5s var(--ease-out) .02s backwards; }
.tool-head { animation: rise-in .5s var(--ease-out) .08s backwards; }
.workcard  { animation: rise-in .5s var(--ease-out) .16s backwards; }

/* ── Work card ──────────────────────────────────────────────── */
.workcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: 13px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background:
    radial-gradient(320px 140px at 50% 0%, var(--paper) 0%, transparent 80%);
}

.dropzone:hover, .dropzone.is-drag {
  border-color: var(--ink);
  background: var(--paper);
}

.dropzone.is-drag { transform: scale(1.005); }

.dz-glyph {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 4px;
  transition: transform .2s var(--ease-out), color .2s;
}

.dropzone:hover .dz-glyph { transform: translateY(3px); color: var(--ink); }

.dropzone strong { font-size: .95rem; font-weight: 600; }

.dz-or { font-size: .78rem; color: var(--muted); }

.dz-browse {
  font-family: var(--body);
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 20px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  margin-top: 4px;
  transition: background .15s, transform .1s;
}

.dz-browse:hover { background: #2A2F38; }

.dz-hint { font-family: var(--mono); font-size: .68rem; color: var(--muted); margin-top: 10px; letter-spacing: .02em; }

.file-list { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .82rem;
  animation: rise .25s var(--ease-out);
}

.file-item .fi-ext {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--qr-t);
  color: var(--ink);
  flex-shrink: 0;
}

.file-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-size { font-family: var(--mono); font-size: .68rem; color: var(--muted); flex-shrink: 0; }

.fi-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 5px;
  transition: color .15s;
}

.fi-remove:hover { color: var(--pdf); }

/* ── Buttons / status / result ──────────────────────────────── */
.btn-primary {
  width: 100%;
  margin-top: 18px;
  padding: 15px;
  background: linear-gradient(180deg, #262B33, var(--ink) 55%);
  color: #fff;
  border: none;
  border-radius: 11px;
  font-family: var(--display);
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23,26,31,.2), inset 0 1px 0 rgba(255,255,255,.07);
  transition: filter .15s, transform .1s, box-shadow .15s;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.18);
  box-shadow: 0 3px 10px rgba(23,26,31,.25), inset 0 1px 0 rgba(255,255,255,.07);
}
.btn-primary:active:not(:disabled) { transform: scale(.99); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.status {
  display: none;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.5;
}

.status.is-busy {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--mid);
}

.status.is-error {
  display: block;
  background: var(--pdf-t);
  border: 1px solid #EFC7C3;
  color: var(--pdf);
  font-weight: 500;
}

.status.is-ok {
  display: block;
  background: #E8F5EC;
  border: 1px solid #B7DFC4;
  color: #1E7145;
  font-weight: 500;
}

.status.is-ok a { color: #1E7145; font-weight: 600; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

.result-card {
  display: none;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #B7DFC4;
  background: linear-gradient(180deg, #F2FAF5, var(--sheet-t));
  border-radius: 13px;
  animation: rise .3s var(--ease-out);
}

.result-card.is-visible { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-name {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
}

.result-meta { font-size: .74rem; color: var(--mid); margin-bottom: 14px; }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--sheet);
  color: #fff;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(30,113,69,.3);
  transition: filter .15s, box-shadow .15s;
}

.btn-download:hover { filter: brightness(1.1); box-shadow: 0 3px 10px rgba(30,113,69,.35); }

.btn-download svg { flex-shrink: 0; }

.btn-again {
  padding: 12px 20px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: var(--body);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.btn-again:hover { background: var(--surface); border-color: var(--mid); }

/* ── Forms (QR + video + login pages) ───────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }

.field label {
  font-size: .8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.label-chip {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .9rem;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(23,26,31,.08);
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }

.field-note { font-size: .74rem; color: var(--muted); font-weight: 400; }

/* ── QR result panel ────────────────────────────────────────── */
.qr-result {
  display: none;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: rise .3s var(--ease-out);
  background: var(--surface);
}

.qr-result.is-visible { display: block; }

.qr-result-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, var(--paper), var(--surface));
}

.qr-result-title { font-family: var(--display); font-weight: 700; font-size: .98rem; }

.qr-result-tag {
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--sheet);
  font-weight: 600;
  letter-spacing: .06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sheet-t);
  padding: 4px 10px;
  border-radius: 99px;
}

.qr-result-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sheet);
}

.qr-result-body { display: grid; grid-template-columns: auto 1fr; }

.qr-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--line);
}

.qr-panel img {
  width: 158px; height: 158px;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--line);
  padding: 6px;
  background: #fff;
}

.qr-info { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.info-key {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.copy-row { display: flex; gap: 8px; align-items: stretch; }

.copy-val {
  flex: 1;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--mid);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  min-width: 0;
}

.copy-btn {
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--body);
  white-space: nowrap;
  transition: background .15s;
}

.copy-btn.copied { background: var(--sheet); }

.route-item { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--mid); margin-bottom: 7px; }
.route-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rd-ios { background: var(--doc); }
.rd-android { background: var(--sheet); }
.rd-web { background: var(--media); }

.dl-btn {
  padding: 9px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.dl-btn:hover { background: var(--line); border-color: var(--line-strong); }

/* ── Video result ───────────────────────────────────────────── */
.video-result {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: rise .3s var(--ease-out);
}

.video-result.is-visible { display: block; }

.video-frame {
  border-radius: 11px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.video-frame video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
  display: block;
}

.video-info { margin: 14px 4px; }

/* ── Send to YouTube panel ──────────────────────────────────── */
.yt-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.yt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.yt-badge {
  font-size: .74rem;
  font-weight: 600;
  color: var(--sheet);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sheet-t);
  padding: 4px 12px;
  border-radius: 99px;
}

.yt-disconnect { font-size: .74rem; color: var(--muted); text-decoration: underline; }
.yt-disconnect:hover { color: var(--ink); }

.yt-note { font-size: .8rem; color: var(--mid); margin-bottom: 12px; line-height: 1.5; }

.btn-youtube {
  display: inline-block;
  padding: 12px 24px;
  background: #FF0033;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--body);
  font-size: .86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(255,0,51,.3);
  transition: filter .15s, box-shadow .15s;
}

.btn-youtube:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 3px 10px rgba(255,0,51,.3); }
.btn-youtube:disabled { opacity: .4; cursor: not-allowed; }

.yt-panel select,
.yt-panel textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--body);
  font-size: .88rem;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.yt-panel select:focus,
.yt-panel textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23,26,31,.08);
}

.yt-panel textarea { resize: vertical; line-height: 1.5; }

.video-note {
  margin-top: 16px;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── SEO checker ────────────────────────────────────────────── */
.tool-page-wide { max-width: 860px; }

.seo-report { display: none; }
.seo-report.is-visible { display: block; animation: rise .3s var(--ease-out); }

.seo-scorecard {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 20px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.seo-ring-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.seo-ring { width: 120px; height: 120px; transform: rotate(-90deg); }

.ring-track { fill: none; stroke: var(--line); stroke-width: 10; }

.ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s var(--ease-out);
}

.seo-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.seo-score-info { min-width: 0; }

.seo-band {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.seo-scanned {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  word-break: break-all;
  margin-bottom: 12px;
}

.seo-tally { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--mid); }
.tally { display: inline-flex; align-items: center; gap: 6px; }
.tally i { width: 8px; height: 8px; border-radius: 50%; }
.tally-pass i { background: var(--sheet); }
.tally-warn i { background: var(--img); }
.tally-fail i { background: var(--pdf); }
.tally b { font-weight: 700; color: var(--ink); }

.seo-panel {
  margin-top: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seo-panel-head {
  font-family: var(--display);
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.seo-panel-sub {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.seo-bots { display: flex; gap: 10px; flex-wrap: wrap; }

.bot-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 99px;
}

.bot-chip i { width: 7px; height: 7px; border-radius: 50%; }
.bot-ok { background: var(--sheet-t); color: var(--sheet); }
.bot-ok i { background: var(--sheet); }
.bot-no { background: var(--pdf-t); color: var(--pdf); }
.bot-no i { background: var(--pdf); }

.seo-keywords { display: flex; gap: 8px; flex-wrap: wrap; }

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--doc-t);
  color: var(--doc);
  border-radius: 8px;
}

.kw-chip b {
  font-size: .62rem;
  font-weight: 600;
  color: var(--doc);
  opacity: .55;
}

.seo-empty { font-size: .8rem; color: var(--muted); }

.seo-gen { margin-bottom: 16px; }
.seo-gen:last-child { margin-bottom: 0; }

.seo-snippet {
  font-family: var(--mono);
  font-size: .7rem;
  line-height: 1.65;
  color: var(--mid);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 10px;
}

.seo-snippet-copy { display: inline-block; }

.seo-checks { list-style: none; display: flex; flex-direction: column; }

.check {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.check:last-child { border-bottom: none; }

.check-ico {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.check-pass .check-ico { background: var(--sheet-t); color: var(--sheet); }
.check-warn .check-ico { background: var(--img-t); color: var(--img); }
.check-fail .check-ico { background: var(--pdf-t); color: var(--pdf); }

.check-body { min-width: 0; }

.check-top { font-size: .84rem; line-height: 1.5; }
.check-top b { font-weight: 600; margin-right: 8px; }
.check-top span { color: var(--mid); word-break: break-word; }

.check-fix {
  margin-top: 4px;
  font-size: .78rem;
  color: var(--mid);
  background: var(--paper);
  border-left: 2px solid var(--line-strong);
  padding: 6px 10px;
  border-radius: 0 7px 7px 0;
  line-height: 1.5;
}

.check-fail .check-fix { border-left-color: var(--pdf); }
.check-warn .check-fix { border-left-color: var(--img); }

/* ── Preview page ───────────────────────────────────────────── */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 520px;
  margin: 60px auto;
  width: calc(100% - 40px);
  box-shadow: var(--shadow);
}

.preview-card h1 { font-family: var(--display); font-size: 1.2rem; font-weight: 800; margin-bottom: 22px; }

.preview-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border-bottom: none; }
.preview-row .val { font-size: .84rem; word-break: break-all; line-height: 1.5; }
.preview-row .val a { color: var(--doc); text-decoration: none; }
.preview-row .val a:hover { text-decoration: underline; }

/* ── Footer — the dark bookend ──────────────────────────────── */
.site-footer {
  margin-top: auto;
  position: relative;
  padding: 26px 40px;
  background: var(--ink-2);
  color: #9AA3B0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .76rem;
}

/* The flag again, closing the page. */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--manifest);
}

.foot-brand {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-right: 18px;
}

.foot-brand .wm-arrow { font-family: var(--mono); color: var(--pdf); font-weight: 600; }

.foot-left { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.site-footer .foot-mono {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .08em;
  color: #6B7482;
}

/* ── Telegram directory ─────────────────────────────────────── */
.tg-searchbar { display: flex; gap: 10px; }
.tg-searchbar input {
  flex: 1;
  padding: 13px 16px;
  font-size: .95rem;
  font-family: var(--body);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink);
}
.tg-searchbar input:focus { outline: none; border-color: var(--tg); background: var(--surface); }
.tg-searchbar .btn-primary { flex-shrink: 0; width: auto; padding-left: 28px; padding-right: 28px; }

.tg-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tg-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--mid);
  cursor: pointer;
  transition: all .18s var(--ease-out);
}
.tg-cat:hover { border-color: var(--tg); color: var(--tg); }
.tg-cat b { font-size: .62rem; font-weight: 700; opacity: .5; }
.tg-cat.is-active { background: var(--tg); color: #fff; border-color: var(--tg); }
.tg-cat.is-active b { opacity: .75; color: #fff; }

.tg-status { margin: 20px 4px 12px; font-family: var(--mono); font-size: .74rem; color: var(--muted); letter-spacing: .02em; }

.tg-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.tg-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow .2s var(--ease-out), border-color .2s var(--ease-out);
}
.tg-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.tg-card-main { min-width: 0; }
.tg-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

.tg-badge {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 3px 7px;
  border-radius: 5px;
}
.tg-badge-channel { background: var(--tg-t); color: var(--tg); }
.tg-badge-group   { background: var(--media-t); color: var(--media); }

.tg-cat-tag { font-family: var(--mono); font-size: .64rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tg-members { font-family: var(--mono); font-size: .64rem; color: var(--muted); }

.tg-card h3 { font-family: var(--display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; word-break: break-word; }
.tg-handle { display: block; font-family: var(--mono); font-size: .72rem; color: var(--tg); margin-top: 3px; text-decoration: none; word-break: break-all; }
.tg-card p { font-size: .82rem; color: var(--mid); line-height: 1.5; margin-top: 7px; }

.tg-join {
  flex-shrink: 0;
  align-self: center;
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--tg);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: filter .18s var(--ease-out);
}
.tg-join:hover { filter: brightness(1.08); }

.tg-submit { margin-top: 28px; }
.tg-form { display: flex; flex-direction: column; gap: 14px; }
.tg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Admin moderation */
.tg-adminstats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: .82rem; color: var(--mid); }

.tg-admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.tg-admin-row:last-child { border-bottom: none; }
.tg-admin-info { min-width: 0; }
.tg-admin-info h3 { font-family: var(--display); font-size: .98rem; font-weight: 700; margin-top: 4px; }
.tg-admin-info p { font-size: .8rem; color: var(--mid); line-height: 1.5; margin-top: 5px; }
.tg-admin-actions { display: flex; gap: 7px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.tg-act {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--mid);
  cursor: pointer;
  transition: all .15s var(--ease-out);
}
.tg-act-approve:hover { background: var(--sheet-t); color: var(--sheet); border-color: var(--sheet); }
.tg-act-reject:hover  { background: var(--img-t);   color: var(--img);   border-color: var(--img); }
.tg-act-del:hover     { background: var(--pdf-t);   color: var(--pdf);   border-color: var(--pdf); }

/* ── Connected-account corner chip ──────────────────────────── */
.yt-corner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  color: var(--sheet);
  background: var(--sheet-t);
  border-radius: 99px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yt-corner-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sheet); flex-shrink: 0; }

/* ── Backstage table ────────────────────────────────────────── */
.bs-table-wrap { overflow-x: auto; }
.bs-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.bs-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.bs-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bs-table tr:last-child td { border-bottom: none; }
.bs-name { font-weight: 600; }
.bs-email { font-family: var(--mono); font-size: .74rem; color: var(--mid); }
.bs-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bs-time { font-family: var(--mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bs-live, .bs-off { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.bs-live { background: var(--sheet); box-shadow: 0 0 0 3px var(--sheet-t); }
.bs-off  { background: var(--line-strong); }

/* ── Accessibility & responsive ─────────────────────────────── */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 760px) {
  .tools-wrap { grid-template-columns: 1fr; }
  .tg-results { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 13px 20px; }
  .header-nav { gap: 2px; }
  .header-nav a { padding: 6px 10px; }
  .hero { padding: 52px 20px 26px; }
  .hero-cycle { gap: 12px; }
  .tools-wrap { padding: 8px 20px 70px; }
  .tool-page { padding: 32px 20px 70px; }
  .workcard { padding: 22px; }
  .qr-result-body { grid-template-columns: 1fr; }
  .qr-panel { border-right: none; border-bottom: 1px solid var(--line); }
  .tg-searchbar { flex-direction: column; }
  .tg-form-row { grid-template-columns: 1fr; }
  .tg-card { flex-direction: column; }
  .tg-join { align-self: flex-start; }
  .tg-admin-row { flex-direction: column; }
  .tg-admin-actions { justify-content: flex-start; }
  .site-footer { padding: 20px; flex-direction: column; align-items: flex-start; }
}
