/* ==========================================================================
   Умный дневник ХЕ — единая тема сайта (светлая и тёмная).
   Работает поверх Bootstrap 5.3: тема переключается атрибутом data-bs-theme на <html>.
   Цвета меняются в двух блоках ниже: :root (светлая) и [data-bs-theme='dark'] (тёмная).
   ========================================================================== */

/* ---------- Цвета и шрифты ---------- */
:root {
  --brand: #0e8a6a;
  --brand-rgb: 14, 138, 106;
  --accent: #ff6a4d;
  --accent-rgb: 255, 106, 77;
  --sun: #ffc247;

  --bg: #f6f3eb;
  --surface: #fffefb;
  --surface-2: #efebe1;
  --border: #e4dfd2;
  --text: #16231e;
  --muted: #67756f;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(22, 35, 30, .04), 0 14px 34px -16px rgba(22, 35, 30, .16);
  --shadow-hover: 0 1px 0 rgba(22, 35, 30, .04), 0 26px 48px -18px rgba(22, 35, 30, .26);
  --gradient: linear-gradient(135deg, #0e8a6a 0%, #11a07b 100%);
  --glow-1: rgba(14, 138, 106, .10);
  --glow-2: rgba(255, 106, 77, .09);

  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --nav-h: 64px;
  --bottom-nav-h: 68px;

  /* Bootstrap */
  --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-color-rgb: 22, 35, 30;
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--border);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: #0a6b53;
  --bs-link-hover-color-rgb: 10, 107, 83;
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
}

[data-bs-theme='dark'] {
  --brand: #34d399;
  --brand-rgb: 52, 211, 153;
  --accent: #ff8a6e;
  --accent-rgb: 255, 138, 110;

  --bg: #0a110e;
  --surface: #111a16;
  --surface-2: #172420;
  --border: #22342c;
  --text: #e8f1ec;
  --muted: #8da298;

  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 16px 36px -16px rgba(0, 0, 0, .65);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, .03), 0 28px 50px -18px rgba(0, 0, 0, .8);
  --gradient: linear-gradient(135deg, #0f9a75 0%, #0c8664 100%);
  --glow-1: rgba(52, 211, 153, .08);
  --glow-2: rgba(255, 138, 110, .06);

  --bs-body-color-rgb: 232, 241, 236;
  --bs-link-hover-color: #7ee8c0;
  --bs-link-hover-color-rgb: 126, 232, 192;
}

/* ---------- Основа ---------- */
html { scroll-behavior: smooth; overflow-y: scroll; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-weight: 500;
  background:
    radial-gradient(900px 520px at 6% -10%, var(--glow-1), transparent 60%),
    radial-gradient(760px 420px at 100% 0%, var(--glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 800; letter-spacing: -.02em; color: var(--text); }
h1, h2, .h1, .h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; }
h1 { font-size: clamp(1.55rem, 1.1rem + 1.7vw, 2.25rem); }
h2 { font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem); }

a { text-underline-offset: 3px; }
::selection { background: rgba(var(--brand-rgb), .25); }
i.bi { line-height: 1; vertical-align: -.125em; }

.site-main { flex: 1 0 auto; padding-top: 1.5rem; padding-bottom: 3rem; }
/* страницы, которые сами оборачивают содержимое в .container, не получают двойных отступов */
.site-main > .container { max-width: none; padding-left: 0; padding-right: 0; }

.text-muted, .form-text { color: var(--muted) !important; }
hr { border-color: var(--border); opacity: 1; }

/* иконка в цветной плашке и заголовок страницы с иконкой */
.icon-chip { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 15px; font-size: 1.3rem; color: var(--brand); background: rgba(var(--brand-rgb), .12); }
.icon-chip.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 1rem; }
.icon-chip.accent { color: var(--accent); background: rgba(var(--accent-rgb), .13); }
.page-title { display: flex; align-items: center; gap: .9rem; margin-bottom: .4rem; }
.page-title h1, .page-title h2 { margin: 0; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.8rem; }

