:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #d8dee6;
  --text: #15202b;
  --muted: #5c6b7a;
  --accent: #1d6cf5;
  --accent-hover: #155bd4;
  --warning-bg: #fff8eb;
  --warning-border: #e8c96a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Общая шапка и подвал (partials + js/site-shell.js) */
.site-header {
  position: relative;
  z-index: 2;
  margin-bottom: 1.4rem;
  background: linear-gradient(90deg, #0f2e75 0%, #18429d 55%, #1f4fbf 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px rgba(11, 25, 61, 0.18);
}

.site-header-inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  justify-content: flex-start;
}

.site-brand-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 0;
  order: 1;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  width: 210px;
  overflow: hidden;
  flex: 0 0 210px;
}

.site-brand img {
  display: block;
  width: auto;
  height: 46px;
}

.site-header-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex-shrink: 0;
  order: 3;
}

.site-total-reviews {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  color: #f6f9ff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.73rem;
  white-space: nowrap;
}

.site-total-reviews-icon {
  font-size: 0.82rem;
}

.site-total-reviews-label {
  opacity: 0.95;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.12rem 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  order: 2;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.24rem 0.32rem;
  border-radius: 6px;
  line-height: 1.25;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
}

#site-footer-mount {
  margin-top: 2.5rem;
}

