/* happ-info.pro, справочник по Happ */
/* Палитра: бумага #FFFFFF, чернила #1B1F23, вики-синий #0B57A4, серый #5B6470 */

:root {
  --paper: #ffffff;
  --ink: #1b1f23;
  --muted: #5b6470;
  --link: #0b57a4;
  --link-visited: #5a3696;
  --rule: #d9dde3;
  --bg-soft: #f4f6f8;
  --note-bg: #eef4fb;
  --note-edge: #9dbfe3;
  --warn-bg: #fdf6e3;
  --warn-edge: #e3c76a;
  --ok-bg: #eef8ef;
  --ok-edge: #9ccfa2;
  --mono-bg: #f0f2f4;
  --serif: "PT Serif", Georgia, serif;
  --sans: "PT Sans", "Segoe UI", Arial, sans-serif;
  --mono: "PT Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Шапка */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.site-header .inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.site-title a { color: var(--ink); }
.site-title a:hover { text-decoration: none; }
.site-tagline {
  color: var(--muted);
  font-size: 14px;
}

/* Каркас: сайдбар + контент + оглавление */
.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 40px;
}
.layout.no-toc {
  grid-template-columns: 220px minmax(0, 1fr);
}

/* Навигация слева */
.sidenav {
  padding: 28px 0 40px;
  border-right: 1px solid var(--rule);
  font-size: 15px;
}
.sidenav h2 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 8px;
}
.sidenav h2:first-child { margin-top: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li { margin: 0 0 7px; }
.sidenav .soon {
  color: var(--muted);
}
.sidenav .soon::after {
  content: " · скоро";
  font-size: 12px;
}

/* Контент */
.content {
  padding: 28px 0 60px;
  min-width: 0;
}
.content h1 {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.25;
  margin: 0 0 6px;
}
.content h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 38px 0 12px;
  padding-top: 10px;
}
.content h3 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 26px 0 8px;
}
.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 14px; padding-left: 26px; }
.content li { margin-bottom: 6px; }

/* Статус-плашка */
.status {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--link);
  background: var(--bg-soft);
  padding: 8px 14px;
  margin: 14px 0 26px;
}
.status b { color: var(--ink); font-weight: 700; }

/* Плашки-примечания */
.note, .warn {
  padding: 12px 16px;
  margin: 18px 0;
  border: 1px solid;
  border-radius: 3px;
}
.note { background: var(--note-bg); border-color: var(--note-edge); }
.warn { background: var(--warn-bg); border-color: var(--warn-edge); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }

/* Моно-фрагменты: имена серверов, ссылки, кнопки */
code, .kbd {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--mono-bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* Таблицы */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 18px 0;
  font-size: 15px;
}
th, td {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--bg-soft); font-weight: 700; }

/* Оглавление справа */
.toc {
  padding: 28px 0 40px;
  font-size: 14px;
  align-self: start;
  position: sticky;
  top: 0;
}
.toc h2 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--rule); }
.toc li { margin-bottom: 7px; }

/* Главная: карточки разделов */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 26px 0 10px;
}
.hub-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 18px;
}
.hub-card h2 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0 0 8px;
  padding: 0;
}
.hub-card ul { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.hub-card li { margin-bottom: 7px; }
.hub-card .soon { color: var(--muted); }
.hub-card .soon::after { content: " · скоро"; font-size: 12px; }

/* FAQ */
.faq dt {
  font-weight: 700;
  margin: 18px 0 6px;
}
.faq dd { margin: 0 0 12px; }

/* Подвал */
.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}
.site-footer .inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px;
}

/* Адаптив */
@media (max-width: 1080px) {
  .layout, .layout.no-toc { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
  .toc { display: none; }
}
@media (max-width: 760px) {
  .layout, .layout.no-toc { display: block; }
  .sidenav {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 18px 0;
  }
  .sidenav h2 { margin-top: 14px; }
  .content { padding-top: 22px; }
  .content h1 { font-size: 26px; }
  body { font-size: 16px; }
}

/* Скриншоты в статьях */
.shot {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin: 16px 0 6px;
}
.shot-cap {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  transform: translateY(110%);
  transition: transform .35s ease;
  box-shadow: 0 -2px 12px rgba(27,31,35,.25);
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta .cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 44px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.sticky-cta .cta-text {
  font-size: 15px;
  line-height: 1.35;
}
.sticky-cta .cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 18px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}
.sticky-cta .cta-btn:hover { background: var(--bg-soft); color: var(--ink); }
.sticky-cta .cta-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  opacity: .7;
  font-size: 22px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
}
.sticky-cta .cta-close:hover { opacity: 1; }
@media (min-width: 900px) {
  .sticky-cta {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 400px;
    border-radius: 10px;
  }
  .sticky-cta .cta-inner { padding: 12px 44px 12px 18px; }
}

@media (max-width: 760px) {
  .content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .content td code, .content th code { white-space: normal; overflow-wrap: anywhere; }
}