/* ---------- Верхняя навигация ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
  min-height: var(--nav-h);
  display: flex; align-items: center;
}
.site-nav > .container { max-width: 1320px; display: flex; align-items: center; gap: .75rem; }
.navbar-brand { display: inline-flex; align-items: center; gap: .65rem; margin: 0; padding: 0; color: var(--text); text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #fff; border: 1px solid var(--border); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .25); }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: .95rem; letter-spacing: -.03em; line-height: 1.1; }
.brand-text small { display: block; font-family: var(--bs-body-font-family); font-weight: 700; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: .15rem; margin: 0 auto 0 1rem; padding: 0; list-style: none; }
.nav-links a, .nav-right .nav-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .8rem; border-radius: 999px;
  color: var(--text); font-weight: 700; font-size: .92rem; white-space: nowrap; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav-links a i { font-size: 1.05rem; color: var(--muted); transition: color .15s ease; }
.nav-links a:hover, .nav-right .nav-chip:hover { background: var(--surface-2); color: var(--text); }
.nav-links a:hover i { color: var(--brand); }
.nav-links a.active { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.nav-links a.active i { color: var(--brand); }
.nav-right { display: flex; align-items: center; gap: .4rem; }
.nav-right .nav-chip i { font-size: 1.15rem; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.05rem; text-decoration: none; transition: transform .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle:hover { transform: rotate(14deg) scale(1.06); }
.theme-toggle .bi-sun-fill { display: none; }
[data-bs-theme='dark'] .theme-toggle .bi-sun-fill { display: inline; }
[data-bs-theme='dark'] .theme-toggle .bi-moon-stars-fill { display: none; }

/* ---------- Нижнее меню (телефон и планшет) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  backdrop-filter: saturate(1.5) blur(16px);
  border-top: 1px solid var(--border);
}
.bottom-nav .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: .45rem 0 .3rem; border: 0; background: none; text-decoration: none;
  color: var(--muted); font-family: inherit; font-size: .68rem; font-weight: 700; line-height: 1.1;
  position: relative; transition: color .15s ease;
}
.bottom-nav .tab i { font-size: 1.4rem; transition: transform .2s ease; }
.bottom-nav .tab.active { color: var(--brand); }
.bottom-nav .tab.active i { transform: translateY(-1px); }
.bottom-nav .tab.active::before { content: ''; position: absolute; top: -.3rem; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.bottom-nav .tab-fab { flex: 0 0 auto; width: 56px; height: 56px; margin: 0 .35rem; margin-top: -26px; padding: 0; justify-content: center; border-radius: 50%; color: #fff; background: var(--gradient); box-shadow: 0 10px 24px -6px rgba(var(--brand-rgb), .6), 0 0 0 5px var(--bg); }
.bottom-nav .tab-fab i { font-size: 1.7rem; }
.bottom-nav .tab-fab:hover, .bottom-nav .tab-fab.active { color: #fff; }
.bottom-nav .tab-fab.active::before { display: none; }

.more-sheet { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-border-color: var(--border); --bs-offcanvas-height: auto; border-radius: 24px 24px 0 0; }
.more-sheet .offcanvas-header { padding-bottom: .25rem; }
.more-sheet .offcanvas-body { padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.sheet-tile { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem .5rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2); color: var(--text); font-family: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; text-align: center; }
.sheet-tile i { font-size: 1.5rem; color: var(--brand); }
.sheet-tile:hover { border-color: var(--brand); color: var(--text); }
.sheet-tile.danger i { color: #e5484d; }
.sheet-grid form { display: contents; }

@media (max-width: 1199.98px) {
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .nav-links, .nav-right .desktop-only { display: none !important; }
  .site-nav > .container { justify-content: space-between; }
  .site-main { padding-bottom: 2rem; }
  #scrollTopBtn { bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom)) !important; }
}
@media (min-width: 1200px) {
  .bottom-nav, .more-sheet { display: none !important; }
}

/* ---------- Карточки ---------- */
.card {
  --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-cap-bg: transparent;
  --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text);
}
.card.shadow, .card.shadow-sm { box-shadow: var(--shadow) !important; }
.card.border-0 { border: 1px solid var(--border) !important; }
.card-footer { background: transparent !important; border-top: 1px solid var(--border); }
.card-hover { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover) !important; border-color: rgba(var(--brand-rgb), .45) !important; }
.card .card { box-shadow: none; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--border); --bs-list-group-color: var(--text); }
.list-group-item { background: transparent; }

