/* Фрибет Гид — light editorial theme. BEM, prefix fb- */
:root {
  --fb-green: #0a7d4f;
  --fb-green-dark: #075c3a;
  --fb-green-soft: #e7f4ee;
  --fb-bg: #fbfaf7;
  --fb-surface: #ffffff;
  --fb-text: #1c2421;
  --fb-muted: #55615c;
  --fb-line: #e3e1da;
  --fb-warn: #8a4b00;
  --fb-warn-soft: #fff4e2;
  --fb-radius: 12px;
  --fb-radius-sm: 8px;
  --fb-shadow: 0 1px 2px rgba(20, 30, 25, .05), 0 4px 16px rgba(20, 30, 25, .05);
  --fb-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fb-serif: Georgia, "Times New Roman", "PT Serif", serif;
  --fb-wrap: 1180px;
  --fb-gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--fb-bg);
  color: var(--fb-text);
  font: 16px/1.65 var(--fb-font);
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--fb-green); text-underline-offset: 2px; }
a:hover { color: var(--fb-green-dark); }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--fb-serif); line-height: 1.25; color: #111917; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); margin: 0 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .5em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

.fb-wrap { max-width: var(--fb-wrap); margin: 0 auto; padding: 0 var(--fb-gutter); }
.fb-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fb-skip { position: absolute; left: 8px; top: -60px; background: var(--fb-green); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.fb-skip:focus { top: 8px; color: #fff; }

/* Top bar & header */
.fb-topbar { background: #1c2421; color: #e9efec; font-size: .8rem; padding: 6px 0; text-align: center; }
.fb-header { background: var(--fb-surface); border-bottom: 1px solid var(--fb-line); position: sticky; top: 0; z-index: 20; }
.fb-header__inner { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.fb-header__logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fb-text); flex-shrink: 0; }
.fb-header__mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--fb-green); color: #fff; font-weight: 700; font-size: .9rem; }
.fb-header__brand { font-family: var(--fb-serif); font-weight: 700; font-size: 1.2rem; }
.fb-nav { flex: 1; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fb-nav::-webkit-scrollbar { display: none; }
.fb-nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; justify-content: flex-end; }
.fb-nav__link { display: block; padding: 8px 10px; color: var(--fb-text); text-decoration: none; font-size: .93rem; border-radius: 6px; white-space: nowrap; }
.fb-nav__link:hover { background: var(--fb-green-soft); color: var(--fb-green-dark); }

@media (max-width: 860px) {
  .fb-header__inner { flex-wrap: wrap; gap: 0; padding-top: 8px; }
  .fb-nav { flex-basis: 100%; margin: 0 calc(-1 * var(--fb-gutter)); padding: 0 var(--fb-gutter) 4px; }
  .fb-nav__list { justify-content: flex-start; }
}

/* Breadcrumbs */
.fb-crumbs { margin: 18px 0 8px; font-size: .88rem; color: var(--fb-muted); }
.fb-crumbs__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.fb-crumbs__item + .fb-crumbs__item::before { content: "›"; margin: 0 8px; color: #9aa39f; }

/* Hero */
.fb-hero { padding: 8px 0 24px; border-bottom: 1px solid var(--fb-line); }
.fb-hero__title { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); margin: 0 0 16px; max-width: 900px; }
.fb-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.fb-meta__text { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9rem; color: var(--fb-muted); }
.fb-avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--fb-green-soft); color: var(--fb-green-dark); font-weight: 700; font-size: .85rem; border: 1px solid #c9e5d7; }
.fb-avatar--lg { width: 56px; height: 56px; font-size: 1.05rem; }
.fb-hero__intro { max-width: 820px; }
.fb-lead { font-size: 1.12rem; }
.fb-hero__stats { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.fb-hero__stats li { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius-sm); padding: 10px 16px; font-size: .9rem; color: var(--fb-muted); }
.fb-hero__stats strong { display: block; color: var(--fb-green); font-size: 1.25rem; font-family: var(--fb-serif); }

/* Sections */
.fb-section { padding: 40px 0 8px; scroll-margin-top: 80px; }
.fb-section__desc { color: var(--fb-muted); max-width: 760px; }
.fb-note { font-size: .85rem; color: var(--fb-muted); margin-top: 12px; }

