/* Оформление страницы «Закладки»: темы, шапка, блоки (редактор и публичная страница) */

/* ---------- Цветовые темы ---------- */
.bm-page, .bm-theme-light {
  --bm-bg: #f4f6f5; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.88);
  --bm-text: #16231f; --bm-muted: #6b7a75; --bm-border: #e1e8e5; --bm-accent: #1f7a68;
  --bm-accent-soft: rgba(31,122,104,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff; --bm-shadow: 0 1px 3px rgba(20,40,30,.08);
}
.bm-theme-dark {
  --bm-bg: #12161c; --bm-card: #1b222b; --bm-card-alpha: rgba(27,34,43,.88);
  --bm-text: #e8edf2; --bm-muted: #9aa7b3; --bm-border: #2a3440; --bm-accent: #3ecf9e;
  --bm-accent-soft: rgba(62,207,158,.16); --bm-on-accent: #07211a; --bm-dim-color: #000000; --bm-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.bm-theme-blue {
  --bm-bg: #eaf1fb; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #12263f; --bm-muted: #61758f; --bm-border: #d6e2f3; --bm-accent: #2563eb;
  --bm-accent-soft: rgba(37,99,235,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-violet {
  --bm-bg: #f1edfb; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #231a3d; --bm-muted: #75698f; --bm-border: #e1d9f3; --bm-accent: #7c3aed;
  --bm-accent-soft: rgba(124,58,237,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-sunset {
  --bm-bg: #fff3ea; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3a2012; --bm-muted: #8f6f5c; --bm-border: #f5dccb; --bm-accent: #e8590c;
  --bm-accent-soft: rgba(232,89,12,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-mint {
  --bm-bg: #e8f7f2; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #0f2f27; --bm-muted: #5b8076; --bm-border: #cdebe2; --bm-accent: #0d9488;
  --bm-accent-soft: rgba(13,148,136,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-rose {
  --bm-bg: #fdeef3; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3b1626; --bm-muted: #8f6577; --bm-border: #f5d5e1; --bm-accent: #d6336c;
  --bm-accent-soft: rgba(214,51,108,.12); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-midnight {
  --bm-bg: #0f1b33; --bm-card: #172643; --bm-card-alpha: rgba(23,38,67,.88);
  --bm-text: #eaf1ff; --bm-muted: #9bb0d3; --bm-border: #263a60; --bm-accent: #5aa9ff;
  --bm-accent-soft: rgba(90,169,255,.16); --bm-on-accent: #04152e; --bm-dim-color: #000000;
}
.bm-theme-forest {
  --bm-bg: #10201a; --bm-card: #172b23; --bm-card-alpha: rgba(23,43,35,.88);
  --bm-text: #e6f3ec; --bm-muted: #93b3a3; --bm-border: #24402f; --bm-accent: #4ade80;
  --bm-accent-soft: rgba(74,222,128,.16); --bm-on-accent: #04200f; --bm-dim-color: #000000;
}

/* ---------- Ещё 20 цветовых тем ---------- */
.bm-theme-sand {
  --bm-bg: #f7f1e6; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #33281a; --bm-muted: #787168; --bm-border: #e3ddd2; --bm-accent: #92631a;
  --bm-accent-soft: rgba(146,99,26,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-sky {
  --bm-bg: #e8f4fb; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #0f2a3d; --bm-muted: #61727f; --bm-border: #d2e0e8; --bm-accent: #0369a1;
  --bm-accent-soft: rgba(3,105,161,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-lemon {
  --bm-bg: #fffbe6; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3a3008; --bm-muted: #7d765c; --bm-border: #ebe7d0; --bm-accent: #a16207;
  --bm-accent-soft: rgba(161,98,7,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-coral {
  --bm-bg: #fff1ee; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3d1a14; --bm-muted: #7f6864; --bm-border: #ecdcd8; --bm-accent: #d23f2a;
  --bm-accent-soft: rgba(210,63,42,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-lilac {
  --bm-bg: #f5eefa; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #2e1a3d; --bm-muted: #75687f; --bm-border: #e1d9e7; --bm-accent: #9d4edd;
  --bm-accent-soft: rgba(157,78,221,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-olive {
  --bm-bg: #f2f4e6; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #262c0d; --bm-muted: #70745f; --bm-border: #dee0d0; --bm-accent: #6b7f1f;
  --bm-accent-soft: rgba(107,127,31,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-ocean {
  --bm-bg: #e3f2f5; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #0c2d36; --bm-muted: #5f747a; --bm-border: #cedee2; --bm-accent: #0e7490;
  --bm-accent-soft: rgba(14,116,144,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-caramel {
  --bm-bg: #fbefdc; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3b230c; --bm-muted: #7e6e5f; --bm-border: #e8dbc7; --bm-accent: #b45309;
  --bm-accent-soft: rgba(180,83,9,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-paper {
  --bm-bg: #f5f1ea; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #27231f; --bm-muted: #706e6b; --bm-border: #e0dcd6; --bm-accent: #57534e;
  --bm-accent-soft: rgba(87,83,78,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-notebook {
  --bm-bg: #eef3fb; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #17224a; --bm-muted: #666d88; --bm-border: #d9dee9; --bm-accent: #3b5bdb;
  --bm-accent-soft: rgba(59,91,219,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-cherry {
  --bm-bg: #fbecef; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #3d0e1b; --bm-muted: #7f6069; --bm-border: #e8d6da; --bm-accent: #be123c;
  --bm-accent-soft: rgba(190,18,60,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-grass {
  --bm-bg: #eaf6e4; --bm-card: #ffffff; --bm-card-alpha: rgba(255,255,255,.9);
  --bm-text: #16300f; --bm-muted: #657661; --bm-border: #d5e2cf; --bm-accent: #357a22;
  --bm-accent-soft: rgba(53,122,34,.14); --bm-on-accent: #ffffff; --bm-dim-color: #ffffff;
}
.bm-theme-chalkboard {
  --bm-bg: #1f3a32; --bm-card: #2a4a40; --bm-card-alpha: rgba(42,74,64,.9);
  --bm-text: #f2f5ee; --bm-muted: #a2b1a8; --bm-border: #4a655c; --bm-accent: #f3e9b8;
  --bm-accent-soft: rgba(243,233,184,.14); --bm-on-accent: #24231c; --bm-dim-color: #000000;
}
.bm-theme-graphite {
  --bm-bg: #1a1d21; --bm-card: #252a30; --bm-card-alpha: rgba(37,42,48,.9);
  --bm-text: #e9ecef; --bm-muted: #9b9ea3; --bm-border: #44494f; --bm-accent: #9ca3af;
  --bm-accent-soft: rgba(156,163,175,.14); --bm-on-accent: #17181a; --bm-dim-color: #000000;
}
.bm-theme-seanight {
  --bm-bg: #0b1f2a; --bm-card: #122f3d; --bm-card-alpha: rgba(18,47,61,.9);
  --bm-text: #e3f4f6; --bm-muted: #8fa5ac; --bm-border: #334f5b; --bm-accent: #2dd4bf;
  --bm-accent-soft: rgba(45,212,191,.14); --bm-on-accent: #07201d; --bm-dim-color: #000000;
}
.bm-theme-plum {
  --bm-bg: #231528; --bm-card: #31203a; --bm-card-alpha: rgba(49,32,58,.9);
  --bm-text: #f6e8fa; --bm-muted: #a798ad; --bm-border: #514059; --bm-accent: #e879f9;
  --bm-accent-soft: rgba(232,121,249,.14); --bm-on-accent: #231225; --bm-dim-color: #000000;
}
.bm-theme-coffee {
  --bm-bg: #231a14; --bm-card: #33271e; --bm-card-alpha: rgba(51,39,30,.9);
  --bm-text: #f3e9df; --bm-muted: #a69b92; --bm-border: #52463d; --bm-accent: #d6a36a;
  --bm-accent-soft: rgba(214,163,106,.14); --bm-on-accent: #201810; --bm-dim-color: #000000;
}
.bm-theme-cosmos {
  --bm-bg: #0d0b1f; --bm-card: #191633; --bm-card-alpha: rgba(25,22,51,.9);
  --bm-text: #e9e8fb; --bm-muted: #9694ab; --bm-border: #3a3853; --bm-accent: #818cf8;
  --bm-accent-soft: rgba(129,140,248,.14); --bm-on-accent: #131525; --bm-dim-color: #000000;
}
.bm-theme-amber {
  --bm-bg: #1f1a10; --bm-card: #2e2718; --bm-card-alpha: rgba(46,39,24,.9);
  --bm-text: #f7efd9; --bm-muted: #a79f8c; --bm-border: #4e4737; --bm-accent: #fbbf24;
  --bm-accent-soft: rgba(251,191,36,.14); --bm-on-accent: #261d05; --bm-dim-color: #000000;
}
.bm-theme-bordeaux {
  --bm-bg: #2a1218; --bm-card: #3a1b23; --bm-card-alpha: rgba(58,27,35,.9);
  --bm-text: #fbe9ec; --bm-muted: #ae979c; --bm-border: #593c43; --bm-accent: #fb7185;
  --bm-accent-soft: rgba(251,113,133,.14); --bm-on-accent: #261114; --bm-dim-color: #000000;
}

/* ---------- Страница ---------- */
.bm-page {
  position: relative;
  min-height: 100vh;
  background-color: var(--bm-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--bm-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.3;
}
.bm-page *, .bm-page *::before, .bm-page *::after { box-sizing: border-box; }
.bm-page::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--bm-dim-color); opacity: 0;
}
.bm-has-bg::before { opacity: var(--bm-dim, 0); }
.bm-page > * { position: relative; z-index: 1; }
.bm-wrap { max-width: var(--bm-maxw, 1444px); margin: 0 auto; padding: 12px 8px 24px; }

/* ---------- Шапка ---------- */
.bm-header {
  width: 100%;
  background: var(--bm-card);
  border-bottom: 1px solid var(--bm-border);
  box-shadow: var(--bm-shadow);
  color: var(--bm-text);
}
.bm-has-bg .bm-header { background: var(--bm-card-alpha); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.bm-header-inner {
  max-width: var(--bm-maxw, 1444px); margin: 0 auto; padding: 10px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
}
.bm-header-logo { display: flex; align-items: center; justify-content: flex-start; min-height: 48px; }
.bm-header-logo img { max-height: 52px; max-width: 120px; object-fit: contain; }
.bm-header-name { text-align: center; font-size: clamp(16px, 2.4vw, 26px); font-weight: 700; }
.bm-header-clock { text-align: right; line-height: 1.15; }
.bm-hc-time { font-size: clamp(20px, 2.6vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; }
.bm-hc-date { font-size: clamp(11px, 1.3vw, 14px); color: var(--bm-muted); text-transform: capitalize; }
@media (max-width: 640px) {
  .bm-header-inner { grid-template-columns: auto 1fr auto; padding: 8px 10px; gap: 8px; }
  .bm-header-logo img { max-height: 36px; max-width: 60px; }
  .bm-header-name { font-size: 14px; }
}

/* ---------- Сетка публичной страницы ---------- */
.bm-grid { display: grid; grid-template-columns: repeat(14, 1fr); grid-auto-rows: var(--bm-row, 80px); }
.bm-cell { padding: 4px; min-width: 0; min-height: 0; }
.bm-view { height: 100%; }
.bm-page-empty { grid-column: 1 / -1; text-align: center; color: var(--bm-muted); padding: 60px 0; }
@media (max-width: 700px) {
  .bm-grid { display: block; }
  .bm-cell { height: calc(var(--h, 2) * 44px); }
}

/* ---------- Общий вид блока ---------- */
.bm-block {
  height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden;
  color: var(--bm-text); text-decoration: none; border-radius: 16px;
}
.bm-card {
  padding: 14px 16px;
  background: var(--bm-card); border: 1px solid var(--bm-border); box-shadow: var(--bm-shadow);
}
.bm-has-bg .bm-card { background: var(--bm-card-alpha); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.bm-block-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.bm-empty { color: var(--bm-muted); margin: auto; text-align: center; font-size: 14px; padding: 8px; }
.bm-has-bg .bm-block:not(.bm-card) { text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* ---------- Кнопка-ссылка ---------- */
a.bm-link { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.bm-link:hover { border-color: var(--bm-accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.bm-link-arrow { position: absolute; top: 10px; right: 14px; color: var(--bm-muted); font-size: 14px; }
.bm-link-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--bm-accent-soft);
}
.bm-link-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bm-link-text { min-width: 0; }
/* Обычный и большой блок: всё по центру */
.bm-link:not(.bm-link-row):not(.bm-link-tiny) { align-items: center; justify-content: center; text-align: center; }
.bm-link:not(.bm-link-row):not(.bm-link-tiny) .bm-link-text { width: 100%; }
.bm-link:not(.bm-link-row):not(.bm-link-tiny) .bm-link-icon { margin-left: auto; margin-right: auto; }
.bm-link:not(.bm-link-row):not(.bm-link-tiny) .bm-link-title,
.bm-link:not(.bm-link-row):not(.bm-link-tiny) .bm-link-desc { text-align: center; }
/* Скриншот / картинка сайта: занимает всё свободное место над названием */
.bm-link-shot:not(.bm-link-row):not(.bm-link-tiny) .bm-link-icon { margin-bottom: 8px; }
.bm-link-shot .bm-link-icon { width: 100% !important; height: auto !important; flex: 1 1 0; min-height: 40px; border-radius: 10px; }
.bm-link-shot .bm-link-icon img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; object-position: top center; }
.bm-link-letter { font-size: 22px; font-weight: 700; color: var(--bm-accent); }
.bm-link-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bm-link-desc { color: var(--bm-muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Поиск ---------- */
.bm-search { justify-content: center; padding: 0 12px; }
.bm-search-bg { position: absolute; left: 6px; top: 50%; height: 140%; aspect-ratio: 1 / 1; transform: translateY(-50%); color: var(--bm-accent); opacity: .13; pointer-events: none; }
.bm-search-bg svg { width: 100%; height: 100%; display: block; }
.bm-search-form { display: flex; align-items: stretch; gap: 8px; width: 100%; height: 90%; position: relative; z-index: 1; }
.bm-search-icon { color: var(--bm-muted); }
.bm-search-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--bm-text);
  font-size: 16px; padding: 6px 4px;
  color: var(--bm-text) !important; -webkit-text-fill-color: var(--bm-text); caret-color: var(--bm-text);
}
.bm-search-input::placeholder { color: var(--bm-muted); opacity: 1; -webkit-text-fill-color: var(--bm-muted); }
.bm-theme-dark, .bm-theme-midnight, .bm-theme-forest, .bm-theme-chalkboard, .bm-theme-graphite, .bm-theme-seanight, .bm-theme-plum, .bm-theme-coffee, .bm-theme-cosmos, .bm-theme-amber, .bm-theme-bordeaux { color-scheme: dark; }
.bm-engine {
  display: flex; align-items: center; gap: 8px; flex: none; padding: 0 12px 0 8px; cursor: pointer; font-size: 15px; font-weight: 600;
  border: 1px solid var(--bm-border); background: var(--bm-card); color: var(--bm-text); border-radius: 12px; max-width: 45%;
}
.bm-engine-static { cursor: default; }
.bm-engine-icon {
  width: 1.9em; height: 1.9em; max-height: 34px; max-width: 34px; border-radius: 50%; flex: none; color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; font-family: system-ui, sans-serif;
}
.bm-engine-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-engine-arrow { color: var(--bm-muted); font-size: 12px; }
.bm-engine-menu {
  position: fixed; z-index: 9400; padding: 6px; border-radius: 14px; min-width: 170px;
  background: var(--bm-card); color: var(--bm-text); border: 1px solid var(--bm-border); box-shadow: 0 12px 32px rgba(0,0,0,.3);
  animation: bm-pop .12s ease-out;
}
.bm-engine-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.bm-engine-item:hover, .bm-engine-item.bm-on { background: var(--bm-accent-soft); }
.bm-engine-item .bm-engine-icon { width: 30px; height: 30px; font-size: 14px; }
.bm-search-button {
  border: 0; border-radius: 12px; padding: 0 20px; cursor: pointer; font-weight: 700; font-size: 15px;
  background: var(--bm-accent); color: var(--bm-on-accent);
}

/* ---------- Погода ---------- */
.bm-weather-city { font-size: 13px; color: var(--bm-muted); font-weight: 600; }
.bm-weather-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0; }
.bm-weather-temp { font-size: 38px; font-weight: 700; line-height: 1; }
.bm-weather-icon { font-size: 44px; line-height: 1; }
.bm-weather-desc { font-size: 14px; margin-bottom: 8px; }
.bm-weather-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; }
.bm-weather-cell { display: flex; flex-direction: column; font-size: 12px; }
.bm-weather-label { color: var(--bm-muted); }
.bm-weather-value { font-weight: 600; }
.bm-weather-credit { font-size: 10.5px; color: var(--bm-muted); margin-top: 6px; }
.bm-weather-credit a { color: inherit; }

/* ---------- Часы ---------- */
.bm-clock { align-items: center; justify-content: center; }
.bm-clock svg { width: 100%; flex: 1; min-height: 0; color: var(--bm-text); }
.bm-clock-date { font-size: 12px; color: var(--bm-muted); text-transform: capitalize; text-align: center; margin-top: 4px; }
.bm-clock.bm-card { padding: 10px; }
.bm-dclock { align-items: center; justify-content: center; text-align: center; }
.bm-dclock-time { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.bm-dclock-date { color: var(--bm-muted); text-transform: capitalize; margin-top: 4px; }

/* ---------- Таймер ---------- */
.bm-timer { align-items: center; justify-content: center; text-align: center; }
.bm-timer-title { font-weight: 700; margin-bottom: 6px; }
.bm-timer-cells { display: flex; gap: 10px; justify-content: center; }
.bm-timer-cell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bm-timer-num { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; color: var(--bm-accent); }
.bm-timer-label { font-size: 11px; color: var(--bm-muted); }
.bm-timer-done { font-weight: 700; color: var(--bm-accent); }

/* ---------- Расписание звонков ---------- */
/* --bm-bells-scale задаёт настройка «Размер текста» (1 - обычный) */
.bm-bells-status { font-size: calc(18px * var(--bm-bells-scale, 1)); font-weight: 700; color: var(--bm-accent); text-align: center; }
.bm-bells-sub { font-size: calc(12.5px * var(--bm-bells-scale, 1)); color: var(--bm-muted); margin-bottom: calc(8px * var(--bm-bells-scale, 1)); text-align: center; }
.bm-bells-list { overflow: auto; flex: 1; min-height: 0; }
.bm-bell-row { display: flex; justify-content: space-between; gap: 8px; padding: calc(5px * var(--bm-bells-scale, 1)) calc(8px * var(--bm-bells-scale, 1)); border-radius: 8px; font-size: calc(13px * var(--bm-bells-scale, 1)); }
.bm-bell-row.bm-active { background: var(--bm-accent); color: var(--bm-on-accent); font-weight: 600; }
.bm-bell-time { font-variant-numeric: tabular-nums; }

/* ---------- Календарь ---------- */
.bm-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bm-cal-label { font-weight: 700; font-size: 14px; }
.bm-cal-nav { border: 0; background: var(--bm-accent-soft); color: var(--bm-accent); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1; }
.bm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; flex: 1; min-height: 0; align-content: start; }
.bm-cal-dow { font-size: 11px; color: var(--bm-muted); padding: 2px 0; }
.bm-cal-day { font-size: 12.5px; padding: 4px 0; border-radius: 8px; }
.bm-cal-day.bm-weekend { color: #e0455a; }
.bm-cal-day.bm-today { background: var(--bm-accent); color: var(--bm-on-accent); font-weight: 700; }

/* ---------- Праздники ---------- */
.bm-holiday-list { overflow: auto; flex: 1; min-height: 0; }
.bm-holiday { padding: 6px 0; border-bottom: 1px solid var(--bm-border); }
.bm-holiday:last-child { border-bottom: 0; }
.bm-holiday-date { font-size: 12px; color: var(--bm-accent); font-weight: 600; }
.bm-holiday-name { font-size: 13.5px; }
.bm-holiday.bm-today .bm-holiday-name { font-weight: 700; }

/* ---------- Курс валют ---------- */
.bm-cur-list { flex: 1; min-height: 0; overflow: auto; }
.bm-cur-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--bm-border); }
.bm-cur-row:last-child { border-bottom: 0; }
.bm-cur-code { font-weight: 700; }
.bm-cur-name { font-size: 11.5px; color: var(--bm-muted); }
.bm-cur-right { text-align: right; }
.bm-cur-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.bm-cur-diff { font-size: 11.5px; }
.bm-cur-up { color: #1f9d55; }
.bm-cur-down { color: #e0455a; }
.bm-cur-foot { font-size: 11px; color: var(--bm-muted); margin-top: 6px; }

/* ---------- Новости ---------- */
.bm-rss-list { flex: 1; min-height: 0; overflow: auto; }
.bm-rss-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bm-border); color: inherit; text-decoration: none; }
.bm-rss-item:last-child { border-bottom: 0; }
.bm-rss-item:hover .bm-rss-title { color: var(--bm-accent); }
.bm-rss-img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }
.bm-rss-date { font-size: 11px; color: var(--bm-muted); }
.bm-rss-title { font-size: 13.5px; font-weight: 600; }
.bm-rss-text { font-size: 12px; color: var(--bm-muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- Текст ---------- */
.bm-text { overflow: auto; padding: 12px 16px; box-sizing: border-box; }
.bm-text-title { font-size: 1.15em; font-weight: 700; margin: 0 0 8px; }
.bm-text-content { font-size: 15px; word-wrap: break-word; }
.bm-text-content p { margin: 0 0 .6em; }
.bm-text-content h1 { font-size: 1.8em; margin: 0 0 .4em; }
.bm-text-content h2 { font-size: 1.5em; margin: 0 0 .4em; }
.bm-text-content h3 { font-size: 1.25em; margin: 0 0 .4em; }
.bm-text-content h4 { font-size: 1.1em; margin: 0 0 .4em; }
.bm-text-content ul, .bm-text-content ol { margin: 0 0 .6em 1.3em; padding: 0; }
.bm-text-content a { color: var(--bm-accent); }
.bm-text-content table { border-collapse: collapse; max-width: 100%; margin-bottom: .6em; }
.bm-text-content td, .bm-text-content th { border: 1px solid var(--bm-border); padding: 4px 8px; vertical-align: top; }
.bm-text-content th { background: var(--bm-accent-soft); }
.bm-text-content blockquote { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--bm-accent); color: var(--bm-muted); }
.bm-text-content hr { border: 0; border-top: 1px solid var(--bm-border); }

/* ---------- Картинка ---------- */
.bm-image { background: transparent; }
.bm-img-wrap { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; }
.bm-img-slide { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.bm-img-slide.bm-on { opacity: 1; }
.bm-img-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; border: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; line-height: 1;
  opacity: 0; transition: opacity .2s;
}
.bm-image:hover .bm-img-nav { opacity: 1; }
.bm-img-prev { left: 8px; } .bm-img-next { right: 8px; }
.bm-img-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.bm-img-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; }
.bm-img-dot.bm-on { background: #fff; transform: scale(1.25); }

/* ---------- Стикер, логотип ---------- */
.bm-sticker { align-items: center; justify-content: center; }
.bm-sticker-img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.bm-logo { align-items: center; justify-content: center; text-align: center; gap: 6px; }
.bm-logo-img { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.bm-logo-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bm-logo-placeholder { font-size: 40px; }
.bm-logo-name { font-weight: 700; font-size: 14px; }

/* ---------- Видео, iframe ---------- */
.bm-video, .bm-iframe { background: #000; border-radius: 16px; }
.bm-video iframe, .bm-iframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.bm-video-stub { margin: auto auto 0; color: #fff; font-size: 20px; font-weight: 700; text-shadow: none; }
.bm-video-host { margin: 4px auto auto; color: #bbb; font-size: 12px; text-shadow: none; }
.bm-iframe { background: var(--bm-card); border: 1px solid var(--bm-border); }
.bm-iframe .bm-video-stub { color: var(--bm-text); } .bm-iframe .bm-video-host { color: var(--bm-muted); }

/* ---------- Аудио ---------- */
.bm-audio { flex-direction: row; align-items: center; gap: 10px; flex-wrap: nowrap; padding: 8px 12px; }
.bm-audio-play {
  width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer; font-size: 18px;
  background: var(--bm-accent); color: var(--bm-on-accent); display: flex; align-items: center; justify-content: center;
}
.bm-audio.bm-playing .bm-audio-play { box-shadow: 0 0 0 5px var(--bm-accent-soft); }
.bm-audio-info { flex: 1; min-width: 0; }
.bm-audio-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-audio-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--bm-muted); font-variant-numeric: tabular-nums; }
.bm-audio-hint { position: absolute; left: 12px; right: 12px; bottom: 2px; font-size: 11px; color: #e0455a; background: var(--bm-card); }
.bm-audio-hint:empty { display: none; }
.bm-audio-volbtn { flex: none; border: 0; background: transparent; font-size: 20px; cursor: pointer; padding: 4px; line-height: 1; color: var(--bm-text); }
.bm-audio-bar, .bm-audio-vol { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--bm-border); outline: 0; width: 100%; cursor: pointer; }
.bm-audio-bar::-webkit-slider-thumb, .bm-audio-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--bm-accent); border: 0; }
.bm-audio-bar::-moz-range-thumb, .bm-audio-vol::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bm-accent); border: 0; }
/* Окно громкости: вертикальная полоса поверх страницы */
.bm-audio-pop {
  position: fixed; z-index: 9999; width: 34px; padding: 10px 0; border-radius: 12px;
  background: var(--bm-card); border: 1px solid var(--bm-border); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
}
.bm-audio-pop .bm-audio-vol { writing-mode: vertical-lr; direction: rtl; width: 6px; height: 100%; }
/* Узкий и высокий блок: всё столбиком */
.bm-audio-tall { flex-direction: column; justify-content: center; padding: 10px 8px; }
.bm-audio-tall .bm-audio-info { flex: none; width: 100%; }
.bm-audio-tall .bm-audio-title { text-align: center; }
/* Блок 1x1: только кнопка */
.bm-audio-tiny { justify-content: center; padding: 6px; }
.bm-audio-tiny .bm-audio-info, .bm-audio-tiny .bm-audio-volbtn, .bm-audio-tiny .bm-audio-hint { display: none; }
.bm-audio-tiny .bm-audio-play { width: 56px; height: 56px; font-size: 22px; }

/* ---------- Документ ---------- */
.bm-document { flex-direction: row; align-items: center; gap: 12px; }
.bm-doc-tile {
  width: 52px; height: 62px; border-radius: 8px; flex: none; color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .5px;
}
.bm-doc-text { flex: 1; min-width: 0; }
.bm-doc-title { font-weight: 700; font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bm-doc-kind { font-size: 12px; color: var(--bm-muted); }
.bm-doc-button { background: var(--bm-accent); color: var(--bm-on-accent); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; text-decoration: none; flex: none; }
.bm-document.bm-doc-preview { flex-direction: column; align-items: stretch; padding: 10px; }
.bm-doc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.bm-doc-open { font-size: 13px; color: var(--bm-accent); text-decoration: none; white-space: nowrap; }
.bm-doc-frame { flex: 1; min-height: 0; width: 100%; border: 0; border-radius: 8px; background: #fff; }

/* ---------- QR ---------- */
.bm-qr { align-items: center; justify-content: center; gap: 6px; padding: 12px; }
.bm-qr-img { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 8px; }
.bm-qr-img svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; aspect-ratio: 1 / 1; }
.bm-qr-caption { font-size: 13px; font-weight: 600; text-align: center; }

/* Кнопка-ссылка в одну строку высотой (2х1): значок слева, текст справа */
.bm-link.bm-link-row { flex-direction: row; align-items: center; column-gap: 10px; padding: 6px 12px; }
.bm-link-row .bm-link-icon { width: 38px; height: 38px; margin: 0; border-radius: 10px; }
.bm-link-row .bm-link-letter { font-size: 18px; }
.bm-link-row .bm-link-text { flex: 1; min-width: 0; padding-right: 14px; }
.bm-link-row .bm-link-title { -webkit-line-clamp: 1; font-size: 14px; line-height: 1.25; }
.bm-link-row .bm-link-desc { -webkit-line-clamp: 1; font-size: 11.5px; line-height: 1.25; margin-top: 1px; }
.bm-link-row .bm-link-arrow { top: 5px; right: 9px; font-size: 12px; }
.bm-link-row.bm-link-shot .bm-link-icon { width: 68px !important; height: 100% !important; flex: none; }
/* Квадрат в одну клетку: значок и название */
.bm-link.bm-link-tiny { align-items: center; justify-content: center; text-align: center; padding: 6px; }
.bm-link-tiny .bm-link-arrow, .bm-link-tiny .bm-link-desc { display: none; }
.bm-link-tiny .bm-link-icon { width: 46px; height: 46px; margin: 0 0 3px; }
.bm-link-tiny .bm-link-text { width: 100%; }
.bm-link-tiny .bm-link-title { font-size: 11.5px; line-height: 1.2; -webkit-line-clamp: 1; }
.bm-link-tiny.bm-link-shot { padding: 0; }
.bm-link-tiny.bm-link-shot .bm-link-icon { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border-radius: 0; margin: 0; }
.bm-link-tiny.bm-link-shot .bm-link-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.bm-link-tiny.bm-link-shot .bm-link-title { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

/* Календарь меньшего размера */
.bm-cal-grid { grid-auto-rows: minmax(0, 1fr); }
.bm-cal-compact { padding: 8px 10px; }
.bm-cal-compact .bm-cal-head { margin-bottom: 2px; }
.bm-cal-compact .bm-cal-nav { width: 22px; height: 22px; font-size: 14px; }
.bm-cal-compact .bm-cal-label { font-size: 13px; }
.bm-cal-compact .bm-cal-dow { font-size: 10px; padding: 0; }
.bm-cal-compact .bm-cal-day { font-size: 11px; padding: 0; line-height: 1.5; border-radius: 5px; }
.bm-cal-tiny { padding: 5px 8px; }
.bm-cal-tiny .bm-cal-head { margin-bottom: 0; }
.bm-cal-tiny .bm-cal-nav { width: 18px; height: 18px; font-size: 12px; border-radius: 6px; }
.bm-cal-tiny .bm-cal-label { font-size: 11.5px; }
.bm-cal-tiny .bm-cal-grid { gap: 0 2px; }
.bm-cal-tiny .bm-cal-dow { font-size: 8.5px; padding: 0; line-height: 1.2; }
.bm-cal-tiny .bm-cal-day { font-size: 9.5px; padding: 0; line-height: 1.25; border-radius: 4px; }

/* Погода меньшего размера */
.bm-weather-compact, .bm-weather-tiny { padding: 10px 12px; }
.bm-weather-compact .bm-weather-temp { font-size: 30px; }
.bm-weather-compact .bm-weather-icon { font-size: 34px; }
.bm-weather-compact .bm-weather-row { margin: 2px 0; }
.bm-weather-compact .bm-weather-desc { font-size: 13px; margin-bottom: 4px; }
.bm-weather-compact .bm-weather-meta { display: none; }
.bm-weather-compact .bm-weather-credit { margin-top: auto; }
.bm-weather-tiny .bm-weather-city { font-size: 11px; }
.bm-weather-tiny .bm-weather-temp { font-size: 24px; }
.bm-weather-tiny .bm-weather-icon { font-size: 26px; }
.bm-weather-tiny .bm-weather-row { margin: 0; }
.bm-weather-tiny .bm-weather-desc { font-size: 12px; margin: 0; }
.bm-weather-tiny .bm-weather-meta { display: none; }
.bm-weather-tiny .bm-weather-credit { display: none; }

/* Просмотр PDF и Word на странице */
.bm-doc-viewer { flex: 1; min-height: 0; overflow: auto; border-radius: 8px; background: rgba(128,128,128,.12); }
.bm-doc-page { display: block; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); max-width: 100%; }
.bm-docx { background: #fff; color: #000; padding: 12px; min-height: 100%; box-sizing: border-box; }
.bm-docx * { max-width: 100%; }

/* ---------- Олимпиада ---------- */
.bm-olympiad { font-size: 16px; padding: 1.4em 1.5em; overflow: auto; gap: 0; }
.bm-oly-title { font-size: 2em; font-weight: 800; line-height: 1.1; margin-bottom: .5em; }
.bm-oly-info { display: flex; flex-wrap: wrap; gap: .6em 2.5em; margin-bottom: 1em; }
.bm-oly-label { font-size: .85em; color: var(--bm-muted); }
.bm-oly-value { font-size: 1.5em; font-weight: 800; line-height: 1.2; }
.bm-oly-shift { margin-top: .2em; font-size: .9em; font-weight: 600; color: var(--bm-accent); }
.bm-oly-note { display: flex; align-items: center; gap: 1em; padding: .9em 1em; margin-bottom: 1.1em; border-radius: 14px; background: var(--bm-accent-soft); border: 1px solid var(--bm-border); }
.bm-oly-icon { width: 3.4em; height: 3.4em; border-radius: .8em; flex: none; object-fit: cover; }
.bm-oly-note-text { font-size: 1em; line-height: 1.8; font-weight: 700; }
.bm-oly-note-text a {
  display: inline-block; padding: .1em .8em; margin: 0 .15em; border-radius: 10px; font-weight: 700; text-decoration: none;
  background: var(--bm-accent); color: var(--bm-on-accent); transition: transform .15s, box-shadow .15s;
}
.bm-oly-note-text a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.bm-oly-foot-text a { color: var(--bm-accent); text-decoration: underline; text-underline-offset: 3px; }
.bm-oly-heading { font-size: 1.05em; font-weight: 700; margin-bottom: .7em; }
.bm-oly-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5em, 1fr)); gap: .7em; }
.bm-oly-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: .8em .4em; min-height: 4.6em; border-radius: 14px; text-decoration: none;
  background: var(--bm-accent-soft); border: 1px solid var(--bm-accent); color: var(--bm-accent);
  transition: transform .15s, box-shadow .15s, background .15s;
}
a.bm-oly-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.14); background: var(--bm-accent); color: var(--bm-on-accent); }
.bm-oly-num { font-size: 2.1em; font-weight: 800; line-height: 1; }
.bm-oly-cls { font-size: .95em; margin-top: .15em; }
.bm-oly-plain { font-size: 1.1em; font-weight: 700; margin: 0; }
.bm-oly-foot { display: flex; align-items: flex-start; gap: .8em; margin-top: 1.1em; padding: .9em 1em; border-radius: 14px; border: 1px dashed var(--bm-border); color: var(--bm-muted); font-size: .85em; line-height: 1.5; }
.bm-oly-q { flex: none; width: 1.6em; height: 1.6em; border: 1px solid var(--bm-muted); border-radius: 50%; text-align: center; line-height: 1.5em; font-size: .9em; }
/* Требования с сайта олимпиады: пустой блок (данных нет) не занимает места */
.bm-oly-req:empty { display: none; }
.bm-oly-req-title { font-weight: 600; }
.bm-oly-req-line { margin-top: .15em; }
/* Значок «!» слева, как «?» у подсказки про резервную систему. При наведении - источник данных */
.bm-oly-req-mark { position: relative; font-weight: 700; cursor: help; outline: none; }
.bm-oly-req-tip {
  display: none; position: absolute; left: 0; top: 100%; margin-top: .5em; z-index: 5; white-space: nowrap;
  padding: .35em .7em; border-radius: 8px; font-size: 1em; font-weight: 400; line-height: 1.3; text-align: left;
  background: #1f2937; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.bm-oly-req-mark:hover .bm-oly-req-tip, .bm-oly-req-mark:focus .bm-oly-req-tip { display: block; }
/* Эта подсказка важнее остальных: в среднем по размеру блоке остаётся, в самом маленьком скрыта */
.bm-oly-compact .bm-oly-req:not(:empty) { display: flex; }
.bm-oly-tiny .bm-oly-req, .bm-oly-tiny .bm-oly-req:not(:empty) { display: none; }
.bm-oly-compact .bm-oly-note, .bm-oly-compact .bm-oly-foot, .bm-oly-tiny .bm-oly-note, .bm-oly-tiny .bm-oly-foot { display: none; }
.bm-oly-tiny .bm-oly-info, .bm-oly-tiny .bm-oly-heading { display: none; }
.bm-oly-tiny .bm-oly-title { font-size: 1.3em; margin-bottom: .4em; }
.bm-oly-tiny { padding: .8em 1em; }

/* ---------- Погода: узкий блок (1 клетка в ширину) ---------- */
.bm-weather-narrow { padding: 8px 8px; align-items: center; text-align: center; }
.bm-weather-narrow .bm-weather-city { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bm-weather-narrow .bm-weather-row { flex-direction: column; justify-content: center; gap: 2px; margin: 2px 0; }
.bm-weather-narrow .bm-weather-temp { font-size: 20px; }
.bm-weather-narrow .bm-weather-icon { font-size: 24px; }
.bm-weather-narrow .bm-weather-desc { font-size: 11px; margin: 0; }
.bm-weather-narrow .bm-weather-meta { display: none; }
.bm-weather-narrow .bm-weather-prefix { display: none; }

/* ---------- QR-код без подписи: заполняет блок на ~90% ---------- */
.bm-qr-plain { padding: 5%; }
.bm-qr-plain .bm-qr-img { padding: 3%; border-radius: 8px; }

/* ---------- Кнопка-ссылка со своими цветами ---------- */
.bm-link-colored .bm-link-desc, .bm-link-colored .bm-link-arrow { color: inherit; opacity: .75; }
.bm-link-colored .bm-link-letter { color: inherit; }
.bm-link-colored .bm-link-icon { background: rgba(127,127,127,.18); }

/* ---------- Стикеры поверх страницы (не привязаны к сетке) ---------- */
.bm-grid { position: relative; }
.bm-free { position: absolute; z-index: 5; pointer-events: none; left: calc(var(--bm-row, 80px) * var(--fx)); top: calc(var(--bm-row, 80px) * var(--fy)); width: calc(var(--bm-row, 80px) * var(--fw)); height: calc(var(--bm-row, 80px) * var(--fh)); }
.bm-free .bm-view { height: 100%; }
@media (max-width: 700px) { .bm-free { display: none; } }
/* Оформление «за виджетами»: уходит под все блоки страницы */
.bm-grid { isolation: isolate; }
.bm-free-back { z-index: -1; }

/* ---------- Блок «Оформление» ---------- */
.bm-deco { position: relative; width: 100%; height: 100%; pointer-events: none; }
.bm-deco-body { position: absolute; inset: 0; border-radius: 0; }
.bm-deco-round .bm-deco-body { border-radius: 22px; }
.bm-deco-ellipse .bm-deco-body { border-radius: 50%; }
.bm-deco-tape .bm-deco-body { border-radius: 3px; clip-path: polygon(0 0, 3% 12%, 0 25%, 3% 38%, 0 50%, 3% 62%, 0 75%, 3% 88%, 0 100%, 100% 100%, 97% 88%, 100% 75%, 97% 62%, 100% 50%, 97% 38%, 100% 25%, 97% 12%, 100% 0); }
.bm-deco-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.bm-deco-text { position: absolute; display: flex; align-items: center; overflow: hidden; line-height: 1.2; color: var(--bm-text); }
.bm-deco-text-inner { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }

/* ---------- Папка со ссылками ---------- */
.bm-folder { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.bm-folder:hover { border-color: var(--bm-accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.bm-folder-icon { background: transparent !important; color: #f59e0b; }
.bm-folder-icon svg { width: 100%; height: 100%; display: block; }
.bm-folder.bm-link-colored .bm-folder-icon { color: inherit; }
.bm-modal {
  position: fixed; inset: 0; z-index: 9000; background: rgba(8, 12, 20, .6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: bm-fade .15s ease-out;
}
.bm-modal-card {
  background: var(--bm-bg); color: var(--bm-text); border: 1px solid var(--bm-border); border-radius: 18px;
  width: 100%; max-width: 760px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: bm-pop .18s ease-out;
}
.bm-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bm-border); }
.bm-modal-title { flex: 1; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-modal-close { border: 0; background: var(--bm-accent-soft); color: var(--bm-text); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.bm-modal-body { padding: 16px; overflow: auto; }
.bm-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.bm-folder-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; text-align: center; text-decoration: none;
  background: var(--bm-card); color: var(--bm-text); border: 1px solid var(--bm-border); border-radius: 14px; box-shadow: var(--bm-shadow);
  transition: border-color .15s, transform .15s;
}
.bm-folder-item:hover { border-color: var(--bm-accent); transform: translateY(-2px); }
.bm-folder-item .bm-link-icon { margin: 0; }
.bm-folder-item-title { font-size: 13px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
@keyframes bm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bm-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Рандомайзер ---------- */
.bm-random { align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 10px 12px; --rnd-size: 70px; }
.bm-rnd-title { font-size: 13px; font-weight: 700; color: var(--bm-muted); }
.bm-rnd-screen { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.bm-rnd-number {
  font-size: var(--rnd-size); font-weight: 800; line-height: 1; cursor: pointer; user-select: none;
  font-variant-numeric: tabular-nums; color: var(--bm-accent);
  text-shadow: 0 4px 18px var(--bm-accent-soft);
}
.bm-rnd-spin .bm-rnd-number { filter: blur(1.2px); color: var(--bm-muted); transform: scale(.94); }
.bm-rnd-number.bm-rnd-done { animation: bm-rnd-pop .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bm-rnd-pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
.bm-rnd-conf { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 2px; opacity: 0; animation: bm-rnd-fly .95s ease-out forwards; pointer-events: none; }
@keyframes bm-rnd-fly { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(360deg); } }
.bm-rnd-history { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 22px; }
.bm-rnd-chip { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; background: var(--bm-accent-soft); color: var(--bm-muted); }
.bm-rnd-chip.bm-on { background: var(--bm-accent); color: var(--bm-on-accent); }
.bm-rnd-all { font-size: 12px; color: var(--bm-muted); }
.bm-rnd-controls { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.bm-rnd-label { font-size: 13px; color: var(--bm-muted); }
.bm-rnd-input { width: 58px; text-align: center; border: 1px solid var(--bm-border); border-radius: 10px; padding: 6px 4px; font-size: 15px; font-weight: 700; background: var(--bm-card); color: var(--bm-text); }
.bm-rnd-step, .bm-rnd-reset { width: 32px; height: 32px; border: 1px solid var(--bm-border); border-radius: 10px; background: var(--bm-card); color: var(--bm-text); font-size: 18px; cursor: pointer; line-height: 1; padding: 0; }
.bm-rnd-go { border: 0; border-radius: 12px; padding: 8px 18px; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--bm-accent); color: var(--bm-on-accent); }
.bm-rnd-compact .bm-rnd-label, .bm-rnd-compact .bm-rnd-history, .bm-rnd-compact .bm-rnd-title { display: none; }
.bm-rnd-tiny { padding: 4px; }
.bm-rnd-tiny .bm-rnd-controls, .bm-rnd-tiny .bm-rnd-history, .bm-rnd-tiny .bm-rnd-title { display: none; }

/* ---------- Секундомер ---------- */
.bm-stopwatch { align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 10px 12px; --sw-size: 44px; }
.bm-sw-time { font-size: var(--sw-size); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; cursor: pointer; user-select: none; color: var(--bm-text); }
.bm-sw-frac { font-size: .5em; color: var(--bm-muted); font-weight: 700; }
.bm-sw-running .bm-sw-main { color: var(--bm-accent); }
.bm-sw-buttons { display: flex; align-items: center; gap: 10px; }
.bm-sw-start { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--bm-accent); color: var(--bm-on-accent); font-size: 20px; cursor: pointer; }
.bm-sw-running .bm-sw-start { box-shadow: 0 0 0 5px var(--bm-accent-soft); }
.bm-sw-small { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--bm-border); background: var(--bm-card); color: var(--bm-text); font-size: 16px; cursor: pointer; padding: 0; }
.bm-sw-laps { display: none; width: 100%; max-height: 40%; overflow: auto; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bm-sw-laps-on .bm-sw-laps { display: block; }
.bm-sw-lap { display: flex; justify-content: space-between; gap: 8px; padding: 2px 4px; border-top: 1px solid var(--bm-border); }
.bm-sw-lap-n { color: var(--bm-muted); width: 24px; text-align: left; }
.bm-sw-lap-t { color: var(--bm-muted); }
.bm-sw-tiny { padding: 4px; gap: 4px; }
.bm-sw-tiny .bm-sw-frac { display: none; }
.bm-sw-tiny .bm-sw-start { width: 34px; height: 34px; font-size: 14px; }
.bm-sw-tiny .bm-sw-small { display: none; }

/* ---------- Шкала шума ---------- */
.bm-noise { border-radius: 16px; background: #0b1026; color: #fff; box-shadow: 0 8px 28px rgba(60, 20, 140, .35); }
.bm-noise-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bm-noise-start {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 22px; border: 0; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 0 0 0 rgba(236, 72, 153, .7); animation: bm-noise-pulse 1.8s infinite;
}
.bm-noise-mic { font-size: 32px; line-height: 1; }
@keyframes bm-noise-pulse { 0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, .6); } 70% { box-shadow: 0 0 0 22px rgba(236, 72, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); } }
.bm-noise-message { position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 2; text-align: center; font-size: 12px; color: #ffb4c0; }
.bm-noise-message:empty { display: none; }
.bm-noise-stop { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font-size: 12px; padding: 0; }
.bm-noise-stop:hover { background: rgba(255,255,255,.25); }
@media (max-width: 160px) { .bm-noise-start-text { display: none; } }

/* ---------- Экранная клавиатура ---------- */
.bm-osk {
  position: fixed; z-index: 9500; padding: 8px; border-radius: 16px; user-select: none;
  background: var(--bm-bg); border: 1px solid var(--bm-border); box-shadow: 0 14px 40px rgba(0,0,0,.35);
  animation: bm-pop .15s ease-out;
}
.bm-osk-row { display: flex; justify-content: center; gap: 5px; margin-bottom: 5px; }
.bm-osk-row:last-child { margin-bottom: 0; }
.bm-osk-key {
  flex: 1 1 0; min-width: 0; height: 46px; border: 1px solid var(--bm-border); border-radius: 10px; cursor: pointer;
  background: var(--bm-card); color: var(--bm-text); font-size: 18px; font-weight: 600; padding: 0;
  touch-action: manipulation;
}
.bm-osk-key:active { background: var(--bm-accent-soft); }
.bm-osk-key.bm-on { background: var(--bm-accent); color: var(--bm-on-accent); }
.bm-osk-wide { flex: 1.5 1 0; }
.bm-osk-space { flex: 5 1 0; font-size: 14px; color: var(--bm-muted); }
.bm-osk-enter { background: var(--bm-accent); color: var(--bm-on-accent); font-size: 15px; }
@media (max-width: 500px) { .bm-osk-key { height: 40px; font-size: 16px; } }

/* Кнопка-ссылка: фото на весь фон */
.bm-link.bm-link-cover { padding: 0; overflow: hidden; position: relative; }
.bm-link-photo { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .25s; }
a.bm-link-cover:hover .bm-link-photo { transform: scale(1.04); }
.bm-link-cover .bm-link-cover-text { position: absolute; left: 0; right: 0; bottom: 0; width: auto; padding: 28px 12px 10px; text-align: left; color: #fff;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.55) 40%, rgba(0,0,0,.78)); }
.bm-link-cover .bm-link-title { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); text-align: left; }
.bm-link-cover .bm-link-desc { color: rgba(255,255,255,.88); text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bm-link-cover-0 .bm-link-cover-text { display: none; }
.bm-link-cover-1 .bm-link-desc { display: none; }

/* Папка с паролем */
.bm-folder-lock { position: absolute; top: 8px; right: 12px; font-size: 13px; opacity: .8; }
.bm-folder-pass { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 12px 4px; }
.bm-folder-pass-text { width: 100%; text-align: center; font-weight: 600; margin-bottom: 4px; }
.bm-folder-pass-input { flex: 1 1 160px; max-width: 260px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--bm-border, rgba(128,128,128,.4)); background: var(--bm-card, #fff); color: var(--bm-text, inherit); font-size: 15px; }
.bm-folder-pass-btn { padding: 9px 18px; border: 0; border-radius: 10px; background: var(--bm-accent); color: var(--bm-on-accent, #fff); font-weight: 600; cursor: pointer; font-size: 15px; }
.bm-folder-pass-btn:disabled { opacity: .6; cursor: wait; }
.bm-folder-pass-error { width: 100%; text-align: center; color: #d33; font-size: 13px; min-height: 1.2em; }

/* Перетаскиваемая клавиатура */
.bm-osk-grip { cursor: move; text-align: center; font-size: 12px; letter-spacing: 1px; opacity: .6; padding: 2px 0 6px; user-select: none; touch-action: none; }
.bm-osk-grip:hover { opacity: 1; }

/* ---------- Лампочка ---------- */
.bm-lamp { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; color: inherit; }
div.bm-lamp { cursor: move; }
.bm-lamp-svg { height: 100%; width: 100%; overflow: visible; transition: filter .35s; }
.bm-lamp-s1 { stop-color: #f4f6f9; transition: stop-color .35s; }
.bm-lamp-s2 { stop-color: #dfe5ec; transition: stop-color .35s; }
.bm-lamp-s3 { stop-color: #b8c2cf; transition: stop-color .35s; }
.bm-lamp-glass { stroke: #98a3b1; stroke-width: 3; opacity: .92; }
.bm-lamp-shine { stroke: rgba(255,255,255,.75); }
.bm-lamp-wire { stroke: #6b7482; transition: stroke .3s; }
.bm-lamp-rays { stroke: #ffd43b; opacity: 0; transition: opacity .35s; }
.bm-lamp-halo { opacity: 0; transition: opacity .35s; }
.bm-lamp-on .bm-lamp-s1 { stop-color: #fffef0; }
.bm-lamp-on .bm-lamp-s2 { stop-color: #ffe56a; }
.bm-lamp-on .bm-lamp-s3 { stop-color: #ffb81c; }
.bm-lamp-on .bm-lamp-glass { stroke: #f5a700; }
.bm-lamp-on .bm-lamp-wire { stroke: #fff6c2; }
.bm-lamp-on .bm-lamp-rays, .bm-lamp-on .bm-lamp-halo { opacity: 1; }
.bm-lamp:active .bm-lamp-svg { transform: scale(.97); }

/* Просмотр Excel и PowerPoint */
.bm-xlsx { background: #fff; color: #000; min-height: 100%; box-sizing: border-box; }
.bm-xlsx-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #eef1f4; position: sticky; top: 0; }
.bm-xlsx-tab { border: 1px solid #c7ced6; background: #fff; color: #222; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.bm-xlsx-tab.bm-on { background: #217346; border-color: #217346; color: #fff; }
.bm-xlsx-body { overflow: auto; padding: 8px; }
.bm-xlsx-body table { border-collapse: collapse; font-size: 13px; }
.bm-xlsx-body td, .bm-xlsx-body th { border: 1px solid #d0d5db; padding: 3px 7px; white-space: nowrap; }

.bm-doc-viewer.bm-pptx-holder { overflow: hidden; background: rgba(0,0,0,.85); }
.bm-pptx-wrap { display: flex; flex-direction: column; height: 100%; outline: none; }
.bm-pptx-view { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: pointer; }
.bm-pptx-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.4); }
.bm-pptx-nav { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px; color: #fff; font-size: 13px; background: rgba(0,0,0,.35); }
.bm-pptx-btn { border: 0; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff; width: 36px; height: 28px; cursor: pointer; font-size: 13px; }
.bm-pptx-btn:hover:not(:disabled) { background: rgba(255,255,255,.35); }
.bm-pptx-btn:disabled { opacity: .35; cursor: default; }
.bm-pptx-counter { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Объявление ---------- */
.bm-ann-overlay { position: fixed; inset: 0; z-index: 9800; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(8, 14, 28, .58); animation: bm-ann-fade .25s ease-out; }
@keyframes bm-ann-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bm-ann-pop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.bm-ann-card { box-sizing: border-box; max-width: 100%; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; padding: 22px 26px; border-radius: 20px;
  background: var(--bm-card, #fff); color: var(--bm-text, #16231f); box-shadow: 0 24px 70px rgba(0,0,0,.45); animation: bm-ann-pop .3s ease-out; }
.bm-ann-title { font-size: 1.5em; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.bm-ann-body { flex: 1; font-size: 1.05em; }
.bm-ann-footer { display: flex; justify-content: center; margin-top: 18px; }
.bm-ann-button { min-width: 150px; padding: 12px 28px; border: 0; border-radius: 14px; background: var(--bm-accent, #1f7a68); color: var(--bm-on-accent, #fff); font-size: 1.05em; font-weight: 700; cursor: pointer; transition: transform .12s, filter .12s; }
.bm-ann-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.bm-ann-button:focus-visible { outline: 3px solid rgba(255,255,255,.7); outline-offset: 2px; }
.bm-announce-bell { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #f59e0b; background: rgba(255,255,255,.92); border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: move; }
.bm-announce-bell svg { width: 62%; height: 62%; }
.bm-announce-badge { position: absolute; top: 6%; right: 6%; width: 28%; height: 28%; min-width: 12px; min-height: 12px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Автооткрытие: кнопка, если браузер не дал открыть вкладки сам */
.bm-autoopen-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2147483000;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 12px 10px 12px 18px;
  background: #16231f; color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-size: 14px; line-height: 1.35; font-family: inherit;
}
.bm-autoopen-text { flex: 1; }
.bm-autoopen-go { flex: none; padding: 8px 14px; border: 0; border-radius: 10px; background: #1f7a68; color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.bm-autoopen-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }

/* ---------- Колесо фортуны ---------- */
.bm-wheel { display: flex; flex-direction: column; align-items: center; padding: 10px; gap: 6px; box-sizing: border-box; height: 100%; }
.bm-wheel-title { font-weight: 800; font-size: 15px; text-align: center; color: var(--bm-text); }
.bm-wheel-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.bm-wheel-wrap { position: relative; }
.bm-wheel-canvas { display: block; border-radius: 50%; }
.bm-wheel-pointer { position: absolute; left: 50%; top: -4px; transform: translateX(-50%); width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-top: 18px solid #1e293b; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.bm-wheel-result { font-weight: 700; font-size: 14px; min-height: 20px; color: var(--bm-accent); text-align: center; }
.bm-wheel-go { padding: 8px 18px; border: 0; border-radius: 999px; background: var(--bm-accent); color: var(--bm-on-accent); font-weight: 700; font-size: 14px; cursor: pointer; }
.bm-wheel-go:disabled { opacity: .5; cursor: default; }

/* ---------- Баллы команд ---------- */
.bm-scores { padding: 10px 12px; box-sizing: border-box; height: 100%; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.bm-scores-title { font-weight: 800; font-size: 15px; color: var(--bm-text); }
.bm-scores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; overflow: auto; min-height: 0; flex: 1; align-content: start; }
.bm-scores-card { position: relative; border: 1px solid var(--bm-border); border-top: 4px solid #f59e0b; border-radius: 12px; padding: 8px; background: var(--bm-card); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bm-scores-leader { box-shadow: 0 0 0 2px #f59e0b inset; }
.bm-scores-name { font-size: 13px; font-weight: 700; color: var(--bm-text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-scores-value { font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--bm-text); font-variant-numeric: tabular-nums; }
.bm-scores-row { display: flex; gap: 6px; }
.bm-scores-step { width: 34px; height: 30px; border: 1px solid var(--bm-border); border-radius: 8px; background: var(--bm-card); color: var(--bm-text); font-size: 18px; font-weight: 700; cursor: pointer; }
.bm-scores-plus { background: var(--bm-accent); color: var(--bm-on-accent); border-color: transparent; }
.bm-scores-del { position: absolute; top: 2px; right: 4px; border: 0; background: transparent; color: var(--bm-muted); font-size: 15px; cursor: pointer; line-height: 1; }
.bm-scores-add { display: flex; gap: 6px; }
.bm-scores-input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--bm-border); border-radius: 8px; background: var(--bm-card); color: var(--bm-text); font-size: 13px; font-family: inherit; }
.bm-scores-addbtn { flex: none; padding: 6px 10px; border: 0; border-radius: 8px; background: var(--bm-accent); color: var(--bm-on-accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.bm-scores-message { font-size: 12px; color: #e0455a; min-height: 0; }
.bm-scores-message:empty { display: none; }
.bm-scores-reset { align-self: flex-start; padding: 5px 10px; border: 1px solid var(--bm-border); border-radius: 8px; background: transparent; color: var(--bm-muted); font-size: 12px; cursor: pointer; }
.bm-scores-empty { font-size: 13px; color: var(--bm-muted); }

/* ---------- Светофор класса ---------- */
.bm-traffic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; box-sizing: border-box; height: 100%; }
.bm-traffic-title { font-weight: 800; font-size: 14px; text-align: center; color: var(--bm-text); }
.bm-traffic-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; background: #1e293b; flex: 0 1 auto; min-height: 0; }
.bm-traffic-light { width: clamp(36px, 22vmin, 64px); height: clamp(36px, 22vmin, 64px); border-radius: 50%; border: 3px solid #0f172a; cursor: pointer; opacity: .22; transition: opacity .2s, box-shadow .2s, transform .2s; padding: 0; }
.bm-traffic-light.bm-traffic-on { opacity: 1; transform: scale(1.06); box-shadow: 0 0 22px currentColor; }
.bm-traffic-red { background: #ef4444; color: #ef4444; }
.bm-traffic-yellow { background: #facc15; color: #facc15; }
.bm-traffic-green { background: #22c55e; color: #22c55e; }
.bm-traffic-caption { font-size: 13px; font-weight: 600; text-align: center; color: var(--bm-text); }

/* ---------- Обратный отсчёт ---------- */
.bm-countdown { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; box-sizing: border-box; height: 100%; text-align: center; }
.bm-cd-title { font-weight: 800; font-size: 15px; color: var(--bm-text); }
.bm-cd-number { font-size: clamp(34px, 18vmin, 80px); font-weight: 900; line-height: 1; color: var(--bm-accent); font-variant-numeric: tabular-nums; }
.bm-cd-sub { font-size: 14px; color: var(--bm-muted); }

/* ---------- Оцени урок (три смайлика) ---------- */
.bm-fingers { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; box-sizing: border-box; height: 100%; min-height: 0; overflow: hidden; }
.bm-fg-title { font-weight: 800; font-size: 15px; color: var(--bm-text); }
.bm-fg-grid { display: flex; align-items: center; justify-content: space-around; gap: 6px; flex: 1; min-height: 40px; }
.bm-fg-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; cursor: pointer; padding: 2px 6px; border-radius: 12px; min-height: 0; transition: transform .15s; }
.bm-fg-btn:hover { transform: scale(1.08); }
.bm-fg-btn:active { transform: scale(.95); }
.bm-fg-num { font-size: clamp(22px, 8vmin, 44px); line-height: 1.05; }
.bm-fg-count { font-size: 12px; font-weight: 700; color: var(--bm-muted); font-variant-numeric: tabular-nums; }
.bm-fg-btn.bm-fg-lead .bm-fg-count { color: var(--bm-accent); }
.bm-fg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bm-fg-summary { font-size: 13px; font-weight: 600; color: var(--bm-text); min-height: 16px; }
.bm-fg-reset { flex: none; padding: 3px 9px; border: 1px solid var(--bm-border); border-radius: 8px; background: transparent; color: var(--bm-muted); font-size: 12px; cursor: pointer; }

/* ---------- Шкала шума: шестерёнка с настройкой ---------- */
.bm-noise { position: relative; }
.bm-noise-gear { position: absolute; top: 8px; left: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font-size: 15px; padding: 0; line-height: 1; }
.bm-noise-gear:hover { background: rgba(255,255,255,.25); }
.bm-noise-panel { position: absolute; top: 44px; left: 8px; z-index: 4; width: min(250px, calc(100% - 16px)); box-sizing: border-box; padding: 12px; border-radius: 12px; background: #1e1b3a; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 10px 30px rgba(0,0,0,.5); color: #fff; font-size: 13px; }
.bm-noise-panel-title { font-weight: 700; margin-bottom: 8px; }
.bm-noise-sens { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.bm-noise-sens-btn { flex: 1; padding: 5px 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font-size: 12px; cursor: pointer; }
.bm-noise-sens-btn.bm-noise-on { background: #3ecf9e; border-color: #3ecf9e; color: #0b1026; font-weight: 700; }
.bm-noise-thr-label { margin-bottom: 4px; }
.bm-noise-slider { width: 100%; }
.bm-noise-reset { margin-top: 8px; padding: 0; border: 0; background: transparent; color: #9ad9c4; font-size: 12px; text-decoration: underline; cursor: pointer; }

/* ---------- Календарь: цифры по центру ячейки ---------- */
.bm-cal-grid { grid-template-rows: auto; align-content: stretch; }
.bm-cal-day { display: flex; align-items: center; justify-content: center; min-height: 0; }

/* ---------- Модальное окно (виджет «Модальное окно») ---------- */
.bm-modalbtn .bm-folder-icon { color: var(--bm-accent); }
.bm-modal-card.bm-msize-sm { max-width: 480px; }
.bm-modal-card.bm-msize-md { max-width: 720px; }
.bm-modal-card.bm-msize-lg { max-width: 960px; }
.bm-modal-card.bm-msize-xl { max-width: 1200px; }
.bm-modal-card.bm-msize-full { max-width: none; height: calc(100vh - 32px); }
.bm-modal-card[class*="bm-msize-"] .bm-modal-body { flex: 1; min-height: 0; }
.bm-modal-grid { padding: 0; }
.bm-modal-grid .bm-page-empty { padding: 40px 0; }

/* ---------- Виджет «Заявки» (модуль helpdesk) ---------- */
.bm-helpdesk { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 14px; height: 100%; }
.bm-hd-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bm-hd-icon { width: 48px; height: 48px; flex-shrink: 0; color: var(--bm-accent); }
.bm-hd-icon svg { width: 100%; height: 100%; display: block; }
.bm-hd-text { min-width: 0; }
.bm-hd-title { font-weight: 700; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.bm-hd-desc { font-size: 13px; opacity: .75; line-height: 1.3; }
.bm-hd-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-hd-btn { flex: 1 1 120px; border: 2px solid var(--bm-accent); background: transparent; color: var(--bm-accent); border-radius: 12px; padding: 9px 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .1s, opacity .2s; }
.bm-hd-btn.primary { background: var(--bm-accent); color: #fff; }
.bm-hd-btn:hover { opacity: .9; }
.bm-hd-btn:active { transform: scale(.98); }
.bm-helpdesk.bm-hd-compact { flex-direction: row; align-items: center; padding: 8px 12px; }
.bm-helpdesk.bm-hd-compact .bm-hd-icon { width: 34px; height: 34px; }
.bm-helpdesk.bm-hd-compact .bm-hd-desc { display: none; }
.bm-helpdesk.bm-hd-compact .bm-hd-buttons { flex-wrap: nowrap; margin-left: auto; }
.bm-helpdesk.bm-hd-compact .bm-hd-btn { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }
.bm-helpdesk.bm-hd-narrow .bm-hd-icon { display: none; }
.bm-hd-frame { display: block; width: 100%; height: min(78vh, 900px); border: 0; border-radius: 12px; background: transparent; }
