/* YouTube Разбор — аналитическая панель: холодный нейтральный + один бирюзовый акцент */

:root {
  --bg: #0b0d12;
  --panel: #11141b;
  --raise: #171b24;
  --line: rgba(238, 242, 248, .08);
  --line-2: rgba(238, 242, 248, .16);
  --txt: #eef1f6;
  --sec: #a7b0c0;
  --dim: #828b9c;
  --acc: #ff4d4d;
  --acc-btn: #d63c3c;
  --acc-btn-hover: #e24646;
  --acc-ink: #ffffff;
  --ok: #6ecf8f;
  --warn: #e0b25a;
  --err: #e5675c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--txt); text-decoration: none; transition: color 160ms var(--ease); }
a:hover { color: var(--acc); }

/* ---------- ШАПКА ---------- */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
}
.brand::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acc); margin-right: 9px; vertical-align: 2px;
}
.top nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.top nav a {
  color: var(--sec); font-size: 14px; padding: 7px 11px; border-radius: 7px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.top nav a:hover { color: var(--txt); background: var(--panel); }
.top nav a.on { color: var(--txt); background: var(--raise); }
.top nav a.out { color: var(--dim); }
.top nav a.out:hover { color: var(--err); background: transparent; }

main { padding: 28px 24px 48px; max-width: 1180px; margin: 0 auto; }
.bot {
  color: var(--dim); font-size: 12px; text-align: center;
  padding: 20px 24px 36px; border-top: 1px solid var(--line); margin-top: 16px;
}

/* ---------- ВХОД ---------- */
.loginbox {
  max-width: 320px; margin: 16vh auto; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 24px;
}
.loginbox h1 { font-size: 20px; font-weight: 500; margin: 0 0 6px; letter-spacing: -.01em; }
.loginbox input { width: 100%; margin: 18px 0 10px; }
.loginbox button { width: 100%; }
.hint { color: var(--sec); font-size: 13px; line-height: 1.5; }
.err { color: var(--err); font-size: 13px; }

/* ---------- ПОЛЯ ---------- */
input, select, button, textarea {
  font: inherit; color: var(--txt);
  background: var(--raise); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; min-width: 0;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
input::placeholder { color: var(--dim); }
input:hover, select:hover { border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); }
input[type="search"]::-webkit-search-cancel-button { filter: invert(.6); }
button {
  background: var(--acc-btn); border-color: var(--acc-btn); color: var(--acc-ink);
  font-weight: 500; cursor: pointer;
}
button:hover { background: var(--acc-btn-hover); border-color: var(--acc-btn-hover); }
button:active { opacity: .9; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.searchbar input { flex: 1; }
.searchbar select { max-width: 190px; }

/* ---------- РЕЖИМЫ ---------- */
.modes { display: inline-flex; gap: 2px; margin: 0 0 18px; padding: 3px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
.modes .chip {
  padding: 7px 16px; font-size: 13.5px; font-weight: 400; border-radius: 6px;
  color: var(--sec); background: none; border: 0;
}
.modes .chip:hover { color: var(--txt); }
.modes .chip.on { background: var(--acc-btn); color: #fff; }

/* ---------- ФИЛЬТРЫ ---------- */
.filters {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 0 16px; margin-bottom: 16px;
}
.filters summary {
  cursor: pointer; color: var(--sec); font-size: 13.5px; padding: 13px 0;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::before {
  content: "›"; font-size: 16px; line-height: 1; color: var(--acc); width: 10px;
  transition: transform 160ms var(--ease);
}
.filters[open] summary::before { transform: rotate(90deg); }
.filters[open] summary { border-bottom: 1px solid var(--line); }
.fgroup { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup h4 {
  margin: 0 0 10px; font-size: 11.5px; font-weight: 400; color: var(--dim);
  font-family: var(--mono); letter-spacing: .02em;
}
.fgrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 14px;
}
.fgrid label, .sigform label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; color: var(--sec);
}
.fgrid input, .fgrid select { width: 100%; }
.range { display: flex; align-items: center; gap: 6px; }
.range input { width: 100%; }
.range span { color: var(--dim); font-size: 12px; }
.wide { grid-column: span 2; }
.fbtns { display: flex; gap: 14px; align-items: center; padding: 14px 0; }
.fbtns button {
  padding: 9px 18px; background: transparent; border: 1px solid var(--line-2);
  color: var(--txt); font-weight: 400;
}
.fbtns button:hover { background: var(--raise); border-color: var(--sec); }
.reset { color: var(--sec); font-size: 13px; }
.reset:hover { color: var(--txt); }

/* ---------- СВОДКА ---------- */
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-bottom: 18px;
}
.summary div { background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.summary b {
  font: 500 22px/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.summary span { color: var(--dim); font-size: 12px; }

/* ---------- ТАБЛИЦЫ ---------- */
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
table.res { width: 100%; border-collapse: collapse; font-size: 14px; }
table.res th {
  text-align: left; color: var(--dim); font-weight: 400;
  font-size: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--panel);
}
table.res th.n, table.res th.d { text-align: right; }
table.res td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.res tr:last-child td { border-bottom: none; }
table.res tr:hover td { background: var(--raise); }
td.th img { width: 84px; border-radius: 6px; display: block; }
td.n { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13px; }
td.ti { min-width: 240px; }
td.ti a { font-weight: 500; }
td.hit { color: var(--ok); font-weight: 500; }
.ch { color: var(--dim); font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ch a { color: var(--dim); }
.ch a:hover { color: var(--acc); }
.tag {
  background: rgba(255, 77, 77, .12); color: #ff8f8f; border-radius: 4px;
  padding: 1px 6px; font-size: 10.5px; font-family: var(--mono);
}
.mob { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--sec);
  border-radius: 999px; padding: 4px 11px; font-size: 12px;
}

/* ---------- КНОПКИ ---------- */
.btn {
  display: inline-block; background: var(--acc-btn); color: var(--acc-ink);
  border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--acc-btn);
}
.btn:hover { color: var(--acc-ink); background: var(--acc-btn-hover); border-color: var(--acc-btn-hover); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--sec); }
.btn.ghost:hover { color: var(--txt); background: var(--raise); }

/* ---------- СТРАНИЦА КАНАЛА ---------- */
.ptitle { font-size: 20px; font-weight: 500; margin: 0 0 16px; letter-spacing: -.01em; }
.chead { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.chead h1 { font-size: 24px; font-weight: 500; margin: 0 0 4px; letter-spacing: -.02em; }
.cstats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.cstats div { background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.cstats b { font: 500 20px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.cstats span { color: var(--dim); font-size: 12px; }
.cbtns { display: flex; gap: 8px; flex-wrap: wrap; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card h3 { font-size: 12px; font-weight: 400; color: var(--dim); margin: 0 0 10px; font-family: var(--mono); }
.chart { width: 100%; height: auto; display: block; }
.cv { font-size: 9px; fill: var(--sec); }
.cl { font-size: 10px; fill: var(--dim); }
.sec { font-size: 16px; font-weight: 500; margin: 24px 0 10px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- РАЗБОР ИИ ---------- */
.aicard { padding: 18px; }
.aihead {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 12px;
}
.aihead h3 { color: var(--txt); font-size: 15px; font-weight: 500; margin: 0 0 4px; }
.aicard h4 {
  font-size: 11.5px; color: var(--dim); font-weight: 400; font-family: var(--mono);
  margin: 20px 0 10px;
}
.verdict { margin: 0 0 6px; font-size: 15px; line-height: 1.6; }
.aigrid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ailist { list-style: none; margin: 0; padding: 0; }
.ailist li { border-left: 2px solid var(--line-2); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.ailist.ok li { border-color: var(--ok); }
.ailist.bad li { border-color: var(--err); }
.ailist b { display: block; font-size: 13.5px; font-weight: 500; }
.ailist span, .ideas span { display: block; color: var(--sec); font-size: 12.5px; margin-top: 3px; }
.ideas { margin: 0; padding-left: 18px; }
.ideas li { margin-bottom: 12px; }
.ideas b { font-size: 14px; font-weight: 500; }
.ideas em { display: block; color: var(--dim); font-size: 12px; font-style: normal; margin-top: 4px; }
.aifoot { color: var(--dim); font-size: 11.5px; margin: 16px 0 0; }

/* ---------- ПРОЧЕЕ ---------- */
.ratiohelp { margin: 0 0 16px; }
.ratiohelp-body { padding: 4px 0 16px; font-size: 13.5px; line-height: 1.6; color: var(--sec); }
.ratiohelp-body p { margin: 0 0 10px; }
.ratiohelp-body ul { margin: 0 0 10px; padding-left: 18px; }
.ratiohelp-body li { margin-bottom: 4px; }
.ratiohelp-body b { color: var(--txt); font-weight: 500; }

.batchform { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 24px; }
.batchform textarea {
  width: 100%; resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 13px;
}
.batchform button { align-self: flex-start; }
.sortbar { margin: 0 0 14px; display: flex; gap: 12px; }
.sortbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sec); }

.plain { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 16px; }
.plain p { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--sec); }
.plain p:last-child { margin-bottom: 0; }
.plain b { color: var(--txt); font-weight: 500; }

.sigform {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin: 0 0 20px;
}
.sigform label:first-child { flex: 1 1 260px; }
.sigform input, .sigform select { width: 100%; }
.acts { white-space: nowrap; }
form.inline { display: inline; }
.linkbtn {
  background: none; border: 0; color: var(--dim); font: inherit; font-size: 12px;
  cursor: pointer; padding: 6px; text-decoration: underline;
}
.linkbtn:hover { color: var(--txt); background: none; }
.linkbtn.bad:hover { color: var(--err); }
tr.dim td { opacity: .45; }
.okmsg { color: var(--ok); font-size: 13px; margin: 8px 0; }
.warn { color: var(--warn); font-size: 13px; margin: 8px 0; }

.thumbrow { margin-bottom: 16px; }
.thumbrow h4 { font-size: 11.5px; color: var(--dim); font-family: var(--mono);
  font-weight: 400; margin: 0 0 8px; }
.thumbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; transition: border-color 160ms var(--ease); }
.thumb:hover { border-color: var(--line-2); }
.thumb img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.thumb span { display: block; padding: 6px 8px; font-size: 11.5px; color: var(--dim); }

.note { font-size: 13px; line-height: 1.6; margin: 0 0 10px; color: var(--sec); }
.note b { color: var(--txt); font-weight: 500; }

.mini { font-size: 11.5px; color: var(--dim); text-decoration: none; }
.mini:hover { color: var(--acc); text-decoration: none; }
.mini.on { color: var(--ok); cursor: default; }
.tline { margin: 0 0 6px; font-size: 13px; line-height: 1.55; }
.tline a { color: var(--acc); text-decoration: none; font-variant-numeric: tabular-nums; margin-right: 6px; }
.vhead { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.vhead img { width: 210px; border-radius: 8px; flex: none; }
.vhead h1 { font-size: 20px; font-weight: 500; margin: 0 0 8px; line-height: 1.35; }
.ttext { max-height: 620px; overflow-y: auto; padding-right: 8px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 0 16px; }
.mini-table th {
  text-align: left; font-size: 11.5px; color: var(--dim); font-weight: 400;
  padding: 6px 8px 8px 0; border-bottom: 1px solid var(--line);
}
.mini-table td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); }
.mini-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.mini-table tr.dim td { opacity: .4; }

.chips a.chip { text-decoration: none; }
.chips a.chip:hover { border-color: var(--line-2); color: var(--txt); }
.chips a.chip.on { background: var(--acc-btn); color: #fff; border-color: var(--acc-btn); }
.folderrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); }
.folderrow:first-of-type { border-top: none; }
.folderrow .hint { margin: 0; }

button.mini.link, .mini.on { background: none; border: none; padding: 0; font: inherit; font-size: 11.5px; cursor: pointer; }

hr.sep { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

.promptbox { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.promptout {
  width: 100%; font: 13px/1.55 var(--mono); resize: vertical;
  background: var(--raise); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px;
}

.copybox { position: fixed; inset: 0; background: rgba(6, 8, 12, .9); z-index: 50;
  display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.copybox textarea {
  flex: 1; width: 100%; font: 12px/1.55 var(--mono);
  background: var(--raise); color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px;
}

/* ---------- МОБИЛЬНЫЙ ---------- */
@media (max-width: 760px) {
  .top { height: auto; padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .top nav { gap: 2px; }
  .top nav a { font-size: 13px; padding: 6px 8px; }
  main { padding: 18px 14px 36px; }
  .modes { display: flex; width: 100%; }
  .modes .chip { flex: 1; text-align: center; }
  .searchbar { flex-direction: column; }
  .searchbar select { max-width: none; }
  .fgrid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  .top nav { flex-wrap: wrap; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div:last-child:nth-child(odd) { grid-column: span 2; }
  td.th, th:first-child { display: none; }
  td.d, th.d, td.nh, th.nh, td.nr, th.nr, td.nd, th.nd, td.nv, th.nv { display: none; }
  .mob { display: block; color: var(--dim); font-size: 12px; margin-top: 5px; }
  .cards { grid-template-columns: 1fr; }
  .aigrid { grid-template-columns: 1fr; }
  .aihead { flex-direction: column; }
  .vhead { flex-direction: column; }
  .vhead img { width: 100%; }
  .thumbgrid { grid-template-columns: repeat(2, 1fr); }
  .sigform { flex-direction: column; align-items: stretch; }
  .batchform button { align-self: stretch; }
  .ttext { max-height: 480px; }
}
@media (max-width: 560px) {
  .range { flex-direction: column; align-items: stretch; gap: 6px; }
  .range span { display: none; }
}

.folderrow form button, .folderrow > button {
  background: transparent; border: 1px solid var(--line-2); color: var(--txt); font-weight: 400;
}
.folderrow form button:hover, .folderrow > button:hover { background: var(--raise); }
.sigform button { align-self: end; }
