.fl-wrap {
  --fl-bg: #ffffff;
  --fl-panel: #f4f6f8;
  --fl-border: #d9dee3;
  --fl-text: #1f2a33;
  --fl-muted: #6b7782;
  --fl-head: #2f4858;
  --fl-head-text: #ffffff;
  --fl-link: #0b6fa4;
  --fl-ok: #2e8b57;
  --fl-bad: #c0392b;
  --fl-stripe: #f8fafb;
  --fl-new: #fff6cc;
  --fl-sel: #e6f2fa;
  font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--fl-text);
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}
/* блочные темы ограничивают ширину контента (~650px) — панели нужна вся ширина */
.is-layout-constrained > .fl-wrap, .entry-content > .fl-wrap, .fl-wrap.alignwide {
  max-width: min(1200px, 100%) !important;
  width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}
.fl-wrap *, .fl-wrap *::before, .fl-wrap *::after { box-sizing: border-box; }
.fl-wrap a { color: var(--fl-link); text-decoration: none; }
.fl-wrap a:hover { text-decoration: underline; }
.fl-wrap input[type="text"], .fl-wrap select, .fl-wrap textarea {
  border: 1px solid var(--fl-border); border-radius: 4px; padding: 4px 6px; font: inherit; background: #fff; color: var(--fl-text);
  min-height: 30px; margin: 0;
}

