:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #ff3b30;
  --accent2: #2d7dff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.brand { color: var(--accent); font-weight: 700; font-size: 20px; text-decoration: none; }
.top nav a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.top nav a:hover { color: var(--text); }
.wrap { max-width: 920px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 24px; margin: 8px 0 18px; }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hint { color: var(--muted); font-size: 14px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; margin-bottom: 20px;
}
input[type=text], input[type=password] {
  width: 100%; padding: 12px 14px; margin-bottom: 10px;
  background: #0c0e12; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 15px;
}
button {
  padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent2); color: #fff; font-size: 14px;
}
button:hover { filter: brightness(1.1); }
button.danger { background: #3a2030; color: var(--accent); }

.row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.row input { flex: 1; margin: 0; min-width: 160px; }

video {
  width: 100%; max-height: 70vh; background: #000;
  border-radius: 12px; border: 1px solid var(--line);
}
.vtitle { font-size: 20px; }
.quality { display: flex; gap: 8px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.quality span { color: var(--muted); }
.quality .q { background: #1d212b; color: var(--text); }
.quality .q.active { background: var(--accent2); }

.share #shareUrl { font-family: ui-monospace, Consolas, monospace; }
.cb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 10px; cursor: pointer; }
.cb input { width: auto; margin: 0; }
.actions .copy { background: #1d3a2a; color: #8affb0; }

.poster { width: 100%; max-height: 50vh; object-fit: contain; background: #000;
  border-radius: 12px; border: 1px solid var(--line); margin-bottom: 14px; }

/* История: сетка карточек */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.vcard { display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text); }
.vcard:hover { border-color: var(--accent2); }
.vcard img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.vcard-t { padding: 8px 10px 2px; font-size: 14px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-d { padding: 0 10px 10px; font-size: 12px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tr.off { opacity: .45; }
td code { color: var(--accent2); word-break: break-all; }
.actions { display: flex; gap: 6px; }
.actions form { margin: 0; }
.actions button { padding: 4px 10px; font-size: 13px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.error { background: #3a2030; color: #ff8a80; }
.flash.success { background: #19311f; color: #8affb0; }

a { color: var(--accent2); }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; border-top: 1px solid var(--line); }