/* ---------- Кнопки ---------- */
.btn { font-weight: 700; border-radius: 999px; padding: .55rem 1.2rem; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; white-space: nowrap; }
.btn i { margin: 0; line-height: 1; }
.btn i.ms-1 { margin-left: 0 !important; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: .8rem 1.7rem; font-size: 1.02rem; }
.btn-sm { padding: .32rem .85rem; font-size: .85rem; }
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  --bs-btn-border-color: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-active-border-color: transparent;
  --bs-btn-bg: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-active-bg: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  background-image: var(--gradient); background-origin: border-box;
  box-shadow: 0 8px 20px -8px rgba(var(--brand-rgb), .7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(var(--brand-rgb), .85); filter: brightness(1.07); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: rgba(var(--brand-rgb), .5); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-active-color: #fff; }
[data-bs-theme='dark'] .btn-outline-primary { --bs-btn-hover-color: #06241a; --bs-btn-active-color: #06241a; }
.btn-outline-secondary, .btn-outline-dark { --bs-btn-color: var(--text); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--muted); --bs-btn-hover-color: var(--text); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--muted); }
.btn-outline-danger { --bs-btn-color: #e5484d; --bs-btn-border-color: rgba(229, 72, 77, .5); --bs-btn-hover-bg: #e5484d; --bs-btn-hover-border-color: #e5484d; }
[data-bs-theme='dark'] .btn-outline-danger { --bs-btn-color: #ff7b80; }
.btn-danger { --bs-btn-bg: #e5484d; --bs-btn-border-color: #e5484d; --bs-btn-hover-bg: #cf3a3f; --bs-btn-hover-border-color: #cf3a3f; }

/* ---------- Формы ---------- */
.form-label, label { font-weight: 700; font-size: .9rem; margin-bottom: .4rem; color: var(--text); }
.form-label i, label i { color: var(--brand); margin-right: .35rem; }
.form-control, .form-select {
  background-color: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .68rem .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control-lg { padding: .85rem 1.1rem; font-size: 1.05rem; border-radius: 16px; }
.form-control::placeholder { color: var(--muted); opacity: .75; }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--text); border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(var(--brand-rgb), .18); }
.form-control[type='file'] { padding: .5rem .75rem; }
.form-control[type='file']::file-selector-button { border: 0; border-radius: 999px; padding: .4rem .9rem; margin-right: .8rem; background: var(--surface-2); color: var(--text); font-weight: 700; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control[type='date'], .form-control[type='time'] { min-height: 48px; }

/* ---------- Таблицы ---------- */
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border);
  --bs-table-striped-bg: color-mix(in srgb, var(--surface-2) 55%, transparent); --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: rgba(var(--brand-rgb), .07); --bs-table-hover-color: var(--text);
}
.table > thead > tr > th { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; border-bottom-width: 1px; background: var(--surface-2); padding-block: .8rem; }
.table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--muted); --bs-table-border-color: var(--border); }
.table-bordered > :not(caption) > * { border-color: var(--border); }
.table-responsive { border-radius: var(--radius-sm); }

