:root {
  --bg: #14171c;
  --bg-deep: #0f1115;
  --panel: #1e222a;
  --panel-2: #1a1e25;
  --panel-3: #232830;
  --border: #3a3f4a;
  --border-soft: #2c313a;
  --metal-hi: #5a6170;
  --text: #d1d5db;
  --text-dim: #9ca3af;
  --heading: #ffffff;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.35);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --gold: #f5c542;
  --link: #6ea8ff;
  --radius: 4px;
  --font: "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* атрибут hidden должен побеждать любые display: ... у классов */
[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    linear-gradient(rgba(20, 23, 28, 0.92), rgba(20, 23, 28, 0.96)),
    radial-gradient(ellipse at top, #1c2430 0%, var(--bg) 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: #9ec5ff;
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* ===== Header ===== */

.site-header {
  background: linear-gradient(180deg, #101318 0%, #15181e 100%);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 0 0;
}

.header-rev {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.header-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #4b6a8f 0%, #1b2a3d 55%, #0d131c 100%);
  border: 1px solid var(--metal-hi);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.05),
    0 0 10px rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #8fb6e0;
  flex-shrink: 0;
}

.brand-name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--heading);
}

.brand-name span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex-basis: 100%;
}

.main-nav a {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--heading);
  background: rgba(59, 130, 246, 0.12);
  text-decoration: none;
}

.main-nav a.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ===== Layout ===== */

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.page {
  flex: 1;
  padding: 28px 0 48px;
}

.page-title {
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 6px;
}

.page-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

.divider {
  display: block;
  width: 160px;
  height: 1px;
  margin: 10px auto 24px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  position: relative;
}

.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--panel-3);
  border: 1px solid var(--border);
}

/* ===== Panels / Cards ===== */

.panel {
  background: rgba(30, 34, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.35);
}

.panel-head {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading);
  text-align: center;
}

.panel-title.left {
  text-align: left;
}

.panel-body {
  padding: 16px 18px;
}

.panel-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.15);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== Forms ===== */

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 14px;
  pointer-events: none;
}