.sidenav-toggle { display: none; }
@media (max-width: 760px) {
  .sidenav.sidenav-collapsible { padding: 4px 0; }
  .sidenav-collapsible .sidenav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0;
    background: none;
    border: 0;
    font: 700 15px/1.3 var(--sans);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }
  .sidenav-collapsible .sidenav-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    margin: 0 6px 4px 12px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .2s ease;
  }
  .sidenav-collapsible.is-open .sidenav-toggle::after { margin: 4px 6px 0 12px; transform: rotate(-135deg); }
  .sidenav-collapsible .sidenav-list { display: none; padding: 4px 0 14px; }
  .sidenav-collapsible.is-open .sidenav-list { display: block; }
  .sidenav-list li { margin-bottom: 0; }
  .sidenav-list li a { display: block; padding: 5px 0; }
}

@media (max-width: 899.98px) {
  .sticky-cta, .sticky-cta.is-visible { transform: none; transition: none; }
  .sticky-cta .cta-close { display: none; }
  .sticky-cta .cta-inner { padding: 10px 16px; }
}

@media (min-width: 900px) {
  .sticky-cta { transform: translateY(calc(100% + 40px)); }
}

.milky-card { border: 1px solid var(--note-edge); background: var(--note-bg); border-radius: 8px; padding: 18px 20px; margin: 18px 0 24px; }
.milky-card p { margin: 0 0 14px; }
.milky-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 0 0 18px; }
.milky-facts div { display: flex; flex-direction: column; }
.milky-facts b { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.milky-facts span { font-size: 14px; line-height: 1.35; color: var(--muted); }
.milky-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.milky-note { font-size: 13px; color: var(--muted); margin: 12px 0 0 !important; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; font-size: 16px; line-height: 1.2; text-align: center; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary, .btn-primary:visited { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #343a41; color: #fff; }
.btn-secondary, .btn-secondary:visited { background: var(--paper); color: var(--ink); border-color: var(--rule); }
.btn-secondary:hover { border-color: var(--muted); color: var(--ink); }
.milky-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.milky-features div { border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; }
.content .milky-features h3 { margin: 0 0 6px; font-size: 17px; }
.milky-features p { margin: 0; font-size: 15px; line-height: 1.55; }
.srv-app { max-width: 420px; margin: 16px 0 20px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #2c1f4f, #3d2b69); color: #fff; box-shadow: 0 6px 24px rgba(27,31,35,.18); }
.srv-head { padding: 14px 18px 10px; }
.srv-title { font-weight: 700; font-size: 18px; line-height: 1.3; }
.srv-sub { font-size: 12px; opacity: .7; }
.srv-announce { background: rgba(0,0,0,.22); padding: 10px 18px; font-size: 13px; line-height: 1.5; text-align: center; }
.srv-row { display: flex; align-items: center; gap: 12px; padding: 9px 18px; border-top: 1px solid rgba(255,255,255,.08); line-height: 1.3; }
.srv-code { flex: 0 0 38px; height: 24px; border-radius: 5px; background: rgba(255,255,255,.15); font-size: 11px; font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; }
.srv-name { font-weight: 700; font-size: 15px; }
.srv-proto { font-size: 12px; opacity: .65; }
@media (max-width: 760px) {
  .milky-card { padding: 16px; }
  .milky-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .milky-facts b { font-size: 20px; }
  .milky-facts span { font-size: 13px; }
  .milky-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 760px) {
  .content code { white-space: normal; overflow-wrap: anywhere; }
}

.content h1, .content h2, .content h3 { overflow-wrap: break-word; }

.note:has(a[href*="milkypanel.com"], a[href="milky-vpn"], a[href*="t.me/MilkyVPN_bot"]) {
  position: relative;
  margin: 26px 0;
  padding: 42px 22px 20px;
  background: linear-gradient(135deg, #e6f0fd 0%, #f5f9ff 100%);
  border: 1px solid #b6d0f0;
  border-left: 5px solid var(--link);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(11, 87, 164, .10);
}
.note:has(a[href*="milkypanel.com"], a[href="milky-vpn"], a[href*="t.me/MilkyVPN_bot"])::before {
  content: "Milky VPN · партнёр справочника";
  position: absolute;
  top: 14px;
  left: 22px;
  font: 700 12px/1 var(--sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--link);
}
.note:has(a[href*="milkypanel.com"], a[href="milky-vpn"], a[href*="t.me/MilkyVPN_bot"]) p {
  font-size: 16.5px;
  line-height: 1.6;
}
.note a[href*="milkypanel.com/checkout"],
.note a[href*="milkypanel.com/checkout"]:visited {
  display: table;
  margin: 14px 0 6px;
  padding: 10px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.note a[href*="milkypanel.com/checkout"]:hover {
  background: #343a41;
  color: #fff;
  text-decoration: none;
}
@media (max-width: 760px) {
  .note:has(a[href*="milkypanel.com"], a[href="milky-vpn"], a[href*="t.me/MilkyVPN_bot"]) {
    padding: 40px 16px 18px;
  }
  .note a[href*="milkypanel.com/checkout"] {
    display: block;
    margin: 14px 0 4px;
    text-align: center;
  }
}