/* --- калькулятор --- */
.fl-calc { background: var(--fl-panel); border: 1px solid var(--fl-border); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; overflow-x: auto; }
.fl-calc-head { min-height: 22px; margin-bottom: 6px; font-size: 13px; }
.fl-c-pct { font-weight: 600; margin-right: 6px; }
.fl-c-pct.pos { color: var(--fl-ok); }
.fl-c-pct.neg { color: var(--fl-bad); }
.fl-calc-body { display: flex; align-items: flex-end; gap: 8px; }
.fl-calc-table { border-collapse: collapse; margin: 0; width: auto; border: 0; }
.fl-calc-table td { padding: 3px 5px; border: 0; vertical-align: middle; white-space: nowrap; background: transparent; }
.fl-calc-table thead td { text-align: center; color: var(--fl-muted); font-size: 13px; }
.fl-calc-table thead td[title] { color: var(--fl-link); cursor: help; }
.fl-c-bk { display: inline-block; min-width: 130px; padding: 4px 8px; border: 1px solid var(--fl-border); border-radius: 4px; background: #fff; color: var(--fl-text) !important; }
.fl-c-mk { display: inline-block; min-width: 110px; }
.fl-num { width: 72px; }
.fl-num-sm { width: 46px; }
.fl-calc-table input[type="checkbox"], .fl-calc-table input[type="radio"] { margin: 0 6px; }
.fl-calc-act { margin-left: auto; display: flex; gap: 4px; }
.fl-badge { display: inline-block; min-width: 42px; text-align: center; padding: 2px 6px; border-radius: 3px; font-size: 12px; font-weight: 600; color: #fff; background: var(--fl-muted); }
.fl-badge-ok { background: var(--fl-ok); }
.fl-badge-bad { background: var(--fl-bad); }

/* --- кнопки --- */
.fl-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; min-height: 32px; border: 1px solid var(--fl-border); border-radius: 4px; background: #fff; color: var(--fl-text); cursor: pointer; font: inherit; white-space: nowrap; }
.fl-btn:hover { background: #eef2f5; }
.fl-btn.active { background: #dfe6ec; box-shadow: inset 0 2px 4px rgba(0,0,0,.12); }
.fl-btn-primary { background: var(--fl-head); border-color: var(--fl-head); color: #fff; }
.fl-btn-primary:hover { background: #3b5a6e; }
.fl-icon-btn { border: 0; background: none; padding: 0 2px; cursor: pointer; font-size: 16px; line-height: 1; color: var(--fl-muted); vertical-align: middle; }
.fl-icon-btn:hover { color: var(--fl-text); }
.fl-link { border: 0; background: none; padding: 0; color: var(--fl-link); cursor: pointer; font: inherit; }

/* --- панель --- */
.fl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fl-sel { width: auto; }
.fl-search { display: inline-flex; }
.fl-search input { width: 220px; border-radius: 4px 0 0 4px !important; }
.fl-search button { border: 1px solid var(--fl-border); border-left: 0; background: #eef2f5; border-radius: 0 4px 4px 0; padding: 0 9px; cursor: pointer; }
.fl-spacer { flex: 1; }
.fl-filter-state { font-size: 12px; background: #dfe6ec; border-radius: 3px; padding: 2px 6px; }
.fl-filter-state:empty { display: none; }
.fl-loader { height: 2px; margin-bottom: 6px; background: transparent; overflow: hidden; position: relative; }
.fl-loader.on::after { content: ""; position: absolute; left: -30%; width: 30%; height: 100%; background: var(--fl-link); animation: fl-load 0.8s linear infinite; }
@keyframes fl-load { to { left: 100%; } }

.fl-alert { padding: 10px 36px 10px 14px; border-radius: 4px; margin: 8px 0 12px; position: relative; border: 1px solid; }
.fl-alert-error { background: #fbeaea; border-color: #f0c4c4; color: #8a2a2a; }
.fl-alert-info { background: #e9f3fa; border-color: #c4dcef; color: #20506f; }
.fl-alert-success { background: #e8f5ec; border-color: #bfe2c9; color: #23603a; }
.fl-close { position: absolute; right: 10px; top: 6px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* --- таблица вилок --- */
.fl-grid-wrap { width: 100%; overflow-x: auto; }
.fl-grid { width: 100%; border-collapse: collapse; border: 1px solid var(--fl-border); margin: 0; }
.fl-grid th { background: var(--fl-head); color: var(--fl-head-text); text-align: left; padding: 7px 8px; font-weight: 600; border: 1px solid #3d5a6c; }
.fl-grid td { padding: 6px 8px; border: 1px solid var(--fl-border); vertical-align: top; font-size: 13.5px; background: var(--fl-bg); }
.fl-grid tbody tr:nth-child(even) td { background: var(--fl-stripe); }
.fl-grid tr.fl-new td { background: var(--fl-new) !important; transition: background 2s; }
.fl-grid tr.fl-selected td { background: var(--fl-sel) !important; }
.fl-grid tr.fl-is-hidden td { opacity: .5; }
.fl-act { width: 92px; white-space: nowrap; }
.fl-sport { font-size: 15px; vertical-align: middle; cursor: default; }
.fl-age { text-align: center; font-size: 11px; color: var(--fl-link); margin-top: 2px; }
.fl-pct { white-space: nowrap; }
.fl-masked .fl-pct { border-left: 3px solid var(--fl-bad); }
.fl-ev small { color: var(--fl-muted); }
.fl-ev-hidden { color: var(--fl-muted); }
.fl-copy-ev { font-size: 13px; float: left; margin-right: 4px; }
.fl-nw { white-space: nowrap; }
.fl-ext { color: var(--fl-muted); margin-right: 4px; font-size: 12px; }
.fl-sub { font-size: 10px; color: var(--fl-link); margin-left: 1px; }
.fl-coef { white-space: nowrap; padding-right: 10px !important; }
.fl-up { color: var(--fl-ok); font-size: 10px; margin-right: 2px; }
.fl-down { color: var(--fl-bad); font-size: 10px; margin-right: 2px; }
.fl-empty { text-align: center; color: var(--fl-muted); padding: 24px !important; }

/* --- модалка фильтров --- */
.fl-modal { position: fixed; inset: 0; background: rgba(20,30,40,.45); z-index: 99999; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.fl-modal[hidden] { display: none; }
.fl-modal-box { background: #fff; border-radius: 6px; width: 100%; max-width: 760px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.fl-modal-head { padding: 12px 16px; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--fl-border); position: relative; }
.fl-modal-body { padding: 12px 16px; max-height: 65vh; overflow-y: auto; }
.fl-modal-foot { padding: 10px 16px; border-top: 1px solid var(--fl-border); display: flex; justify-content: flex-end; gap: 8px; }
.fl-modal fieldset { border: 1px solid var(--fl-border); border-radius: 4px; padding: 8px 12px 10px; margin: 0 0 10px; }
.fl-modal legend { padding: 0 4px; font-weight: 600; font-size: 13px; }
.fl-inline { font-weight: normal; margin-left: 8px; }
.fl-f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 10px; }
.fl-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 10px; margin-bottom: 6px; }
.fl-checks label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fl-toast { position: fixed; right: 16px; bottom: 16px; background: #24323d; color: #fff; padding: 10px 14px; border-radius: 4px; z-index: 100000; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fl-toast-err { background: var(--fl-bad); }
.fl-toast[hidden] { display: none; }

/* --- тарифы / кабинет --- */
.fl-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.fl-plan { border: 1px solid var(--fl-border); border-radius: 6px; padding: 16px; text-align: center; background: var(--fl-panel); }
.fl-plan-name { font-weight: 600; font-size: 16px; }
.fl-plan-price { font-size: 22px; font-weight: 700; color: var(--fl-head); margin: 6px 0; }
.fl-plan-days { color: var(--fl-muted); font-size: 13px; }
.fl-pay-info { background: var(--fl-panel); border-left: 3px solid var(--fl-head); padding: 10px 14px; margin-bottom: 16px; }
.fl-req-form { max-width: 520px; display: grid; gap: 10px; }
.fl-req-form label { display: grid; gap: 4px; font-size: 13px; color: var(--fl-muted); }
.fl-req-form input, .fl-req-form select, .fl-req-form textarea { width: 100%; }
.fl-req-msg.ok { color: var(--fl-ok); }
.fl-req-msg.err { color: var(--fl-bad); }
.fl-simple { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.fl-simple th, .fl-simple td { border: 1px solid var(--fl-border); padding: 6px 8px; text-align: left; font-size: 13px; }
.fl-simple th { background: var(--fl-panel); }

@media (max-width: 760px) {
  .fl-hide-sm { display: none; }
  .fl-calc { padding: 10px; }
  .fl-calc-body { flex-direction: column; align-items: stretch; }
  .fl-c-bk { min-width: 0; }
  .fl-search input { width: 150px; }
  .fl-spacer { display: none; }
  /* таблица не сжимается в нечитаемую колонку — листается по горизонтали */
  .fl-grid { min-width: 760px; }
  .fl-ev { min-width: 280px; }
  .fl-grid-wrap { -webkit-overflow-scrolling: touch; }
}