.input-wrap .input-icon::before {
  opacity: 0.8;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: #12151a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input {
  padding-left: 36px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  cursor: pointer;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  margin: 4px 0 16px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.check input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.form-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  text-align: center;
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  background: linear-gradient(180deg, #2a2f38 0%, #1c2027 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.btn:hover {
  color: var(--heading);
  border-color: var(--metal-hi);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, #2563b8 0%, #1a4a8f 55%, #163c75 100%);
  border-color: #4d8fd6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 12px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  color: #ffffff;
  border-color: #7ab3f0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 16px rgba(59, 130, 246, 0.55);
}

.btn-danger {
  color: #fecaca;
  background: linear-gradient(180deg, #3a1d1d 0%, #2a1414 100%);
  border-color: #7f1d1d;
}

.btn-danger:hover {
  color: #ffffff;
  border-color: var(--red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.btn-success {
  color: #bbf7d0;
  background: linear-gradient(180deg, #14301f 0%, #0f2418 100%);
  border-color: #166534;
}

.btn-success:hover {
  color: #ffffff;
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.btn-sm {
  font-size: 11px;
  padding: 6px 10px;
  letter-spacing: 0.08em;
}

/* подсветка рамки (кнопка Paperdoll в NPCBot Status) */
.btn-accent {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(245, 197, 66, 0.35);
}

.btn-accent:hover {
  color: var(--heading);
  border-color: var(--gold);
  box-shadow:
    0 0 12px rgba(245, 197, 66, 0.55),
    inset 0 0 6px rgba(245, 197, 66, 0.15);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
}

/* ===== Auth card ===== */

.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card .panel-body {
  padding: 26px 28px 28px;
}

.auth-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--heading);
  text-align: center;
}

.auth-links {
  text-align: center;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

/* ===== Status / badges ===== */

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}

.status-dot.off {
  background: var(--red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.status-dot.warn {
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
}

.badge-green {
  color: #bbf7d0;
  border-color: #166534;
  background: rgba(34, 197, 94, 0.12);
}

.badge-red {
  color: #fecaca;
  border-color: #7f1d1d;
  background: rgba(239, 68, 68, 0.12);
}

.badge-blue {
  color: #bfdbfe;
  border-color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.badge-gold {
  color: #fde68a;
  border-color: #854d0e;
  background: rgba(234, 179, 8, 0.1);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-dim {
  color: var(--text-dim);
}

.text-gold {
  color: var(--gold);
}

/* ===== Bars ===== */

.bar {
  height: 7px;
  background: #101318;
  border: 1px solid var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #34d399, #16a34a);
}

.bar.mana > span {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bar.red > span {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.bar.yellow > span {
  background: linear-gradient(180deg, #facc15, #ca8a04);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.bar-row .bar {
  flex: 1;
}

.bar-row .bar-label {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 58px;
  text-align: right;
}

/* ===== Lists / tables ===== */

.list {
  list-style: none;
}

.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}

.list li:last-child {
  border-bottom: none;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  color: var(--text-dim);
}

.kv .v {
  color: var(--text);
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

th {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.25);
  font-weight: 600;
}

tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}

td .btn {
  margin-right: 4px;
}

/* ===== Roster ===== */

.roster-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.roster-item:hover {
  border-color: var(--border);
}

.roster-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.roster-item .name {
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 2px;
}

.roster-item .meta {
  font-size: 13px;
  color: var(--text-dim);
}

.roster-item .side {
  text-align: right;
  flex-shrink: 0;
}

.roster-item .side .label {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

/* ===== Bot card ===== */

.bot-card {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.bot-card:last-child {
  border-bottom: none;
}

.bot-card .name {
  font-weight: 600;
  color: var(--heading);
}

.bot-card .meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.bot-card .meta.gs {
  color: var(--gold);
  font-weight: 600;
}

/* ===== News ===== */

.news-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-soft);
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 13px;
  color: var(--text-dim);
}

.news-date .tag {
  display: inline-block;
  margin-top: 8px;
}

.news-item h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 8px;
}

.news-item h3 a {
  color: inherit;
  text-decoration: none;
}

.news-item h3 a:hover {
  color: var(--link);
  text-decoration: none;
}

.news-item p {
  color: var(--text);
  font-size: 14px;
}

.news-more {
  margin-top: 10px;
  font-size: 13px;
}

.news-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}

.news-pager button {
  min-width: 34px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.news-pager button:hover:not(:disabled):not(.active) {
  color: var(--text);
  border-color: var(--metal-hi);
}

.news-pager button.active {
  color: var(--gold);
  border-color: var(--gold);
}

.news-pager button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* ===== Hero ===== */

.hero {
  text-align: center;
  padding: 34px 20px 30px;
  background:
    linear-gradient(rgba(15, 18, 24, 0.75), rgba(20, 23, 28, 0.9)),
    radial-gradient(ellipse at center, #243447 0%, #14171c 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero h1 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 10px;
}

.hero p {
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 20px;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Widget tiles ===== */

.tile {
  display: block;
  padding: 16px 18px;
  background: rgba(30, 34, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

a.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.tile .tile-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 4px;
}

.tile .tile-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== Stats ===== */

.stat {
  padding: 16px 18px;
  text-align: center;
}

.stat .stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: 0.04em;
}

.stat .stat-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ===== Tabs ===== */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tabs a,
.tabs button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
}

.tabs a:hover,
.tabs button:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active,
.tabs button.active {
  color: var(--heading);
  border-bottom-color: var(--accent);
}

/* ===== Alerts ===== */

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-ok {
  color: #bbf7d0;
  border-color: #166534;
  background: rgba(34, 197, 94, 0.1);
}

.alert-err {
  color: #fecaca;
  border-color: #7f1d1d;
  background: rgba(239, 68, 68, 0.1);
}

.alert-info {
  color: #bfdbfe;
  border-color: #1e40af;
  background: rgba(59, 130, 246, 0.1);
}

/* ===== Downloads ===== */

.dl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.dl-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dl-filter {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: #12151a;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
}

.dl-filter:hover {
  color: var(--text);
  border-color: var(--border);
}

.dl-filter.active {
  color: var(--heading);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(30, 34, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
}

.dl-card.featured {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 12px rgba(59, 130, 246, 0.15);
}

.dl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dl-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
}

.dl-card .desc {
  font-size: 13px;
  color: var(--text-dim);
}

.dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--text-dim);
}

.dl-meta strong {
  color: var(--text);
  font-weight: 600;
}

.dl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.kind-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
  flex-shrink: 0;
}

.kind-badge.torrent {
  color: #bfdbfe;
  border-color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.kind-badge.direct,
.kind-badge.zip {
  color: #bbf7d0;
  border-color: #166534;
  background: rgba(34, 197, 94, 0.1);
}

.kind-badge.github {
  color: #e5e7eb;
  border-color: #4b5563;
  background: rgba(107, 114, 128, 0.18);
}

.kind-badge.gdrive {
  color: #fde68a;
  border-color: #b45309;
  background: rgba(245, 158, 11, 0.12);
}

.kind-badge.ydisk {
  color: #fecaca;
  border-color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.dl-url {
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
  background: #12151a;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 6px 8px;
}

@media (max-width: 720px) {
  .dl-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Articles (Knowledge Base) ===== */

.art-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.art-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.art-filter {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: #12151a;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
}

.art-filter:hover {
  color: var(--text);
  border-color: var(--border);
}

.art-filter.active {
  color: var(--heading);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

#art-search {
  width: 220px;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

a.art-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(30, 34, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

a.art-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

a.art-card.featured {
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 12px rgba(59, 130, 246, 0.15);
}

.art-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kind-badge.art-cat {
  color: #bfdbfe;
  border-color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.art-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
}

.art-excerpt {
  font-size: 13px;
  color: var(--text-dim);
}

.art-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.art-tag {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--panel-3);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 2px 7px;
}

.art-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: auto;
  padding-top: 6px;
}

.art-meta strong {
  color: var(--text);
  font-weight: 600;
}

.article-body h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 16px 0 8px;
}

.article-body h3:first-child {
  margin-top: 0;
}

.article-body code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  background: #12151a;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 1px 5px;
}

@media (max-width: 720px) {
  .art-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Realm switcher ===== */

.realm-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(30, 34, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.realm-switch.compact {
  margin-bottom: 0;
  padding: 6px 10px;
}

.realm-switch-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.realm-switch select.realm-select,
.realm-switch select.server-select {
  min-width: 220px;
  max-width: 320px;
  background: #12151a;
  border: 1px solid var(--border);
  color: var(--heading);
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.realm-switch select.server-select {
  min-width: 240px;
}

.realm-switch.compact select.realm-select,
.realm-switch.compact select.server-select {
  min-width: 180px;
  padding: 6px 10px;
  font-size: 13px;
}

.realm-switch-sep {
  width: 1px;
  height: 28px;
  background: var(--border-soft);
  margin: 0 2px;
}

.realm-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-left: auto;
}

.realm-meta strong {
  color: var(--text);
  font-weight: 600;
}

.realm-id-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid #1d4ed8;
  border-radius: 3px;
  padding: 2px 7px;
}

.realm-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.realm-chip {
  font-family: var(--font);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: #12151a;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.realm-chip:hover {
  color: var(--text);
  border-color: var(--border);
}

.realm-chip.active {
  color: var(--heading);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.realm-chip .chip-status {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.realm-chip .chip-status.on {
  background: var(--green);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.7);
}

.realm-chip .chip-status.off {
  background: var(--red);
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.6);
}

@media (max-width: 720px) {
  .realm-meta {
    margin-left: 0;
    width: 100%;
  }

  .realm-switch select.realm-select,
  .realm-switch select.server-select {
    width: 100%;
    max-width: none;
  }

  .realm-switch-sep {
    display: none;
  }
}

/* ===== Footer ===== */

.site-footer {
  background: #101318;
  border-top: 1px solid var(--border-soft);
  padding: 18px 20px 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ===== Legal modal ===== */

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.legal-modal[hidden] {
  display: none;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.legal-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: rgba(30, 34, 42, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 40px rgba(0, 0, 0, 0.55);
}

.legal-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.legal-modal-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading);
}

.legal-modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.legal-modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.legal-modal-body h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 16px 0 8px;
}

.legal-modal-body h3:first-child {
  margin-top: 0;
}

.legal-modal-body p,
.legal-modal-body li {
  margin-bottom: 8px;
}

.legal-modal-body ol,
.legal-modal-body ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.legal-modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

body.legal-open {
  overflow: hidden;
}

/* ===== Feedback modal ===== */

#feedback-text {
  min-height: 150px;
}

.feedback-status {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.15);
}

.feedback-status[hidden] {
  display: none;
}

.feedback-status.is-wait {
  color: var(--text-dim);
  border-color: var(--accent);
}

.feedback-status.is-ok {
  color: var(--green);
  border-color: var(--green);
}

.feedback-status.is-err {
  color: var(--red);
  border-color: var(--red);
}

.legal-modal-foot .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ===== Legal page ===== */

.legal-toc {
  list-style: none;
  margin-bottom: 24px;
}

.legal-toc li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

.legal-body h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--heading);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

.legal-body h2:first-child {
  margin-top: 0;
}

.legal-body p,
.legal-body li {
  font-size: 14px;
  margin-bottom: 8px;
}

.legal-body ol,
.legal-body ul {
  padding-left: 22px;
  margin-bottom: 12px;
}

.legal-body a {
  color: var(--link);
}

/* ===== Utility ===== */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* ===== Responsive ===== */

@media (max-width: 980px) {
  .grid-3,
  .grid-4,
  .grid-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-main {
    grid-template-columns: 1fr;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .brand-name {
    font-size: 20px;
  }

  .hero h1 {
    font-size: 22px;
  }
}