/* ---------- Прочее из Bootstrap ---------- */
.alert { border-radius: var(--radius-sm); border-width: 1px; }
.badge { font-weight: 700; border-radius: 999px; padding: .4em .75em; }
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-color: var(--brand); --bs-pagination-hover-border-color: var(--border); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-disabled-bg: var(--surface); --bs-pagination-disabled-border-color: var(--border); --bs-pagination-border-radius: 999px; }
.nav-pills { gap: .35rem; flex-wrap: wrap; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: .45rem; }
.nav-pills .nav-link:hover { color: var(--brand); }
.nav-pills .nav-link.active { background: var(--gradient); color: #fff; }
.modal-content, .dropdown-menu { background: var(--surface); border-color: var(--border); }

/* ---------- Заголовок раздела ---------- */
.page-head { text-align: center; max-width: 720px; margin: 1.25rem auto 2.5rem; }
.page-head p { color: var(--muted); font-size: 1.08rem; margin: .7rem 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .85rem; border-radius: 999px; background: rgba(var(--brand-rgb), .12); color: var(--brand); font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .9rem; }

/* ---------- Главная: экран с видео ---------- */
.hero, .band { position: relative; width: 100vw; left: 50%; margin-left: -50vw; }
.hero {
  margin-top: -1.5rem;
  min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h));
  display: grid; grid-template-rows: 1fr auto;
  overflow: hidden; isolation: isolate; color: #fff;
  /* запасной фон, пока видео не загрузилось (или файла нет) */
  background:
    radial-gradient(700px 420px at 12% 18%, rgba(255, 106, 77, .35), transparent 60%),
    radial-gradient(800px 480px at 88% 82%, rgba(255, 194, 71, .22), transparent 60%),
    linear-gradient(135deg, #0a3d31 0%, #0e6b54 55%, #14805f 120%);
}
.hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
[data-bs-theme='dark'] .hero video { filter: brightness(.62) saturate(.95); }
/* нейтральное затемнение только для читаемости текста, без цветного «стекла» */
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5, 12, 9, .58) 0%, rgba(5, 12, 9, .22) 58%, rgba(5, 12, 9, .06) 100%), linear-gradient(0deg, rgba(5, 12, 9, .62) 0%, rgba(5, 12, 9, 0) 42%); }
[data-bs-theme='dark'] .hero::after { background: linear-gradient(90deg, rgba(5, 12, 9, .66) 0%, rgba(5, 12, 9, .34) 58%, rgba(5, 12, 9, .18) 100%), linear-gradient(0deg, rgba(5, 12, 9, .78) 0%, rgba(5, 12, 9, 0) 45%); }
.hero-inner { align-self: center; width: 100%; max-width: 1140px; margin-inline: auto; padding: 3.5rem 1rem 2rem; }
.hero .chip { display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .95rem; margin-bottom: 1.5rem; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1rem + 4.6vw, 4.4rem); line-height: 1.04; letter-spacing: -.045em; max-width: 14ch; margin-bottom: 1.2rem; text-shadow: 0 6px 40px rgba(0, 0, 0, .3); }
.hero h1 em { font-style: normal; color: var(--sun); }
.hero .lead { color: rgba(255, 255, 255, .88); font-size: clamp(1.02rem, .95rem + .5vw, 1.25rem); font-weight: 500; max-width: 560px; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero .btn-light { background: #fff; color: #0a3d31; border: 0; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .5); }
.hero .btn-light:hover { transform: translateY(-2px) scale(1.02); }
.hero .btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.hero-facts { width: 100%; max-width: 1140px; margin-inline: auto; padding: 0 1rem 1.75rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.hero-fact { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.1rem; border-radius: 18px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.hero-fact i { font-size: 1.4rem; color: var(--sun); }
.hero-fact strong { display: block; font-size: .92rem; line-height: 1.2; }
.hero-fact span { font-size: .8rem; color: rgba(255, 255, 255, .78); }
@media (max-width: 767.98px) {
  .hero-facts { grid-template-columns: 1fr; gap: .5rem; padding-bottom: 1.25rem; }
  .hero-fact { padding: .65rem .9rem; }
  .hero-fact span { display: none; }
  .hero h1 { max-width: none; }
}

/* ---------- Главная: блоки ---------- */
.band { padding: 5rem 0 1rem; }
.band-inner { max-width: 1140px; margin-inline: auto; padding-inline: 1rem; }

.bento { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(190px, auto); }
.tile { position: relative; display: flex; flex-direction: column; padding: 1.5rem; color: var(--text); text-decoration: none; overflow: hidden; }
.tile:hover { color: var(--text); }
.tile h5 { font-size: 1.05rem; margin: 1.1rem 0 .35rem; }
.tile p { margin: 0; color: var(--muted); font-size: .94rem; }
.tile .go { position: absolute; right: 1.1rem; top: 1.1rem; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: all .25s ease; }
.tile:hover .go { background: var(--brand); color: #fff; transform: rotate(-45deg); }
.tile-lg { grid-column: span 2; grid-row: span 2; background: var(--gradient); border-color: transparent; color: #fff; justify-content: flex-end; box-shadow: 0 30px 60px -28px rgba(var(--brand-rgb), .8); }
.tile-lg:hover { color: #fff; }
.tile-lg::before { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 71, .55), transparent 68%); }
.tile-lg::after { content: ''; position: absolute; left: -50px; bottom: 40%; width: 180px; height: 180px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .07); }
.tile-lg .icon-chip { background: rgba(255, 255, 255, .18); color: #fff; position: relative; z-index: 1; margin-bottom: auto; }
.tile-lg .big { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); line-height: 1.02; letter-spacing: -.045em; position: relative; z-index: 1; }
.tile-lg .big small { display: block; font-family: var(--bs-body-font-family); font-size: 1rem; font-weight: 600; letter-spacing: 0; color: rgba(255, 255, 255, .8); margin-top: .8rem; max-width: 30ch; line-height: 1.45; }
.tile-lg .go { background: rgba(255, 255, 255, .2); color: #fff; z-index: 1; }
.tile-lg:hover .go { background: #fff; color: var(--brand); }
.tile-wide { grid-column: span 2; }
@media (max-width: 991.98px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-lg { grid-row: span 1; min-height: 280px; }
}
@media (max-width: 575.98px) {
  .bento { grid-template-columns: 1fr; }
  .tile-lg, .tile-wide { grid-column: auto; }
}

.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { padding: 1.6rem 1.6rem 1.5rem; }
.step .num { font-family: var(--font-display); font-weight: 600; font-size: 2.6rem; line-height: 1; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px var(--brand); margin-bottom: .9rem; display: block; }
.step strong { display: block; font-size: 1.05rem; margin-bottom: .25rem; }
.step span.t { color: var(--muted); font-size: .94rem; }

.cta { position: relative; overflow: hidden; margin-top: 3.5rem; padding: 3rem 1.5rem; border-radius: 30px; text-align: center; color: #fff; background: var(--gradient); box-shadow: 0 30px 60px -28px rgba(var(--brand-rgb), .85); }
.cta::before { content: ''; position: absolute; left: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 194, 71, .5), transparent 68%); }
.cta::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 34px solid rgba(255, 255, 255, .07); }
.cta > * { position: relative; z-index: 1; }
.cta h2 { color: #fff; margin-bottom: .6rem; }
.cta p { color: rgba(255, 255, 255, .85); margin-bottom: 1.5rem; }
.cta .btn-light { background: #fff; color: #0a3d31; border: 0; }

/* ---------- Калькулятор ---------- */
.calc-card { max-width: 880px; margin-inline: auto; padding: clamp(1.25rem, 3vw, 2.4rem); }
.calc-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 1.75rem; animation: rise .35s ease; }
.stat { padding: 1.3rem 1.5rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.stat .label { font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-weight: 600; font-size: 2.5rem; letter-spacing: -.05em; line-height: 1.1; margin-top: .35rem; }
.stat .value small { font-family: var(--bs-body-font-family); font-size: 1rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.stat.stat-xe { background: var(--gradient); border-color: transparent; color: #fff; box-shadow: 0 20px 40px -20px rgba(var(--brand-rgb), .85); }
.stat.stat-xe .label, .stat.stat-xe .value small { color: rgba(255, 255, 255, .8); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Справочник ---------- */
.sort-pills { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sort-pills .label { color: var(--muted); font-weight: 700; font-size: .88rem; margin-right: .25rem; }
.sort-pills a { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: .86rem; transition: all .15s ease; }
.sort-pills a:hover { border-color: var(--brand); color: var(--brand); }
.sort-pills a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-bs-theme='dark'] .sort-pills a.active { color: #06241a; }

/* ---------- Статьи ---------- */
.article-card { overflow: hidden; }
.article-card .cover { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; background: var(--surface-2); }
.article-card .cover-empty { aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 2.4rem; color: var(--brand); background: linear-gradient(135deg, rgba(var(--brand-rgb), .14), rgba(var(--accent-rgb), .14)); }
.article-card .card-title { font-size: 1.12rem; font-weight: 800; line-height: 1.3; color: var(--text); }
.article-card .card-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.article-card a.stretched { color: inherit; text-decoration: none; }
.meta { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .84rem; font-weight: 600; }

.article-cover { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.75rem; }
.article-body { max-width: 780px; margin-inline: auto; }
.article-content { font-size: 1.1rem; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.article-content h2, .article-content h3 { margin-top: 2.2rem; margin-bottom: .75rem; }
.article-content p { margin-bottom: 1.1rem; }
.article-content img { max-width: 100%; height: auto; border-radius: 16px; margin: 1.25rem 0; box-shadow: var(--shadow); }
.article-content figure { margin: 1.5rem 0; }
.article-content figure img { margin: 0; }
.article-content figcaption { color: var(--muted); font-size: .9rem; text-align: center; margin-top: .5rem; }
.article-content blockquote { margin: 1.5rem 0; padding: .9rem 1.25rem; border-left: 4px solid var(--brand); background: rgba(var(--brand-rgb), .07); border-radius: 0 14px 14px 0; color: var(--text); }
.article-content a { font-weight: 700; }
.article-content table { width: 100%; margin: 1.25rem 0; border-collapse: collapse; }
.article-content th, .article-content td { padding: .6rem .8rem; border: 1px solid var(--border); }
.article-content th { background: var(--surface-2); }
.article-content ul, .article-content ol { padding-left: 1.4rem; margin-bottom: 1.1rem; }
.article-content li { margin-bottom: .35rem; }

/* ---------- Календарь ---------- */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.calendar-nav h2 { margin: 0; text-transform: capitalize; }
.calendar-nav .btns { display: flex; gap: .5rem; }
.calendar-table { table-layout: fixed; border-collapse: separate; border-spacing: 6px; margin: 0 -6px; width: calc(100% + 12px); }
.calendar-table th { background: transparent; text-align: center; }
.calendar-table td { height: 108px; padding: .5rem; vertical-align: top; background: var(--surface-2); border: 1px solid var(--border) !important; border-radius: 16px; transition: border-color .15s ease, transform .15s ease; text-align: left; }
.calendar-table td:hover { border-color: var(--brand) !important; transform: translateY(-2px); }
.calendar-table td.calendar-out { background: transparent; opacity: .45; }
.calendar-day { display: flex; justify-content: space-between; align-items: center; }
.calendar-day strong { font-size: .95rem; }
.calendar-plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; text-decoration: none; font-size: .8rem; background: var(--surface); border: 1px solid var(--border); color: var(--brand); opacity: .75; }
.calendar-plus:hover { opacity: 1; background: var(--brand); color: #fff; }
.calendar-cell-body { cursor: pointer; }
.calendar-cell-body .badge { font-size: .68rem; }
.mobile-calendar { display: none; }
.mobile-day-card { border: 1px solid var(--border); border-radius: 16px; padding: .85rem 1rem; margin-bottom: .6rem; background: var(--surface-2); cursor: pointer; }
.mobile-day-card:hover { border-color: var(--brand); }
.mobile-day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.mobile-day-header strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 75%; display: block; }
.mobile-day-header a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
@media (max-width: 768px) {
  .calendar-table { display: none; }
  .mobile-calendar { display: block; }
}

/* ---------- Анализ фото ---------- */
.analyzer { max-width: 720px; margin: 1rem auto; text-align: center; }
.analyzer .page-title { justify-content: center; }
.upload-box { display: grid; gap: .4rem; place-items: center; border: 2px dashed rgba(var(--brand-rgb), .55); border-radius: var(--radius); padding: 3rem 1.25rem; background: rgba(var(--brand-rgb), .05); color: var(--text); cursor: pointer; font-size: 1.05rem; font-weight: 700; transition: all .2s ease; }
.upload-box .bi { font-size: 2.4rem; color: var(--brand); }
.upload-box small { color: var(--muted); font-weight: 500; }
.upload-box:hover, .upload-box.dragover { background: rgba(var(--brand-rgb), .11); border-color: var(--brand); transform: scale(1.01); }
.result-card { margin-top: 2rem; padding: 1.75rem; text-align: left; animation: rise .4s ease; }
.result-card h3 { font-size: 1.3rem; margin-bottom: .75rem; display: flex; align-items: center; gap: .6rem; }
.result-card p { margin-bottom: .6rem; }
.result-card ul { list-style: none; padding: 0; margin: 0; }
.result-card li { background: rgba(var(--brand-rgb), .08); border-left: 4px solid var(--brand); padding: .75rem 1rem; margin-bottom: .55rem; border-radius: 0 12px 12px 0; line-height: 1.55; }
.error-card { margin-top: 2rem; padding: 1.25rem 1.5rem; text-align: left; border-radius: var(--radius); background: rgba(229, 72, 77, .1); border: 1px solid rgba(229, 72, 77, .35); border-left-width: 5px; color: var(--text); }
.error-card h3 { font-size: 1.1rem; margin-bottom: .3rem; display: flex; align-items: center; gap: .5rem; }
.error-card p { margin: 0; }

/* ---------- Формы входа, ошибки ---------- */
.auth-card { padding: clamp(1.4rem, 3vw, 2.2rem); }
.auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head .icon-chip { width: 56px; height: 56px; border-radius: 18px; font-size: 1.6rem; margin-bottom: .9rem; }
.auth-head h1 { font-size: 1.5rem; margin: 0; }
.error-page { text-align: center; padding: 3rem 0; }
.error-page .code { font-family: var(--font-display); font-weight: 600; font-size: clamp(4rem, 3rem + 6vw, 7.5rem); line-height: 1; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px var(--brand); }
.error-page p { color: var(--muted); font-size: 1.1rem; margin: .75rem 0 1.5rem; }

/* ---------- Админка ---------- */
.ck.ck-editor { color: #16231e; }
.ck-editor__editable_inline { min-height: 360px; }

/* ---------- Подвал и кнопка «наверх» ---------- */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); padding: 1.6rem 0; color: var(--muted); font-size: .88rem; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--brand); }
#scrollTopBtn { position: fixed; right: 22px; bottom: 22px; z-index: 1000; display: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; place-items: center; font-size: 1.1rem; }
#scrollTopBtn i { margin: 0; }
#scrollTopBtn.show { display: grid; }

/* ---------- Мелочи ---------- */
.fade-in { animation: rise .45s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 575.98px) {
  .btn-lg { width: 100%; }
  .hero-actions .btn-lg { width: auto; flex: 1 1 100%; }
}

/* Компактная верхняя панель на 1200-1439px */
@media (min-width: 1200px) and (max-width: 1439.98px) {
  .brand-text small { display: none; }
  .nav-links { margin-left: .5rem; }
  .nav-links a { padding-left: .6rem; padding-right: .6rem; }
  .nav-right .nav-chip { font-size: 0; gap: 0; padding: .5rem .6rem; }
  .nav-right .nav-chip i { font-size: 1.3rem; }
}