.site-footer {
  background: linear-gradient(90deg, #0f2e75 0%, #18429d 55%, #1f4fbf 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: #eef4ff;
  box-shadow: 0 10px 26px rgba(11, 25, 61, 0.18);
}

.site-footer-inner {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.1rem;
}

.site-footer-col h3 {
  margin: 0 0 0.55rem;
  font-size: 0.96rem;
  color: #ffffff;
}

.site-footer-col p {
  margin: 0.28rem 0;
}

.site-footer-col a {
  color: #dce8ff;
  text-decoration: none;
  font-size: 0.88rem;
}

.site-footer-col a:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (min-width: 700px) {
  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .site-footer-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header-inner {
    width: 100%;
    padding: 0.5rem 1.25rem;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    white-space: normal;
    overflow: visible;
  }

  .site-brand-block {
    width: 100%;
    justify-content: flex-start;
  }

  .site-total-reviews {
    font-size: 0.7rem;
  }

  .site-header-stats {
    width: 100%;
    margin-top: 0.35rem;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

header.hero {
  margin-bottom: 2rem;
}

header.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

header.hero .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

header.hero .intro,
header.hero .criteria {
  color: var(--muted);
  max-width: 65ch;
}

header.hero .criteria {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.disclaimer {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  color: #6b5420;
}

section {
  margin-top: 2.5rem;
}

section h2 {
  font-size: 1.15rem;
  margin: 0 0 1rem;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

table.rating {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.rating th,
table.rating td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.rating th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: bottom;
}

table.rating .th-sort {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  border-radius: 4px;
}

table.rating .th-sort:hover {
  color: var(--text);
}

table.rating .th-sort:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

table.rating .th-sort .sort-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  margin-left: 0.28em;
  font-size: 0.78em;
  font-weight: 500;
  line-height: 1;
  opacity: 0.55;
  vertical-align: middle;
}

table.rating .th-sort:hover .sort-arrows {
  opacity: 0.9;
}

table.rating .th-sort.is-active .sort-arrows {
  display: none;
}

table.rating .th-sort .sort-caret {
  display: inline;
  margin-left: 0.2em;
  font-weight: 600;
  color: var(--accent);
}

table.rating .th-sort:not(.is-active) .sort-caret {
  display: none;
}

table.rating .th-sort.is-active {
  color: var(--text);
}

table.rating tr:last-child td {
  border-bottom: none;
}

table.rating td.num {
  width: 2.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  position: relative;
  overflow: visible;
}

table.rating .rank-cell {
  position: relative;
  display: inline-block;
  min-width: 1ch;
}

table.rating .rank-cup {
  position: absolute;
  left: 100%;
  margin-left: 0.78rem;
  top: 50%;
  font-size: 0.95rem;
  line-height: 1;
  transform: translateY(-50%);
}

table.rating .rank-num {
  font-weight: 600;
}

table.rating .rank--gold .rank-cup {
  filter: saturate(1.3) drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

table.rating .rank--silver .rank-cup {
  filter: grayscale(0.85) brightness(1.22) contrast(0.92);
}

table.rating .rank--bronze .rank-cup {
  filter: sepia(0.72) hue-rotate(332deg) saturate(1.35) brightness(1.05);
}

table.rating .host-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  vertical-align: middle;
}

table.rating .host-name-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

table.rating .host-page-link {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}

table.rating .host-page-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (min-width: 640px) {
  table.rating .host-name-wrap {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
  }

  table.rating .host-page-link::before {
    content: "·";
    margin-right: 0.6rem;
    color: var(--border);
    font-weight: 400;
    text-decoration: none;
    pointer-events: none;
  }
}

table.rating .host-favicon-wrap {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

table.rating .host-favicon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

table.rating .host-favicon--placeholder {
  opacity: 0.88;
}

table.rating .rating-cell {
  white-space: nowrap;
}

footer.site {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.load-error {
  background: #fef2f2;
  border: 1px solid #f5c2c7;
  color: #9b1c1c;
  padding: 1rem;
  border-radius: 10px;
}

/* Главная витрина */
.home-rating-card {
  margin-top: 1.65rem;
}

.home-rating-card h2 {
  margin-bottom: 0.75rem;
}

.home-rating-link {
  display: inline-flex;
  margin-top: 0.75rem;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: #eef4ff;
}

.home-rating-link:hover {
  background: #e0ebff;
}

.home-comments-card {
  margin-top: 1.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.home-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.home-comments-head h2 {
  margin: 0;
}

.home-comments-badge {
  font-size: 0.78rem;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-weight: 600;
}

.home-comments-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.home-comment-item {
  background: #fff;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  box-shadow: 0 3px 10px rgba(11, 25, 61, 0.05);
}

.home-comment-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.home-comment-host {
  font-weight: 700;
  text-decoration: none;
}

.home-comment-date {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.home-comment-text {
  margin: 0.45rem 0 0.55rem;
  color: #243447;
  font-size: 0.92rem;
}

.home-comment-bottom {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
}

.home-comment-meta {
  color: #111111;
  font-size: 0.78rem;
  line-height: 1.2;
}

.home-comment-stars {
  color: #f59e0b;
  letter-spacing: 0.02em;
  font-size: 0.88rem;
  font-weight: 700;
}

.rating tbody tr.top-row td {
  font-weight: 600;
}

.rating tbody tr.top-row--gold td {
  background: linear-gradient(90deg, #fff6d7 0%, #fffbeb 100%);
}

.rating tbody tr.top-row--silver td {
  background: linear-gradient(90deg, #f2f4f7 0%, #f8fafc 100%);
}

.rating tbody tr.top-row--bronze td {
  background: linear-gradient(90deg, #fbe9da 0%, #fff3e9 100%);
}

@media (min-width: 640px) {
  table.rating {
    font-size: 0.9rem;
  }

  table.rating th,
  table.rating td {
    padding: 0.75rem 1rem;
  }
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.promo-card {
  background: #fff;
  border: 1px solid color-mix(in oklab, var(--line) 86%, #60a5fa 14%);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.promo-card-provider {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.promo-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.promo-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.promo-badge--kind {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #bae6fd;
}

.promo-badge--code {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.promo-badge--nocode {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.promo-card-text {
  margin: 0;
  color: var(--ink);
}

.promo-card-code {
  margin: 10px 0 0;
  font-weight: 600;
}

.promo-card code {
  font-size: 14px;
}

.promo-card-footer {
  margin: 14px 0 0;
}

.promo-card-link {
  font-weight: 600;
  text-decoration: none;
}

.promo-card-link:hover {
  text-decoration: underline;
}

.contact-section {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.contact-note {
  margin: 0 0 14px;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 10px;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #0f172a;
}

.contact-form textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.hp-trap {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.contact-check-block,
.contact-captcha-block {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 12px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
}

.contact-check-block label,
.contact-captcha-block label {
  color: #0f172a;
}

.contact-check-expr {
  display: inline-block;
  margin: 0 0.15em;
  padding: 0.05em 0.35em;
  border-radius: 6px;
  background: #e2e8f0;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.contact-form-msg {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.contact-form-msg.is-error {
  color: #b91c1c;
}

.contact-form-msg.is-ok {
  color: #166534;
}

.faq-section {
  margin-top: 1.5rem;
}

.faq-section h2 {
  margin-bottom: 0.9rem;
}

.seo-copy-block {
  margin-top: 1.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.05rem;
}

.seo-copy-block--before {
  margin-top: 0.35rem;
  margin-bottom: 1.2rem;
}

.seo-copy-block h2 {
  margin: 0 0 0.65rem;
  font-size: 1.08rem;
}

.seo-copy-block p {
  margin: 0.5rem 0;
  line-height: 1.55;
}

.rating-pagination {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.rating-page-btn {
  border: 1px solid #9bb7ff;
  background: #fff;
  color: #173a8f;
  border-radius: 8px;
  padding: 0.4rem 0.68rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 48, 128, 0.08);
}

.rating-page-btn:hover:not(:disabled) {
  border-color: #4f7cff;
  background: #f2f7ff;
}

.rating-page-btn.is-active {
  border-color: #2f63ff;
  background: #2f63ff;
  color: #fff;
  box-shadow: 0 6px 14px rgba(30, 84, 220, 0.28);
}

.rating-page-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1rem;
  font-weight: 600;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.faq-answer {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem 1rem;
  color: var(--muted);
}

.faq-answer p {
  margin: 0;
}