/* Buttons */
.fb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px; border: 1px solid transparent; border-radius: var(--fb-radius-sm);
  font: 600 .95rem/1.2 var(--fb-font); text-decoration: none; cursor: pointer; transition: background .15s;
}
.fb-btn--primary { background: var(--fb-green); color: #fff; }
.fb-btn--primary:hover { background: var(--fb-green-dark); color: #fff; }
.fb-btn--sm { min-height: 36px; padding: 7px 14px; font-size: .88rem; }
.fb-btn--block { width: 100%; }

/* Tables */
.fb-table-wrap { overflow-x: auto; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); box-shadow: var(--fb-shadow); margin: 12px 0; }
.fb-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.fb-table caption { text-align: left; padding: 12px 16px 0; font-weight: 600; color: var(--fb-muted); font-size: .88rem; }
.fb-table th, .fb-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--fb-line); vertical-align: middle; }
.fb-table thead th { background: #f4f2ec; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--fb-muted); }
.fb-table tbody tr:last-child > * { border-bottom: 0; }
.fb-top th[scope="row"] { white-space: nowrap; font-weight: 600; }
.fb-top th[scope="row"] a { color: var(--fb-text); }
.fb-top__rank { font-family: var(--fb-serif); font-weight: 700; color: var(--fb-green); font-size: 1.15rem; }

@media (max-width: 640px) {
  .fb-top thead { display: none; }
  .fb-top, .fb-top tbody, .fb-top tr, .fb-top td, .fb-top th { display: block; }
  .fb-top tr { display: grid; grid-template-columns: 32px 1fr auto; gap: 4px 10px; padding: 14px 16px; border-bottom: 1px solid var(--fb-line); }
  .fb-top tr:last-child { border-bottom: 0; }
  .fb-top td, .fb-top th { padding: 0; border: 0; }
  .fb-top__rank { grid-row: span 2; }
  .fb-top td:nth-child(3) { text-align: right; }
  .fb-top td:nth-child(4), .fb-top td:nth-child(5), .fb-top td:nth-child(6) { grid-column: 2 / 4; font-size: .85rem; color: var(--fb-muted); }
  .fb-top td:nth-child(5)::before { content: "Коэф.: "; }
  .fb-top td:nth-child(6)::before { content: "Срок: "; }
  .fb-top td:last-child { grid-column: 1 / 4; margin-top: 6px; }
  .fb-top td:last-child .fb-btn { width: 100%; }
}

/* Logo badge */
.fb-logo { --fb-badge: var(--fb-green); display: inline-grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 10px; background: var(--fb-badge); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.fb-logo--sm { width: 28px; height: 28px; border-radius: 6px; font-size: .68rem; vertical-align: middle; margin-right: 6px; }

/* Filters */
.fb-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.fb-filters__group { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-filters__btn { min-height: 40px; padding: 8px 16px; border: 1px solid var(--fb-line); border-radius: 999px; background: var(--fb-surface); color: var(--fb-text); font: 500 .92rem var(--fb-font); cursor: pointer; }
.fb-filters__btn:hover { border-color: var(--fb-green); }
.fb-filters__btn.is-active { background: var(--fb-green); border-color: var(--fb-green); color: #fff; }
.fb-filters__count { margin: 0; font-size: .9rem; color: var(--fb-muted); }

/* Card grid */
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 20px; }
.fb-card { display: flex; flex-direction: column; gap: 10px; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 18px; box-shadow: var(--fb-shadow); scroll-margin-top: 90px; }
.fb-card[hidden] { display: none; }
.fb-card:target { outline: 2px solid var(--fb-green); }
.fb-card__head { display: flex; align-items: center; gap: 12px; }
.fb-card__name { flex: 1; min-width: 0; }
.fb-card__title { font-family: var(--fb-font); font-size: 1.05rem; margin: 0; }
.fb-card__site { margin: 0; font-size: .82rem; color: var(--fb-muted); }
.fb-card__ad { font-size: .7rem; color: var(--fb-muted); border: 1px solid var(--fb-line); border-radius: 4px; padding: 2px 6px; white-space: nowrap; align-self: flex-start; }
.fb-card__amount { margin: 4px 0 0; font-family: var(--fb-serif); font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--fb-green); }
.fb-card__sub { margin: 0; font-size: .88rem; color: var(--fb-muted); }
.fb-card__type { margin: 0; font-size: .9rem; }
.fb-tag { display: inline-block; background: var(--fb-green-soft); color: var(--fb-green-dark); font-weight: 600; font-size: .78rem; padding: 2px 8px; border-radius: 4px; margin-right: 4px; }
.fb-card__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.fb-card__facts div { background: #f7f6f2; border-radius: 6px; padding: 6px 10px; }
.fb-card__facts dt { font-size: .72rem; color: var(--fb-muted); text-transform: uppercase; letter-spacing: .03em; }
.fb-card__facts dd { margin: 0; font-weight: 600; font-size: .9rem; }
.fb-card__badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fb-badge { display: inline-block; font-size: .74rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--fb-line); color: var(--fb-muted); }
.fb-badge--cupis { border-color: #b9dccb; color: var(--fb-green-dark); background: var(--fb-green-soft); font-weight: 600; }
.fb-promo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px dashed #b9c4bf; border-radius: var(--fb-radius-sm); padding: 6px 6px 6px 10px; }
.fb-promo__label { font-size: .82rem; color: var(--fb-muted); }
.fb-promo__code { flex: 1; font-weight: 700; font-size: .9rem; min-width: 0; }
.fb-promo__copy { min-height: 34px; padding: 6px 12px; border: 1px solid var(--fb-green); border-radius: 6px; background: transparent; color: var(--fb-green-dark); font: 600 .82rem var(--fb-font); cursor: pointer; }
.fb-promo__copy:hover, .fb-promo__copy.is-done { background: var(--fb-green); color: #fff; }
.fb-card__details { font-size: .88rem; border-top: 1px solid var(--fb-line); padding-top: 8px; }
.fb-card__details summary { cursor: pointer; font-weight: 600; color: var(--fb-green-dark); padding: 4px 0; }
.fb-card__details p { margin: 8px 0 0; }
.fb-card__note { color: var(--fb-warn); font-size: .82rem; }
.fb-card__legal { margin: auto 0 0; font-size: .75rem; color: var(--fb-muted); }

/* Calculator */
.fb-calc__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; align-items: end; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 20px; box-shadow: var(--fb-shadow); }
.fb-calc__result { grid-column: 1 / -1; background: var(--fb-green-soft); border-radius: var(--fb-radius-sm); padding: 14px 16px; }
.fb-calc__line { margin: 0; }
.fb-calc__line--muted { color: var(--fb-muted); font-size: .92rem; margin-top: 4px; }
.fb-calc__value { font-family: var(--fb-serif); font-size: 1.6rem; font-weight: 700; color: var(--fb-green-dark); }

/* Fields */
.fb-field { display: flex; flex-direction: column; gap: 6px; }
.fb-field__label { font-size: .88rem; font-weight: 600; }
.fb-field__input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c8cdc9; border-radius: var(--fb-radius-sm); background: #fff; color: var(--fb-text); font: 1rem var(--fb-font); }
.fb-field__input:focus { border-color: var(--fb-green); }
.fb-field__input--area { min-height: 110px; resize: vertical; }
.fb-field--check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: .88rem; }
.fb-field--check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--fb-green); flex-shrink: 0; }

