:root {
  --bg: #0e1014; --card: #161a21; --line: #232a35; --inset: #11151b; --deep: #0a0c10;
  --text: #e8ecf2; --muted: #9aa4b2; --faint: #8a94a3; --link: #7cb8ff;
  --accent: #5aa9ff; --accent-strong: #2b6fd6; --warn: #ff9f43; --off: #5b6574;
  --ok-bg: #13233a; --ok-text: #cfe4ff; --warn-bg: #3a2612; --warn-text: #ffd8b0;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: Unbounded, Manrope, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #a9d0ff; }
button, input { font: inherit; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand b { font-family: var(--display); font-size: 21px; letter-spacing: .4px; }
.brand small { display: block; font-size: 13px; color: var(--muted); }
.top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--ok-bg); color: var(--ok-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.dot.warn { background: var(--warn); } .dot.off { background: var(--off); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #2a313d; background: transparent; color: #c9d1dc; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #3a4352; color: var(--text); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 700; }
.btn.primary:hover { background: #3a7fe6; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { margin: 0; font-size: 17px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { display: flex; align-items: center; gap: 10px; }
.card-title svg { flex: none; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-text); white-space: nowrap; }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.plain { background: transparent; color: #c9d1dc; font-family: var(--mono); padding: 0; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; font-size: 13px; color: var(--faint); }
.card-foot a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.server { flex-direction: row; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.server-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; justify-content: space-between; }
.metrics { flex: 3 1 560px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.metric { background: var(--inset); border: 1px solid #222935; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.metric .big { font-family: var(--mono); font-size: 30px; }
.bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s; }
.bar > i.warn { background: var(--warn); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--inset); border-radius: 12px; }
.row .l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .n { font-size: 14px; font-weight: 600; }
.row .s { font-size: 12px; color: var(--faint); }
.mono { font-family: var(--mono); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--inset); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--mono); font-size: 22px; font-weight: 500; }
.stat span { font-size: 12px; color: var(--faint); }
.tor { display: flex; flex-direction: column; gap: 6px; }
.tor .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.tor .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tor small { font-size: 12px; color: var(--faint); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--inset); border-radius: 10px; font-size: 13px; }
.term { background: var(--deep); border: 1px solid #222935; border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 13px; color: #b9c3cf; display: flex; flex-direction: column; gap: 4px; }
.lines { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.note { text-align: center; font-size: 12px; color: #6f7986; }
.spark { width: 100%; height: 60px; }
.empty { font-size: 14px; color: var(--muted); }
/* Кино */
.k-head { display: flex; align-items: center; gap: 12px; }
.k-head h1 { margin: 0; font-size: 24px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; flex: none; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 48px; }
.search input { flex: 1; background: transparent; border: 0; color: var(--text); font-size: 15px; outline: none; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #2a313d; background: transparent; color: #c9d1dc; font-size: 14px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0; }
.poster { width: 56px; height: 80px; border-radius: 8px; background: #1d2430 center/cover no-repeat; flex: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: 11px; font-weight: 700; color: var(--text); }
.item-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-body b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-body span { font-size: 12px; color: var(--faint); }
.item-body .st { color: #a9c4e6; }
.share-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #1d2a3d; color: var(--link); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.sheet-bg { position: fixed; inset: 0; background: rgba(5, 7, 10, .62); display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet-bg.open { display: flex; }
.sheet { width: 100%; max-width: 520px; background: var(--card); border: 1px solid #2a313d; border-bottom: 0; border-radius: 22px 22px 0 0; padding: 18px 16px 26px; display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow: auto; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: #3a4250; align-self: center; }
.choice { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.choice button { min-height: 44px; border-radius: 10px; border: 1px solid #2a313d; background: transparent; color: #c9d1dc; cursor: pointer; }
.choice button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input[type="text"] { min-height: 44px; border-radius: 10px; border: 1px solid #2a313d; background: var(--bg); color: var(--text); padding: 0 12px; font-size: 15px; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: 15px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent-strong); }
.linkbox { font-family: var(--mono); font-size: 13px; color: #c9d1dc; background: var(--bg); border: 1px solid #2a313d; border-radius: 12px; padding: 12px; word-break: break-all; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sr { position: absolute; left: -9999px; }
/* Просмотр */
.watch { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; }
.watch-top { padding: 14px 16px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.player { width: 100%; aspect-ratio: 16 / 9; background: #05070a; }
.player video { width: 100%; height: 100%; display: block; background: #05070a; }
.watch-body { padding: 18px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.watch-body h1 { margin: 0; font-size: 24px; }
.watch-body p { margin: 0; font-size: 14px; line-height: 1.55; color: #b9c3cf; }
.info-box { padding: 14px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.info-box b { font-size: 14px; color: var(--text); }
@media (max-width: 520px) {
  .wrap { padding: 16px 12px 40px; gap: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .metric .big { font-size: 24px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .items { grid-template-columns: 1fr; }
}
