/* Parser - стиль Latency Lab (те же цвета, шрифты и фон, что у основного сайта). */
:root {
  --bg: #070b14;
  --bg-elevated: #0d1424;
  --bg-card: rgba(16, 24, 42, 0.72);
  --line: rgba(120, 160, 220, 0.14);
  --text: #e8eefc;
  --muted: #93a0bd;
  --accent: #00e5a8;
  --accent-2: #4f8cff;
  --danger: #ff6b8a;
  --warn: #ffb454;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.muted { color: var(--muted); }

.bg-grid, .bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-grid {
  background-image: linear-gradient(rgba(79, 140, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}
.bg-glow {
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 229, 168, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(79, 140, 255, 0.16), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(0, 229, 168, 0.08), transparent 35%);
}

.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--accent); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.7rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.3rem; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #19c4ff); color: #041018; font: inherit; font-weight: 700; border: 0; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 229, 168, 0.2); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0, 229, 168, 0.28); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn--ghost:hover { border-color: rgba(0, 229, 168, 0.4); box-shadow: none; }
.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.9rem; }
.btn--wide { width: 100%; padding: 0.95rem 1.3rem; font-size: 1rem; }

/* ---- вход ---- */
.login { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.1rem; padding: 2rem 1rem; }
.login__card {
  width: min(440px, 100%); text-align: center; padding: 2.4rem 2rem 2rem; border-radius: 26px; background: var(--bg-card);
  border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px); animation: rise 0.5s ease both;
}
.login__owl { display: block; margin: 0 auto 1.1rem; border-radius: 24px; box-shadow: 0 0 40px rgba(0, 229, 168, 0.3); }
.login .eyebrow { display: flex; justify-content: center; }
.login h1 { font-size: 2.4rem; line-height: 1.1; margin-bottom: 0.5rem; }
.login__lead { color: var(--muted); margin-bottom: 1.5rem; }
.login__hint { margin-top: 1rem; font-size: 0.84rem; color: var(--muted); }
.login__foot { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); opacity: 0.7; }
.login__error { margin-bottom: 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; font-size: 0.9rem; text-align: left; color: #ffd4d4; background: rgba(232, 93, 93, 0.14); border: 1px solid rgba(232, 93, 93, 0.5); }

/* ---- шапка ---- */
.header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(16px); background: rgba(7, 11, 20, 0.72); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.header__brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.logo__mark { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; background: url("/static/owl.png") center / cover no-repeat; box-shadow: 0 0 20px rgba(0, 229, 168, 0.4); }
.header__title { display: flex; flex-direction: column; gap: 0.08rem; }
.header__eyebrow { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); line-height: 1.2; }
.header__tagline { font-size: 1rem; font-weight: 800; line-height: 1.2; }
.header__tagline span { color: var(--accent); }
.header__user { display: flex; align-items: center; gap: 0.7rem; }
.user-chip { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.8rem 0.3rem 0.35rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 24, 42, 0.6); animation: rise 0.4s ease both; }
.user-chip strong { font-size: 0.9rem; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; color: #041018; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.role-badge { font-family: var(--mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.12rem 0.5rem; border-radius: 999px; border: 1px solid rgba(0, 229, 168, 0.45); color: var(--accent); }
.role-badge--admin { border-color: rgba(255, 180, 84, 0.55); color: var(--warn); }

/* ---- внутренняя часть ---- */
.app { padding: 2.2rem 0 4rem; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; animation: rise 0.5s ease both; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; margin-bottom: 0.5rem; }
.hero__lead { color: var(--muted); max-width: 640px; }
.pill { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid rgba(255, 180, 84, 0.45); background: rgba(255, 180, 84, 0.08); color: var(--warn); font-family: var(--mono); font-size: 0.78rem; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: pulse 1.8s ease-in-out infinite; }

.tabs { display: flex; gap: 0.4rem; padding: 0.35rem; margin-bottom: 1.4rem; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(16, 24, 42, 0.6); }
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 0.92rem; padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: color 0.2s ease, background 0.2s ease; }
.tab:hover { color: var(--text); }
.tab.is-active { color: #041018; background: linear-gradient(135deg, var(--accent), #19c4ff); }

.panel { animation: rise 0.35s ease both; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.2rem; }
.stat { display: flex; flex-direction: column; gap: 0.15rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-card); backdrop-filter: blur(10px); transition: border-color 0.2s ease, transform 0.2s ease; }
.stat:hover { border-color: rgba(0, 229, 168, 0.35); transform: translateY(-2px); }
.stat__k { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat__v { font-size: 2rem; line-height: 1.15; font-weight: 800; background: linear-gradient(135deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__h { font-size: 0.8rem; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.card { padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-card); backdrop-filter: blur(10px); }
.card h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.card .muted { margin-top: 0.9rem; font-size: 0.9rem; }
.card--owl { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.4rem; background: radial-gradient(circle at 100% 0%, rgba(0, 229, 168, 0.12), transparent 55%), var(--bg-card); }
.card--owl img { border-radius: 22px; margin-bottom: 0.4rem; box-shadow: 0 0 36px rgba(0, 229, 168, 0.25); }
.steps { list-style: none; counter-reset: step; display: grid; gap: 0.75rem; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; color: var(--muted); }
.steps li b { color: var(--text); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; font-family: var(--mono); font-weight: 600; font-size: 0.85rem; color: var(--accent); border: 1px solid rgba(0, 229, 168, 0.4); background: rgba(0, 229, 168, 0.08); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.service { position: relative; display: flex; gap: 1rem; align-items: flex-start; padding: 1.3rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-card); backdrop-filter: blur(10px); transition: border-color 0.2s ease, transform 0.2s ease; }
.service:hover { border-color: rgba(0, 229, 168, 0.4); transform: translateY(-3px); }
.service--add { border-style: dashed; background: transparent; }
.service__ico { flex-shrink: 0; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; font-weight: 800; color: var(--accent); background: rgba(0, 229, 168, 0.1); border: 1px solid rgba(0, 229, 168, 0.3); font-family: var(--mono); }
.service h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.service p { color: var(--muted); font-size: 0.9rem; }
.chip { position: absolute; top: 0.9rem; right: 0.9rem; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.15rem 0.55rem; border-radius: 999px; color: var(--warn); border: 1px solid rgba(255, 180, 84, 0.45); }
.chip--ghost { color: var(--muted); border-color: var(--line); }

.empty { display: grid; justify-items: center; text-align: center; gap: 0.5rem; padding: 3.5rem 1rem; border-radius: var(--radius); border: 1px dashed var(--line); background: rgba(16, 24, 42, 0.35); }
.empty img { border-radius: 20px; opacity: 0.85; margin-bottom: 0.4rem; animation: float 4s ease-in-out infinite; }
.empty h2 { font-size: 1.2rem; }
.empty p { color: var(--muted); max-width: 440px; }

.footer { border-top: 1px solid var(--line); padding: 1.4rem 0; color: var(--muted); font-size: 0.85rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-family: var(--mono); }
.footer b { color: var(--accent); font-weight: 600; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .cards { grid-template-columns: 1fr; }
  .header__tagline { font-size: 0.95rem; }
  .user-chip strong { max-width: 90px; }
}
@media (max-width: 520px) {
  .user-chip .role-badge { display: none; }
  .hero { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---- рабочая часть: поиск, токены, результаты, настройки ---- */
.small { font-size: 0.86rem; }
.hint { margin-top: 0.8rem; font-size: 0.82rem; color: var(--muted); }
.card .hint { margin-top: 0.9rem; }
.card code, .hint code, .muted code { font-family: var(--mono); font-size: 0.86em; color: var(--accent); background: rgba(0, 229, 168, 0.08); padding: 0.05rem 0.35rem; border-radius: 6px; }
.card a, .hint a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.card__head h2 { margin: 0; }
.grid2--wide-left { grid-template-columns: 1.5fr 1fr; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1rem; }
.actions--end { justify-content: flex-end; margin-top: 1.2rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--stop { background: linear-gradient(135deg, #ff7a93, #ff9a62); box-shadow: 0 10px 30px rgba(255, 107, 138, 0.22); }
.tab__n { margin-left: 0.3rem; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; opacity: 0.8; }
.tab__n:empty { display: none; }
.pill--ok { border-color: rgba(0, 229, 168, 0.5); background: rgba(0, 229, 168, 0.08); color: var(--accent); }
.pill--ok i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pill--off { border-color: var(--line); background: rgba(16, 24, 42, 0.6); color: var(--muted); }
.pill--off i { background: var(--muted); box-shadow: none; animation: none; }

.input { width: 100%; padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(7, 11, 20, 0.7); color: var(--text); font: inherit; font-family: var(--mono); font-size: 0.84rem; line-height: 1.5; resize: vertical; transition: border-color 0.2s ease; }
.input:focus { border-color: rgba(0, 229, 168, 0.6); outline: none; }
.input--sm { width: 110px; font-size: 0.95rem; }
textarea.input { margin: 0.7rem 0 0.9rem; min-height: 120px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-size: 0.92rem; }
.switch { display: flex; align-items: center; gap: 0.7rem; margin: 0.4rem 0; cursor: pointer; font-size: 0.95rem; }
.switch input, .check input { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.switch + .muted { margin: 0 0 0.8rem 1.8rem; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); cursor: pointer; }

.log { list-style: none; display: grid; gap: 0.35rem; max-height: 280px; overflow: auto; font-size: 0.84rem; }
.log li { display: grid; grid-template-columns: 90px 1fr; gap: 0.6rem; padding: 0.3rem 0.5rem; border-radius: 8px; background: rgba(7, 11, 20, 0.5); }
.log time { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); padding-top: 0.1rem; }
.log__ok span { color: var(--accent); }
.log__warn span { color: var(--warn); }
.log__error span { color: var(--danger); }
.log__empty { display: block !important; color: var(--muted); }

.tokens { display: grid; gap: 0.6rem; }
.token { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.9rem; padding: 0.75rem 0.9rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(7, 11, 20, 0.45); }
.token__main, .token__state { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.token__main code { font-size: 0.78rem; word-break: break-all; background: none; padding: 0; color: var(--muted); }
.token small { color: var(--muted); font-size: 0.74rem; }
.token__state { align-items: flex-end; }
.chip { position: static; display: inline-block; }
.chip--ok { color: var(--accent); border-color: rgba(0, 229, 168, 0.5); }
.chip--warn { color: var(--warn); border-color: rgba(255, 180, 84, 0.5); }
.chip--bad { color: var(--danger); border-color: rgba(255, 107, 138, 0.5); }
.icon-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 0.9rem; transition: color 0.2s ease, border-color 0.2s ease; }
.icon-btn:hover { color: var(--danger); border-color: rgba(255, 107, 138, 0.5); }
.empty-mini { padding: 1.4rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }

.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.table td { padding: 0.65rem 0.7rem; border-bottom: 1px solid rgba(120, 160, 220, 0.08); white-space: nowrap; }
.table tr:hover td { background: rgba(0, 229, 168, 0.04); }
.table .is-hidden td { opacity: 0.45; }
.table code { font-size: 0.92rem; }
.table__act { text-align: right; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.82rem; cursor: pointer; margin-left: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }

.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 100; max-width: min(92vw, 520px); padding: 0.75rem 1.1rem; border-radius: 14px; background: rgba(16, 24, 42, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 0.92rem; animation: rise 0.25s ease both; }
.toast--ok { border-color: rgba(0, 229, 168, 0.5); }
.toast--warn { border-color: rgba(255, 180, 84, 0.5); }
.toast--bad { border-color: rgba(255, 107, 138, 0.55); }

@media (max-width: 860px) {
  .grid2--wide-left { grid-template-columns: 1fr; }
  .token { grid-template-columns: 1fr auto; }
  .token__state { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 0.6rem; }
  .log li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---- главное меню парсеров и настройки аккаунтов ---- */
.header__brand { text-decoration: none; color: inherit; }
.crumbs { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--accent); }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs b { font-weight: 600; color: var(--text); }
.cards--hub { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.service--link { text-decoration: none; color: inherit; cursor: pointer; padding-right: 2.6rem; }
.service__body { min-width: 0; }
.service__meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.7rem; }
.service__meta small { color: var(--muted); font-size: 0.78rem; }
.service__go { position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--accent); transition: transform 0.2s ease; }
.service--link:hover .service__go { transform: translate(4px, -50%); }
.service--skeleton { min-height: 108px; opacity: 0.5; }
.service .chip--ok, .service .chip--warn, .service .chip--off { position: static; }
.chip--off { color: var(--muted); border-color: var(--line); }

.range { display: flex; align-items: center; gap: 0.7rem 1rem; flex-wrap: wrap; margin-top: 0.85rem; font-size: 0.92rem; }
.range > span { flex: 1 1 210px; color: var(--text); }
.range label { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.85rem; }
.range .input--sm { width: 92px; padding: 0.5rem 0.6rem; }
.input--text { font-family: var(--font); font-size: 0.92rem; }
.field--col { flex-direction: column; align-items: stretch; gap: 0.4rem; }
.token { display: block; }
.token__row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.9rem; }
.token__btns { display: flex; gap: 0.4rem; }
.token__cfg { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); display: grid; gap: 0.2rem; }
.token__cfg .actions { margin-top: 0.8rem; }
@media (max-width: 860px) {
  .token__row { grid-template-columns: 1fr auto; }
  .token__row .token__state { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
}

/* прокси */
select.input { cursor: pointer; appearance: auto; }
select.input option { background: #0b1222; color: var(--text); }
.proxy-pick { display: grid; gap: 0.6rem; }
.warn-text { color: var(--warn, #ffc861); }
.service__ico--img { padding: 0; overflow: hidden; background: none; border-color: transparent; }
.service__ico--img img { display: block; width: 100%; height: 100%; }
.card__sub { margin: 1.1rem 0 0.3rem; font-size: 0.95rem; }
.zones { display: grid; gap: 0.45rem; margin-top: 0.4rem; }
.zones code { font-size: 0.8rem; }