/* Guide with sticky TOC */
.fb-guide { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 40px 0 8px; scroll-margin-top: 80px; }
.fb-toc__inner { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 18px 20px; }
.fb-toc__title { font-size: 1.1rem; margin: 0 0 10px; }
.fb-toc__list { margin: 0; padding-left: 20px; font-size: .92rem; }
.fb-toc__list li { margin: 4px 0; }
.fb-toc__link { color: var(--fb-text); text-decoration: none; }
.fb-toc__link:hover, .fb-toc__link.is-current { color: var(--fb-green); text-decoration: underline; }
.fb-guide__body { min-width: 0; max-width: 760px; font-size: 1.04rem; }
.fb-guide__body section { scroll-margin-top: 80px; }
.fb-guide__body h2 { margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--fb-line); }
.fb-guide__body section:first-child h2 { margin-top: 0; border-top: 0; padding-top: 0; }
.fb-guide__body ul, .fb-guide__body ol { padding-left: 1.3em; }
.fb-guide__body li { margin: .4em 0; }
.fb-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.fb-steps__item { counter-increment: step; position: relative; padding: 12px 14px 12px 56px; margin: 10px 0; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius-sm); }
.fb-steps__item::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--fb-green); color: #fff; font-weight: 700; font-size: .9rem; }
.fb-steps__name { display: block; }

@media (min-width: 1024px) {
  .fb-guide { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; }
  .fb-toc__inner { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
}

/* Expert */
.fb-expert__figure { margin: 0; background: var(--fb-surface); border-left: 4px solid var(--fb-green); border-radius: var(--fb-radius); padding: 24px; box-shadow: var(--fb-shadow); }
.fb-expert__quote { margin: 0 0 16px; font-family: var(--fb-serif); font-size: 1.15rem; line-height: 1.6; }
.fb-expert__by { display: flex; align-items: center; gap: 12px; font-size: .92rem; color: var(--fb-muted); }
.fb-expert__by strong { color: var(--fb-text); }

/* Reviews */
.fb-reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.fb-review { margin: 0; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 18px; }
.fb-review__text { margin: 0 0 10px; font-size: .95rem; }
.fb-review__by { font-size: .82rem; color: var(--fb-muted); }

/* FAQ */
.fb-faq__item { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius-sm); margin: 0 0 10px; }
.fb-faq__q { cursor: pointer; padding: 14px 48px 14px 18px; position: relative; list-style: none; }
.fb-faq__q::-webkit-details-marker { display: none; }
.fb-faq__q::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--fb-green); }
.fb-faq__item[open] > .fb-faq__q::after { content: "−"; }
.fb-faq__title { display: inline; margin: 0; font-family: var(--fb-font); font-size: 1rem; font-weight: 600; }
.fb-faq__a { padding: 0 18px 4px; color: #333d39; }

/* About */
.fb-about__grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .fb-about__grid { grid-template-columns: 2fr 1fr; } }
.fb-about__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fb-about__facts li { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius-sm); padding: 12px 16px; color: var(--fb-muted); font-size: .9rem; }
.fb-about__facts strong { display: block; font-family: var(--fb-serif); color: var(--fb-green); font-size: 1.3rem; }
.fb-about__subtitle { scroll-margin-top: 80px; }
.fb-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.fb-person { display: flex; gap: 14px; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 16px; }
.fb-person__name { font-weight: 700; margin: 0 0 4px; }
.fb-person__role { margin: 0; font-size: .9rem; color: var(--fb-muted); }
.fb-check { padding-left: 1.3em; }

/* Contacts */
.fb-contacts__grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 860px) { .fb-contacts__grid { grid-template-columns: 1fr 1.3fr; } }
.fb-contacts__info { font-style: normal; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 20px; }
.fb-contacts__info p { margin: 0 0 8px; }
.fb-contacts__label { color: var(--fb-muted); font-size: .88rem; display: inline-block; min-width: 110px; }
.fb-form { display: grid; gap: 14px; background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 20px; }
.fb-form .fb-btn { justify-self: start; }
.fb-form__status { margin: 0; font-size: .9rem; min-height: 1.4em; }
.fb-form__status.is-error { color: #b3261e; }
.fb-form__status.is-ok { color: var(--fb-green-dark); }

/* Legal */
.fb-legal__doc { background: var(--fb-surface); border: 1px solid var(--fb-line); border-radius: var(--fb-radius-sm); padding: 12px 18px; margin-bottom: 10px; scroll-margin-top: 80px; }
.fb-legal__doc summary { cursor: pointer; font-weight: 600; }
.fb-legal__doc p { margin: 10px 0 0; font-size: .92rem; color: var(--fb-muted); }

/* Footer */
.fb-footer { margin-top: 48px; background: #f1efe8; border-top: 1px solid var(--fb-line); padding: 36px 0 90px; font-size: .9rem; color: var(--fb-muted); }
.fb-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 24px; }
.fb-footer__brand { font-family: var(--fb-serif); font-weight: 700; font-size: 1.2rem; color: var(--fb-text); margin-bottom: 6px; }
.fb-footer__head { font-weight: 700; color: var(--fb-text); margin-bottom: 8px; }
.fb-footer__links, .fb-footer__social { list-style: none; margin: 0; padding: 0; }
.fb-footer__links li { margin: 4px 0; }
.fb-footer__social { display: flex; gap: 14px; }
.fb-footer a { color: var(--fb-green-dark); }
.fb-footer__warn { display: flex; gap: 14px; align-items: flex-start; margin-top: 28px; padding: 14px 16px; background: var(--fb-warn-soft); border-radius: var(--fb-radius-sm); color: #5a3a10; }
.fb-footer__warn p { margin: 0; }
.fb-footer__age { flex-shrink: 0; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--fb-warn); color: var(--fb-warn); font-weight: 800; }
.fb-footer__copy { margin: 18px 0 0; font-size: .82rem; }

/* Cookie banner */
.fb-cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 14px; background: #1c2421; color: #eef3f0; padding: 14px 16px; border-radius: var(--fb-radius); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.fb-cookie__text { margin: 0; font-size: .88rem; flex: 1; }
.fb-cookie a { color: #8fe0bb; }
@media (max-width: 480px) { .fb-cookie { flex-direction: column; align-items: stretch; } }
