/* ЭО ККТ — light-first theme, calm UI */

:root {
  --bg-dark: #fafdf8;
  --bg-card: #ffffff;
  --bg-card2: #f5f9f1;
  --bg-shape: #e8f5e8;
  --accent: #4caf45;
  --accent2: #6bcf5f;
  --accent-purple: #4b5563;
  --accent-green: #4caf45;
  --accent-red: #b42318;
  --accent-yellow: #b54708;
  --text-primary: #1c1917;
  --text-muted: #6b7368;
  --border: rgba(28, 25, 23, 0.1);
  --border-accent: rgba(76, 175, 69, 0.35);
  --glow: none;
  --glow-green: none;
  --glow-red: none;
  --shadow-card: 0 1px 2px rgba(28, 25, 23, 0.04), 0 8px 24px rgba(28, 25, 23, 0.05);
  --accent-grad: linear-gradient(135deg, #4caf45, #3d8f38);
  --accent-rgb: 76, 175, 69;
  --radius: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --transition: 0.25s ease;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html {
  touch-action: auto;
  -ms-touch-action: auto;
}
html, body {
  overflow-x: clip;
  overflow-y: auto;
}

html.theme-dark {
  color-scheme: dark;
  background: var(--bg-dark, #161b17);
  --bg-dark: #161b17;
  --bg-card: #222a24;
  --bg-card2: #2c362f;
  --bg-shape: #1c231e;
  --accent: #6dcc63;
  --accent2: #9ee296;
  --accent-purple: #a8b5a6;
  --accent-green: #6dcc63;
  --accent-red: #f07167;
  --accent-yellow: #e8b949;
  --text-primary: #f4f8f1;
  --text-muted: #c5d0c2;
  --border: rgba(244, 248, 241, 0.14);
  --border-accent: rgba(109, 204, 99, 0.42);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.32);
  --bs-body-color: var(--text-primary);
  --bs-secondary-color: var(--text-muted);
  --accent-grad: linear-gradient(135deg, #6dcc63, #4caf45);
  --accent-rgb: 109, 204, 99;
}

/* Live list search + right filter panel */
.list-page { margin-bottom: 1.25rem; }
.card .list-page { margin-bottom: 0; }
.list-page__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}
.list-page__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.list-page__main { min-width: 0; }
.list-page--no-panel .list-page__body { grid-template-columns: 1fr; }
.list-page--no-panel .list-filter-panel { display: none !important; }
.list-search__field {
  position: relative;
  flex: 1 1 240px;
  max-width: 520px;
  display: block;
  margin: 0;
}
.list-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  padding: 0 1rem;
  border-radius: 14px;
  border: 1px solid rgba(76, 175, 69, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: #2e7d32;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
html.theme-dark .list-filter-toggle {
  background: rgba(26, 29, 38, 0.92);
}
.list-filter-panel {
  position: sticky;
  top: 4.2rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.08);
}
html.theme-dark .list-filter-panel {
  background: var(--bg-card);
  border-color: rgba(109, 204, 99, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
html.theme-dark .list-filter-panel::before,
html.theme-dark .chat-members-panel::before,
html.chat-theme-dark .chat-members-panel::before {
  background: rgba(255, 255, 255, 0.22);
}
.list-filter-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}
.list-filter-panel__head strong {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.list-filter-panel__close,
.kkt-drawer-close {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 0.85rem 0 0.45rem;
  border: none;
  border-radius: 12px;
  background: rgba(76, 175, 69, 0.12);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  pointer-events: auto;
}
.list-filter-panel__close i,
.kkt-drawer-close i {
  font-size: 1.2rem;
  line-height: 1;
}
.kkt-drawer-close {
  display: inline-flex;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}
.list-filter-field {
  display: block;
  margin-bottom: 0.75rem;
}
.list-filter-field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.list-filter-select {
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 2.4rem 0 0.85rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(76, 175, 69, 0.22) !important;
  background-color: #f7faf5 !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #2e7d32 50%),
    linear-gradient(135deg, #2e7d32 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  color: var(--text-primary) !important;
  font: inherit;
  font-size: 0.9rem !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.05);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.list-filter-select:hover {
  border-color: rgba(76, 175, 69, 0.45) !important;
  background-color: #fff !important;
}
.list-filter-select:focus {
  outline: none;
  border-color: var(--accent, #4caf45) !important;
  box-shadow: 0 0 0 4px rgba(76, 175, 69, 0.16) !important;
  background-color: #fff !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #2e7d32 50%),
    linear-gradient(135deg, #2e7d32 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px) !important;
  background-size: 6px 6px, 6px 6px !important;
}
.list-filter-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.list-filter-select option {
  color: #1b4332 !important;
  background: #fff !important;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
}
.list-filter-select option:checked,
.list-filter-select option:hover {
  background: #e8f5e9 !important;
  color: #1b5e20 !important;
}
html.theme-dark .list-filter-select {
  background-color: var(--bg-card2) !important;
  border-color: rgba(76, 175, 69, 0.3) !important;
  color: var(--text-primary) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #a5d6a7 50%),
    linear-gradient(135deg, #a5d6a7 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px) !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
  box-shadow: none;
}
html.theme-dark .list-filter-select:hover,
html.theme-dark .list-filter-select:focus {
  background-color: #2a332c !important;
}
html.theme-dark .list-filter-select option {
  color: #e8f5e9 !important;
  background: #1a1d26 !important;
}
html.theme-dark .list-filter-select option:checked {
  background: #2e4a32 !important;
  color: #c8e6c9 !important;
}
.list-filter-panel__reset {
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
}
.list-filter-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1350;
  background: rgba(20, 30, 22, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.list-filter-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}
body.list-filter-open { overflow: hidden; }
body.list-filter-open .fab-wrap,
body.list-filter-open .chat-float-btn,
body.chat-members-open .fab-wrap,
body.chat-members-open .chat-float-btn {
  visibility: hidden;
  pointer-events: none;
}
@media (max-width: 991px) {
  .list-page__body { grid-template-columns: 1fr; }
  .list-filter-toggle { display: inline-flex; }
  .list-filter-backdrop {
    z-index: 20040;
  }
  .list-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 90vw);
    z-index: 20050;
    margin: 0;
    padding: calc(0.95rem + env(safe-area-inset-top, 0px)) 1.15rem calc(1.35rem + env(safe-area-inset-bottom, 0px) + 4.6rem);
    border-radius: 22px 0 0 22px;
    border-right: 0;
    background: var(--bg-card);
    box-shadow: -18px 0 40px rgba(20, 30, 22, 0.22);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .list-filter-panel.is-open { transform: translateX(0); }
  .list-filter-panel::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 50%;
    width: 4px;
    height: 3rem;
    margin-top: -1.5rem;
    border-radius: 999px;
    background: rgba(28, 25, 23, 0.16);
    pointer-events: none;
  }
  .list-filter-panel__close,
  .kkt-drawer-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .list-filter-panel__close {
    order: 1;
    position: relative;
    z-index: 3;
  }
  .list-filter-panel__head {
    position: sticky;
    top: 0;
    margin: 0 0 0.95rem;
    padding: 0.15rem 0 0.75rem;
    background: var(--bg-card);
    z-index: 2;
  }
  .list-filter-panel__head strong {
    order: 2;
    margin-left: auto;
    margin-right: 0;
  }
}
.list-page__toolbar {
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 175, 69, 0.16);
  box-shadow: 0 6px 18px rgba(76, 175, 69, 0.06);
}
html.theme-dark .list-page__toolbar {
  background: rgba(26, 29, 38, 0.88);
  border-color: rgba(76, 175, 69, 0.22);
}
.list-search__field > .bi-search {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}
.list-search__input {
  width: 100%;
  height: 44px;
  padding: 0 2.4rem 0 2.45rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.list-search__input::placeholder { color: var(--text-muted); }
.list-search__input:hover { border-color: rgba(76, 175, 69, 0.35); }
.list-search__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(76, 175, 69, 0.14);
  background: #fff;
}
.list-search__clear {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.list-search__clear:hover {
  background: rgba(76, 175, 69, 0.1);
  color: var(--accent);
}
.list-search__meta {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(76, 175, 69, 0.1);
}
html.theme-dark .list-search__input {
  background: rgba(26, 29, 38, 0.92);
}
html.theme-dark .list-search__input:focus {
  background: var(--bg-card);
}

/* RDR-style honor / reputation bar */
.honor-bar {
  width: 100%;
  margin: 0.35rem 0 0.65rem;
}
.honor-bar__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.honor-bar__title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.honor-bar__score {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--text-primary);
}
.honor-bar__track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}
.honor-bar__gradient {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  /* Красное слева → широкая жёлтая зона у 0 → зелёное справа */
  background: linear-gradient(
    90deg,
    #b71c1c 0%,
    #e53935 10%,
    #ff9800 22%,
    #ffc107 32%,
    #ffeb3b 42%,
    #fff176 48%,
    #ffee58 50%,
    #fff176 52%,
    #ffeb3b 58%,
    #cddc39 68%,
    #8bc34a 78%,
    #43a047 90%,
    #2e7d32 100%
  );
}
.honor-bar__center {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  z-index: 1;
  pointer-events: none;
}
.honor-bar__marker {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 22px;
  margin-left: -2px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
  z-index: 2;
  transition: left .35s ease;
}
.honor-bar__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.28rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.honor-bar__labels span:first-child { color: #c62828; }
.honor-bar__labels span:last-child { color: #2e7d32; }

/* Rating pages */
.rating-page { max-width: 860px; margin: 0 auto; }
.rating-page--filtered { max-width: 1100px; }
.rating-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.rating-layout__main { min-width: 0; }
.rating-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 175, 69, 0.16);
  box-shadow: 0 6px 18px rgba(76, 175, 69, 0.06);
}
html.theme-dark .rating-toolbar {
  background: rgba(26, 29, 38, 0.88);
  border-color: rgba(76, 175, 69, 0.22);
}
.rating-search { flex: 1 1 220px; max-width: 420px; }
.rating-filter-panel { position: sticky; top: 4.2rem; }
.rating-row__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -0.1rem 0 0.35rem;
  font-weight: 650;
}
@media (max-width: 991px) {
  .rating-layout { grid-template-columns: 1fr; }
  .rating-filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 1400;
    border-radius: 16px 0 0 16px;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
  }
  .rating-filter-panel.is-open { transform: translateX(0); }
  .rating-page--filtered .list-filter-toggle { display: inline-flex; }
  .rating-page--filtered .list-filter-panel__close { display: inline-flex; align-items: center; justify-content: center; }
}
.rating-page__lead {
  color: var(--text-muted);
  margin: -0.55rem 0 1.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 42rem;
}
.rating-page__empty { color: var(--text-muted); margin: 0; }
.rating-seg {
  display: inline-flex;
  padding: 0.28rem;
  gap: 0.2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 175, 69, 0.18);
  box-shadow: 0 6px 18px rgba(76, 175, 69, 0.06);
  margin-bottom: 1.15rem;
}
html.theme-dark .rating-seg {
  background: rgba(26, 29, 38, 0.9);
  border-color: rgba(76, 175, 69, 0.24);
}
.rating-seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.rating-seg__btn:hover { color: var(--text-primary); background: rgba(76, 175, 69, 0.08); }
.rating-seg__btn.is-active {
  color: #1b5e20;
  background: #fff;
  box-shadow: 0 4px 14px rgba(76, 175, 69, 0.18);
}
html.theme-dark .rating-seg__btn.is-active {
  color: #c8e6c9;
  background: rgba(76, 175, 69, 0.22);
}
.rating-seg__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(76, 175, 69, 0.12);
  color: #2e7d32;
}
.rating-seg__btn.is-active .rating-seg__count {
  background: rgba(76, 175, 69, 0.2);
}
.rating-board {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.07);
  overflow: hidden;
}
html.theme-dark .rating-board {
  background: rgba(26, 29, 38, 0.92);
  border-color: rgba(76, 175, 69, 0.22);
}
.rating-board__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(76, 175, 69, 0.12);
}
.rating-board__head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.rating-board__head span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 650;
}
.rating-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.5rem 0.55rem;
}
.rating-list__empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.rating-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.7rem;
  border-radius: 14px;
  transition: background .15s ease;
}
.rating-row:hover { background: rgba(76, 175, 69, 0.07); }
.rating-row__place {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.92rem;
  background: rgba(76, 175, 69, 0.1);
  color: #2e7d32;
}
.rating-row--top-1 .rating-row__place {
  background: linear-gradient(145deg, #ffe082, #ffca28);
  color: #5d4037;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
}
.rating-row--top-2 .rating-row__place {
  background: linear-gradient(145deg, #eceff1, #b0bec5);
  color: #37474f;
}
.rating-row--top-3 .rating-row__place {
  background: linear-gradient(145deg, #ffcc80, #ff8a65);
  color: #4e342e;
}
.rating-row__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.rating-row__name {
  font-weight: 750;
  color: var(--text-primary);
}
.rating-row__badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(76, 175, 69, 0.12);
  color: #2e7d32;
}
.rating-row__bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: visible;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
}
html.theme-dark .rating-row__bar { border-color: rgba(255, 255, 255, 0.12); }
.rating-row__gradient {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    #b71c1c 0%,
    #e53935 10%,
    #ff9800 22%,
    #ffc107 32%,
    #ffeb3b 42%,
    #fff176 48%,
    #ffee58 50%,
    #fff176 52%,
    #ffeb3b 58%,
    #cddc39 68%,
    #8bc34a 78%,
    #43a047 90%,
    #2e7d32 100%
  );
}
.rating-row__center {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 1;
  pointer-events: none;
}
.rating-row__marker {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-left: -1.5px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.rating-row__fill {
  display: none;
}
.rating-row__score {
  text-align: right;
  min-width: 4.5rem;
}
.rating-row__score strong {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.rating-row__score span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 650;
}
.rating-hero {
  padding: 1.15rem 1.2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.07);
  margin-bottom: 1.25rem;
}
html.theme-dark .rating-hero {
  background: rgba(26, 29, 38, 0.92);
  border-color: rgba(76, 175, 69, 0.22);
}
.rating-section { margin-bottom: 1.5rem; }
.rating-section__title {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  font-weight: 800;
}
.rating-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.rating-part {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.05);
}
html.theme-dark .rating-part {
  background: rgba(26, 29, 38, 0.9);
  border-color: rgba(76, 175, 69, 0.2);
}
.rating-part--penalty {
  border-color: rgba(198, 40, 40, 0.22);
  background: rgba(255, 235, 238, 0.55);
}
html.theme-dark .rating-part--penalty {
  background: rgba(60, 28, 28, 0.45);
  border-color: rgba(239, 83, 80, 0.28);
}
.rating-part__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(76, 175, 69, 0.12);
  color: #2e7d32;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.rating-part--penalty .rating-part__icon {
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
}
.rating-part__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}
.rating-part__value {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.rating-part--penalty .rating-part__value { color: #c62828; }
.rating-penalties {
  display: grid;
  gap: 0.65rem;
}
.rating-penalty {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 235, 238, 0.7), rgba(255, 255, 255, 0.85));
  border: 1px solid rgba(198, 40, 40, 0.18);
  box-shadow: 0 6px 16px rgba(198, 40, 40, 0.05);
}
html.theme-dark .rating-penalty {
  background: linear-gradient(135deg, rgba(70, 28, 28, 0.45), rgba(26, 29, 38, 0.92));
  border-color: rgba(239, 83, 80, 0.28);
}
.rating-penalty__icon { display: none; }
.rating-penalty__body {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1;
  padding-right: 2.2rem;
}
.rating-penalty__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}
.rating-penalty__top strong {
  font-size: 0.95rem;
  font-weight: 780;
  color: var(--text-primary);
}
.rating-penalty__points {
  font-size: 1.05rem;
  font-weight: 800;
  color: #c62828;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.rating-penalty__hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.rating-ok {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  background: rgba(76, 175, 69, 0.1);
  border: 1px solid rgba(76, 175, 69, 0.22);
  color: #2e7d32;
  font-weight: 700;
  font-size: 0.92rem;
}
html.theme-dark .rating-ok {
  color: #a5d6a7;
  background: rgba(76, 175, 69, 0.14);
}
.rating-achs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.rating-ach {
  display: flex;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(76, 175, 69, 0.14);
  box-shadow: 0 6px 16px rgba(46, 125, 50, 0.05);
}
html.theme-dark .rating-ach {
  background: rgba(26, 29, 38, 0.9);
  border-color: rgba(76, 175, 69, 0.2);
}
.rating-ach__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ach-color, #4caf45) 16%, transparent);
  color: var(--ach-color, #4caf45);
  font-size: 1.25rem;
}
.rating-ach__body h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 780;
}
.rating-ach__body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.rating-ach__meta {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .rating-seg { display: flex; width: 100%; }
  .rating-seg__btn { flex: 1; justify-content: center; padding-inline: 0.55rem; font-size: 0.84rem; }
  .rating-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "place body"
      "place score";
  }
  .rating-row__place { grid-area: place; }
  .rating-row__body { grid-area: body; }
  .rating-row__score {
    grid-area: score;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
  }
  .rating-row__score strong { display: inline; font-size: 1rem; }
}

html {
  scrollbar-gutter: stable;
}
html.reduce-motion .app-bg__blob,
html.reduce-motion .app-bg__iso-item,
html.reduce-motion .kkt-bg__blob,
html.reduce-motion .kkt-shell {
  animation: none !important;
}
html, body {
  background: var(--bg-dark) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
}

body::before { display: none !important; }

/* Main work area — soft green atmosphere + light isometric decor */
body.app-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 16% 84%, rgba(220, 237, 200, 0.5) 0%, transparent 46%),
    radial-gradient(circle at 84% 16%, rgba(197, 225, 165, 0.38) 0%, transparent 44%),
    linear-gradient(135deg, #fafdf8 0%, #f5f9f1 48%, #eef7e8 100%) !important;
}
html.theme-dark body.app-shell {
  background: var(--bg-dark) !important;
}
/* Decorative bg: own compositor layer; animations = transform only (no blur filters) */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.app-bg.is-paused .app-bg__blob,
.app-bg.is-paused .app-bg__iso-item {
  animation-play-state: paused !important;
}
.app-bg__blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.65;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.app-bg__blob--1 {
  width: 42vw; height: 42vw; max-width: 480px; max-height: 480px;
  left: -10%; top: -14%;
  background: radial-gradient(circle at 30% 30%, rgba(168, 230, 153, 0.5), rgba(76, 175, 69, 0.16), transparent 68%);
  animation: app-drift-1 32s ease-in-out infinite alternate;
}
.app-bg__blob--2 {
  width: 36vw; height: 36vw; max-width: 420px; max-height: 420px;
  right: -12%; top: 22%;
  background: radial-gradient(circle at 70% 40%, rgba(197, 225, 165, 0.4), rgba(76, 175, 69, 0.12), transparent 68%);
  animation: app-drift-2 38s ease-in-out infinite alternate;
}
.app-bg__blob--3 {
  width: 32vw; height: 32vw; max-width: 360px; max-height: 360px;
  left: 30%; bottom: -16%;
  background: radial-gradient(circle at 50% 50%, rgba(220, 237, 200, 0.42), rgba(76, 175, 69, 0.1), transparent 68%);
  animation: app-drift-3 34s ease-in-out infinite alternate;
}
.app-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(76, 175, 69, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 175, 69, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 72% 62% at 50% 38%, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 38%, #000 18%, transparent 78%);
  opacity: 0.65;
}
.app-bg__iso {
  position: absolute;
  inset: 0;
  opacity: 0.45;
}
.app-bg__iso-item {
  position: absolute;
  width: 72px;
  height: 72px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  /* static decor — animated iso caused continuous compositor work */
  transform: none;
  animation: none !important;
}
.app-bg__iso-item--1 {
  left: 6%; top: 18%;
  width: 88px; height: 88px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='%234caf45' fill-opacity='.35' d='M40 8 L72 26 L40 44 L8 26 Z'/%3E%3Cpath fill='%233d8f38' fill-opacity='.28' d='M8 26 L40 44 L40 72 L8 54 Z'/%3E%3Cpath fill='%236bcf5f' fill-opacity='.22' d='M40 44 L72 26 L72 54 L40 72 Z'/%3E%3C/svg%3E");
}
.app-bg__iso-item--2 {
  right: 10%; top: 28%;
  width: 64px; height: 64px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='%236bcf5f' fill-opacity='.4' d='M40 10 L66 40 L40 70 L14 40 Z'/%3E%3C/svg%3E");
}
.app-bg__iso-item--3 {
  left: 18%; bottom: 16%;
  width: 56px; height: 56px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath fill='%234caf45' fill-opacity='.3' d='M40 8 L72 26 L40 44 L8 26 Z'/%3E%3Cpath fill='%233d8f38' fill-opacity='.24' d='M8 26 L40 44 L40 72 L8 54 Z'/%3E%3Cpath fill='%236bcf5f' fill-opacity='.18' d='M40 44 L72 26 L72 54 L40 72 Z'/%3E%3C/svg%3E");
}
.app-bg__iso-item--4,
.app-bg__iso-item--5 {
  display: none; /* fewer layers = less GPU */
}
html.theme-dark .app-bg,
body.chat-page .app-bg { display: none; }

@media (max-width: 768px) {
  html.chat-lock,
  html.chat-lock body.chat-page {
    overflow: hidden !important;
    overscroll-behavior: none;
  }
  body.chat-page .app-dock-layer {
    display: none !important;
  }
}
@keyframes app-drift-1 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4%, 5%, 0); }
}
@keyframes app-drift-2 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-5%, 4%, 0); }
}
@keyframes app-drift-3 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(3%, -5%, 0); }
}
@keyframes app-iso-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(12px, -18px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .app-bg__blob,
  .app-bg__iso-item,
  .kkt-shell,
  .kkt-bg__blob,
  .kkt-bg__grid { animation: none !important; }
}
/* Weak devices / lite mode: keep soft blobs, freeze motion */
html.bg-lite .app-bg__blob,
html.bg-lite .kkt-bg__blob,
html.bg-lite .kkt-shell,
html.bg-lite .kkt-bg__grid {
  animation: none !important;
}
html.bg-lite .app-bg__iso {
  display: none;
}
html.bg-lite .app-bg__blob--3,
html.bg-lite .kkt-bg__blob--3 {
  display: none;
}
/* Content above bg; navbar stays above main so profile menu is not covered */
body.app-shell > main,
body.app-shell > footer {
  position: relative;
  z-index: 1;
}
body.app-shell > .navbar {
  position: sticky !important;
  z-index: 1200 !important;
}

html {
  scrollbar-gutter: stable;
}
html.chat-lock {
  scrollbar-gutter: auto;
}

/* Переходы страниц: без морфинга шапки/карточек */
@view-transition {
  navigation: none;
}

#appNavbar,
.app-dock-layer,
.app-dock,
.kkt-busy,
.toast-container,
body:not(.chat-page) #pageMain {
  view-transition-name: none;
}
body:not(.chat-page) #pageMain {
  min-height: calc(100dvh - 8.5rem);
}

.kkt-navwait {
  position: fixed;
  inset: 0;
  z-index: 199990;
  display: grid;
  place-items: center;
  background: rgba(250, 253, 248, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.kkt-navwait.is-on {
  opacity: 1;
  pointer-events: auto;
}
html.chat-lock .kkt-navwait,
html.chat-lock .kkt-busy,
body.chat-page .kkt-navwait,
body.chat-page .kkt-busy {
  display: none !important;
}
.kkt-navwait[hidden] { display: none !important; }
.kkt-navwait__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem 1.15rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.18);
  box-shadow: 0 16px 36px rgba(40, 110, 35, 0.14);
  color: #2e7d32;
}
.kkt-navwait__card span {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-primary);
}
html.theme-dark .kkt-navwait {
  background: rgba(16, 20, 18, 0.45);
}
html.theme-dark .kkt-navwait__card {
  background: var(--bg-card);
  border-color: rgba(76, 175, 69, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .kkt-navwait { transition: none; }
}
.chat-sidebar,
.chat-float-btn {
  position: fixed !important;
  z-index: 1300 !important;
}
#navDropdown,
.nav-dropdown-panel {
  z-index: 13000 !important;
}

.navbar {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--border) !important;
  position: sticky !important;
  top: 0;
  z-index: 1200 !important;
  box-shadow: none !important;
}
html.theme-dark .navbar { background: rgba(18, 20, 26, 0.94) !important; }

.navbar-brand {
  background: none !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}
.navbar-brand i { -webkit-text-fill-color: var(--accent) !important; color: var(--accent) !important; }
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.navbar .container,
.navbar-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem;
  min-height: 58px;
}

.navbar-nav {
  align-items: center !important;
  gap: 0.35rem !important;
  flex-wrap: nowrap !important;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.navbar-nav::-webkit-scrollbar { display: none; }

.navbar-nav > li {
  flex-shrink: 0;
}

#navProfileWrap,
.nav-profile-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  gap: 0.45rem !important;
  min-height: 42px;
  height: 42px;
}

.navbar .nav-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  color: var(--text-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 0.42rem 0.9rem !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

.navbar .nav-link i {
  width: 1em;
  height: 1em;
  font-size: 0.95rem;
  opacity: 0.85;
  flex-shrink: 0;
  display: inline-block;
  text-align: center;
  transition: opacity .18s ease, color .18s ease;
}

.navbar .nav-link:hover {
  color: var(--text-primary) !important;
  background: rgba(76, 175, 69, 0.08) !important;
  border-color: rgba(76, 175, 69, 0.18) !important;
}

.navbar .nav-link:hover i { opacity: 1; color: var(--accent); }

.navbar .nav-link.active {
  color: #fff !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 6px 16px rgba(76, 175, 69, 0.28);
}

.navbar .nav-link.active i {
  color: #fff !important;
  opacity: 1;
}

html.theme-dark .navbar .nav-link:hover {
  background: rgba(76, 175, 69, 0.14) !important;
  border-color: rgba(76, 175, 69, 0.28) !important;
}

html.theme-dark .navbar .nav-link.active {
  box-shadow: 0 6px 18px rgba(76, 175, 69, 0.35);
}

.nav-profile-btn {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  gap: 0;
  padding: 0.16rem;
  border-radius: 999px;
  position: relative;
  width: 42px;
  height: 42px;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0 !important;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-profile-btn:hover {
  background: rgba(76, 175, 69, 0.08) !important;
  border-color: rgba(76, 175, 69, 0.25) !important;
  box-shadow: 0 4px 14px rgba(76, 175, 69, 0.12);
}

.nav-profile-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.nav-profile-avatar,
.nav-profile-btn img {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--bg-card, #fff);
}

.nav-profile-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
  animation: nav-dot-pulse 1.6s ease-out infinite;
  z-index: 2;
}

.nav-profile-dot[hidden] { display: none !important; }

.nav-profile-btn.has-unread {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.18);
}

@keyframes nav-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.nav-notify-bell {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.nav-notify-bell i { font-size: 1.15rem; line-height: 1; }
.nav-notify-bell:hover,
.nav-notify-bell[aria-expanded="true"] {
  background: rgba(76, 175, 69, 0.1);
  border-color: rgba(76, 175, 69, 0.28);
  color: #2f8a2a;
}
.nav-notify-bell .nav-profile-dot {
  top: -2px;
  right: -2px;
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  display: grid;
  place-items: center;
  animation: none;
  box-shadow: none;
}
.nav-notify-bell .nav-profile-dot::after {
  content: attr(data-count);
}

.kkt-notify {
  position: fixed;
  inset: 0;
  z-index: 50000;
  isolation: isolate;
  display: block;
  pointer-events: none;
  view-transition-name: none;
}
.kkt-notify[hidden] { display: none !important; }
.kkt-notify__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  pointer-events: auto;
  background: rgba(244, 250, 242, 0.42);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  cursor: pointer;
}
.kkt-notify__panel {
  position: fixed;
  top: 64px;
  right: 12px;
  z-index: 2;
  pointer-events: auto;
  width: min(360px, calc(100vw - 24px));
  max-height: min(78dvh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.18);
  border-radius: 18px;
  box-shadow: none;
  transform-origin: top right;
  animation: kkt-notify-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes kkt-notify-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.kkt-notify.is-centered {
  display: grid;
  place-items: center;
  pointer-events: auto;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 0.75rem calc(5.6rem + env(safe-area-inset-bottom, 0px));
}
.kkt-notify.is-centered .kkt-notify__panel {
  position: relative;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70dvh, 520px);
  transform: none;
  animation: kkt-notify-center-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes kkt-notify-center-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
body.kkt-notify-open {
  overflow: hidden;
}
body.kkt-notify-open .navbar,
body.kkt-notify-open .app-dock-layer {
  pointer-events: none;
}
body.kkt-notify-open .chat-float-btn,
body.kkt-notify-open .chat-sidebar {
  visibility: hidden;
  pointer-events: none;
}
.kkt-notify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.9rem 0.95rem 0.5rem;
}
.kkt-notify__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.kkt-notify__close {
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 10px;
  background: rgba(28, 25, 23, 0.05);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.kkt-notify__toolbar {
  display: flex;
  gap: 0.4rem;
  padding: 0 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.kkt-notify__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
html.theme-dark .kkt-notify__panel {
  background: var(--bg-card);
}
html.theme-dark .kkt-notify__backdrop {
  background: rgba(8, 10, 9, 0.62);
}
html.theme-dark .nav-notify-bell {
  background: var(--bg-card2);
  color: var(--text-primary);
}
html.theme-dark .nav-notify-bell .nav-profile-dot {
  border-color: var(--bg-card);
}

.nav-profile-fallback {
  position: absolute;
  inset: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3d8f38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.role-badge {
  background: rgba(76, 175, 69, 0.12) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(76, 175, 69, 0.22);
  box-shadow: none !important;
  border-radius: 999px !important;
  padding: 0.15rem 0.55rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.navbar .btn-nav-enter {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(76, 175, 69, 0.28);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.navbar .btn-nav-enter:hover {
  color: #fff;
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(76, 175, 69, 0.34);
}

.card, .stat-card, .test-card,
.btn-primary, .btn-success, .btn-danger, .btn-outline-primary,
.builder-save-btn, .builder-add-btn { transform: none !important; }

.card:hover, .stat-card:hover, .test-card:hover { transform: none !important; }

.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: var(--radius) !important;
}
.card:hover { box-shadow: 0 2px 8px rgba(28, 25, 23, 0.08) !important; }
html.theme-dark .card:hover { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4) !important; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--bg-card2) !important;
  border-bottom: 1px solid var(--border) !important;
}

.fade-in, .fade-in-1, .fade-in-2, .fade-in-3, .fade-in-4 {
  animation: none !important; opacity: 1 !important; transform: none !important;
}
#pageMain.page-fade-in { animation: pageFadeIn 0.18s ease both; }

.pcard-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
  justify-content: start;
  gap: 1.25rem !important;
  row-gap: 1.25rem !important;
  column-gap: 1.25rem !important;
  align-items: stretch;
  align-content: start;
  padding: 0.2rem 0.15rem 1.2rem;
}
.pcard {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  min-height: 0 !important;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  --pcard-btn: 40px;
  --pcard-btn-gap: 0.4rem;
  --pcard-btn-inset: 0.8rem;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(165deg, #6ec8c2 0%, #3fa8a0 42%, #1f6f78 100%) !important;
  border: 0 !important;
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.16) !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: #fff !important;
  isolation: isolate;
  transition: box-shadow .25s ease !important;
}
.pcard::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(4, 8, 6, 0.38) 0%,
    rgba(4, 8, 6, 0.16) 46%,
    transparent 78%
  );
}
.pcard::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78%;
  z-index: 1;
  pointer-events: none;
  background: rgba(6, 10, 8, 0.12);
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
  -webkit-mask-image: linear-gradient(
    to top,
    #000 0%,
    rgba(0,0,0,0.92) 36%,
    rgba(0,0,0,0.55) 62%,
    rgba(0,0,0,0.18) 84%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to top,
    #000 0%,
    rgba(0,0,0,0.92) 36%,
    rgba(0,0,0,0.55) 62%,
    rgba(0,0,0,0.18) 84%,
    transparent 100%
  );
}
.pcard:hover {
  transform: none !important;
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.16) !important;
  border-color: transparent !important;
  text-decoration: none !important;
  color: #fff !important;
}
.pcard:hover .pcard-bg img:not(.pcard-mark),
.pcard:hover .pcard-bg canvas,
.pcard:hover .cover-img {
  transform: none !important;
  filter: none !important;
}
.pcard-shine { display: none !important; }
.pcard-title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.pcard-title-row .pcard-title {
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
}
.pcard-badge,
.pcard-chip {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: static !important;
  top: auto !important;
  left: auto !important;
  z-index: auto;
  flex: 0 0 auto;
  margin: 0 auto 0.05rem !important;
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 0.28rem 0.78rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  text-transform: none !important;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pcard-badge--muted,
.pcard-chip--muted {
  background: rgba(255,255,255,.18) !important;
  color: rgba(255,255,255,.92) !important;
  border-color: transparent !important;
}
.pcard-bg {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  height: auto !important;
  z-index: 0;
  overflow: hidden;
  background: transparent;
  border-radius: 0 !important;
  pointer-events: none;
}
.pcard-bg::after { display: none !important; }
.pcard-mark,
.pcard-mark--prop {
  display: none !important;
}
.pcard-bg img:not(.pcard-mark),
.pcard-bg canvas,
.pcard-bg .auto-cover,
.pcard-bg .cover-img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover;
  object-position: center top;
  filter: none !important;
  transform: none;
  background: transparent;
}
.pcard-body {
  margin-top: auto !important;
  padding: 0.85rem 1.15rem 0.4rem !important;
  color: #fff !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  position: relative !important;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.pcard-title {
  color: #fff !important;
  font-size: 1.28rem !important;
  font-weight: 800 !important;
  font-family: var(--font-sans) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 6px 20px rgba(0,0,0,.4) !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.28 !important;
  max-width: 100%;
}
.pcard-desc,
.pcard-meta,
.pcard-meta span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 6px 18px rgba(0,0,0,.55) !important;
  justify-content: center;
  text-align: center;
}
.pcard-desc {
  font-size: 1rem !important;
  font-weight: 600;
  line-height: 1.4;
  max-width: 22em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.pcard-meta {
  font-size: 0.75rem !important;
  opacity: 1 !important;
}
.pcard-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
.pcard-footer {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: 0 !important;
  padding: 0.15rem 1.05rem 1.05rem !important;
  margin-top: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  position: relative;
  z-index: 6;
  border-radius: 0 !important;
  pointer-events: none;
}
.pcard-footer .pcard-info,
.pcard-footer .pcard-menu,
.pcard-footer a.pcard-action,
.pcard-footer .pcard-action[href] {
  pointer-events: auto;
}
.pcard-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.58rem 0.85rem !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #171717 !important;
  font-weight: 750 !important;
  font-size: 0.82rem !important;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(20, 24, 22, 0.14);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.pcard-action:hover {
  transform: translateY(-1px);
  color: #111 !important;
  text-decoration: none !important;
}
.pcard-footer > .pcard-action,
.pcard-footer > a.pcard-action {
  margin-right: 0;
}
.pcard-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-right: 0;
  min-width: 0;
  width: 100%;
}
.pcard-footer-actions .pcard-action {
  flex: 1 1 0;
}
.pcard-footer-actions .pcard-action,
.pcard-footer-actions .pcard-action:last-child,
.pcard-footer > .pcard-action:nth-of-type(2) {
  background: #fff !important;
  color: #171717 !important;
}

/* Card actions: three-dots on the photo */
.pcard-menu {
  position: absolute;
  top: var(--pcard-btn-inset, 0.8rem);
  right: var(--pcard-btn-inset, 0.8rem);
  z-index: 6;
  flex: 0 0 auto;
  margin: 0;
  pointer-events: auto;
}
.pcard-info {
  position: absolute;
  top: var(--pcard-btn-inset, 0.8rem);
  right: var(--pcard-btn-inset, 0.8rem);
  left: auto;
  bottom: auto;
  z-index: 7;
  width: var(--pcard-btn, 40px);
  height: var(--pcard-btn, 40px);
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: auto;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 8px 18px rgba(8, 14, 12, 0.16);
}
.pcard-footer > .pcard-info {
  position: absolute;
  flex: none;
  left: auto;
  right: var(--pcard-btn-inset, 0.8rem);
  bottom: auto;
  top: var(--pcard-btn-inset, 0.8rem);
}
.pcard:has(> .pcard-menu) > .pcard-info {
  top: calc(var(--pcard-btn-inset, 0.8rem) + var(--pcard-btn, 40px) + var(--pcard-btn-gap, 0.4rem));
  right: var(--pcard-btn-inset, 0.8rem);
  left: auto;
}
.pcard-info:hover,
.pcard-info.is-open {
  background: rgba(255,255,255,.3);
  color: #fff;
}
.pcard-info__pop {
  position: fixed;
  z-index: 70010;
  min-width: 11.5rem;
  max-width: min(18rem, calc(100vw - 1.25rem));
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 16px 36px rgba(28, 25, 23, 0.18);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  color: #1c1917;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  text-shadow: none;
}
.pcard-info__pop[hidden] { display: none !important; }
html.theme-dark .pcard-info__pop {
  background: rgba(28, 32, 40, 0.96);
  border-color: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
html.theme-dark .pcard-menu__sep {
  background: rgba(255,255,255,0.08);
}
.pcard-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: inherit !important;
  text-decoration: none !important;
  min-height: 0;
}
.pcard-menu__btn {
  width: var(--pcard-btn, 40px);
  height: var(--pcard-btn, 40px);
  box-sizing: border-box;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  color: #171717;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(20, 24, 22, 0.16);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pcard-menu__btn:hover,
.pcard-menu.is-open .pcard-menu__btn {
  background: #fff;
  color: #111;
  border-color: transparent;
}
.pcard-menu__panel {
  position: fixed;
  z-index: 70000;
  min-width: 13.75rem;
  max-width: min(20rem, calc(100vw - 1.25rem));
  max-height: min(72vh, 32rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.18);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  display: none;
  transform-origin: top right;
  animation: pcard-menu-in 0.18s cubic-bezier(.22,1,.36,1) both;
}
@keyframes pcard-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.pcard-menu__panel.is-open,
.pcard-menu__panel[data-open="1"] {
  display: block !important;
}
.pcard-menu__panel[hidden] {
  display: none !important;
}
.pcard-menu__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 44px;
  padding: 0.62rem 0.8rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.pcard-menu__item i {
  width: 1.15rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.pcard-menu__item:hover {
  background: rgba(76, 175, 69, 0.12);
  color: var(--accent);
  text-decoration: none;
}
.pcard-menu__item:hover i { color: var(--accent); }
.pcard-menu__item--danger {
  color: var(--accent-red, #b42318);
  margin-top: 0.15rem;
  box-shadow: inset 0 1px 0 rgba(28, 25, 23, 0.06);
}
.pcard-menu__item--danger i { color: inherit; }
.pcard-menu__item--danger:hover {
  background: rgba(180, 35, 24, 0.08);
  color: var(--accent-red, #b42318);
}
.pcard-menu__item--danger:hover i { color: inherit; }
.pcard-menu__sep {
  height: 1px;
  margin: 0.28rem 0.45rem;
  background: rgba(28, 25, 23, 0.08);
}
.pcard-menu form.cover-form,
.pcard-menu__panel form.cover-form {
  display: block !important;
  width: 100%;
  margin: 0;
}
.pcard-menu__panel form {
  margin: 0;
  width: 100%;
}
.entity-card form.cover-form {
  display: block !important;
  width: 100%;
  margin: 0;
}
.pcard-menu .cover-edit-label {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.pcard-menu .cover-edit-label input,
.pcard-menu__panel input[type="file"],
.cover-edit-label input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  pointer-events: none;
}
.pcard-menu .cover-edit-label input::file-selector-button,
.pcard-menu__panel input[type="file"]::file-selector-button,
.cover-edit-label input[type="file"]::file-selector-button,
.pcard-menu .cover-edit-label input::-webkit-file-upload-button,
.pcard-menu__panel input[type="file"]::-webkit-file-upload-button {
  display: none !important;
}
html.theme-dark .pcard-menu__panel {
  background: rgba(32, 38, 36, 0.94);
  border-color: rgba(255,255,255,0.08);
}

/* legacy icon-row on cover — unused */
.pcard-img-actions { display: none !important; }
.pcard-icon-btn {
  width: 30px !important;
  height: 30px !important;
  flex: 0 0 auto;
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem !important;
}
.pcard-icon-btn:hover { background: rgba(76, 175, 69, 0.12) !important; color: var(--accent) !important; border-color: transparent !important; }
.pcard-icon-danger:hover { color: var(--accent-red) !important; background: rgba(180, 35, 24, 0.08) !important; border-color: transparent !important; }
.pcard-result-pct {
  position: static;
  z-index: 4;
  background: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: #171717;
  text-shadow: none;
  box-shadow: 0 8px 16px rgba(20, 30, 20, 0.16);
}
.pcard-progress-wrap { margin-top: 0.35rem; width: 70%; }
.pcard-result .pcard-footer {
  justify-content: space-between;
  padding-left: 0.95rem !important;
  padding-right: 0.95rem !important;
}
html.theme-dark .pcard-result-pct {
  background: #eef6ea;
  color: #143016;
}
.pcard-progress-bar { height: 5px; background: rgba(255,255,255,.28); border-radius: 99px; overflow: hidden; }
.pcard-progress-fill { height: 100%; border-radius: 99px; }
.fill-green { background: #dfffe0; }
.fill-yellow { background: #ffe7b3; }
.fill-red { background: #ffc9c4; }
.pct-green { color: #166534; }
.pct-yellow { color: #92400e; }
.pct-red { color: #991b1b; }

.entity-card,
.group-card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  text-decoration: none !important;
  color: #fff !important;
}
.entity-card .pcard-bg,
.group-card .pcard-bg {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  height: auto !important;
}
.entity-card .pcard-bg::after,
.group-card .pcard-bg::after,
.entity-card .pcard-shine,
.group-card .pcard-shine { display: none !important; }
.entity-card .pcard-title,
.group-card .pcard-title {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 6px 20px rgba(0,0,0,.4) !important;
}
.entity-card .pcard-meta,
.entity-card .pcard-desc,
.entity-card .pcard-meta span,
.group-card .pcard-meta,
.group-card .pcard-desc,
.group-card .pcard-meta span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 6px 18px rgba(0,0,0,.55) !important;
}
.entity-card .cover-edit-label {
  margin: 0;
  cursor: pointer;
}
.entity-card .cover-edit-label input,
.group-card .cover-edit-label input { display: none !important; }
.entity-card form.cover-form { display: block; width: 100%; margin: 0; }

.page-header {
  border-bottom-color: var(--border) !important;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.page-header > .page-back {
  flex: 0 0 auto;
  order: 0;
}
.page-header > h1,
.page-header > h2 {
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
  margin: 0 !important;
}
.page-header__actions,
.page-header > .btn-prim,
.page-header > .btn-sec,
.page-header > a.btn,
.page-header > a.btn-prim,
.page-header > a.btn-sec {
  order: 2;
  margin-left: auto;
}
.page-back {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.page-back i { font-size: 1.35rem; line-height: 1; }
.page-back:hover {
  color: var(--text-primary);
  background: rgba(28, 25, 23, 0.06);
}
html.theme-dark .page-back:hover {
  background: rgba(255,255,255,.08);
}
.page-header h2,
.page-header h1,
.auth-title,
.empty-title,
.sd-section-title,
.sd-section-title span {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  text-shadow: none !important;
}
.empty-title { color: var(--text-muted) !important; }
.result-pct.good,
.result-pct.ok,
.result-pct.bad {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
}
.result-pct.good { color: var(--accent) !important; }
.result-pct.ok { color: var(--accent-yellow) !important; }
.result-pct.bad { color: var(--accent-red) !important; }
.btn-prim {
  background: var(--accent) !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.btn-prim span,
.btn-prim i,
.btn-prim .btn-busy {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.btn-prim:hover {
  background: var(--accent2) !important;
  box-shadow: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
#pageMain a:not([class]) {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
#pageMain a:not([class]):hover {
  text-decoration: underline;
}
.btn-sec {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1.15rem !important;
  border-radius: var(--radius-pill) !important;
  border: 1.5px solid rgba(76, 175, 69, 0.45) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #2e7d32 !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-sec:hover {
  background: rgba(76, 175, 69, 0.12) !important;
  border-color: var(--accent) !important;
  color: #1b5e20 !important;
}
.btn-act {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 34px;
  padding: 0 0.8rem !important;
  border-radius: 999px !important;
  border: 1.5px solid rgba(76, 175, 69, 0.4) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #2e7d32 !important;
  font: inherit;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none !important;
  vertical-align: middle;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease;
}
.btn-act:hover {
  background: rgba(76, 175, 69, 0.12) !important;
  border-color: var(--accent) !important;
  color: #1b5e20 !important;
  text-decoration: none !important;
}
.btn-act:active { transform: translateY(1px); }
.btn-act--danger {
  border-color: rgba(198, 40, 40, 0.35) !important;
  color: #c62828 !important;
  background: rgba(255, 255, 255, 0.92) !important;
}
.btn-act--danger:hover {
  background: rgba(198, 40, 40, 0.1) !important;
  border-color: #c62828 !important;
  color: #b71c1c !important;
}
html.theme-dark .btn-act {
  background: rgba(26, 29, 38, 0.92) !important;
}
html.theme-dark .btn-act--danger {
  background: rgba(26, 29, 38, 0.92) !important;
  border-color: rgba(239, 83, 80, 0.4) !important;
  color: #ef5350 !important;
}
html.theme-dark .btn-act--danger:hover {
  background: rgba(239, 83, 80, 0.14) !important;
  color: #ff8a80 !important;
}
.btn-act-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.ico-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1.5px solid rgba(76, 175, 69, 0.38) !important;
  background: #fff !important;
  color: #2e7d32 !important;
  font-size: 1.05rem !important;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(40, 80, 50, 0.08);
  flex: 0 0 auto;
}
.ico-btn i { font-size: 1.05rem; line-height: 1; }
.ico-btn:hover {
  background: rgba(76, 175, 69, 0.12) !important;
  border-color: var(--accent) !important;
  color: #1b5e20 !important;
}
.ico-btn--prim {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 8px 16px rgba(46, 155, 58, 0.28);
}
.ico-btn--prim:hover {
  background: var(--accent2) !important;
  color: #fff !important;
}
.ico-btn--ok {
  color: #1b7a28 !important;
  background: #eef8ec !important;
}
.ico-btn--muted {
  color: #64748b !important;
  border-color: rgba(100, 116, 139, 0.28) !important;
}
.ico-btn--danger {
  color: #c62828 !important;
  border-color: rgba(198, 40, 40, 0.38) !important;
}
.ico-btn--danger:hover {
  background: rgba(198, 40, 40, 0.1) !important;
  color: #b71c1c !important;
}
html.theme-dark .ico-btn {
  background: rgba(32, 38, 36, 0.92) !important;
  color: #9be48a !important;
}
html.theme-dark .ico-btn--prim {
  background: var(--accent) !important;
  color: #fff !important;
}
html.theme-dark .ico-btn--danger { color: #ef9a9a !important; }
.btn-act:has(> i:only-child) {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 !important;
  border-radius: 50% !important;
}
.page-header__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex: 0 0 auto;
  position: relative;
}
.page-menu.pcard-menu {
  position: relative;
  top: auto;
  right: auto;
  inset: auto;
  z-index: 8;
  flex: 0 0 auto;
}
.page-menu .pcard-menu__btn {
  width: 42px;
  height: 42px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: none;
}
.page-menu .pcard-menu__btn:hover,
.page-menu.pcard-menu.is-open .pcard-menu__btn {
  background: var(--bg-card2);
  color: var(--accent);
}

.board-page {
  display: block;
}
.board-page .page-header { flex: 0 0 auto; }
.board-page .list-page {
  margin-bottom: 0;
}
.board-page .list-page__toolbar { flex: 0 0 auto; }
.board-page .list-page__body {
  min-height: 0;
}
.board-page .list-page__main {
  min-width: 0;
}
.board-page .list-filter-panel {
  min-height: 0;
  overflow: auto;
}
.board-page .pcard-grid {
  padding: 0.9rem 1.15rem 1.6rem;
  align-content: start;
  gap: 1.8rem !important;
}

@media (max-width: 991px) {
  .board-page .pcard-grid {
    padding: 0.45rem 0.55rem 2rem;
    gap: 0.85rem !important;
  }
}

@media (max-width: 768px) {
  .pcard-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    padding: 0.15rem 0.05rem 1rem;
  }
  .pcard,
  .entity-card,
  .group-card {
    min-height: 11.4rem !important;
    aspect-ratio: 3 / 3.55;
    max-width: none;
    margin-inline: 0;
    width: 100%;
    border-radius: 18px !important;
  }
  .pcard-footer {
    padding: 0.1rem 0.55rem 0.55rem !important;
    flex-wrap: nowrap;
    gap: 0.3rem;
  }
  .pcard-footer-actions {
    width: auto;
    gap: 0.3rem;
    flex-wrap: nowrap;
  }
  .pcard-action,
  .pcard-footer-actions .pcard-action {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 30px;
    height: 30px;
    padding: 0 0.65rem !important;
    font-size: 0.72rem !important;
  }
  .pcard-info {
    --pcard-btn: 40px;
    width: var(--pcard-btn);
    height: var(--pcard-btn);
    top: 0.55rem;
    right: 0.55rem;
    font-size: 1rem;
  }
  .pcard {
    --pcard-btn: 40px;
    --pcard-btn-gap: 0.35rem;
    --pcard-btn-inset: 0.55rem;
  }
  .pcard-menu {
    top: var(--pcard-btn-inset);
    right: var(--pcard-btn-inset);
  }
  .pcard-menu__btn {
    width: var(--pcard-btn);
    height: var(--pcard-btn);
    font-size: 1.15rem;
  }
  .pcard:has(> .pcard-menu) > .pcard-info {
    top: calc(var(--pcard-btn-inset) + var(--pcard-btn) + var(--pcard-btn-gap));
    right: var(--pcard-btn-inset);
  }
  .pcard-title,
  .entity-card .pcard-title,
  .group-card .pcard-title {
    font-size: 0.92rem !important;
    line-height: 1.2 !important;
  }
  .dash-profile-grid--student .pcard-title,
  .pcard-grid--student .pcard-title {
    font-size: 0.98rem !important;
    line-height: 1.18 !important;
  }
  .pcard-desc { display: none !important; }
}

.notify-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.notify-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.notify-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.notify-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.2;
}
.notify-pill input:checked + span {
  border-color: var(--accent);
  background: rgba(76, 175, 69, 0.14);
  color: #2e7d32;
}

.members-search input[type="search"]::-webkit-search-cancel-button,
.list-search__input::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.kkt-busy,
.toast-container {
  z-index: 80000 !important;
}
.toast-container {
  position: fixed !important;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(22.5rem, calc(100vw - 1.5rem));
  pointer-events: none;
  top: auto !important;
  right: 1.25rem !important;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
  left: auto !important;
  transform: none !important;
}
@media (min-width: 992px) {
  .toast-container .auth-lite__error {
    animation: toast-in-br 0.4s cubic-bezier(.22, 1, .36, 1) both;
  }
  .toast-container .auth-lite__error.is-out {
    animation: toast-out-br 0.28s ease forwards;
  }
}
@media (max-width: 991px) {
  .toast-container {
    top: calc(0.7rem + env(safe-area-inset-top, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
  }
  .toast-container .auth-lite__error {
    animation: toast-in-top 0.4s cubic-bezier(.22, 1, .36, 1) both;
  }
  .toast-container .auth-lite__error.is-out {
    animation: toast-out-top 0.28s ease forwards;
  }
}
@keyframes toast-in-br {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out-br {
  to { opacity: 0; transform: translateY(12px); }
}
@keyframes toast-in-top {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out-top {
  to { opacity: 0; transform: translateY(-12px); }
}

@media (min-width: 992px) {
  .tg-sidebar { width: 340px; }
  .tg-contact {
    gap: 0.9rem;
    padding: 0.85rem 0.9rem;
  }
  .tg-contact-avatar,
  .tg-main-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 1rem !important;
  }
  .tg-contact-name { font-size: 0.98rem !important; }
  .tg-contact-last,
  .tg-contact-time { font-size: 0.8rem !important; }
  .tg-chat-toolbar { min-height: 48px; }
  .tg-chat-toolbar__title { font-size: 1.2rem !important; }
  .tg-chat-toolbar__text-title { font-size: 1.05rem !important; }
  .tg-chat-toolbar__text-sub { font-size: 0.82rem !important; }
  .tg-chat-toolbar__icon-btn,
  .tg-new-chat-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.15rem !important;
  }
  .tg-sidebar-header .form-control { font-size: 0.95rem !important; min-height: 42px; }
  .chat-bubble { font-size: 0.98rem; padding: 0.7rem 0.9rem; }
  .chat-input { font-size: 1rem; min-height: 46px; }
}
.tg-main {
  transition: opacity 0.2s ease;
}
.tg-main.is-swap { opacity: 0; }
.btn-prim {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1.2rem !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  text-align: center;
  text-decoration: none !important;
}

.sd-profile-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
}
.sd-profile-bg { display: none !important; }

.btn-primary, .btn-success {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
  color: #fff !important;
  border-radius: var(--radius-pill) !important;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition) !important;
}
.btn-primary:hover, .btn-success:hover {
  background: var(--accent2) !important;
  border-color: var(--accent2) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.btn, .btn-outline-primary, .btn-outline-secondary, .btn-danger, .btn-warning,
.builder-save-btn, .builder-add-btn {
  border-radius: var(--radius-pill) !important;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition) !important;
}

.form-control, .form-select,
select.form-control,
select:not(.list-filter-select):not(.la-select) {
  background-color: #fff !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition) !important;
  font-family: var(--font-sans) !important;
}

html.theme-dark .form-control,
html.theme-dark .form-select,
html.theme-dark select.form-control,
html.theme-dark select:not(.list-filter-select):not(.la-select) {
  background-color: var(--bg-card2) !important;
}

.form-control:hover,
.form-select:hover,
select.form-control:hover,
select:not(.list-filter-select):not(.la-select):hover {
  border-color: rgba(76, 175, 69, 0.35) !important;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus,
select:not(.list-filter-select):not(.la-select):focus {
  border-color: #4caf45 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.18) !important;
  outline: none !important;
  background-color: #fff !important;
}

html.theme-dark .form-control:focus,
html.theme-dark .form-select:focus,
html.theme-dark select:not(.list-filter-select):not(.la-select):focus {
  background-color: var(--bg-card2) !important;
}

/* Выпадающие списки (native select) */
.form-select,
select.form-control,
select:not([multiple]):not(.list-filter-select):not(.la-select) {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234caf45' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 14px !important;
  padding: 0.65rem 2.5rem 0.65rem 0.95rem !important;
  cursor: pointer !important;
}

.form-select:hover,
select.form-control:hover,
select:not([multiple]):not(.list-filter-select):not(.la-select):hover {
  background-color: rgba(76, 175, 69, 0.04) !important;
}

.form-select:focus,
select.form-control:focus,
select:not([multiple]):not(.list-filter-select):not(.la-select):focus {
  background-color: rgba(76, 175, 69, 0.06) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%233d8f38' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.85rem center !important;
  background-size: 14px !important;
}

.form-select option,
select.form-control option,
select:not(.list-filter-select) option {
  background: #fff !important;
  color: #1c1917 !important;
  padding: 0.45rem 0.6rem !important;
}

html.theme-dark .form-select option,
html.theme-dark select:not(.list-filter-select) option {
  background: #1a1d26 !important;
  color: #e8ecef !important;
}

select[multiple],
.form-select[multiple] {
  background-image: none !important;
  padding-right: 0.95rem !important;
  min-height: 140px;
}

select[multiple] option:checked,
.form-select[multiple] option:checked {
  background: linear-gradient(0deg, #4caf45, #4caf45) !important;
  color: #fff !important;
}

/* Bootstrap / custom dropdown menus */
.dropdown-menu {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.1) !important;
  padding: 0.4rem !important;
}

html.theme-dark .dropdown-menu {
  background: var(--bg-card2) !important;
}

.dropdown-item {
  color: var(--text-muted) !important;
  border-radius: 10px !important;
  padding: 0.55rem 0.85rem !important;
  font-family: var(--font-sans) !important;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active,
.dropdown-item:active {
  background: rgba(76, 175, 69, 0.1) !important;
  color: #1c1917 !important;
}

html.theme-dark .dropdown-item:hover,
html.theme-dark .dropdown-item:focus,
html.theme-dark .dropdown-item.active {
  color: #fff !important;
}

.custom-select-wrap {
  position: relative;
  display: inline-block;
  min-width: 0;
  vertical-align: middle;
  max-width: 100%;
  min-height: 2.4rem;
  contain: layout style;
}

.custom-select-wrap--form {
  display: block;
  width: 100%;
}

.custom-select-wrap > select,
.custom-select-wrap > .la-select,
.custom-select-wrap > .form-select,
.custom-select-wrap > .form-control,
.custom-select-wrap > .list-filter-select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
  appearance: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.custom-select-wrap--la {
  display: inline-block;
  min-width: 210px;
  width: auto;
  vertical-align: middle;
}

.custom-select-wrap--form.custom-select-wrap--la {
  display: block;
  width: 100%;
  min-width: 0;
}

.custom-select-trigger {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  padding: 0.65rem 0.95rem !important;
  cursor: pointer !important;
  text-align: left !important;
  box-shadow: none !important;
  outline: none !important;
}

.custom-select-trigger--sm {
  padding: 0.4rem 0.75rem !important;
  font-size: 0.82rem !important;
  border-radius: 10px !important;
}

.custom-select-trigger::after {
  content: '' !important;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-left: 0.25rem;
  border: none !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234caf45' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 12px !important;
  transition: transform 0.2s ease !important;
}

.custom-select-trigger.open::after {
  transform: rotate(180deg) !important;
  border: none !important;
}

.custom-select-dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  right: 0 !important;
  display: none;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  font-family: var(--font-sans) !important;
  box-shadow: 0 14px 36px rgba(28, 25, 23, 0.12) !important;
  padding: 0.35rem !important;
  z-index: 1200 !important;
  max-height: 240px;
  overflow-y: auto;
}

.custom-select-dropdown.open {
  display: block !important;
}

html.theme-dark .custom-select-trigger,
html.theme-dark .custom-select-dropdown {
  background: var(--bg-card2) !important;
}

.custom-select-trigger:hover,
.custom-select-trigger.open {
  border-color: rgba(76, 175, 69, 0.4) !important;
  background: rgba(76, 175, 69, 0.04) !important;
}

.custom-select-trigger.open {
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.16) !important;
}

.custom-select-option {
  border-radius: 10px !important;
  padding: 0.55rem 0.8rem !important;
  color: #3f4a43 !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.custom-select-option:hover {
  background: rgba(76, 175, 69, 0.1) !important;
  color: #1c1917 !important;
}

.custom-select-option.selected {
  background: rgba(76, 175, 69, 0.16) !important;
  color: #2e7d32 !important;
  font-weight: 700 !important;
}

html.theme-dark .custom-select-option {
  color: var(--text-muted) !important;
}

html.theme-dark .custom-select-option:hover,
html.theme-dark .custom-select-option.selected {
  color: #fff !important;
}

.custom-select-search {
  display: block;
  width: calc(100% - 0.8rem);
  margin: 0.4rem auto 0.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
}

.kkt-combo { position: relative; }
.kkt-combo__drop {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.12);
}
.kkt-combo__opt {
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.kkt-combo__opt:hover,
.kkt-combo__opt.is-on { background: rgba(76, 175, 69, 0.12); }

.kkt-hint {
  margin-top: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card2, #f7faf7);
  padding: 0.15rem 0.85rem 0.2rem;
}
.kkt-hint > summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 0.86rem;
  padding: 0.55rem 0;
}
.kkt-hint p {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.chat-room-theme { position: relative; }
.chat-room-theme__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  width: min(22rem, 80vw);
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 14px 32px rgba(20, 40, 30, 0.16);
}
.chat-room-theme__panel p {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.qbento--teacher .qbento__subj,
.qbento--student .qbento__subj {
  isolation: isolate;
  background:
    radial-gradient(18rem 12rem at 108% 118%, rgba(255, 236, 150, 0.42) 0%, transparent 55%),
    radial-gradient(12rem 10rem at -10% -20%, rgba(255, 255, 255, 0.28) 0%, transparent 50%),
    linear-gradient(152deg, #4fd15a 0%, #2ea83c 42%, #18802c 100%);
  border: 0;
  box-shadow:
    0 18px 34px rgba(18, 92, 32, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}
.qbento--teacher .qbento__subj .qbento__copy strong,
.qbento--student .qbento__subj .qbento__copy strong {
  color: #fff;
  font-size: 1.16rem;
  text-shadow: 0 1px 0 rgba(20, 70, 28, 0.18);
}
.qbento--teacher .qbento__subj .qbento__copy em,
.qbento--student .qbento__subj .qbento__copy em {
  color: rgba(255, 255, 255, 0.86);
}
.qbento--teacher .qbento__subj .qbento__ico,
.qbento--student .qbento__subj .qbento__ico {
  z-index: 2;
  filter: drop-shadow(0 8px 16px rgba(12, 50, 20, 0.35));
}
html.theme-dark .qbento--teacher .qbento__subj,
html.theme-dark .qbento--student .qbento__subj {
  background:
    radial-gradient(16rem 12rem at 100% 120%, rgba(180, 255, 140, 0.16) 0%, transparent 52%),
    linear-gradient(152deg, #2a6b34 0%, #1b4a24 55%, #12351a 100%);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}
html.theme-dark .qbento--teacher .qbento__subj .qbento__copy strong,
html.theme-dark .qbento--student .qbento__subj .qbento__copy strong { color: #e8ffd8; }

.profile-field .custom-select-wrap,
.list-filter-field .custom-select-wrap,
.la-filters__field .custom-select-wrap {
  display: block;
  width: 100%;
  contain: none;
}
.profile-field .custom-select-trigger {
  border-radius: 12px !important;
  padding: 0.55rem 0.7rem !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  background: var(--bg-card) !important;
  border-color: rgba(28, 25, 23, 0.1) !important;
}
.custom-select-trigger--filter {
  height: 44px;
  min-height: 44px;
  border-radius: 12px !important;
  border-color: rgba(76, 175, 69, 0.22) !important;
  background: #f7faf5 !important;
  font-weight: 650 !important;
  font-size: 0.9rem !important;
}
html.theme-dark .custom-select-trigger--filter {
  background: var(--bg-card2) !important;
  border-color: rgba(76, 175, 69, 0.3) !important;
}
body > .custom-select-dropdown {
  position: fixed !important;
  z-index: 120000 !important;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 36px rgba(28, 25, 23, 0.16) !important;
  padding: 0.35rem !important;
  max-height: min(280px, 50vh);
  overflow-y: auto;
}
html.theme-dark body > .custom-select-dropdown {
  background: var(--bg-card2) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

.custom-select-trigger--la {
  min-height: 42px;
  border-radius: 14px !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  font-weight: 650 !important;
  padding: 0.55rem 0.9rem !important;
}

.custom-select-wrap--group {
  display: block;
  width: 100%;
  min-width: 18rem;
}
.custom-select-trigger--group {
  min-height: 3.35rem !important;
  padding: 0.9rem 1.15rem !important;
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  border-radius: 16px !important;
}
.custom-select-dropdown--group {
  max-height: 22rem !important;
  padding: 0.5rem !important;
  border-radius: 16px !important;
}
.custom-select-dropdown--group .custom-select-search {
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  width: calc(100% - 0.6rem);
}
.custom-select-dropdown--group .custom-select-option {
  padding: 0.7rem 0.9rem !important;
  font-size: 0.98rem !important;
  border-radius: 12px !important;
}

.custom-select-dropdown--la {
  border-radius: 14px !important;
  border-color: var(--border) !important;
}

.custom-select-dropdown--la .custom-select-option {
  border-radius: 8px !important;
}

.custom-file-input:hover {
  border-color: #4caf45 !important;
  background: rgba(76, 175, 69, 0.06) !important;
}

.custom-file-input .cfi-icon {
  background: rgba(76, 175, 69, 0.12) !important;
  color: #4caf45 !important;
}

.custom-file-input .cfi-text strong { color: #4caf45 !important; }

.custom-file-input.has-file {
  border-color: rgba(76, 175, 69, 0.35) !important;
  background: rgba(76, 175, 69, 0.06) !important;
}

/* Аналитика: период */
.la-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234caf45' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 6l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 14px !important;
  border: 1px solid var(--la-line, var(--border)) !important;
  border-radius: 10px !important;
  padding: 0.55rem 2.3rem 0.55rem 0.9rem !important;
  color: #24362b !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

.la-select:hover {
  border-color: rgba(76, 175, 69, 0.4) !important;
  background-color: rgba(76, 175, 69, 0.04) !important;
}

.la-select:focus {
  border-color: #4caf45 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.16) !important;
  outline: none !important;
}

/* ── Mobile floating dock (как Расписание ККТ) + FAB cutout ── */
.app-dock-layer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  height: calc(140px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  overflow: visible;
}
.app-dock-layer .app-dock,
.app-dock-layer .fab-wrap {
  pointer-events: auto;
}

.app-dock {
  position: absolute !important;
  z-index: 1;
  left: 50%;
  right: auto;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100vw - 24px));
  max-width: min(440px, calc(100vw - 24px));
  box-sizing: border-box;
  margin: 0;
  padding: 0.32rem 0.32rem;
  transform: translateX(-50%) translateZ(0);
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.16) !important;
  border-radius: 28px;
  box-shadow:
    0 10px 32px rgba(var(--accent-rgb), 0.14),
    0 2px 8px rgba(28, 25, 23, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.85);
  isolation: isolate;
  overflow: visible;
}

.app-dock__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.app-dock--fab {
  overflow: visible;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0.55rem 0.32rem 0.32rem !important;
  width: min(420px, calc(100vw - 16px));
  max-width: min(420px, calc(100vw - 16px));
  min-width: 0;
}

.app-dock__bowl {
  display: none;
}

.app-dock--fab .app-dock__bowl {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(76, 175, 69, 0.16);
  -webkit-mask-image: radial-gradient(circle 32px at 50% 0, transparent 30px, #000 31.5px);
  mask-image: radial-gradient(circle 32px at 50% 0, transparent 30px, #000 31.5px);
  filter: drop-shadow(0 10px 24px rgba(76, 175, 69, 0.14)) drop-shadow(0 2px 8px rgba(28, 25, 23, 0.08));
}

html.theme-dark .app-dock--fab .app-dock__bowl {
  background: rgba(26, 30, 36, 0.92);
  border-color: rgba(76, 175, 69, 0.28);
}

.app-dock--fab .app-dock__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  width: 100%;
  padding: 0.15rem 0.1rem 0.08rem;
}

.app-dock__fab-slot {
  width: 64px;
  flex: 0 0 64px;
  pointer-events: none;
}

.app-dock__cluster { display: none; }

/* FAB sits in the notch, above the bar */
/* FAB sits in the notch, above the bar */
.fab-wrap {
  position: absolute !important;
  left: calc(50% - 28px) !important;
  right: auto !important;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
  width: 56px;
  transform: none !important;
  z-index: 2 !important;
  background: transparent !important;
  overflow: visible;
}

.app-dock__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-width: 0;
  max-width: none;
  min-height: 52px;
  padding: 0.42rem 0.18rem;
  border: 0;
  background: transparent;
  color: #6b7368 !important;
  text-decoration: none !important;
  font-family: var(--font-sans) !important;
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.1;
  cursor: pointer;
  border-radius: 18px;
  transition: color .28s cubic-bezier(0.22, 1, 0.36, 1), background .28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .28s cubic-bezier(0.22, 1, 0.36, 1), transform .28s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}

.app-dock__item i {
  width: 1.48rem;
  height: 1.48rem;
  font-size: 1.48rem;
  line-height: 1;
  color: inherit !important;
  display: inline-block;
  text-align: center;
  transform-origin: center;
  transition: transform 0.18s ease;
}

.app-dock__item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: inherit !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.app-dock__item:hover {
  color: #2f8a2a !important;
  background: rgba(76, 175, 69, 0.1);
  text-decoration: none !important;
}

.app-dock__item:last-child {
  position: relative;
  z-index: 2;
}

.app-dock__item.is-active {
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(63, 168, 58, 0.28);
}

.app-dock__item.is-active i,
.app-dock__item.is-active span {
  color: #fff !important;
}

.app-dock__item.is-pop i {
  animation: dock-icon-pop 0.58s cubic-bezier(0.22, 1.15, 0.36, 1);
}

@keyframes dock-icon-pop {
  0% { transform: scale(0.88) rotate(-4deg); }
  35% { transform: scale(1.14) rotate(2deg); }
  65% { transform: scale(0.97) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.fab-btn {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%) !important;
  box-shadow: 0 10px 24px rgba(63, 168, 58, 0.38) !important;
  border: 3px solid #fff !important;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  overflow: hidden;
}

.fab-wrap.open .fab-btn {
  background: linear-gradient(145deg, #ef4444, #dc2626) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

body.fab-open {
  overflow: hidden;
}
body.fab-open .app-dock-layer {
  z-index: 50000;
}

.fab-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  background: rgba(244, 250, 242, 0.48) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.28s ease, visibility 0.28s ease !important;
}
.fab-wrap.open .fab-overlay,
.fab-wrap.is-closing .fab-overlay {
  visibility: visible !important;
}
.fab-wrap.open .fab-overlay {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.fab-items {
  position: absolute !important;
  left: 50% !important;
  bottom: 72px !important;
  width: max-content !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  align-items: center !important;
  gap: 10px !important;
  transform: translateX(-50%) !important;
  pointer-events: none;
  visibility: visible;
  z-index: 3;
}
.fab-wrap.open .fab-items {
  pointer-events: auto;
}

.fab-item {
  position: static !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.7rem;
  min-height: 52px;
  padding: 0.45rem 1.2rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 12px 28px rgba(40, 80, 35, 0.14),
    0 2px 8px rgba(28, 25, 23, 0.08);
  color: #1c1917 !important;
  font-family: var(--font-sans) !important;
  font-weight: 750;
  font-size: 0.95rem;
  line-height: 1.1;
  text-decoration: none !important;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transition:
    opacity 0.22s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.18s ease,
    box-shadow 0.18s ease;
  pointer-events: none;
}
.fab-wrap.open .fab-item,
.fab-wrap.open .fab-item:nth-child(1),
.fab-wrap.open .fab-item:nth-child(2),
.fab-wrap.open .fab-item:nth-child(3),
.fab-wrap.open .fab-item:nth-child(4) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.fab-wrap.open .fab-item:nth-child(1) { transition-delay: .04s; }
.fab-wrap.open .fab-item:nth-child(2) { transition-delay: .08s; }
.fab-wrap.open .fab-item:nth-child(3) { transition-delay: .12s; }
.fab-wrap.open .fab-item:nth-child(4) { transition-delay: .16s; }
.fab-wrap.is-closing .fab-item { transition-delay: 0s; }
.fab-wrap.is-closing .fab-item:nth-child(1) { transition-delay: .12s; }
.fab-wrap.is-closing .fab-item:nth-child(2) { transition-delay: .08s; }
.fab-wrap.is-closing .fab-item:nth-child(3) { transition-delay: .04s; }
.fab-wrap.is-closing .fab-item:nth-child(4) { transition-delay: 0s; }
.fab-wrap.open .fab-item:hover,
.fab-wrap.open .fab-item:active,
.fab-wrap.open .fab-item.is-press,
.fab-wrap.open .fab-item.is-pop {
  transition-delay: 0s;
}
@media (hover: hover) and (pointer: fine) {
  .fab-wrap.open .fab-item:hover {
    transform: translateY(-3px) scale(1.04);
    background: #fff;
    box-shadow:
      0 16px 32px rgba(40, 80, 35, 0.18),
      0 4px 10px rgba(28, 25, 23, 0.08);
  }
  .fab-wrap.open .fab-item:hover .fab-item-icon {
    transform: scale(1.1) rotate(-8deg);
  }
}
.fab-wrap.open .fab-item:active,
.fab-wrap.open .fab-item.is-press {
  transform: translateY(1px) scale(0.94);
  box-shadow:
    0 6px 14px rgba(40, 80, 35, 0.12),
    0 1px 3px rgba(28, 25, 23, 0.08);
}
.fab-wrap.open .fab-item:active .fab-item-icon,
.fab-wrap.open .fab-item.is-press .fab-item-icon {
  transform: scale(0.88);
}
.fab-wrap.open .fab-item.is-pop .fab-item-icon {
  animation: fab-icon-pop 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fab-icon-pop {
  0% { transform: scale(0.88); }
  42% { transform: scale(1.2) rotate(-10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.fab-item-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: none !important;
  border: 0 !important;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.fab-item-icon::after {
  content: none !important;
  display: none !important;
}
.fab-item-label {
  display: inline !important;
  color: inherit !important;
}

.fab-item-icon--test {
  background: rgba(76, 175, 69, 0.18) !important;
  color: #2e7d32 !important;
}
.fab-item-icon--lecture {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #2563eb !important;
}
.fab-item-icon--hw {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #d97706 !important;
}
.fab-item-icon--analytics {
  background: rgba(168, 85, 247, 0.16) !important;
  color: #7c3aed !important;
}

html.theme-dark .fab-overlay {
  background: rgba(8, 10, 9, 0.5) !important;
}
html.theme-dark .fab-item {
  background: rgba(36, 42, 40, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f3f7f2 !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
html.theme-dark .fab-btn {
  border-color: #1a1e24 !important;
}
@media (prefers-reduced-motion: reduce) {
  .fab-item,
  .fab-item-icon {
    transition: none !important;
    animation: none !important;
  }
}

/* legacy bottom-nav hide if any leftover */
.bottom-nav { display: none !important; }

html.theme-dark .app-dock {
  background: rgba(26, 30, 36, 0.92) !important;
  border-color: rgba(var(--accent-rgb), 0.28) !important;
}

html.theme-dark .app-dock__item {
  color: #a8b5ac !important;
}

@media (max-width: 420px) {
  .app-dock {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding: 0.28rem 0.22rem;
    border-radius: 26px;
  }
  .app-dock__cluster {
    padding: 0.35rem;
    border-radius: 22px;
  }
  .app-dock__item {
    min-width: 0;
    max-width: none;
    font-size: 0.58rem;
    padding: 0.32rem 0.08rem;
    border-radius: 16px;
  }
  .app-dock__item i {
    width: 1.38rem;
    height: 1.38rem;
    font-size: 1.38rem;
  }
  .app-dock--fab .app-dock__bowl { border-radius: 26px; }
  .app-dock__fab-slot { width: 56px; flex: 0 0 56px; }
  .fab-btn { width: 52px !important; height: 52px !important; }
  .fab-wrap {
    left: calc(50% - 26px) !important;
    width: 52px;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 991px) {
  .kkt-notify__panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: min(78dvh, 560px);
  }
  .nav-notify-panel {
    width: min(340px, calc(100vw - 16px));
  }
  .nav-profile-btn {
    width: 42px;
    height: 42px;
    padding: 0.16rem !important;
  }
  main.container {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
  .page-header {
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    gap: 0.65rem;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap;
  }
  .page-header h2,
  .page-header h1 {
    font-size: 1.32rem !important;
    line-height: 1.25;
  }
  .page-header__actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .page-header__actions .btn-prim,
  .page-header__actions .btn-sec,
  .page-header__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .manage-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .manage-nav .btn-prim,
  .manage-nav .btn-sec {
    width: 100%;
    min-height: 44px;
    height: auto;
    justify-content: center;
    padding: 0.65rem 0.7rem !important;
    font-size: 0.84rem !important;
    white-space: nowrap;
  }
  .kkt-stats {
    border-radius: 14px;
  }
  .kkt-stats__item {
    padding: 0.7rem 0.8rem;
  }
  .kkt-stats__value {
    font-size: 1rem;
  }
  .mod-card {
    padding: 0.95rem 0.9rem 1.05rem;
  }
  .mod-card__head {
    flex-direction: column;
  }
  .mod-card__actions {
    width: 100%;
  }
  .mod-card__toolbar {
    width: 100%;
  }
  .mod-card__toolbar .btn-prim,
  .mod-card__toolbar .btn-sec,
  .mod-card__actions .btn-prim,
  .mod-card__actions .btn-sec {
    flex: 1 1 calc(50% - 0.45rem);
    justify-content: center;
    min-height: 42px;
  }
  #pageMain .card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
  }
  #pageMain .table {
    font-size: 0.84rem;
  }
  #pageMain .table td,
  #pageMain .table th {
    padding: 0.55rem 0.7rem;
  }
  .btn-act-group {
    width: 100%;
  }
  .form-control,
  .form-select,
  select.form-control,
  textarea.form-control {
    max-width: 100%;
  }
}

/* Profile dropdown (mobile menu) */
.nav-dropdown-panel,
#navDropdown {
  display: none;
  position: fixed !important;
  top: 60px;
  right: 12px;
  width: min(340px, calc(100vw - 24px)) !important;
  max-height: min(78vh, 640px);
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.14) !important;
  padding: 0.45rem !important;
  font-family: var(--font-sans) !important;
  z-index: 99999 !important;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity .2s ease, transform .2s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

#navDropdown[hidden] {
  display: none !important;
}

#navDropdown:not(.dd-open) {
  pointer-events: none;
}

html.theme-dark #navDropdown {
  background: var(--bg-card2) !important;
}

.nav-dd-head {
  padding: 0.65rem 0.8rem 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.3rem;
}

.nav-dd-notify {
  padding: 0.1rem 0.2rem 0.25rem;
}

.nav-dd-notify .nav-notify-head {
  padding: 0.25rem 0.55rem 0.1rem;
  border-bottom: none;
}
.nav-dd-notify .nav-notify-actions {
  padding: 0 0.45rem 0.4rem;
}
.nav-dd-notify .nav-notify-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 0.15rem 0.35rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  -webkit-overflow-scrolling: touch;
}

.nav-dd-notify .nav-notify-empty {
  padding: 0.85rem 0.6rem;
  font-size: 0.82rem;
}

.nav-dd-notify .nav-notify-item.kkt-notice {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}
.nav-dd-notify .nav-notify-item.is-read {
  opacity: 0.62;
}
.nav-dd-notify .nav-notify-item.is-unread {
  opacity: 1;
}

.nav-dd-head__name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1c1917;
  line-height: 1.25;
}

.nav-dd-head__role {
  font-size: 0.75rem;
  color: #7a8a7d;
  margin-top: 0.1rem;
}

html.theme-dark .nav-dd-head__name { color: var(--text-primary); }

.nav-dd-sep {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0.35rem;
}

.nav-dd-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  width: 100%;
  margin: 0;
  padding: 0.62rem 0.8rem !important;
  border: none !important;
  border-radius: 12px !important;
  background: none !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #3f4a43 !important;
  text-align: left !important;
  text-decoration: none !important;
  transition: background .15s, color .15s !important;
  font-family: var(--font-sans) !important;
  cursor: pointer !important;
}

.nav-dd-item i {
  width: 1.15rem;
  text-align: center;
  color: #4caf45;
  font-size: 1rem;
  opacity: 0.9;
}

.nav-dd-item:hover,
.nav-dd-item:focus {
  background: rgba(76, 175, 69, 0.1) !important;
  color: #1c1917 !important;
  text-decoration: none !important;
}

.nav-dd-item--danger,
.nav-dd-item.nav-dd-item--danger {
  color: #dc2626 !important;
}

.nav-dd-item--danger i {
  color: #dc2626 !important;
}

.nav-dd-item--danger:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #b91c1c !important;
}

html.theme-dark .nav-dd-item {
  color: var(--text-muted) !important;
}

html.theme-dark .nav-dd-item:hover {
  color: #fff !important;
}

footer { background: transparent !important; border-top: 1px solid var(--border) !important; color: var(--text-muted) !important; }

.auth-wrap {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
  position: relative;
  isolation: isolate;
  overflow: visible;
}
.auth-wrap--v2 {
  background: transparent;
}
.auth-bg { display: none; }
.auth-wrap > *:not(.auth-bg) { position: relative; z-index: 1; }

.kkt-main--auth {
  width: 100%;
  place-items: center;
  align-content: center;
  padding: 1.5rem 1.25rem 2.5rem;
}
@media (max-width: 760px) {
  .kkt-main--auth {
    padding: 0.85rem 0.9rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }
  .auth-split { border-radius: 20px; }
}
.auth-split {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 28px rgba(40, 110, 35, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.auth-split__brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2.5rem 2.1rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 420px;
  background: #2f8a2a;
}
.auth-split__logo-bg {
  position: absolute;
  width: min(128%, 420px);
  height: auto;
  max-width: none;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}
.auth-split__brand::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(165deg, rgba(92, 191, 82, 0.78) 0%, rgba(47, 138, 42, 0.88) 55%, rgba(40, 120, 36, 0.92) 100%),
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.22), transparent 45%);
  pointer-events: none;
}
.auth-split__brand-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 17.5rem;
  color: #fff;
}
.auth-split__title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #fff;
}
.auth-split__text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #fff;
  opacity: 0.95;
  font-weight: 450;
}
.auth-split__points {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  color: #fff;
}
.auth-split__points li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.86rem;
  color: #fff;
  opacity: 0.95;
  line-height: 1.35;
}
.auth-split__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.auth-split__panel {
  padding: 2.25rem 2rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-split__heading {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
  font-weight: 750;
  color: var(--text-primary);
}
.auth-split__hint {
  margin: 0 0 1.35rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-brand-logo {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.97) !important;
  border: 1px solid rgba(76, 175, 69, 0.16) !important;
  border-radius: 24px !important;
  padding: 2rem 1.75rem !important;
  box-shadow: 0 8px 24px rgba(40, 110, 35, 0.08) !important;
  overflow: visible !important;
  backdrop-filter: none;
}
.auth-card::before { display: none !important; }
.auth-title {
  font-family: var(--font-display);
  font-size: 1.65rem !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  background: none !important;
  -webkit-text-fill-color: unset !important;
  text-align: center;
  margin-bottom: 0.35rem;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-muted) !important;
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.auth-form { display: grid; gap: 0.85rem; }
.auth-field {
  position: relative;
}
.auth-field__input {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-pill) !important;
  border: 1.5px solid rgba(28, 25, 23, 0.12) !important;
  background: rgba(255,255,255,0.95) !important;
  padding: 1.15rem 2.6rem 0.35rem 1.15rem !important;
  color: var(--text-primary) !important;
  font-size: 0.98rem !important;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: none !important;
}
.auth-field__input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(76, 175, 69, 0.16) !important;
}
.auth-field__label {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: 0.22s ease;
  background: transparent;
}
.auth-field__input:focus + .auth-field__label,
.auth-field__input:not(:placeholder-shown) + .auth-field__label {
  top: 0.42rem;
  transform: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2f8a2a;
}
.auth-field__toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.auth-field__toggle:hover { color: var(--accent); background: rgba(76, 175, 69, 0.08); }

.auth-field.has-error .auth-field__input,
.auth-field__input.is-invalid {
  border-color: #f04438 !important;
  box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.12) !important;
}

.auth-field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: #fef2f2;
  color: #b42318;
  border: 1px solid #fecaca;
  border-left: 3px solid #b42318;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.auth-field-error i { flex-shrink: 0; margin-top: 1px; font-size: 0.9rem; }

.auth-error {
  background: #fef2f2;
  color: #b42318;
  border: 1px solid #fecaca;
  border-left: 3px solid #b42318;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.auth-error i { flex-shrink: 0; margin-top: 1px; }

.auth-warning {
  background: #fffaeb;
  color: #b54708;
  border: 1px solid #fedf89;
  border-left: 3px solid #f79009;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-ok {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #aaefc6;
  border-left: 3px solid #12b76a;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 0.9rem;
}
.auth-ok i, .auth-warning i { flex-shrink: 0; margin-top: 1px; }
.auth-warning { margin-bottom: 0.9rem; }
.auth-field__input--code {
  letter-spacing: 0.35em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.auth-foot__sep { display: inline-block; width: 0.7rem; }

.auth-remember {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  line-height: 1.35;
}
.auth-remember input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid rgba(28, 25, 23, 0.18);
  background: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.78rem;
  box-shadow: none;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.auth-remember input:hover {
  border-color: rgba(76, 175, 69, 0.55);
}
.auth-remember input:checked {
  background-color: #4caf45;
  border-color: #4caf45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.2 8.3l3.1 3.1 6.5-6.6'/%3E%3C/svg%3E");
}
.auth-remember input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.28);
}

.auth-clear {
  width: 100%;
  margin-top: 0.15rem;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(28, 25, 23, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.auth-clear:hover {
  background: rgba(76, 175, 69, 0.08);
  color: #2f8a2a;
  border-color: rgba(76, 175, 69, 0.35);
}

.auth-saved {
  margin-top: 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  color: #2f8a2a;
  background: rgba(76, 175, 69, 0.08);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}

.auth-submit {
  margin-top: 0.35rem;
  height: 50px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(63, 168, 58, 0.22);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(63, 168, 58, 0.26);
  transform: translateY(-1px);
  color: #fff;
}
.auth-submit:active { transform: translateY(0); }
.auth-foot { margin-top: 1.1rem; text-align: center; font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }
.auth-link { color: #2f8a2a; font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .auth-split {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }
  .auth-split__brand {
    min-height: 240px;
    padding: 1.7rem 1.5rem 1.45rem;
    justify-content: flex-end;
    align-items: stretch;
  }
  .auth-split__logo-bg {
    width: min(100%, 280px);
    top: 38%;
    opacity: 0.22;
  }
  .auth-split__brand-content {
    max-width: none;
    align-items: flex-start;
  }
  .auth-split__panel { padding: 1.6rem 1.4rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .kkt-shell, .kkt-bg__blob, .kkt-bg__grid { animation: none !important; }
}

.kkt-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  /* static gradient — animated background-position was paint-heavy */
  background: linear-gradient(135deg, #f7fcf5 0%, #eef8eb 45%, #e8f6e4 100%);
  background-size: auto;
  animation: none;
  color: var(--text-primary); font-family: var(--font-sans);
}
.kkt-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  transform: translateZ(0);
}
.kkt-bg.is-paused .kkt-bg__blob,
.kkt-bg.is-paused .kkt-bg__iso,
.kkt-shell.is-paused { animation-play-state: paused !important; }
.kkt-bg.is-paused .kkt-bg__blob { animation-play-state: paused !important; }
.kkt-bg__blob {
  position: absolute;
  border-radius: 50%;
  /* soft edges via gradient — no filter:blur (was the main lag on login/landing) */
  filter: none;
  opacity: 0.7;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.kkt-bg__blob--1 {
  width: 46vw; height: 46vw; max-width: 520px; max-height: 520px;
  left: -8%; top: -12%;
  background: radial-gradient(circle at 30% 30%, rgba(168, 230, 153, 0.55), rgba(76, 175, 69, 0.18), transparent 68%);
  animation: kkt-drift-1 28s ease-in-out infinite alternate;
}
.kkt-bg__blob--2 {
  width: 40vw; height: 40vw; max-width: 460px; max-height: 460px;
  right: -10%; top: 18%;
  background: radial-gradient(circle at 70% 40%, rgba(116, 216, 102, 0.4), rgba(76, 175, 69, 0.14), transparent 68%);
  animation: kkt-drift-2 34s ease-in-out infinite alternate;
}
.kkt-bg__blob--3 {
  width: 36vw; height: 36vw; max-width: 400px; max-height: 400px;
  left: 28%; bottom: -14%;
  background: radial-gradient(circle at 50% 50%, rgba(200, 240, 170, 0.42), rgba(76, 175, 69, 0.12), transparent 68%);
  animation: kkt-drift-3 30s ease-in-out infinite alternate;
}
.kkt-bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(76, 175, 69, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(76, 175, 69, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  animation: none; /* was animating background-position */
}
@keyframes kkt-bg-shift {
  0%, 100% { background-position: 0% 40%; }
}
@keyframes kkt-blob-pulse {
  from, to { opacity: 0.65; }
}
@keyframes kkt-drift-1 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(5%, 6%, 0); }
}
@keyframes kkt-drift-2 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-5%, 4%, 0); }
}
@keyframes kkt-drift-3 {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(4%, -5%, 0); }
}
@keyframes kkt-grid-drift {
  from, to { background-position: 0 0; }
}
.kkt-bg__iso {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 18px 28px rgba(47, 138, 42, 0.18));
}
.kkt-bg__iso--e-learn-c1 {
  width: min(24vw, 220px);
  top: 10%;
  left: 1.5%;
  opacity: 0.7;
  animation: kkt-iso-e-learn-a 10s ease-in-out infinite;
}
.kkt-bg__iso--e-learn-p1 {
  width: min(17vw, 168px);
  top: 3%;
  right: 2%;
  opacity: 0.64;
  animation: kkt-iso-e-learn-b 12s ease-in-out infinite;
}
.kkt-bg__iso--e-learn-c2 {
  width: min(13vw, 118px);
  bottom: 7%;
  left: 7%;
  opacity: 0.5;
  animation: kkt-iso-e-learn-c 11s ease-in-out infinite;
}
.kkt-bg__iso--e-learn-p2 {
  width: min(15vw, 140px);
  bottom: 8%;
  right: 1.5%;
  opacity: 0.58;
  animation: kkt-iso-e-learn-a 13s ease-in-out infinite reverse;
}
.kkt-bg__iso--e-learn-c3 {
  width: min(11vw, 98px);
  top: 48%;
  right: 16%;
  opacity: 0.4;
  animation: kkt-iso-e-learn-b 14s ease-in-out infinite reverse;
}
@keyframes kkt-iso-e-learn-a {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(8deg); }
  50% { transform: translate3d(10px, -16px, 0) rotate(-4deg); }
}
@keyframes kkt-iso-e-learn-b {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-10deg); }
  50% { transform: translate3d(-12px, -14px, 0) rotate(6deg); }
}
@keyframes kkt-iso-e-learn-c {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(14deg); }
  50% { transform: translate3d(8px, -20px, 0) rotate(2deg); }
}
html.auth-lite-html .auth-lite__bg,
body.landing-shell .kkt-bg {
  contain: none;
}
@media (max-width: 760px) {
  .kkt-bg__iso--e-learn-c1 {
    width: min(36vw, 150px);
    top: 3%;
    left: -4%;
    opacity: 0.5;
  }
  .kkt-bg__iso--e-learn-p1 {
    width: min(28vw, 120px);
    top: 2%;
    right: -6%;
    opacity: 0.46;
  }
  .kkt-bg__iso--e-learn-c2 {
    width: min(22vw, 92px);
    bottom: 10%;
    left: -2%;
    opacity: 0.38;
  }
  .kkt-bg__iso--e-learn-p2 {
    width: min(24vw, 100px);
    bottom: 4%;
    right: -4%;
    opacity: 0.42;
  }
  .kkt-bg__iso--e-learn-c3 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kkt-shell, .kkt-bg__blob, .kkt-bg__grid, .kkt-bg__iso { animation: none !important; }
}
.kkt-shell > *:not(.kkt-bg):not(.landing-ios) { position: relative; z-index: 1; }
.kkt-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.5rem; max-width: 1080px; width: 100%; margin: 0 auto;
}
.kkt-logo {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none;
  color: var(--text-primary); font-family: var(--font-sans); font-weight: 700; font-size: 1.25rem;
}
.kkt-logo-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: contain; display: block;
  background: transparent;
}
.kkt-top-link {
  text-decoration: none; color: #fff; background: var(--accent);
  padding: 0.55rem 1.2rem; border-radius: var(--radius-pill); font-weight: 600; font-size: 0.9rem;
  transition: background var(--transition), transform var(--transition), color var(--transition), border-color var(--transition);
}
.kkt-top-link:hover { background: var(--accent2); color: #fff; }
.kkt-top-link--ghost {
  background: rgba(255,255,255,0.55);
  color: #2f8a2a;
  border: 1.5px solid rgba(76, 175, 69, 0.45);
}
.kkt-top-link--ghost:hover {
  background: rgba(76, 175, 69, 0.12);
  color: #2f8a2a;
}
.kkt-main { flex: 1; display: grid; place-items: center; padding: 2.5rem 1.25rem 4rem; }
.kkt-hero {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.kkt-panel { width: 100%; text-align: left; }
.kkt-panel h1 {
  font-family: inherit; font-size: clamp(2rem, 4.5vw, 2.85rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 1rem; font-weight: 700;
}
body.landing-shell {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
.landing-shell .kkt-logo,
.landing-shell .kkt-top-link,
.landing-shell .kkt-panel h1,
.landing-shell .kkt-panel p,
.landing-shell .kkt-btn,
.landing-shell .kkt-btn-outline,
.landing-shell .kkt-bottom {
  font-family: inherit;
}
.landing-shell .kkt-panel h1 {
  font-weight: 700;
}
.landing-shell .kkt-panel h1 em { font-weight: 700; }
.landing-shell .kkt-panel p { font-weight: 400; }
.landing-shell .kkt-btn,
.landing-shell .kkt-btn-outline {
  font: inherit;
  font-weight: 600;
}
.kkt-panel h1 em { font-style: normal; color: var(--accent); }
.kkt-panel p { margin: 0 0 1.5rem; font-size: 1.05rem; line-height: 1.6; color: var(--text-muted); max-width: 36rem; font-weight: 400; }
.kkt-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.kkt-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none;
  background: var(--accent); color: #fff; font-weight: 600; padding: 0.8rem 1.4rem;
  border-radius: var(--radius-pill);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.kkt-btn:hover { background: var(--accent2); color: #fff; }
.kkt-btn-outline {
  display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none;
  background: rgba(255,255,255,0.55); color: #2f8a2a; font-weight: 600;
  padding: 0.75rem 1.35rem; border-radius: var(--radius-pill); border: 1.5px solid var(--accent);
  backdrop-filter: blur(6px);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.kkt-btn-outline:hover { background: rgba(76, 175, 69, 0.12); color: #2f8a2a; }
.kkt-hero-visual {
  display: flex; justify-content: center; align-items: center;
}
.kkt-hero-visual img {
  width: min(100%, 400px); height: auto; display: block;
  background: transparent;
  filter: drop-shadow(0 18px 30px rgba(47, 120, 40, 0.18));
}
.kkt-phone {
  width: min(100%, 232px);
  aspect-ratio: 9 / 16.6;
  padding: 11px;
  border-radius: 34px;
  background: #1c1c1f;
  box-shadow: 0 22px 44px rgba(30, 70, 28, 0.2);
}
.kkt-phone__screen {
  height: 100%;
  border-radius: 24px;
  background: linear-gradient(180deg, #f7fcf5, #e8f6e4);
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.kkt-phone__notch {
  width: 78px;
  height: 7px;
  border-radius: 99px;
  background: #1c1c1f;
  margin: 0 auto 6px;
}
.kkt-phone__row {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.52rem 0.55rem;
  border-radius: 12px;
  background: #fff;
  font-size: 0.7rem;
  color: #1c1917;
  font-weight: 500;
}
.kkt-phone__row b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kkt-phone__row i { font-style: normal; color: #6b7368; font-variant-numeric: tabular-nums; }
.kkt-phone__num {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 8px;
  background: #4caf45;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.68rem;
}
.kkt-phone__row.is-now {
  background: #d9f3d4;
  box-shadow: 0 0 0 1.5px rgba(76, 175, 69, 0.55);
}
.kkt-bottom {
  padding: 1rem 1.5rem 1.4rem; text-align: center; color: var(--text-muted);
  font-size: 0.82rem; border-top: 1px solid rgba(76, 175, 69, 0.12);
  background: rgba(255,255,255,0.35); backdrop-filter: blur(8px);
}
@media (max-width: 800px) {
  .kkt-phone { width: min(100%, 180px); }
}
.landing-ios[hidden] { display: none !important; }
.landing-ios {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(18, 28, 16, 0.45);
  backdrop-filter: blur(6px);
}
.landing-ios__card {
  width: min(24rem, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 1.4rem 1.45rem 1.25rem;
  text-align: left;
  box-shadow: 0 18px 40px rgba(20, 40, 16, 0.18);
  color: #1c1917;
}
.landing-ios__card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.landing-ios__card ol {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  color: #333;
  line-height: 1.45;
}
.landing-ios__note {
  margin: 0 0 1rem;
  color: #6b7368;
  font-size: 0.9rem;
  line-height: 1.45;
}
.landing-ios .kkt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  border: 0;
  cursor: pointer;
}
.brand-logo, .auth-brand-logo {
  background: transparent !important;
  object-fit: contain !important;
}

.dash-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; overflow-x: hidden; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.85rem; }
.dash-tile {
  display: block; text-decoration: none; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.1rem 1.15rem; color: var(--text-primary);
}
.dash-tile:hover { border-color: var(--border-accent); color: var(--text-primary); text-decoration: none; background: var(--bg-card2); }
.dash-tile strong { display: block; font-size: 1.02rem; margin-bottom: 0.25rem; }
.dash-tile span { display: block; color: var(--text-muted); font-size: 0.88rem; }
.dash-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 1.25rem;
  padding: 0.2rem 0.05rem 0.5rem;
  justify-content: stretch;
}
.dash-profile-grid .pcard {
  max-width: none !important;
  width: 100%;
}
.dash-profile-grid .pcard-title {
  font-size: 1.22rem !important;
}
.dash-profile-grid--student .pcard-title,
.pcard-grid--student .pcard-title {
  font-size: 1.82rem !important;
  line-height: 1.18 !important;
  letter-spacing: -0.02em;
}
.dash-profile-grid--student .pcard-action,
.pcard-grid--student .pcard-action {
  font-size: 1rem !important;
  padding: 0.72rem 1.2rem !important;
}
.course-mod-grid {
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  justify-content: stretch;
  padding: 0;
}
.course-mod-grid .pcard {
  max-width: none;
}
.course-mod-grid .course-choice {
  grid-column: 1 / -1;
}
.course-choice {
  padding: 1.05rem 1.1rem 1.15rem;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(40, 70, 50, 0.08);
}
.course-choice .course-form { margin-top: 0.55rem; }

.kkt-stats {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  overflow: hidden;
}
.kkt-stats__item {
  flex: 1 1 150px;
  min-width: 140px;
  padding: 0.8rem 1.05rem;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.kkt-stats__item:last-child { border-right: 0; }
a.kkt-stats__item:hover { background: var(--bg-card2); color: inherit; }
.kkt-stats__label {
  display: block;
  margin: 0 0 0.15rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.kkt-stats__value {
  display: block;
  color: var(--text-primary);
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.manage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.manage-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.manage-bento--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.manage-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 10.8rem;
  padding: 1.15rem 1.15rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(47, 138, 42, 0.05);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  overflow: hidden;
}
.manage-tile:hover {
  border-color: rgba(76, 175, 69, 0.4);
  background: var(--bg-card2);
  color: var(--text-primary);
  text-decoration: none !important;
  transform: translateY(-1px);
}
.manage-tile i {
  display: grid;
  place-items: center;
  width: 3.85rem;
  height: 3.85rem;
  margin: 0 0 0.85rem;
  border-radius: 16px;
  background: rgba(76, 175, 69, 0.14);
  color: var(--accent);
  font-size: 2.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.manage-tile strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.manage-tile span {
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}
.manage-tile--accent {
  grid-column: span 2;
  background: linear-gradient(180deg, rgba(76, 175, 69, 0.16), var(--bg-card) 62%);
  border-color: rgba(76, 175, 69, 0.28);
}
.manage-tile--wide {
  grid-column: span 2;
  min-height: 12.4rem;
  padding: 1.3rem 1.35rem 1.25rem;
}
.manage-tile--wide i {
  width: 5.1rem;
  height: 5.1rem;
  border-radius: 20px;
  font-size: 2.85rem;
  margin-bottom: 0.95rem;
}
.manage-tile--wide strong { font-size: 1.32rem; }
.manage-tile--ghost {
  background: transparent;
  box-shadow: none;
}
.manage-tile--warn i {
  color: #b54708;
  background: rgba(181, 71, 8, 0.14);
}
.manage-tile--warn { border-color: rgba(181, 71, 8, 0.25); }
.role-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.role-module {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  cursor: pointer;
  user-select: none;
}
.role-module input { margin: 0 0 0.25rem; }
.role-module i { color: var(--accent); font-size: 1.05rem; }
.role-module strong { font-size: 0.92rem; font-weight: 800; }
.role-module span { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; line-height: 1.35; }
.role-module.is-on {
  border-color: rgba(76, 175, 69, 0.45);
  background: rgba(76, 175, 69, 0.1);
}
.role-assign { display: grid; gap: 0.55rem; }
@media (max-width: 560px) {
  .role-modules { grid-template-columns: 1fr; }
}
html.theme-dark .manage-tile {
  box-shadow: none;
}
html.theme-dark .manage-tile i {
  background: rgba(76, 175, 69, 0.2);
}
html.theme-dark .manage-tile--warn i {
  background: rgba(181, 71, 8, 0.22);
}
html.theme-dark .manage-tile--accent {
  background: linear-gradient(180deg, rgba(76, 175, 69, 0.18), var(--bg-card) 70%);
}
@media (max-width: 980px) {
  .manage-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-tile--accent,
  .manage-tile--wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .manage-bento,
  .manage-bento--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-tile { min-height: 9.4rem; padding: 0.95rem 0.85rem 1rem; }
  .manage-tile i { width: 3.15rem; height: 3.15rem; font-size: 1.75rem; margin-bottom: 0.7rem; }
  .manage-tile--wide { min-height: 10.6rem; }
  .manage-tile--wide i { width: 4.1rem; height: 4.1rem; font-size: 2.25rem; }
  .manage-tile strong { font-size: 0.92rem; }
}

.kkt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 1.15rem;
  border-bottom: 1px solid var(--border);
}
.kkt-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.05rem;
  margin-bottom: -1px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 650;
  border-bottom: 2px solid transparent;
}
.kkt-tabs__item:hover { color: var(--text-primary); }
.kkt-tabs__item.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.kkt-tabs__count {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.course-layout__panel-body { padding: 1rem 1.05rem; }
.group-pick {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 28rem;
  overflow: auto;
}
.group-pick--wide {
  max-height: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.group-pick__item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.55rem 0.7rem 0.55rem 2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card2);
  cursor: pointer;
  position: relative;
}
.group-pick__item input {
  position: absolute;
  left: 0.65rem;
  top: 0.7rem;
}
.group-pick__item:has(input:checked) {
  border-color: var(--border-accent);
  background: var(--bg-card);
}
.group-pick__name { font-weight: 650; }
.group-pick__meta { color: var(--text-muted); font-size: 0.78rem; }
.merge-keep {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .course-layout { grid-template-columns: 1fr; }
}

.kkt-table-wrap,
#pageMain .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#pageMain .table,
#pageMain table.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: var(--bg-card2);
  --bs-table-hover-bg: var(--bg-card2);
  --bs-table-accent-bg: transparent;
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  color: var(--text-primary);
  background: transparent;
  font-size: 0.92rem;
}
#pageMain .table > :not(caption) > * > *,
#pageMain .table td,
#pageMain .table th {
  background: transparent !important;
  border-bottom: 1px solid var(--border);
  padding: 0.68rem 0.95rem;
  vertical-align: middle;
  box-shadow: none !important;
}
#pageMain .table thead th {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  background: var(--bg-card2) !important;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
#pageMain .table tbody tr:hover > * {
  background: var(--bg-card2) !important;
}
#pageMain .table tbody tr:last-child > * {
  border-bottom: 0;
}
#pageMain .table .kkt-table__empty {
  color: var(--text-muted);
  text-align: left;
  padding: 1rem 0.95rem;
}
#pageMain .card-body:has(> .table),
#pageMain .card-body:has(> .kkt-table-wrap),
#pageMain .card-body:has(> .table-responsive) {
  padding: 0;
}

@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .kkt-stats__item {
    flex: 1 1 46%;
    border-bottom: 1px solid var(--border);
  }
  .kkt-stats__item:nth-child(even) { border-right: 0; }
  .kkt-stats__item:last-child { border-bottom: 0; }
}

.sd-result-row {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}
.sd-result-name { color: var(--text-primary) !important; }
.sd-result-date, .sd-stat-label { color: var(--text-muted) !important; }
.sd-section-title, .sd-section-title span { color: var(--text-primary) !important; }
.sd-see-all { color: var(--accent) !important; }
.tip-row { background: var(--bg-card2) !important; border-color: var(--border) !important; }
.tip-text { color: var(--text-muted) !important; }
.tip-text strong { color: var(--text-primary) !important; }

.tip-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tip-row {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.9rem !important;
  box-sizing: border-box;
}

.tip-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
  font-size: 1.05rem !important;
  flex-shrink: 0 !important;
}

.tip-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.84rem !important;
  line-height: 1.4 !important;
}

.tip-text strong {
  font-size: 0.92rem !important;
  margin-bottom: 0.12rem !important;
}

.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-bottom-grid:has(.dash-panel:only-child) {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .dash-bottom-grid { grid-template-columns: 1fr; }
}
.sd-settings-btn, .logout-btn {
  background: var(--bg-card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

/* Checkbox + switch — одинаковые в ЭО и в расписании */
.form-check-input[type="checkbox"],
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.12em;
  cursor: pointer;
  vertical-align: top;
  border-radius: 6px;
  border: 1.5px solid rgba(28, 25, 23, 0.18) !important;
  background-color: #fff !important;
  background-image: none !important;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.78rem;
  box-shadow: none !important;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}
.form-check-input[type="checkbox"]:hover,
input[type="checkbox"]:hover {
  border-color: rgba(76, 175, 69, 0.55) !important;
}
.form-check-input[type="checkbox"]:focus,
input[type="checkbox"]:focus {
  border-color: rgba(76, 175, 69, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.22) !important;
}
.form-check-input[type="checkbox"]:checked,
input[type="checkbox"]:checked {
  background-color: #4caf45 !important;
  border-color: #4caf45 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.2 8.3l3.1 3.1 6.5-6.6'/%3E%3C/svg%3E") !important;
}

.form-switch .form-check-input {
  width: 2.7rem !important;
  height: 1.55rem !important;
  margin-top: 0.05rem;
  padding: 0;
  border-radius: 999px !important;
  border: 0 !important;
  background-color: #d7dfd4 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23fff'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 0.16rem center !important;
  background-size: 1.22rem !important;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08) !important;
  transition: background-position .2s ease, background-color .2s ease !important;
}
.form-switch .form-check-input:hover {
  background-color: #cbd5c8 !important;
}
.form-switch .form-check-input:focus {
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08), 0 0 0 3px rgba(76, 175, 69, 0.22) !important;
}
.form-switch .form-check-input:checked {
  background-color: #4caf45 !important;
  border-color: transparent !important;
  background-position: right 0.16rem center !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23fff'/%3E%3C/svg%3E") !important;
  box-shadow: none !important;
}
.form-switch .form-check-input:checked:focus {
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.28) !important;
}

html.theme-dark .form-check-input[type="checkbox"],
html.theme-dark input[type="checkbox"] {
  background-color: #2c362f !important;
  border-color: rgba(244, 248, 241, 0.22) !important;
}
html.theme-dark .form-check-input[type="checkbox"]:checked,
html.theme-dark input[type="checkbox"]:checked,
html.theme-dark .form-switch .form-check-input:checked {
  background-color: #6dcc63 !important;
  border-color: #6dcc63 !important;
}
html.theme-dark .form-switch .form-check-input {
  background-color: #3a453c !important;
  box-shadow: inset 0 0 0 1px rgba(244, 248, 241, 0.1) !important;
}
html.theme-dark .auth-remember input {
  background-color: #2c362f;
  border-color: rgba(244, 248, 241, 0.22);
}
html.theme-dark .auth-remember input:checked {
  background-color: #6dcc63;
  border-color: #6dcc63;
}

/* ══════════════════════════════════════════
   CHAT — light brand theme (#4caf45)
══════════════════════════════════════════ */
.tg-chat-layout {
  background: #fff !important;
  border-color: var(--border) !important;
  border-radius: 18px 18px 0 0 !important;
  box-shadow: 0 8px 28px rgba(28, 25, 23, 0.06);
  font-family: var(--font-sans) !important;
}

.tg-sidebar {
  background: #fff !important;
  border-right: 1px solid var(--border) !important;
  min-width: 0;
}
.tg-sidebar-header {
  background: #fff !important;
  border-bottom: 0 !important;
  padding: 1rem 1rem 0.75rem !important;
  min-width: 0;
  overflow: hidden;
}

.tg-chat-toolbar--list {
  min-height: 44px;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}
.tg-chat-toolbar--list .tg-chat-toolbar__title {
  flex: 1;
  font-size: clamp(1.65rem, 4vw, 1.95rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.tg-chat-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  padding: 0.58rem 0.95rem;
  background: #f1f3f1;
  border-radius: 999px;
  color: #7a8a7d;
}
.tg-chat-search i {
  font-size: 0.95rem;
  flex-shrink: 0;
}
.tg-chat-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1c1917;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}
.tg-chat-search input::placeholder {
  color: #8a9a8d;
}
.tg-chat-search__clear {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #d7ddd7;
  color: #5a6b5e;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.tg-chat-search__clear i { font-size: 0.7rem; }
.tg-chat-tabs {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.tg-chat-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.tg-chat-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.78rem;
  background: #eef1ee;
  color: #1c1917;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}
.tg-chat-tab.is-on {
  background: #4caf45;
  color: #fff;
}

.tg-sidebar-list {
  padding: 0.15rem 0 0.5rem !important;
}
.chat-list-empty {
  padding: 2.4rem 1.25rem;
  text-align: center;
}
.chat-list-empty p {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.chat-list-wait,
.chat-people-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}
.chat-people-wait .smile-loader {
  margin: 0.35rem auto 0;
}
.tg-main-empty .chat-list-wait {
  padding: 1.5rem 1rem;
}

.tg-swipe {
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}
.tg-swipe__front,
.tg-swipe .tg-contact {
  border-radius: 0 !important;
  background: #fff !important;
}
.tg-contact {
  padding: 0.72rem 1rem !important;
  margin-bottom: 0 !important;
  border-radius: 0 !important;
  gap: 0.8rem !important;
  border-bottom: 1px solid #f0f2f0;
}
.tg-contact-avatar {
  width: 52px !important;
  height: 52px !important;
  font-size: 1.05rem !important;
  box-shadow: none !important;
}
.tg-contact-name {
  font-size: 0.98rem !important;
  font-weight: 750 !important;
}
.tg-contact-time {
  font-size: 0.72rem !important;
  color: #8a9a8d !important;
}
.tg-contact-last {
  font-size: 0.82rem !important;
}
.tg-contact-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 0.38rem !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tg-main-header {
  padding: 0.55rem 0.85rem !important;
}
.tg-chat-toolbar__text-title {
  font-size: 1.02rem !important;
  font-weight: 800 !important;
}
.tg-main-avatar {
  width: 42px !important;
  height: 42px !important;
  box-shadow: none !important;
}

.chat-msg {
  flex-direction: column !important;
  align-items: flex-end;
  gap: 0.18rem;
}
.chat-msg-other {
  align-items: flex-start !important;
}
.chat-msg.has-ava {
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 0.4rem;
}
.chat-msg__col {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  min-width: 0;
}
.chat-msg.has-ava .chat-msg__col {
  max-width: calc(78% - 36px);
}
.chat-msg-mine .chat-msg__col { align-items: flex-end; }
.chat-msg-other .chat-msg__col { align-items: flex-start; }
.chat-msg-ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 1.15rem;
  background: linear-gradient(145deg, #4caf45, #3d8f38);
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-msg-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-sender {
  display: block;
  max-width: 100%;
  padding: 0 0.4rem 0.12rem;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1b7f32;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.theme-dark .chat-sender,
html.chat-theme-dark .chat-sender {
  color: #8bd67f;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.chat-bubble {
  max-width: 100%;
  border-radius: 18px !important;
  padding: 0.62rem 0.9rem !important;
}
.chat-msg-mine .chat-bubble {
  border-bottom-right-radius: 6px !important;
  box-shadow: none !important;
}
.chat-msg-other .chat-bubble {
  border-bottom-left-radius: 6px !important;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04) !important;
}
.chat-bubble-img {
  max-width: 220px;
  border-radius: 12px;
  margin-bottom: 0.3rem;
  display: block;
}
.chat-bubble-time {
  margin: 0 0.4rem !important;
  font-size: 0.68rem !important;
  opacity: 1 !important;
  text-align: inherit !important;
}
.chat-msg-mine .chat-bubble-time,
.chat-msg-other .chat-bubble-time {
  color: #8a9a8d !important;
}

.chat-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem !important;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px)) !important;
}
.chat-muted-banner {
  flex: 1 0 100%;
}
.chat-reply-bar {
  flex: 1 0 100%;
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  margin: 0 0 0.2rem;
  padding: 0.2rem 0 0.2rem 0.1rem;
  min-height: 40px;
  background: transparent;
}
.chat-reply-bar[hidden] { display: none !important; }
.chat-reply-bar__accent {
  width: 2px;
  border-radius: 99px;
  flex-shrink: 0;
  background: #4caf45;
}
.chat-reply-bar__body {
  min-width: 0;
  flex: 1;
  padding: 0.12rem 0;
}
.chat-reply-bar__body span {
  display: block;
  font-size: 0.72rem;
  font-weight: 750;
  color: #2e7d32;
  line-height: 1.2;
}
.chat-reply-bar__body p {
  margin: 0.08rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-bar__x {
  width: 36px;
  height: auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-quote {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.chat-quote__bar {
  width: 2px;
  border-radius: 99px;
  flex-shrink: 0;
  background: #4caf45;
  align-self: stretch;
  min-height: 1em;
}
.chat-quote__text {
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-msg-mine .chat-quote__bar {
  background: rgba(255, 255, 255, 0.92);
}
.chat-msg-mine .chat-quote__text {
  color: rgba(255, 255, 255, 0.88);
}
.chat-reacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.28rem;
}
.chat-reacts[hidden] { display: none !important; }
.chat-react {
  border: 0;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  background: rgba(255,255,255,0.86);
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28,25,23,0.08);
}
.chat-react.is-mine {
  background: rgba(76, 175, 69, 0.22);
  box-shadow: inset 0 0 0 1px rgba(76, 175, 69, 0.45);
}
.chat-msg.is-picked .chat-bubble {
  box-shadow: 0 0 0 2px rgba(76, 175, 69, 0.45);
}
#chatMessages,
#chatMessages .chat-msg,
#chatMessages .chat-bubble,
#chatMessages .chat-bubble-text {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#chatMessages .chat-bubble {
  cursor: pointer;
}
#chatMessages .chat-bubble:active {
  filter: brightness(0.97);
}
.chat-msg.is-flash .chat-bubble {
  animation: chat-flash 0.9s ease;
}
@keyframes chat-flash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.55); }
}
.tg-main.is-chat-loading {
  opacity: 0.72;
  pointer-events: none;
}
.tg-msg-layer {
  position: fixed;
  inset: 0;
  z-index: 14050;
  display: block;
  padding: 0;
  pointer-events: none;
}
.tg-msg-layer[hidden] { display: none !important; }
.tg-msg-layer.is-on { pointer-events: auto; }
.tg-msg-layer__dim {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 14, 0.28);
}
.tg-msg-sheet {
  position: absolute;
  width: min(16.6rem, calc(100vw - 24px));
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(28, 25, 23, 0.22);
  overflow: hidden;
  transform: scale(0.96);
  transform-origin: top left;
  opacity: 0;
  transition: transform .16s ease, opacity .16s ease, width .18s ease;
}
.tg-msg-sheet.is-reacts-open {
  width: min(20.4rem, calc(100vw - 24px));
}
.tg-msg-sheet--mine { transform-origin: top right; }
.tg-msg-layer.is-on .tg-msg-sheet {
  transform: none;
  opacity: 1;
}
.tg-msg-reacts {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.55rem 0.55rem 0.2rem;
}
.tg-msg-reacts[hidden] { display: none !important; }
.tg-msg-reacts__quick {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0.08rem;
}
.tg-msg-reacts__extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(28, 25, 23, 0.08);
}
.tg-msg-reacts__extra[hidden] { display: none !important; }
.tg-msg-emoji {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #f3f7f3;
  font-size: 1.18rem;
  line-height: 1;
  cursor: pointer;
}
.tg-msg-emoji--more {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #6b7280;
}
.tg-msg-emoji--more.is-on {
  background: rgba(76, 175, 69, 0.2);
  color: #2e7d32;
}
.tg-msg-emoji:hover { background: rgba(76, 175, 69, 0.18); }
.tg-msg-actions { padding: 0.25rem 0.35rem 0.45rem; }
.tg-msg-sheet__title {
  padding: 0.55rem 0.85rem 0.2rem;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
}
.tg-msg-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  background: transparent;
  padding: 0.78rem 0.85rem;
  font: inherit;
  font-weight: 650;
  text-align: left;
  color: var(--text-primary);
  border-radius: 14px;
  cursor: pointer;
}
.tg-msg-item i { color: var(--text-muted); }
.tg-msg-item:hover { background: rgba(76, 175, 69, 0.1); }
.tg-msg-item--danger { color: #dc2626; }
.tg-msg-item--danger i { color: #dc2626; }
.tg-msg-item--danger:hover { background: rgba(220, 38, 38, 0.1); }
.tg-msg-item--muted { color: var(--text-muted); justify-content: center; }
.tg-report-layer {
  position: fixed;
  inset: 0;
  z-index: 14100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tg-report-layer[hidden] { display: none !important; }
.tg-report-layer__dim {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 14, 0.46);
}
.tg-report-box {
  position: relative;
  width: min(24rem, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 22px 56px rgba(28, 25, 23, 0.22);
  transform: translateY(10px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.tg-report-layer.is-on .tg-report-box {
  transform: none;
  opacity: 1;
}
.tg-report-box h3 {
  margin: 0 0 0.85rem;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tg-report-notice {
  margin: 0 0 0.95rem;
  cursor: default;
  pointer-events: none;
}
.tg-report-notice .kkt-notice__text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.tg-report-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.tg-report-field .custom-select-wrap {
  display: block;
  width: 100%;
  contain: none;
}
.tg-report-field .custom-select-trigger {
  min-height: 44px;
  border-radius: 14px !important;
}
.tg-report-field select,
.tg-report-field textarea {
  font: inherit;
  font-weight: 500;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.6rem 0.75rem;
  background: #f6faf6;
}
.tg-report-field textarea { resize: vertical; min-height: 5.5rem; }
.tg-report-hint {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.tg-report-actions {
  margin-top: 0.2rem;
}
.tg-report-box .kkt-dialog__btn,
.tg-report-actions .kkt-dialog__btn {
  border-radius: 999px !important;
}
html.theme-dark .tg-report-box,
html.chat-theme-dark .tg-report-box {
  background: var(--bg-card);
}
html.theme-dark .tg-report-field select,
html.theme-dark .tg-report-field textarea,
html.chat-theme-dark .tg-report-field select,
html.chat-theme-dark .tg-report-field textarea {
  background: rgba(255,255,255,0.05);
  color: inherit;
}
html.theme-dark .tg-msg-sheet,
html.chat-theme-dark .tg-msg-sheet {
  background: var(--bg-card);
}
html.theme-dark .tg-msg-reacts__extra,
html.chat-theme-dark .tg-msg-reacts__extra {
  border-top-color: rgba(255, 255, 255, 0.1);
}
html.theme-dark .tg-msg-emoji--more,
html.chat-theme-dark .tg-msg-emoji--more {
  color: #cbd5e1;
}
html.theme-dark .chat-react {
  background: rgba(28, 32, 38, 0.9);
  color: #fff;
}
.cmodal-btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}
.chat-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  border: 0 !important;
  flex-shrink: 0;
}
.chat-action-plus {
  background: #eef1ee !important;
  color: #4a5a4d !important;
  font-size: 1.25rem;
}
.chat-input {
  background: #eef1ee !important;
  border: 0 !important;
  padding: 0.68rem 1rem !important;
}

.tg-messages {
  background-image: none !important;
  background-color: #f7f8f7 !important;
}

.tg-chat-toolbar__title,
.tg-chat-toolbar__text-title,
.tg-contact-name,
.chat-row-name,
.chat-header-name {
  color: #1c1917 !important;
}

.tg-chat-toolbar__icon-btn:hover,
.tg-back:hover,
.tg-chat-toolbar .tg-back:hover {
  background: rgba(28, 25, 23, 0.06) !important;
  color: var(--text-primary) !important;
}

a.tg-back,
.tg-chat-toolbar .tg-back {
  width: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 12px !important;
  gap: 0;
  background: transparent !important;
  color: var(--text-primary) !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 700;
  font-size: 1.2rem !important;
}
a.tg-back i {
  font-size: 1.35rem;
}
.tg-back__label { display: none !important; }

.tg-new-chat-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #4caf45;
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.tg-new-chat-btn:hover {
  background: #3d8f38;
  box-shadow: 0 4px 14px rgba(76, 175, 69, 0.35);
  transform: scale(1.05);
}

.tg-contact {
  border-radius: 0 !important;
}

.tg-swipe {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
  touch-action: pan-y;
  background: transparent;
}
.tg-swipe__rail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.7rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  background: transparent;
}
.tg-swipe.is-swiping .tg-swipe__rail,
.tg-swipe.is-open .tg-swipe__rail {
  opacity: 1;
}
.tg-swipe:not(.is-swiping):not(.is-open) .tg-swipe__rail {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}
.tg-swipe:not(.is-swiping):not(.is-open) .tg-swipe__front {
  transform: none !important;
}
.tg-swipe__act {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 0;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 24, 22, 0.18);
  transform: scale(0.82);
  transition: transform .28s cubic-bezier(0.22, 1, 0.36, 1);
}
.tg-swipe.is-swiping .tg-swipe__act,
.tg-swipe.is-open .tg-swipe__act {
  transform: scale(1);
}
.tg-swipe__act i { font-size: 1.2rem; line-height: 1; }
.tg-swipe__act--pin { background: #43a047; }
.tg-swipe__act--del { background: #e53935; margin-left: auto; }
.tg-swipe__front {
  position: relative;
  z-index: 1;
  margin-bottom: 0 !important;
  background: var(--bg-card, #fff) !important;
  border-radius: 0 !important;
  will-change: transform;
  transition: transform .38s cubic-bezier(0.22, 1, 0.36, 1);
}
.tg-swipe .chat-row,
.tg-swipe .tg-contact {
  background: var(--bg-card, #fff) !important;
  margin-bottom: 0;
  border-radius: 0 !important;
}
html.chat-theme-dark .tg-swipe .chat-row,
html.chat-theme-dark .tg-swipe .tg-contact,
html.chat-theme-dark .tg-swipe__front {
  background: var(--bg-card) !important;
}
.tg-contact-pin {
  font-size: 0.78rem;
  margin-right: 0.28rem;
  color: var(--accent) !important;
  flex-shrink: 0;
}
.tg-contact-name .tg-contact-pin ~ .tg-contact-pin,
.chat-row-name .tg-contact-pin ~ .tg-contact-pin {
  display: none;
}

.tg-contact:hover {
  background: rgba(76, 175, 69, 0.06) !important;
}

.tg-contact.active {
  background: rgba(76, 175, 69, 0.12) !important;
}

.tg-contact-avatar,
.tg-main-avatar,
.chat-row-avatar,
.chat-header-avatar {
  background: linear-gradient(145deg, #4caf45, #3d8f38) !important;
  box-shadow: 0 2px 8px rgba(76, 175, 69, 0.25);
  overflow: hidden;
  color: #fff !important;
}
.tg-contact-avatar .bi,
.tg-main-avatar .bi,
.chat-row-avatar .bi {
  font-size: 1.15em;
  line-height: 1;
  color: #fff;
}

.tg-contact-avatar img,
.tg-main-avatar img,
.chat-row-avatar img,
.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-contact-badge,
.chat-row-badge {
  background: #4caf45 !important;
}

.tg-main {
  background: #f3f7f3 !important;
}

.tg-main-empty {
  color: #7a8a7d;
}

.tg-main-empty i {
  color: #4caf45 !important;
  opacity: 0.35 !important;
}

.tg-main-header {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
}

.tg-messages {
  background-color: #f7f8f7 !important;
  background-image: none !important;
}

.chat-msg-mine .chat-bubble {
  background: #4caf45 !important;
  background-image: none !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none;
}

.chat-msg-mine .chat-bubble-text {
  color: rgba(255, 255, 255, 0.95) !important;
}

.chat-msg-mine .chat-bubble-time,
.chat-msg-other .chat-bubble-time {
  color: #8a9a8d !important;
  opacity: 1 !important;
}

.chat-msg-other .chat-bubble {
  background: #fff !important;
  border: 1px solid rgba(28, 25, 23, 0.08) !important;
  color: #1c1917 !important;
  box-shadow: 0 2px 10px rgba(28, 25, 23, 0.04);
}

.chat-msg-other .chat-bubble-text {
  color: #1c1917 !important;
}

.chat-msg-other .chat-bubble-time {
  color: #7a8a7d !important;
  opacity: 1 !important;
}

.chat-file-link,
.chat-msg-mine .chat-file-link,
.chat-msg-other .chat-file-link,
a.chat-file-link {
  color: inherit !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-msg-other .chat-file-link {
  color: #2e7d32 !important;
}

.chat-msg-mine .chat-file-link {
  color: #fff !important;
}

.chat-input-wrap {
  background: #fff !important;
  border-top: 1px solid #eef0ee !important;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px)) !important;
}

.chat-input {
  background: #eef1ee !important;
  border: 0 !important;
  color: #1c1917 !important;
  border-radius: 22px !important;
  font-family: var(--font-sans) !important;
}

.chat-input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
  background: #e8ece8 !important;
  outline: none !important;
}

.chat-action-btn,
.chat-media-btn,
.chat-voice-btn {
  background: #eef1ee !important;
  border: 0 !important;
  color: #5a6b5e !important;
}

.chat-action-btn:hover,
.chat-media-btn:hover,
.chat-voice-btn:hover {
  background: #e3e8e3 !important;
  color: #2e7d32 !important;
  border-color: transparent !important;
}

.chat-action-send,
.chat-send-btn {
  background: #4caf45 !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: none;
}

.chat-action-send:hover,
.chat-send-btn:hover {
  background: #3d8f38 !important;
  border-color: #3d8f38 !important;
}
.chat-action-send:disabled,
.chat-send-btn:disabled {
  background: #c5d4c5 !important;
  border-color: #c5d4c5 !important;
  color: #fff !important;
  box-shadow: none !important;
  opacity: 0.55;
  pointer-events: none;
  transform: none !important;
}
html.chat-theme-dark .chat-action-send:disabled,
html.chat-theme-dark .chat-send-btn:disabled {
  background: #3a463a !important;
  border-color: #3a463a !important;
  color: rgba(255,255,255,.45) !important;
}

.chat-float-btn {
  background: linear-gradient(145deg, #4caf45, #3d8f38) !important;
  box-shadow: 0 8px 24px rgba(76, 175, 69, 0.4) !important;
}

.chat-float-btn:hover {
  box-shadow: 0 10px 32px rgba(76, 175, 69, 0.55) !important;
}

.chat-sidebar {
  background: #fff !important;
  border-left: 1px solid var(--border) !important;
  box-shadow: -12px 0 40px rgba(28, 25, 23, 0.1) !important;
}

.chat-sidebar-header {
  background: #fff !important;
  border-bottom: 1px solid var(--border) !important;
  color: #1c1917 !important;
}

.chat-sidebar-header span {
  font-family: var(--font-sans) !important;
  color: #1c1917 !important;
}

#chatSidebarClose {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f7f3 !important;
  border: 1px solid var(--border) !important;
  color: #5a6b5e !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#chatSidebarClose:hover {
  background: rgba(76, 175, 69, 0.12) !important;
  color: #2e7d32 !important;
}

.chat-row {
  background: #f8faf8 !important;
  border: 1px solid var(--border) !important;
}

.chat-row:hover {
  background: rgba(76, 175, 69, 0.08) !important;
  border-color: rgba(76, 175, 69, 0.25) !important;
}

.chat-row-name,
.chat-header-name {
  color: #1c1917 !important;
}

.chat-back {
  background: rgba(76, 175, 69, 0.08) !important;
  color: #5a6b5e !important;
}

.chat-back:hover {
  background: rgba(76, 175, 69, 0.16) !important;
  color: #1c1917 !important;
}

/* Voice messages — light */
.chat-msg-mine .voice-msg .voice-play-btn {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

.chat-msg-mine .voice-msg .voice-wave-bar {
  background: rgba(255, 255, 255, 0.35) !important;
}

.chat-msg-mine .voice-msg .voice-wave-bar.active {
  background: #fff !important;
}

.chat-msg-mine .voice-msg .voice-duration {
  color: rgba(255, 255, 255, 0.9) !important;
}

.chat-msg-other .voice-msg .voice-play-btn {
  background: rgba(76, 175, 69, 0.12) !important;
  color: #4caf45 !important;
}

.chat-msg-other .voice-msg .voice-wave-bar {
  background: rgba(76, 175, 69, 0.2) !important;
}

.chat-msg-other .voice-msg .voice-wave-bar.active {
  background: #4caf45 !important;
}

.voice-wave-bar.active {
  background: #4caf45 !important;
}

/* Context menu + modals */
.msg-ctx-menu {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.12) !important;
}

.msg-ctx-item {
  color: #1c1917 !important;
  font-family: var(--font-sans) !important;
}

.msg-ctx-item:hover {
  background: rgba(76, 175, 69, 0.1) !important;
}

.cmodal-box {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 20px 50px rgba(28, 25, 23, 0.15) !important;
  font-family: var(--font-sans) !important;
}

.cmodal-title {
  color: #1c1917 !important;
}

.cmodal-text {
  color: #5a6b5e !important;
}

.cmodal-input {
  background: #f6faf6 !important;
  border: 1px solid var(--border) !important;
  color: #1c1917 !important;
  border-radius: 12px !important;
}

.cmodal-input:focus {
  border-color: #4caf45 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.16) !important;
  outline: none !important;
}

.cmodal-btn-primary {
  background: #4caf45 !important;
  border-color: #4caf45 !important;
  color: #fff !important;
}

.cmodal-btn-primary:hover {
  background: #3d8f38 !important;
}

.cmodal-btn-cancel {
  background: #f3f7f3 !important;
  color: #5a6b5e !important;
  border: 1px solid var(--border) !important;
}

/* Embed iframe body */
.chat-embed-wrap {
  background: #fff !important;
  font-family: var(--font-sans) !important;
}

.chat-embed-title {
  color: #1c1917 !important;
}

/* Dark theme chat keep readable */
html.chat-theme-dark .tg-chat-layout,
html.chat-theme-dark .tg-sidebar,
html.chat-theme-dark .tg-main-header,
html.chat-theme-dark .chat-input-wrap,
html.chat-theme-dark .chat-sidebar,
html.chat-theme-dark .chat-sidebar-header,
html.theme-dark .msg-ctx-menu,
html.theme-dark .cmodal-box {
  background: var(--bg-card) !important;
}

html.chat-theme-dark .tg-main,
html.chat-theme-dark .tg-messages {
  background-color: var(--bg-dark, #0d1117) !important;
  background-image: url('/static/img/chat-bg-dark.svg') !important;
}

html.chat-theme-dark .chat-msg-other .chat-bubble {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

html.chat-theme-dark .tg-chat-search {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}
html.chat-theme-dark .tg-chat-search input {
  color: var(--text-primary);
}
html.chat-theme-dark .tg-chat-tab {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
html.chat-theme-dark .tg-chat-tab.is-on {
  background: #4caf45;
  color: #fff;
}
html.chat-theme-dark .chat-action-plus,
html.chat-theme-dark .chat-input {
  background: rgba(255, 255, 255, 0.07) !important;
}
html.chat-theme-dark .tg-contact {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
html.chat-theme-dark .chat-msg-mine .chat-bubble-time,
html.chat-theme-dark .chat-msg-other .chat-bubble-time {
  color: var(--text-muted) !important;
}

html.chat-theme-dark .tg-contact:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

html.chat-theme-dark .chat-input {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
}

html.chat-theme-dark .tg-contact-name,
html.chat-theme-dark .chat-row-name,
html.theme-dark .cmodal-title,
html.theme-dark .msg-ctx-item {
  color: var(--text-primary) !important;
}

@media (min-width: 769px) {
  html.chat-lock {
    height: 100%;
    max-height: 100dvh;
    overflow: hidden !important;
    scrollbar-gutter: auto !important;
  }
  html.chat-lock body.app-shell.chat-page {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden !important;
    background: var(--bg-dark) !important;
  }
  html.chat-lock footer,
  html.chat-lock .app-dock-layer,
  html.chat-lock .chat-float-btn,
  html.chat-lock .chat-sidebar {
    display: none !important;
  }
  html.chat-lock #pageMain {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    max-width: min(1680px, calc(100vw - 0.6rem)) !important;
    width: 100%;
    margin: 0 auto;
    padding: 0.4rem 0 0.45rem !important;
    overflow: hidden !important;
  }
  html.chat-lock .tg-chat-layout {
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }
  html.chat-lock .tg-sidebar {
    width: min(24.5rem, 40%);
  }
  html.chat-lock .tg-chat-layout .tg-back.d-lg-none {
    display: none !important;
  }
}

/* ══════════════════════════════════════════
   NOTIFICATIONS bell
══════════════════════════════════════════ */
.nav-notify {
  position: relative;
}

.nav-notify-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #5a6b5e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 1.05rem;
  transition: background .15s, color .15s, border-color .15s;
}

.nav-notify-btn:hover,
.nav-notify-btn[aria-expanded="true"] {
  background: rgba(76, 175, 69, 0.1);
  color: #2e7d32;
  border-color: rgba(76, 175, 69, 0.35);
}

.nav-notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #4caf45;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.nav-notify-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  left: auto;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.18);
  border-radius: 18px;
  box-shadow: none;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-sans);
  transform-origin: top right;
  animation: notif-drop 0.2s ease;
}

.nav-notify-panel[hidden] {
  display: none !important;
  animation: none;
}

@keyframes notif-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.55rem 0.15rem;
  border-bottom: 0;
}
.nav-notify-head strong {
  font-size: 0.95rem;
  color: #1c1917;
}
.nav-notify-actions:not(:has(button:not([hidden]))) {
  display: none;
}
.nav-notify-all,
.nav-notify-clear {
  border: none;
  background: var(--bg-card2, #f2f2f7);
  color: #4caf45;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.2;
}
.nav-notify-all:hover { color: #3d8f38; }
.nav-notify-clear { color: #b42318; }
.nav-notify-clear:hover { color: #912018; }

.nav-notify-list {
  overflow-y: auto;
  padding: 0.35rem;
}

.nav-notify-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #7a8a7d;
  font-size: 0.88rem;
}

.nav-notify-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  text-decoration: none !important;
  color: inherit;
  transition: background .15s;
}

.nav-notify-item:hover {
  background: rgba(76, 175, 69, 0.08);
}

.nav-notify-item.is-unread {
  background: rgba(76, 175, 69, 0.06);
}

.nav-notify-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(76, 175, 69, 0.12);
  color: #4caf45;
  font-size: 1rem;
}

.nav-notify-icon--warning {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.nav-notify-icon--success {
  background: rgba(76, 175, 69, 0.14);
  color: #2e7d32;
}

.nav-notify-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-notify-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.3;
}

.nav-notify-item.is-unread .nav-notify-title {
  color: #15261c;
}

.nav-notify-text {
  font-size: 0.78rem;
  color: #5a6b5e;
  line-height: 1.35;
}

.nav-notify-time {
  font-size: 0.7rem;
  color: #8a9a8d;
  margin-top: 0.1rem;
}

html.theme-dark .nav-notify-btn,
html.theme-dark .nav-notify-panel {
  background: var(--bg-card2);
  color: var(--text-primary);
}

html.theme-dark .nav-notify-head strong,
html.theme-dark .nav-notify-title {
  color: var(--text-primary);
}

html.theme-dark .nav-notify-badge {
  box-shadow: 0 0 0 2px var(--bg-card);
}

/* ══════════════════════════════════════════
   CALENDAR
══════════════════════════════════════════ */
.cal-page {
  position: relative;
}
.cal-page .page-header {
  margin-bottom: 0.75rem;
}
.cal-page .page-header > .page-back {
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  align-self: center;
  margin: 0;
}
.cal-stage {
  position: relative;
  min-height: 16rem;
}
.cal-fragment,
#calFragment {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  transition: opacity 0.22s ease, filter 0.22s ease;
}
#calFragment.is-in {
  animation: cal-soft-in 0.32s ease;
}
@keyframes cal-soft-in {
  from { opacity: 0.4; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.cal-page.is-loading #calFragment {
  opacity: 0.42;
  pointer-events: none;
  filter: saturate(0.85);
}
.cal-wait {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(247, 252, 245, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 18px;
}
.cal-wait[hidden] { display: none !important; }
.cal-wait__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  min-width: 148px;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.18);
  box-shadow: 0 14px 36px rgba(40, 110, 35, 0.14);
}
.cal-wait__card span {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-primary);
}
.cal-wait__card .smile-loader { margin: 0; }
html.theme-dark .cal-wait {
  background: rgba(22, 27, 23, 0.55);
}
html.theme-dark .cal-wait__card {
  background: var(--bg-card);
}
.cal-nav {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(76, 175, 69, 0.22);
  border-radius: 16px;
  padding: 0.3rem;
  box-shadow: 0 6px 16px rgba(76, 175, 69, 0.07);
}
html.theme-dark .cal-nav {
  background: rgba(26, 29, 38, 0.92);
  border-color: rgba(76, 175, 69, 0.28);
}
.cal-nav__chevron {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none !important;
  background: transparent;
  transition: background .15s, color .15s;
}
.cal-nav__chevron:hover {
  background: rgba(76, 175, 69, 0.14);
  color: #2e7d32;
}
.cal-nav__label {
  min-width: 8.5rem;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 750;
  padding: 0 0.4rem;
  letter-spacing: -0.01em;
}
.cal-nav__today {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 750;
  color: #fff !important;
  text-decoration: none !important;
  padding: 0 0.9rem;
  border-radius: 12px;
  background: var(--accent);
  margin-left: 0.15rem;
  transition: background .15s;
}
.cal-nav__today:hover {
  background: var(--accent2);
  color: #fff !important;
}
.cal-hint {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin: 0 0 0.9rem;
}

.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; gap: 0.75rem; }
}

.cal-grid-wrap {
  padding: 0.85rem;
  margin: 0;
  overflow: hidden;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.3rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.cal-weekdays .cal-wd-full { display: inline; }
.cal-weekdays .cal-wd-short { display: none; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}
.cal-day {
  min-width: 0;
  min-height: 52px;
  height: auto;
  aspect-ratio: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-primary);
  text-decoration: none !important;
  padding: 0.3rem 0.28rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  cursor: pointer;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.cal-day:hover { border-color: rgba(76, 175, 69, 0.45); }
.cal-day:active { transform: scale(0.97); }
.cal-day.is-out { opacity: 0.38; }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px rgba(76, 175, 69, 0.55); }
.cal-day.is-selected {
  background: rgba(76, 175, 69, 0.14);
  border-color: #4caf45;
}
.cal-day__num { font-size: 0.82rem; font-weight: 700; line-height: 1; }
.cal-day__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
  max-width: 100%;
  overflow: hidden;
}
.cal-day__dots i,
.cal-legend i {
  width: 6px; height: 6px; border-radius: 99px; display: inline-block; flex-shrink: 0;
}
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 0.45rem 0.75rem;
  margin-top: 0.75rem; font-size: 0.72rem; color: var(--text-muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }

.cal-side .card { margin: 0; }
.cal-side-body {
  min-height: 72px;
  transition: opacity .2s ease, transform .2s ease;
}
.cal-side-body.is-swap {
  opacity: 0;
  transform: translateY(4px);
}
.cal-event {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid #4caf45;
  border-radius: 0 10px 10px 0;
  background: var(--bg-card2);
  text-decoration: none !important;
  color: inherit;
  margin-bottom: 0.45rem;
  animation: cal-event-in 0.28s ease both;
}
.cal-event:nth-child(2) { animation-delay: .04s; }
.cal-event:nth-child(3) { animation-delay: .08s; }
.cal-event:nth-child(4) { animation-delay: .12s; }
@keyframes cal-event-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cal-event strong { font-size: 0.88rem; color: var(--text-primary); }
.cal-event span { font-size: 0.76rem; color: var(--text-muted); }
.cal-event:hover { background: rgba(76, 175, 69, 0.08); }
.cal-empty { color: var(--text-muted); font-size: 0.88rem; }

@media (max-width: 900px) and (min-width: 577px) {
  .pcard .pcard-menu__btn,
  .pcard-info {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 576px) {
  .cal-page .page-header {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap;
  }
  .cal-nav {
    width: 100%;
    justify-content: space-between;
  }
  .cal-nav__label { min-width: 6.2rem; font-size: 0.82rem; }
  /*.cal-nav a { width: 32px; height: 32px; }*/
  .cal-hint { font-size: 0.78rem; margin-bottom: 0.7rem; }
  .cal-grid-wrap { padding: 0.55rem; border-radius: 16px; }
  .cal-weekdays { gap: 0.15rem; font-size: 0.65rem; }
  .cal-weekdays .cal-wd-full { display: none; }
  .cal-weekdays .cal-wd-short { display: inline; }
  .cal-grid { gap: 0.15rem; }
  .cal-day {
    min-height: 40px;
    padding: 0.22rem 0.15rem 0.25rem;
    border-radius: 8px;
  }
  .cal-day__num { font-size: 0.74rem; }
  .cal-day__dots { gap: 2px; }
  .cal-day__dots i { width: 5px; height: 5px; }
  .cal-legend { gap: 0.35rem 0.55rem; font-size: 0.68rem; margin-top: 0.55rem; }

  .pcard-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.7rem !important;
  }
  .pcard,
  .entity-card,
  .group-card {
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
    max-width: none;
  }
  .pcard-title,
  .entity-card .pcard-title,
  .group-card .pcard-title {
    font-size: 0.88rem !important;
    line-height: 1.2 !important;
    color: #fff !important;
  }
  .dash-profile-grid--student .pcard-title,
  .pcard-grid--student .pcard-title {
    font-size: 0.92rem !important;
    line-height: 1.18 !important;
  }
  .dash-profile-grid--student .pcard-action,
  .pcard-grid--student .pcard-action {
    font-size: 0.7rem !important;
    padding: 0 0.55rem !important;
  }
  .pcard-desc,
  .entity-card .pcard-desc,
  .group-card .pcard-desc,
  .pcard-meta,
  .entity-card .pcard-meta,
  .group-card .pcard-meta,
  .pcard-meta span {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
  }
  .pcard-desc {
    font-size: 0.95rem !important;
    -webkit-line-clamp: 2;
    max-width: 100%;
  }
  .pcard-meta {
    font-size: 0.74rem !important;
  }
  .pcard-body {
    padding: 0.28rem 0.55rem 0.08rem !important;
    gap: 0.12rem;
  }
  .pcard-footer {
    padding: 0.08rem 0.5rem 0.5rem !important;
    flex-wrap: nowrap !important;
    gap: 0.3rem;
  }
  .pcard-action {
    min-width: 0 !important;
    min-height: 28px;
    height: 28px;
    padding: 0 0.55rem !important;
    font-size: 0.7rem !important;
    flex: 0 1 auto !important;
  }
  .pcard-info {
    width: var(--pcard-btn, 40px);
    height: var(--pcard-btn, 40px);
    font-size: 1rem;
  }
  .pcard:has(> .pcard-menu) > .pcard-info {
    top: var(--pcard-btn-inset, 0.55rem);
    right: calc(var(--pcard-btn-inset, 0.55rem) + var(--pcard-btn, 40px) + var(--pcard-btn-gap, 0.35rem));
  }
  .pcard-footer-actions {
    width: auto;
    gap: 0.3rem;
    flex-wrap: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cal-page, #calFragment, #calFragment.is-in, .cal-event, .cal-side-body {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ——— Chat mentions + members panel ——— */
.chat-mention {
  color: #1b6e2a;
  font-weight: 700;
  background: rgba(76, 175, 69, 0.14);
  border-radius: 4px;
  padding: 0 0.18em;
}

.chat-mention-dd {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(100% + 6px);
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(28, 40, 30, 0.14);
  z-index: 40;
  padding: 0.35rem;
}

.chat-mention-dd__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
}

.chat-mention-dd__item:hover,
.chat-mention-dd__item.is-active {
  background: rgba(76, 175, 69, 0.12);
}

.chat-mention-dd__name {
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-mention-dd__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-members-backdrop {
  position: fixed !important;
  inset: 0;
  background: rgba(16, 24, 18, 0.28);
  z-index: 2400;
}

.chat-members-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  width: min(360px, 100vw) !important;
  height: 100% !important;
  max-height: 100dvh !important;
  background: #fff;
  border-left: 1px solid var(--border);
  z-index: 2401;
  display: flex !important;
  flex-direction: column;
  transform: translate3d(110%, 0, 0) !important;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
  box-shadow: -8px 0 28px rgba(20, 30, 22, 0.12);
  visibility: hidden;
  pointer-events: none;
  margin: 0 !important;
}

.chat-members-panel.is-open {
  transform: translate3d(0, 0, 0) !important;
  visibility: visible;
  pointer-events: auto;
}

.chat-members-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
}
.chat-members-head .kkt-drawer-close {
  margin-right: auto;
}
.chat-members-panel::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 50%;
  width: 4px;
  height: 3rem;
  margin-top: -1.5rem;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.16);
  pointer-events: none;
}

.chat-members-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.chat-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1.25rem;
}

.chat-members-section {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.75rem 0.35rem 0.35rem;
}

.chat-members-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.35rem;
  border-radius: 10px;
}

.chat-members-row:hover {
  background: rgba(76, 175, 69, 0.08);
}

.chat-members-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(145deg, #66bb6a, #43a047);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-members-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-members-meta {
  flex: 1;
  min-width: 0;
}

.chat-members-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-members-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chat-members-tag {
  border: 1px solid var(--border);
  background: #f6faf6;
  color: #2e7d32;
  font-weight: 800;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.chat-members-tag:hover {
  background: rgba(76, 175, 69, 0.16);
}

.chat-members-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.55rem 0.85rem 0.2rem;
  line-height: 1.35;
}
.chat-members-mute {
  border: 1px solid var(--border);
  background: #fff8f0;
  color: #c45c00;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}
.chat-members-mute:hover { background: rgba(196, 92, 0, 0.14); }
.chat-members-mute.is-muted {
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
  border-color: rgba(198, 40, 40, 0.35);
}
.chat-members-muted-label {
  color: #c62828;
  margin-right: 6px;
  font-size: 0.95rem;
}
.chat-members-badge-muted {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  color: #c62828;
  background: rgba(198, 40, 40, 0.12);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.chat-members-row.is-muted-row {
  opacity: 0.78;
}
.chat-muted-banner {
  flex: 1 1 100%;
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #b71c1c;
  background: rgba(198, 40, 40, 0.1);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
}
.chat-input-wrap[data-muted="1"] {
  flex-wrap: wrap;
}

.chat-members-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

html.chat-theme-dark .chat-mention {
  color: #9ae6a0;
  background: rgba(76, 175, 69, 0.22);
}

html.chat-theme-dark .chat-mention-dd,
html.chat-theme-dark .chat-members-panel {
  background: #1a221c;
  border-color: rgba(255, 255, 255, 0.08);
}

html.chat-theme-dark .chat-members-tag {
  background: rgba(255, 255, 255, 0.04);
  color: #9ae6a0;
}

body.chat-members-open {
  overflow: hidden;
}

/* ─── Lessons + Moodle-like Activity Chooser ─── */
.lesson-toolbar {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}
.lesson-board {
  padding: 0;
  overflow: hidden;
}
.lesson-board__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 1.05rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.lesson-board__title {
  min-width: 12rem;
  flex: 1 1 14rem;
}
.lesson-board__title strong {
  display: block;
  font-size: 1.05rem;
}
.lesson-board__title p {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}
.lesson-board__when {
  font-size: 0.8rem !important;
  font-weight: 650;
}
.lesson-board__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem;
  margin-left: auto;
}
.lesson-board__group {
  margin: 0;
  flex: 1 1 22rem;
  min-width: 18rem;
  max-width: 36rem;
}
.lesson-board__group .custom-select-wrap--group {
  width: 100%;
}
.lesson-board__group label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--text-muted);
}
.lesson-board__group .la-select {
  min-width: 18rem;
  max-width: none;
  width: 100%;
}
.lesson-board__tools form { margin: 0; }
.lesson-board__add:not(.ico-btn),
.lesson-board__tools .btn-sec,
.lesson-board__tools .btn-prim {
  min-height: 2.5rem;
}
.lesson-board__del { color: #b42318; border-color: rgba(180, 35, 24, 0.28); }

.hw-review {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 72rem;
}
.hw-review__task,
.hw-review__inbox { margin: 0; }
.hw-review__task .card-body,
.hw-review__inbox .card-header {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.hw-review__muted,
.hw-review__meta {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.hw-review__desc {
  margin: 0.85rem 0 0;
  line-height: 1.5;
  white-space: pre-wrap;
}
.hw-review__count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}
.hw-review__empty {
  margin: 0;
  padding: 1.4rem 1.2rem;
  color: var(--text-muted);
}
.hw-review__where {
  margin: -0.55rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.hw-sub-card {
  padding: 1.45rem 1.45rem 1.35rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}
.hw-sub-card__group {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.hw-sub-card:last-child { border-bottom: 0; }
.hw-sub-card.is-pending { background: rgba(245, 158, 11, 0.05); }
.hw-sub-card.is-graded { background: rgba(76, 175, 69, 0.04); }
.hw-sub-card.is-open { outline: 2px solid rgba(var(--accent-rgb), 0.35); outline-offset: -2px; }
.hw-sub-card__name { font-size: 1.08rem; }
.hw-sub-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.hw-status {
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  color: var(--text-muted);
}
.hw-status--wait { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.hw-status--ok { background: rgba(76, 175, 69, 0.16); color: #2e7d32; }
.hw-sub-card__body {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  min-width: 0;
}
.hw-sub-section { min-width: 0; }
.hw-sub-section--full { grid-column: 1 / -1; }
.hw-sub-section__title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.hw-sub-answer {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  line-height: 1.5;
  min-height: 4.5rem;
}
html.theme-dark .hw-sub-answer { background: var(--bg-card2); }
.hw-sub-empty { font-size: 0.9rem; color: var(--text-muted); }
.hw-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
}
.hw-files .hw-file-block {
  flex: 1 1 12rem;
  max-width: 22rem;
}
.hw-file-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
}
.hw-file-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), .28);
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.hw-file-link i { flex: 0 0 auto; }
.hw-file-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hw-file-preview {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
}
.hw-file-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: var(--bg-card2);
}
.hw-grade-form {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px dashed var(--border);
}
.hw-grade-form--five {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
.hw-grade-form label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--text-muted);
}
.grade-picks {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.grade-picks legend {
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.grade-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.grade-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card2, #f3f6f2);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}
.grade-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.grade-pick:has(input:checked),
.grade-pick:has(input:focus-visible) {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}
.hw-grade-form .btn-prim { min-height: 2.5rem; }
.hw-check .card-header { display: flex; justify-content: space-between; align-items: center; }
.hw-check form[hidden],
.hw-check-detail[hidden] { display: none !important; }
.hw-check-cards { display: none; }
.hw-check-table-wrap { overflow: visible; }
.hw-check-table { margin: 0; width: 100%; table-layout: auto; border-collapse: collapse; }
.hw-check-table col.hw-check-col-group,
.hw-check-table col.hw-check-col-status,
.hw-check-table col.hw-check-col-when,
.hw-check-table col.hw-check-col-act { width: 1%; }
.hw-check-table col.hw-check-col-grade { width: 16rem; }
#pageMain .hw-check-table thead th {
  background: transparent !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
#pageMain .hw-check-table td {
  background: transparent !important;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0.85rem;
  vertical-align: middle;
}
#pageMain .hw-check-table tbody tr:hover > * {
  background: transparent !important;
}
#pageMain .hw-check-table .hw-check-row:hover td {
  background: rgba(var(--accent-rgb), 0.04) !important;
}
.hw-check-table th:nth-child(n+2),
.hw-check-table td:nth-child(n+2) { width: 1%; white-space: nowrap; }
.hw-check-table th:nth-child(5),
.hw-check-table td.hw-check-grade {
  white-space: normal;
  width: 16rem;
  min-width: 16rem;
}
.hw-check-name { font-weight: 650; color: var(--text-primary); }
.hw-check-when {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.hw-check-table td:first-child,
.hw-check-table th:first-child { padding-left: 1.2rem; }
.hw-check-table .hw-check-row td:first-child {
  box-shadow: inset 3px 0 0 transparent;
}
.hw-check-table .hw-check-row.is-pending td:first-child {
  box-shadow: inset 3px 0 0 #d97706;
}
.hw-check-table .hw-check-row.is-graded td:first-child {
  box-shadow: inset 3px 0 0 #43a047;
}
#pageMain .hw-check-table .hw-check-row.is-open td {
  background: rgba(var(--accent-rgb), 0.05) !important;
}
.hw-check-grade {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}
.hw-check-table .grade-picks {
  gap: 0.3rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.hw-check-table .grade-pick {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 0.78rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.hw-check-table .grade-pick:first-child {
  width: auto;
  min-width: 2.15rem;
  padding: 0 0.4rem;
  border-radius: 999px;
}
.hw-check-grade-num { width: 5.5rem; }
.hw-check-save {
  height: 2rem !important;
  min-height: 2rem !important;
  padding: 0 0.9rem !important;
  font-size: 0.78rem !important;
  font-weight: 750 !important;
  white-space: nowrap;
  flex-shrink: 0;
  position: static;
  margin: 0;
}
.hw-check-na { color: var(--text-muted); }
.hw-check-acts { width: 1%; }
.hw-check-detail td {
  padding: 0.35rem 1.15rem 1.15rem 1.2rem !important;
  white-space: normal;
  width: auto;
  background: var(--bg-card2, var(--bg-card)) !important;
}
#pageMain .hw-check-table .hw-check-detail td {
  background: var(--bg-card2, var(--bg-card)) !important;
  box-shadow: none;
}
.hw-check-detail .hw-sub-answer { min-height: 0; margin-bottom: 0.7rem; }
.hw-check-comment {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--text-muted);
}
.hw-check-comment .form-control { margin-top: 0.3rem; }
.hw-check-grade--card {
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.hw-check-grade--card .grade-picks { flex-wrap: wrap; }
.hw-check-grade--card .hw-check-save {
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  padding: 0 1.1rem !important;
  font-size: 0.88rem !important;
}
@media (max-width: 980px) {
  .hw-sub-card__body { grid-template-columns: 1fr; }
  .hw-grade-form { grid-template-columns: 1fr; }
  .hw-grade-form .btn-prim { width: 100%; }
  .hw-check-table-wrap { display: none !important; }
  .hw-check-cards { display: block; }
  .hw-check-grade--card .hw-check-save { width: 100%; }
}
.lesson-mod {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.lesson-mod:last-child { border-bottom: 0; }
.lesson-mod__body {
  flex: 1 1 12rem;
  min-width: 0;
}
.lesson-mod__icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.15rem;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}
.lesson-mod--assessment .lesson-mod__icon {
  background: rgba(180, 83, 9, 0.12);
  color: #b54708;
}
.lesson-mod--communication .lesson-mod__icon {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}
.lesson-mod__title {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
a.lesson-mod__title:hover { color: var(--accent); }
.lesson-mod__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.lesson-mod__label {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.lesson-mod__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
  max-width: 100%;
}
.lesson-mod__actions .mod-act:not(.ico-btn),
.lesson-mod__actions .btn:not(.ico-btn) {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px !important;
  font-size: 0.78rem;
  font-weight: 750;
}
.lesson-board__add:not(.ico-btn) {
  min-height: 44px;
  padding: 0.55rem 1.05rem !important;
  border-radius: 999px !important;
  font-weight: 800;
}
.module-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card2);
}
.module-embed iframe { max-width: 100%; }
.workshop-sub {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}
.workshop-assess {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  align-items: center;
}
.lesson-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
}
.lesson-list { display: flex; flex-direction: column; gap: 0.65rem; }
.lesson-list__item {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition);
}
.lesson-list__item:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.lesson-list__item span { color: var(--text-muted); font-size: 0.9rem; }
.lesson-list__item em { font-style: normal; font-size: 0.8rem; color: var(--text-muted); }
.choice-opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
  cursor: pointer;
}
.folder-files {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.achooser {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.achooser[hidden] { display: none !important; }
.achooser__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(2px);
}
.achooser__panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.18);
  animation: achooser-in 0.22s ease;
}
@keyframes achooser-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.achooser__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.4rem;
}
.achooser__head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}
.achooser__close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.45rem;
}
.achooser__close:hover { color: var(--text-primary); }
.achooser__search {
  margin: 0.5rem 1.25rem 0.75rem;
  position: relative;
}
.achooser__search i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.achooser__search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  background: var(--bg-card2);
  color: var(--text-primary);
  font-size: 16px;
}
.achooser__search input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.achooser__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1.25rem 0.75rem;
  flex-wrap: wrap;
}
.achooser__tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.achooser__tab.is-active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.25);
}
.achooser__tab:focus-visible,
.achooser__card:focus-visible,
.achooser__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.achooser__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.65rem;
  padding: 0.25rem 1.25rem 1.35rem;
}
.achooser__card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  row-gap: 0.12rem;
  align-items: start;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, #f8fcf7, #eef6ec);
  text-decoration: none;
  color: inherit;
  min-height: 0;
  transition: border-color var(--transition), background var(--transition);
}
.achooser__card:hover {
  border-color: rgba(76, 175, 69, 0.4);
  background: #fff;
  transform: none;
  box-shadow: none;
  text-decoration: none;
  color: inherit;
}
.achooser__badge {
  grid-row: 1 / span 2;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}
.achooser__badge--resource {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}
.achooser__badge--assessment {
  background: rgba(180, 83, 9, 0.14);
  color: #b54708;
}
.achooser__badge--communication {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}
.achooser__badge--interactive {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}
.achooser__name {
  font-weight: 750;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.achooser__hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 900px) {
  .lesson-mod__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .achooser__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achooser__panel { border-radius: 16px; max-height: 92vh; }
}

html.theme-dark .achooser__backdrop { background: rgba(0, 0, 0, 0.55); }
html.theme-dark .achooser__badge--resource { color: #67e8f9; }
html.theme-dark .achooser__badge--assessment { color: #fbbf24; }
html.theme-dark .achooser__panel { box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); }
html.theme-dark .module-frame { background: #0f172a; }

/* Test timer / time-up modal */
.time-up-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  align-items: center;
  justify-content: center;
  background: rgba(28, 25, 23, 0.55);
  backdrop-filter: blur(3px);
}
.time-up-modal[hidden] { display: none !important; }
.time-up-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 2rem;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.2);
}
.time-up-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 0.5rem; }
.time-up-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.35rem; }
.time-up-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.75rem; }
.time-up-count { font-size: 2rem; font-weight: 800; color: var(--accent); }
.pcard-done { filter: saturate(0.82); }
.pcard-done .pcard-action { color: #171717 !important; }

@media (prefers-reduced-motion: reduce) {
  .pcard,
  .pcard:hover { transform: none !important; }
}

/* Curator / teacher picker */
.group-form-page { max-width: 920px; }
.group-form-lead {
  color: var(--text-muted);
  margin: .35rem 0 0;
  max-width: 38rem;
}
.group-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.group-form__main { margin: 0; }
.group-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .25rem;
}
.curator-picker { margin: 0; }
.curator-picker__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}
.curator-picker__search {
  position: relative;
  margin-bottom: .9rem;
}
.curator-picker__search i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.curator-picker__search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .7rem .9rem .7rem 2.4rem;
  background: var(--bg-card2);
  color: var(--text-primary);
  font-size: 16px;
}
.curator-picker__search input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.curator-picker__grid,
.teacher-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .7rem;
}
.curator-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .35rem;
  padding: 1rem .7rem .85rem;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: 148px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.curator-tile:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.curator-tile.is-selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.curator-tile--static {
  cursor: default;
  min-height: 168px;
}
.curator-tile--static:hover { transform: none; }
.curator-tile.is-inactive { opacity: .55; }
.curator-tile__ava {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 800;
  font-size: .92rem;
  letter-spacing: .02em;
}
.curator-tile__ava--empty {
  background: var(--bg-card2);
  color: var(--text-muted);
  border: 1px dashed var(--border);
}
.curator-tile__name {
  font-weight: 750;
  font-size: .9rem;
  line-height: 1.25;
  max-width: 100%;
}
.curator-tile__meta {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.curator-picker__none,
.curator-picker__empty-state {
  color: var(--text-muted);
  font-size: .9rem;
  margin: .35rem 0 0;
  grid-column: 1 / -1;
}
html.theme-dark .curator-tile.is-selected {
  background: rgba(76, 175, 69, 0.16);
}
html.theme-dark .curator-tile__ava--empty {
  background: rgba(255, 255, 255, 0.04);
}
@media (max-width: 640px) {
  .curator-picker__grid,
  .teacher-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curator-picker__head .btn-sec { width: 100%; justify-content: center; }
}

a.curator-tile {
  text-decoration: none;
  color: inherit;
}
a.curator-tile--static { cursor: pointer; }
a.curator-tile--static:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.curator-tile__action {
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 650;
  color: var(--accent);
}

.kkt-check {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0;
  cursor: pointer;
  line-height: 1.35;
}
.kkt-check input {
  margin-top: .2rem;
  flex: 0 0 auto;
}
.kkt-check strong { display: block; font-weight: 700; }
.kkt-check small {
  display: block;
  color: var(--text-muted);
  font-size: .82rem;
}

.sched-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
  align-items: stretch;
}
.sched-settings__card { margin: 0; }
.sched-settings__card--wide { grid-column: 1 / -1; }
.sched-settings__card .card-body { padding: 1rem 1.1rem; }
.sched-settings__form {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.sched-settings__form label { margin: 0; }
.sched-settings__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.sched-settings__hint {
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.35;
  margin: 0;
}
.subject-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 .85rem;
}
.notify-link-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .55rem;
}
.notify-link-presets .btn-sec {
  padding: .35rem .7rem;
  font-size: .82rem;
}
.notify-link-presets .btn-sec.is-picked {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}
.notify-action {
  margin: 0;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.notify-action legend {
  font-weight: 750;
  font-size: .82rem;
  padding: 0 .35rem;
}
.notify-action__hint {
  display: none;
}
.notify-action .kkt-check + .kkt-check {
  margin-top: .7rem;
}
.notify-action__targets {
  margin-top: .85rem;
}
.notify-action__picked {
  margin: .35rem 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}
.notify-action__picked.is-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
}
.notify-action #notifyGroupWrap {
  display: block;
  margin-top: 0.65rem;
}
.notify-action #notifyGroupWrap[hidden] {
  display: none;
}
.notify-page {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.notify-page__form,
.notify-page__log { margin: 0; max-width: none; }
.notify-page__log .notify-log__hint {
  margin: 0;
  padding: 0.55rem 1.05rem 0.15rem;
  color: var(--text-muted);
  font-size: .82rem;
}
.notify-page__log .members-list { max-height: min(70vh, 36rem); }
.notify-page__log .members-drop__btn { cursor: default; }
.notify-people__count {
  margin: 0;
  padding: 0.45rem 1.05rem 0;
  font-size: .86rem;
  font-weight: 650;
  color: var(--text-muted);
}
.notify-people .members-list {
  max-height: 22rem;
}
.notify-people .members-row__link {
  grid-template-columns: 1.15rem 2.8rem minmax(0, 1.2fr) minmax(4.2rem, 0.55fr);
  cursor: pointer;
}
.notify-people__box {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.notify-people .members-row.is-picked {
  background: rgba(var(--accent-rgb), 0.06);
}
.notify-audience {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}
.notify-audience__label {
  font-weight: 650;
}
.notify-audience .members-drop__btn {
  margin-left: auto;
}
.notify-audience__picked {
  margin: -0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.notify-audience__picked.is-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
}
.btn-prim.notify-send,
html.theme-dark .btn-prim.notify-send {
  width: 100%;
  height: 46px;
  justify-content: center;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.btn-prim.notify-send span,
html.theme-dark .btn-prim.notify-send span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.notify-aud-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.notify-aud-opt {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card2);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.notify-aud-opt:hover {
  border-color: rgba(76, 175, 69, 0.4);
}
.notify-aud-opt.is-on {
  border-color: var(--accent);
  background: rgba(76, 175, 69, 0.14);
  color: #2e7d32;
}
.kkt-dialog__panel--picker {
  overflow: visible;
}
.kkt-dialog__panel--picker .members-drop {
  z-index: 2;
}
.kkt-dialog__panel--picker .members-drop__menu {
  z-index: 30;
}
.notify-people--dialog .members-card__head {
  padding: 0 0 0.55rem;
  border-bottom: 0;
}
.notify-people--dialog .members-list {
  max-height: min(48vh, 22rem);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
}
.notify-log__empty[hidden],
.notify-log__table-wrap[hidden] {
  display: none !important;
}
.notify-page__log .members-row__link {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.notify-page__log .members-row__link:hover { background: var(--bg-card2); }
.notify-people__grid {
  max-height: 22rem;
  overflow: auto;
  padding: .15rem;
}
.notify-people .curator-tile {
  position: relative;
  min-height: 132px;
}
.notify-people .curator-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.notify-log {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1rem 1.1rem !important;
}
.notify-log__hint {
  margin: 0 0 .15rem;
  color: var(--text-muted);
  font-size: .82rem;
}
.notify-log__item {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card2, var(--bg-card));
  overflow: hidden;
}
.notify-log__summary {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
  padding: .85rem .95rem;
  cursor: pointer;
  list-style: none;
}
.notify-log__summary::-webkit-details-marker { display: none; }
.notify-log__item[open] {
  box-shadow: 0 10px 28px rgba(47, 138, 42, .08);
}
.notify-log__item[open] .notify-log__summary {
  border-bottom: 1px solid var(--border);
}
.notify-log__item[open] .notify-log__aside .bi {
  transform: rotate(180deg);
}
.notify-log__when {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: .15rem;
}
.notify-log__body strong {
  display: block;
  font-size: .95rem;
  margin-bottom: .2rem;
}
.notify-log__body p {
  margin: 0 0 .35rem;
  color: var(--text-muted);
  font-size: .86rem;
  line-height: 1.4;
}
.notify-log__body span {
  font-size: .8rem;
  color: var(--text-muted);
}
.notify-log__aside {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
}
.notify-log__aside .bi {
  font-size: .9rem;
  transition: transform .18s ease;
}
.notify-log__actor {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.notify-log__panel {
  padding: .2rem .2rem .85rem;
}
.notify-log__table-wrap {
  overflow-x: auto;
  padding: 0 .85rem 0.85rem;
}
.notify-log__table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .82rem;
}
.notify-log__table col {
  width: 20%;
}
.notify-log__table th,
.notify-log__table td {
  width: 20%;
  text-align: left;
  padding: .55rem .45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.notify-log__table th {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  padding-top: .65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notify-log__table td {
  color: var(--text);
}
.notify-log__table tr:last-child td { border-bottom: 0; }
.notify-log__empty {
  margin: 0;
  padding: 0.35rem 1.25rem 1rem;
  color: var(--text-muted);
}
@media (max-width: 960px) {
  .notify-page { grid-template-columns: 1fr; }
  .notify-log__summary { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .notify-log__aside { grid-column: 2; }
}
@media (max-width: 960px) {
  .sched-settings,
  .sched-excel,
  .subject-form-row { grid-template-columns: 1fr; }
}

.sched-head { margin-bottom: .85rem; }
.sched-head__meta {
  color: var(--text-muted);
  margin: .3rem 0 0;
  font-size: .9rem;
}
.sched-flash { display: flex; flex-direction: column; gap: .55rem; margin-bottom: .9rem; }
.sched-flash__item {
  padding: .75rem 1rem;
  margin: 0;
  border-left: 4px solid var(--accent);
}
.sched-flash__item.is-ok { border-left-color: #16a34a; }
.sched-flash__item.is-err { border-left-color: #dc2626; }
.sched-tabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: .3rem;
  background: var(--bg-card2, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
}
.sched-tabs__item {
  padding: .4rem .9rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.sched-tabs__item.is-on {
  background: var(--accent);
  color: #fff;
}
.sched-toolbar { padding: .85rem 1rem; margin-bottom: 1rem; }
.sched-toolbar__form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: flex-end;
}
.sched-toolbar__form label { margin: 0; min-width: 12rem; }
.sched-toolbar__form--panel {
  flex-direction: column;
  align-items: stretch;
  gap: .85rem;
}
.sched-toolbar__form--panel label {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sched-toolbar__form--panel .btn-prim { width: 100%; }
.list-filter-panel .sched-days { margin-top: 0; }
.list-page--sched-open .list-search__field,
.list-page--sched-open .list-search__meta { display: none; }
.sched-days {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
}
.sched-days__item {
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-size: .82rem;
}
.sched-days__item.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sched-groups {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.sched-chip {
  display: inline-flex;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
  font-weight: 650;
  font-size: .88rem;
}
.sched-chip:hover { border-color: var(--accent); color: var(--accent); }
.sched-hint { color: var(--text-muted); margin: 0 0 .75rem; font-size: .9rem; }
.sched-grid__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.sched-grid__meta {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.sched-grid__tools {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.sched-grid__count {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 650;
}
.sched-editor {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--accent-rgb), 0.06);
}
.sched-editor__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 750;
  margin-bottom: .75rem;
}
.sched-editor__form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.sched-editor__form label { margin: 0; }
.sched-editor__days { min-width: 0; }
.sched-editor__days > div { display: flex; flex-wrap: wrap; gap: .45rem .85rem; margin-top: .35rem; }
.sched-editor__clock {
  display: contents;
}
.sched-subject {
  display: contents;
}
.sched-editor__check,
.sched-editor__actions { grid-column: 1 / -1; }
.sched-editor__actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.sched-table { font-size: .9rem; }
.sched-table tr.is-editing { background: rgba(var(--accent-rgb), 0.1); }
.sched-table__acts { white-space: nowrap; display: flex; gap: .3rem; }
.sched-table__acts form { display: inline; }
.sched-sub { font-size: 1.02rem; margin: 1.15rem 0 .5rem; }
.sched-excel {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
  margin-bottom: 1rem;
}
.sched-excel__card { margin: 0; }
.sched-excel__form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sched-excel__week { display: block; margin: .65rem 0 0; }
.sched-excel__week[hidden] { display: none; }
.sched-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0;
  cursor: pointer;
}
.sched-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.sched-file__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card2, var(--bg-card));
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
}
.sched-file:hover .sched-file__btn,
.sched-file:focus-within .sched-file__btn {
  border-color: var(--accent);
  color: var(--accent);
}
.sched-file__name {
  min-width: 0;
  color: var(--text-muted);
  font-size: .88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sched-excel__result {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: 0 0 .85rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 12px;
  font-size: .88rem;
  color: var(--text-muted);
}
.sched-excel__result.is-ok { border-left-color: #16a34a; }
.sched-excel__result.is-err { border-left-color: #dc2626; }
.sched-excel__result strong { color: var(--text-primary); }
.sched-excel__preview {
  margin-top: .35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.sched-excel__stats {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  padding: .55rem .75rem;
  background: var(--bg-card2, var(--bg-card));
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
}
.sched-status {
  display: inline-flex;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.sched-status--ok { background: rgba(22, 163, 74, .14); color: #15803d; }
.sched-status--err { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.sched-status--muted { background: var(--bg-card2, var(--bg-card)); color: var(--text-muted); }
html.theme-dark .sched-status--ok { background: rgba(76, 175, 69, .18); color: #8ee09a; }
html.theme-dark .sched-status--err { background: rgba(239, 68, 68, .18); color: #fca5a5; }
@media (max-width: 900px) {
  .sched-editor__form { grid-template-columns: 1fr 1fr; }
  .sched-tabs { width: 100%; }
}
@media (max-width: 640px) {
  .sched-editor__form { grid-template-columns: 1fr; }
  .sched-toolbar__form label { min-width: 100%; }
}

.members-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.members-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-page {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-bottom: 1.25rem;
}
.settings-page .page-header {
  margin-bottom: 0.15rem;
}
.settings-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* Карточки настроек — как в профиле расписания */
.profile-settings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.profile-settings__btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 4.75rem;
  padding: 0.95rem 1.1rem 0.95rem 4.1rem;
  border: 0;
  border-radius: 22px;
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-align: left;
  text-decoration: none !important;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.profile-settings__btn:hover {
  text-decoration: none !important;
  color: inherit;
  box-shadow:
    0 2px 4px rgba(28, 25, 23, 0.05),
    0 12px 28px rgba(40, 110, 35, 0.1);
}
.profile-settings__btn:active {
  transform: scale(0.985);
}
.profile-settings__art {
  position: absolute;
  left: -1.15rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4.15rem;
  height: 4.15rem;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}
.profile-settings__plate {
  position: absolute;
  inset: 0.2rem;
  border-radius: 16px;
  background: #e8eaed;
  transform: rotate(12deg) skewX(-4deg);
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.03);
}
.profile-settings__art--prefs .profile-settings__plate { background: #ffe8d4; }
.profile-settings__art--bot .profile-settings__plate { background: #e4ebf5; }
.profile-settings__art--account .profile-settings__plate { background: #e6e8ec; }
.profile-settings__art--map .profile-settings__plate { background: #dceee9; }
.profile-settings__art--sessions .profile-settings__plate { background: #dce8d8; }
.profile-settings__art--password .profile-settings__plate { background: #efe4c8; }
.profile-settings__icon {
  position: relative;
  z-index: 1;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  color: #5f6368;
  font-size: 1.35rem;
  line-height: 1;
}
.profile-settings__art--prefs .profile-settings__icon { color: #c45c1a; }
.profile-settings__art--bot .profile-settings__icon { color: #3b6ea5; }
.profile-settings__art--account .profile-settings__icon { color: #4a5563; }
.profile-settings__art--map .profile-settings__icon { color: #1f7a6c; }
.profile-settings__art--sessions .profile-settings__icon { color: #2f6b32; }
.profile-settings__art--password .profile-settings__icon { color: #8a6a1a; }
.profile-settings__art:not(.profile-settings__art--prefs):not(.profile-settings__art--bot):not(.profile-settings__art--map):not(.profile-settings__art--account):not(.profile-settings__art--sessions):not(.profile-settings__art--password) .profile-settings__icon {
  color: #2f8a2a;
}
.profile-settings__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.profile-settings__title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.profile-settings__sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kkt-blur-backdrop {
  position: fixed !important;
  inset: 0;
  z-index: 9000;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: rgba(244, 250, 242, 0.42);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  -webkit-tap-highlight-color: transparent;
}
.kkt-blur-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.kkt-dialog-open {
  overflow: hidden;
}
body.kkt-dialog-open .navbar,
body.kkt-dialog-open .app-dock-layer {
  pointer-events: none;
}

.profile-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10000;
  width: min(calc(100% - 2rem), 420px);
  max-height: min(82vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(28, 25, 23, 0.06);
  border-radius: 22px;
  box-shadow: 0 22px 52px rgba(28, 25, 23, 0.16);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 10px)) scale(0.98);
  transition:
    opacity 0.32s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.32s ease;
}
.profile-sheet.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.profile-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(28, 25, 23, 0.06);
}
.profile-sheet__head-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.profile-sheet__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.profile-sheet__head-main .profile-settings__icon {
  position: relative;
  flex-shrink: 0;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8f6e4, #d4edcf);
  color: #2f8a2a;
  font-size: 1.05rem;
}
.profile-sheet__head-main .profile-settings__icon--prefs {
  background: linear-gradient(145deg, #fff4e8, #ffe0c2);
  color: #c45c1a;
}
.profile-sheet__head-main .profile-settings__icon--bot {
  background: linear-gradient(145deg, #e8eef8, #d4dff0);
  color: #3b6ea5;
}
.profile-sheet__head-main .profile-settings__icon--account {
  background: linear-gradient(145deg, #eef0f3, #dde1e7);
  color: #4a5563;
}
.profile-sheet__head-main .profile-settings__icon--map {
  background: linear-gradient(145deg, #e6f4f0, #cfe8e2);
  color: #1f7a6c;
}
.profile-sheet__head-main .profile-settings__icon--sessions {
  background: #e7f3e4;
  color: #2f8a2a;
}
.profile-sheet__head-main .profile-settings__icon--password {
  background: linear-gradient(145deg, #f6edd4, #ead7a2);
  color: #7a5c12;
}
.profile-sheet__close {
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 10px;
  background: rgba(28, 25, 23, 0.05);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none !important;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation;
}
.profile-sheet__close:hover {
  background: rgba(28, 25, 23, 0.09);
  color: var(--text-primary);
  text-decoration: none !important;
}
.profile-sheet__body {
  padding: 0.9rem 1rem 1.1rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.profile-email__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.profile-email__text a { font-weight: 700; }
.profile-panel__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  min-height: 2.45rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.58rem 1rem;
  background: linear-gradient(135deg, #5cbf52, #3fa83a);
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(63, 168, 58, 0.22);
}
.profile-panel__cta:hover {
  filter: brightness(1.04);
  text-decoration: none !important;
}
.profile-panel__cta:hover,
.profile-panel__cta span,
.profile-panel__cta .btn-busy,
button.profile-panel__cta,
label.profile-panel__cta {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.profile-account {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.profile-account--reset {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(28, 25, 23, 0.06);
}
.pass-vault {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.35rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(145deg, #eef8eb, #f7fcf6);
  border: 1px solid rgba(76, 175, 69, 0.18);
}
.pass-vault__lock {
  position: relative;
  width: 3.35rem;
  height: 3.35rem;
  flex-shrink: 0;
  display: grid;
  place-items: end center;
}
.pass-vault__shackle {
  position: absolute;
  top: 0.08rem;
  left: 50%;
  width: 1.35rem;
  height: 1.15rem;
  margin-left: -0.68rem;
  border: 3px solid #3d8f38;
  border-bottom: 0;
  border-radius: 999px 999px 4px 4px;
  transform-origin: 10% 90%;
  transform: rotate(-18deg) translate(-2px, 1px);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.pass-vault__lock[data-lvl="2"] .pass-vault__shackle,
.pass-vault__lock[data-lvl="3"] .pass-vault__shackle {
  transform: rotate(0deg) translate(0, 0);
}
.pass-vault__body {
  width: 2.55rem;
  height: 2.05rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #6dcc63, #2e7d32);
  color: #fff;
  box-shadow: 0 8px 16px rgba(46, 125, 50, 0.28);
  font-size: 1.05rem;
}
.pass-vault__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.pass-vault__copy strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}
.pass-vault__copy span {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  font-weight: 600;
}
.pass-field__box {
  position: relative;
  display: block;
}
.pass-field__box input {
  width: 100%;
  padding-right: 2.6rem;
}
.pass-eye {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.pass-eye i {
  grid-area: 1 / 1;
  font-size: 1.05rem;
  line-height: 1;
}
.pass-eye .bi-eye-slash { opacity: 0; }
.pass-eye.is-on { color: #2e7d32; }
.pass-eye.is-on .bi-eye { opacity: 0; }
.pass-eye.is-on .bi-eye-slash { opacity: 1; }
.pass-eye:hover { background: rgba(76, 175, 69, 0.1); color: var(--text-primary); }
.pass-meter {
  display: grid;
  gap: 0.28rem;
  margin: -0.15rem 0 0.15rem;
}
.pass-meter__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(28, 25, 23, 0.08);
  overflow: hidden;
}
.pass-meter__track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #c45c1a;
  transition: width 0.22s ease, background 0.22s ease;
}
.pass-meter__track i[data-lvl="2"] { background: #3d8f38; }
.pass-meter__track i[data-lvl="3"] { background: #1b5e20; }
.pass-meter span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.pass-match {
  margin: -0.2rem 0 0;
  font-size: 0.78rem;
  font-weight: 750;
}
.pass-match.is-ok { color: #2e7d32; }
.pass-match.is-bad { color: #c62828; }
html.theme-dark .pass-vault {
  background: linear-gradient(145deg, rgba(46, 62, 50, 0.9), rgba(32, 42, 36, 0.92));
  border-color: rgba(109, 204, 99, 0.22);
}
html.theme-dark .pass-meter__track {
  background: rgba(255, 255, 255, 0.08);
}
.profile-account__photo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(241, 249, 239, 0.95), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(76, 175, 69, 0.12);
}
.profile-account__preview {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, #7ed275, #2f8a2a);
  overflow: hidden;
}
.profile-account__preview-wait {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(18, 28, 20, 0.48);
  z-index: 2;
}
.profile-account__preview.is-uploading .profile-account__preview-wait,
.profile-account__preview-wait:not([hidden]) {
  display: grid;
}
.profile-account__preview-wait[hidden] {
  display: none !important;
}
.profile-account__preview.is-uploading img {
  filter: brightness(0.72);
}
.profile-account__photo-status {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-muted);
}
.profile-account__photo-status.is-ok { color: #2e7d32; }
.profile-account__photo-status.is-err { color: #c62828; }
.profile-account__photo-status.is-wait { color: var(--text-muted); }
.profile-account__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-account__photo-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.profile-account__photo-meta strong { font-size: 0.9rem; }
.profile-account__photo-meta > span {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.profile-account__photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.profile-account__save {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}
.profile-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 25, 23, 0.06);
  cursor: pointer;
  margin: 0;
}
.profile-toggle strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text-primary);
}
.profile-toggle__hint {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-weight: 600;
}
.profile-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 2.7rem;
  height: 1.55rem;
  margin: 0.12rem 0 0;
  flex-shrink: 0;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background-color: #d7dfd4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.16rem center;
  background-size: 1.22rem;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08);
  transition: background-position 0.2s ease, background-color 0.2s ease;
}
.profile-toggle input:checked {
  background-color: #4caf45;
  background-position: right 0.16rem center;
}
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
}
.profile-field select,
.profile-field input {
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
}
.profile-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 25, 23, 0.06);
}
.profile-theme__label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
}
.profile-theme__switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: rgba(28, 25, 23, 0.06);
  gap: 2px;
}
.profile-theme__switch button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.75rem;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  line-height: 1.2;
}
.profile-theme__switch button.is-on {
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(63, 168, 58, 0.28);
}

.chat-wall {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.chat-wall__label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
}
.chat-wall__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.45rem;
}
.chat-wall-pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-wall-pick__bg {
  display: block;
  height: 4.35rem;
  border-radius: 14px;
  background-color: var(--chat-wall-color, #e7eee4);
  background-image: var(--chat-wall-image, none);
  background-size: var(--chat-wall-size, cover);
  background-repeat: var(--chat-wall-repeat, no-repeat);
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.1);
}
.chat-wall-pick.is-on .chat-wall-pick__bg {
  box-shadow: inset 0 0 0 2px #3fa83a;
}
.chat-wall-pick__name {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.2;
  color: var(--text-muted);
}
.chat-wall-pick.is-on .chat-wall-pick__name {
  color: var(--text-primary);
}

html.chat-wall-plain .tg-main,
html.chat-wall-plain .tg-messages,
.chat-wall-swatch--plain {
  --chat-wall-color: #e8eee6;
  --chat-wall-image:
    radial-gradient(90% 55% at 12% -8%, rgba(255, 255, 255, 0.72), transparent 58%),
    radial-gradient(70% 50% at 100% 108%, rgba(170, 200, 164, 0.45), transparent 55%),
    linear-gradient(168deg, #f3f6f1 0%, #dce8d8 52%, #e6eee4 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #4caf45;
  --chat-mine-text: #fff;
  --chat-other: #fff;
  --chat-other-text: #1c1917;
  --chat-other-border: rgba(28, 25, 23, 0.08);
}
html.chat-wall-ink .tg-main,
html.chat-wall-ink .tg-messages,
.chat-wall-swatch--ink {
  --chat-wall-color: #141a16;
  --chat-wall-image:
    radial-gradient(80% 48% at 50% -10%, rgba(76, 175, 69, 0.18), transparent 58%),
    radial-gradient(60% 40% at 100% 100%, rgba(40, 90, 80, 0.28), transparent 55%),
    linear-gradient(180deg, #1c261f 0%, #101612 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #4caf45;
  --chat-mine-text: #fff;
  --chat-other: #243028;
  --chat-other-text: #e8eee8;
  --chat-other-border: rgba(255, 255, 255, 0.06);
}
html.chat-wall-mint .tg-main,
html.chat-wall-mint .tg-messages,
.chat-wall-swatch--mint {
  --chat-wall-color: #b7dcc0;
  --chat-wall-image:
    radial-gradient(85% 55% at 8% 0%, rgba(255, 255, 255, 0.55), transparent 56%),
    radial-gradient(70% 50% at 100% 90%, rgba(70, 170, 130, 0.38), transparent 58%),
    linear-gradient(158deg, #e8f7ea 0%, #9fd4b0 48%, #6eb89a 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #2f9a6a;
  --chat-mine-text: #fff;
  --chat-other: #f4fbf6;
  --chat-other-text: #163326;
  --chat-other-border: rgba(47, 110, 70, 0.12);
}
html.chat-wall-sea .tg-main,
html.chat-wall-sea .tg-messages,
.chat-wall-swatch--sea {
  --chat-wall-color: #7eb8d4;
  --chat-wall-image:
    radial-gradient(90% 60% at 100% 0%, rgba(180, 245, 245, 0.5), transparent 55%),
    radial-gradient(80% 55% at 0% 100%, rgba(40, 110, 180, 0.42), transparent 58%),
    linear-gradient(168deg, #c8ecf4 0%, #6eb4d8 46%, #3a7cb4 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #2488c4;
  --chat-mine-text: #fff;
  --chat-other: #f2f9fc;
  --chat-other-text: #14324a;
  --chat-other-border: rgba(36, 100, 150, 0.12);
}
html.chat-wall-sky .tg-main,
html.chat-wall-sky .tg-messages,
.chat-wall-swatch--sky {
  --chat-wall-color: #9ec8f0;
  --chat-wall-image:
    radial-gradient(80% 50% at 0% 0%, rgba(255, 255, 255, 0.7), transparent 52%),
    radial-gradient(70% 55% at 90% 100%, rgba(90, 140, 230, 0.45), transparent 58%),
    linear-gradient(165deg, #e8f3ff 0%, #9ec8f4 50%, #6ea0e8 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #3d86e0;
  --chat-mine-text: #fff;
  --chat-other: #f5f9ff;
  --chat-other-text: #163056;
  --chat-other-border: rgba(50, 110, 190, 0.12);
}
html.chat-wall-rose .tg-main,
html.chat-wall-rose .tg-messages,
.chat-wall-swatch--rose {
  --chat-wall-color: #f0a8c4;
  --chat-wall-image:
    radial-gradient(85% 55% at 8% -4%, rgba(255, 255, 255, 0.62), transparent 55%),
    radial-gradient(75% 50% at 100% 100%, rgba(230, 80, 140, 0.38), transparent 58%),
    linear-gradient(158deg, #ffe4ee 0%, #f5a8c8 46%, #e878b0 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #e45a96;
  --chat-mine-text: #fff;
  --chat-other: #fff4f8;
  --chat-other-text: #4a1830;
  --chat-other-border: rgba(200, 70, 120, 0.12);
}
html.chat-wall-clay .tg-main,
html.chat-wall-clay .tg-messages,
.chat-wall-swatch--clay {
  --chat-wall-color: #f0c8a8;
  --chat-wall-image:
    radial-gradient(80% 55% at 100% 0%, rgba(255, 230, 180, 0.7), transparent 55%),
    radial-gradient(70% 50% at 0% 100%, rgba(230, 130, 90, 0.4), transparent 58%),
    linear-gradient(162deg, #ffe8d4 0%, #f0b894 48%, #e89878 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #e07a48;
  --chat-mine-text: #fff;
  --chat-other: #fff7f0;
  --chat-other-text: #4a2818;
  --chat-other-border: rgba(200, 110, 70, 0.14);
}
html.chat-wall-lilac .tg-main,
html.chat-wall-lilac .tg-messages,
.chat-wall-swatch--lilac {
  --chat-wall-color: #c8b4e8;
  --chat-wall-image:
    radial-gradient(85% 55% at 0% 0%, rgba(255, 255, 255, 0.6), transparent 54%),
    radial-gradient(70% 50% at 100% 100%, rgba(130, 80, 210, 0.4), transparent 58%),
    linear-gradient(160deg, #f0e8ff 0%, #c8b0ec 48%, #9a82d8 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #7b5fd0;
  --chat-mine-text: #fff;
  --chat-other: #f7f2ff;
  --chat-other-text: #2e1e55;
  --chat-other-border: rgba(110, 80, 180, 0.14);
}
html.chat-wall-aurora .tg-main,
html.chat-wall-aurora .tg-messages,
.chat-wall-swatch--aurora {
  --chat-wall-color: #7eccc0;
  --chat-wall-image:
    radial-gradient(80% 50% at 0% 80%, rgba(80, 255, 210, 0.42), transparent 55%),
    radial-gradient(70% 50% at 100% 0%, rgba(90, 160, 230, 0.4), transparent 55%),
    linear-gradient(155deg, #d8f8f0 0%, #6ec8c4 46%, #4a88c0 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #1ea89a;
  --chat-mine-text: #fff;
  --chat-other: #f0fbf8;
  --chat-other-text: #143838;
  --chat-other-border: rgba(30, 140, 130, 0.14);
}
html.chat-wall-fog .tg-main,
html.chat-wall-fog .tg-messages,
.chat-wall-swatch--fog {
  --chat-wall-color: #c8d0dc;
  --chat-wall-image:
    radial-gradient(80% 55% at 10% 0%, rgba(255, 255, 255, 0.75), transparent 55%),
    radial-gradient(70% 50% at 100% 100%, rgba(130, 150, 180, 0.4), transparent 58%),
    linear-gradient(168deg, #eef1f6 0%, #c8d2de 52%, #b4c0d0 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #5d7190;
  --chat-mine-text: #fff;
  --chat-other: #f6f8fb;
  --chat-other-text: #1e2838;
  --chat-other-border: rgba(80, 100, 130, 0.12);
}
html.chat-wall-dusk .tg-main,
html.chat-wall-dusk .tg-messages,
.chat-wall-swatch--dusk {
  --chat-wall-color: #8a4868;
  --chat-wall-image:
    radial-gradient(90% 55% at 90% -8%, rgba(255, 170, 90, 0.55), transparent 52%),
    radial-gradient(80% 55% at 0% 110%, rgba(90, 40, 140, 0.5), transparent 55%),
    linear-gradient(165deg, #f0a070 0%, #d06890 42%, #584888 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #f08a68;
  --chat-mine-text: #2a1210;
  --chat-other: rgba(32, 22, 38, 0.72);
  --chat-other-text: #f4ece8;
  --chat-other-border: rgba(255, 255, 255, 0.08);
}
html.chat-wall-lava .tg-main,
html.chat-wall-lava .tg-messages,
.chat-wall-swatch--lava {
  --chat-wall-color: #4a1c18;
  --chat-wall-image:
    radial-gradient(80% 50% at 100% 0%, rgba(255, 120, 50, 0.5), transparent 52%),
    radial-gradient(70% 50% at 0% 100%, rgba(160, 30, 40, 0.45), transparent 55%),
    linear-gradient(168deg, #6a241c 0%, #3a1414 48%, #1a1012 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #e85a38;
  --chat-mine-text: #fff;
  --chat-other: #32201e;
  --chat-other-text: #f4e8e4;
  --chat-other-border: rgba(255, 140, 90, 0.12);
}
html.chat-wall-night .tg-main,
html.chat-wall-night .tg-messages,
.chat-wall-swatch--night {
  --chat-wall-color: #121428;
  --chat-wall-image:
    radial-gradient(70% 45% at 18% 8%, rgba(150, 90, 230, 0.42), transparent 52%),
    radial-gradient(60% 40% at 92% 88%, rgba(40, 120, 210, 0.38), transparent 52%),
    linear-gradient(180deg, #1c1838 0%, #0c101c 58%, #101828 100%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
  --chat-mine: #6b5ae0;
  --chat-mine-text: #fff;
  --chat-other: #1c2238;
  --chat-other-text: #e8ecf8;
  --chat-other-border: rgba(140, 160, 230, 0.14);
}
.chat-wall-swatch--app {
  --chat-wall-color: #e8eee6;
  --chat-wall-image: linear-gradient(90deg, #e8eee6 50%, #141a16 50%);
  --chat-wall-size: cover;
  --chat-wall-repeat: no-repeat;
}
html[class*="chat-wall-"] .tg-main,
html[class*="chat-wall-"] .tg-messages {
  background-color: var(--chat-wall-color) !important;
  background-image: var(--chat-wall-image) !important;
  background-size: var(--chat-wall-size, cover) !important;
  background-repeat: var(--chat-wall-repeat, no-repeat) !important;
  background-position: center !important;
}
html[class*="chat-wall-"] .chat-msg-mine .chat-bubble {
  background: var(--chat-mine, #4caf45) !important;
  color: var(--chat-mine-text, #fff) !important;
}
html[class*="chat-wall-"] .chat-msg-mine .chat-bubble-text {
  color: var(--chat-mine-text, #fff) !important;
}
html[class*="chat-wall-"] .chat-msg-other .chat-bubble {
  background: var(--chat-other, #fff) !important;
  color: var(--chat-other-text, #1c1917) !important;
  border-color: var(--chat-other-border, transparent) !important;
}
html[class*="chat-wall-"] .chat-msg-other .chat-bubble-text {
  color: var(--chat-other-text, #1c1917) !important;
}

.sess {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.sess__top {
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
}
.sess__top b {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}
.sess__top span {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.sess__hint {
  margin: -0.35rem 0 0.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
}
.sess__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sess-card {
  display: grid;
  grid-template-columns: 2.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 4.35rem;
  padding: 0.7rem 0.75rem 0.7rem 0.65rem;
  border-radius: 16px;
  background: var(--bg-card2);
}
.sess-card.is-now {
  background: #eef7ec;
  grid-template-columns: 2.55rem minmax(0, 1fr);
}
.sess-card--empty {
  grid-template-columns: 1fr;
  min-height: 0;
  padding: 0.95rem 0.9rem;
}
.sess-dev {
  position: relative;
  width: 2.55rem;
  height: 2.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
.sess-dev__body {
  position: relative;
  background: #2c342c;
}
.sess-dev__body::before {
  content: "";
  position: absolute;
  background: #d5e6d2;
}
.sess-dev__base { display: none; }
.sess-dev--phone .sess-dev__body,
.sess-dev--tablet .sess-dev__body {
  width: 1.42rem;
  height: 2.42rem;
  border-radius: 6px;
}
.sess-dev--phone .sess-dev__body::before,
.sess-dev--tablet .sess-dev__body::before {
  inset: 5px 3px 6px;
  border-radius: 2.5px;
}
.sess-dev--phone .sess-dev__body::after,
.sess-dev--tablet .sess-dev__body::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 7px;
  height: 1.5px;
  border-radius: 1px;
  background: #1a2018;
  transform: translateX(-50%);
}
.sess-dev--tablet .sess-dev__body {
  width: 1.85rem;
  height: 2.35rem;
  border-radius: 5px;
}
.sess-dev--desktop {
  height: 2.35rem;
}
.sess-dev--desktop .sess-dev__body {
  width: 2.05rem;
  height: 1.38rem;
  border-radius: 4px 4px 1px 1px;
}
.sess-dev--desktop .sess-dev__body::before {
  inset: 3px 3px 4px;
  border-radius: 2px;
}
.sess-dev--desktop .sess-dev__base {
  display: block;
  width: 2.5rem;
  height: 0.26rem;
  margin-top: 0;
  border-radius: 0 0 3px 3px;
  background: #3c453c;
}
.sess-card.is-now .sess-dev__body::before {
  background: #c8e4c4;
}
.sess-card__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
}
.sess-card__copy strong {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.sess-card__os {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.68;
  line-height: 1.2;
}
.sess-card__live,
.sess-card__muted {
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1.25;
}
.sess-card__live {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: #2f8a2a;
  font-weight: 750;
}
.sess-card__live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf45;
}
.sess-card__muted { color: var(--text-muted); }
.sess-card__you {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  color: #2f8a2a;
  background: rgba(76, 175, 69, 0.16);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}
.sess-card__form { margin: 0; }
.sess-card__form button {
  border: 0;
  background: transparent;
  color: #c24141;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  padding: 0.2rem 0;
  white-space: nowrap;
}
.sess-card__form button:hover { color: #9f1f1f; }
.sess__flush {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.75rem 0 0.15rem;
  border: 0;
  border-top: 1px solid rgba(28, 25, 23, 0.08);
  background: transparent;
  color: #c24141;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}
.sess__flush:hover { color: #9f1f1f; }
html.theme-dark .sess-card {
  background: rgba(255, 255, 255, 0.04);
}
html.theme-dark .sess-card.is-now {
  background: rgba(76, 175, 69, 0.12);
}
html.theme-dark .sess-dev__body {
  background: #d8ddd6;
}
html.theme-dark .sess-dev__body::before {
  background: #3a4a38;
}
html.theme-dark .sess-card.is-now .sess-dev__body::before {
  background: #4a6a46;
}
html.theme-dark .sess-dev--phone .sess-dev__body::after,
html.theme-dark .sess-dev--tablet .sess-dev__body::after {
  background: #8a9288;
}
html.theme-dark .sess-dev--desktop .sess-dev__base {
  background: #c5cac2;
}
html.theme-dark .sess__flush {
  border-top-color: var(--border);
}

@media (min-width: 768px) {
  .settings-page {
    max-width: 440px;
    padding-top: 0.35rem;
  }
  .profile-settings__btn {
    min-height: 5rem;
    padding: 1.05rem 1.2rem 1.05rem 4.35rem;
    border-radius: 24px;
  }
  .profile-settings__art {
    left: -1.25rem;
    width: 4.4rem;
    height: 4.4rem;
  }
  .profile-sheet {
    width: min(100%, 440px);
  }
}

html.theme-dark .kkt-blur-backdrop {
  background: rgba(8, 10, 9, 0.62);
}
html.theme-dark .profile-sheet {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.45);
}
html.theme-dark .profile-settings__btn {
  background: var(--bg-card);
}
html.theme-dark .profile-settings__plate {
  box-shadow: inset 0 0 0 1px rgba(244, 248, 241, 0.06);
}
html.theme-dark .profile-account__photo-status.is-ok { color: #9ccc9a; }
html.theme-dark .profile-account__photo-status.is-err { color: #ef9a9a; }
html.theme-dark .profile-account__photo,
html.theme-dark .profile-toggle,
html.theme-dark .profile-theme {
  background: rgba(44, 54, 47, 0.72);
  border-color: var(--border);
}
html.theme-dark .profile-toggle input {
  background-color: #3a453c;
  box-shadow: inset 0 0 0 1px rgba(244, 248, 241, 0.1);
}
html.theme-dark .profile-toggle input:checked {
  background-color: var(--accent);
}
html.theme-dark .profile-field select,
html.theme-dark .profile-field input {
  background: var(--bg-card2);
  border-color: var(--border);
  color: var(--text-primary);
}
html.theme-dark .profile-sheet__close {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
html.theme-dark .profile-sheet__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
html.theme-dark .profile-account--reset,
html.theme-dark .profile-sheet__head {
  border-color: var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .kkt-blur-backdrop,
  .profile-sheet {
    transition: none;
  }
}
.members-drop { position: relative; flex: 0 0 auto; }
.members-drop__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: var(--bg-card2);
  color: var(--text-primary);
  font: inherit;
  font-weight: 650;
  padding: 0.45rem 0.7rem 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.members-drop__count {
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.members-drop__btn .bi { font-size: 0.75rem; color: var(--text-muted); }
.members-drop__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  min-width: 11rem;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.members-drop__opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
}
.members-drop__opt:hover,
.members-drop__opt.is-on { background: var(--bg-card2); }
.members-search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  background: var(--bg-card2);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
}
.members-search i { color: var(--text-muted); }
.members-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  outline: none;
}
.members-search__clear {
  border: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.members-list {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0;
  max-height: min(70vh, 42rem);
  overflow: auto;
}
.members-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.members-row:last-of-type { border-bottom: 0; }
.members-row__link {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1.2fr) minmax(4.2rem, 0.55fr);
  align-items: center;
  gap: 0.75rem 0.9rem;
  padding: 0.72rem 0.7rem 0.72rem 1.05rem;
  color: inherit;
  text-decoration: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.members-row.is-selected,
.curator-row.is-selected {
  background: rgba(var(--accent-rgb), 0.08);
}
.members-row__meta {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0.15rem 0 0;
}
.members-row__del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.55rem;
  color: var(--text-muted);
  opacity: 0.42;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, opacity .15s ease;
}
.members-row__del-form { display: contents; }
span.members-badge { cursor: default; }
.members-row__del:hover,
.members-row__del:focus-visible {
  opacity: 1;
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
}
span.members-row__del {
  pointer-events: none;
  opacity: 0;
}
.members-row__link:hover { background: var(--bg-card2); color: inherit; }
div.members-row__link { cursor: default; }
.members-ava {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 750;
  font-size: 0.82rem;
  border: 2px solid transparent;
}
.members-ava img { width: 100%; height: 100%; object-fit: cover; }
.members-ava--on { border-color: #4c8dff; }
.members-ava--off { border-color: #e0a14a; }
.members-row__name {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.members-row__status {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}
.members-online {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #3b7cff;
  background: rgba(59, 124, 255, 0.12);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.members-online i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.members-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.members-badge__more {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.8;
}
.members-roles {
  position: absolute;
  right: 0;
  top: calc(100% - 0.35rem);
  z-index: 8;
  min-width: 12.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(20, 28, 18, 0.14);
  text-align: left;
}
.members-roles__title {
  display: block;
  padding: 0.15rem 0.4rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.members-roles__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.45rem;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text-primary);
}
.members-roles__item i { color: var(--text-muted); }
.members-badge--teacher { color: #6b4ce0; background: rgba(107, 76, 224, 0.12); }
.members-badge--curator { color: #2f9a57; background: rgba(47, 154, 87, 0.14); }
.members-badge--student { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.members-badge--off { color: #c47a10; background: rgba(196, 122, 16, 0.14); }
.members-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
html.theme-dark .members-drop__btn,
html.theme-dark .members-search { background: rgba(255,255,255,0.06); }
html.theme-dark .members-online { background: rgba(59, 124, 255, 0.2); }
html.theme-dark .members-badge--teacher { background: rgba(151, 122, 255, 0.18); color: #cbb6ff; }
html.theme-dark .members-badge--curator { background: rgba(76, 175, 69, 0.18); color: #8ee09a; }
html.theme-dark .members-badge--student { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
html.theme-dark .members-badge--off { background: rgba(224, 161, 74, 0.18); color: #f0c27a; }
html.theme-dark .members-roles {
  background: #222a24;
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
@media (max-width: 720px) {
  .members-card__head { flex-wrap: wrap; }
  .members-search { width: 100%; }
  .members-row__link {
    grid-template-columns: 2.7rem minmax(0, 1fr);
    grid-template-areas: "ava name" "ava status";
  }
  .members-ava { grid-area: ava; }
  .members-row__name { grid-area: name; }
  .members-row__status { grid-area: status; text-align: left; }
  .members-row__meta { padding-right: 0.2rem; }
  .notify-people .members-row__link {
    grid-template-columns: 1.15rem 2.5rem minmax(0, 1fr);
    grid-template-areas:
      "box ava name"
      "box ava status";
  }
  .notify-people__box { grid-area: box; }
}

html.auth-lite-html {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  scrollbar-gutter: auto !important;
  background: #e7f6e3 !important;
  background-color: #e7f6e3 !important;
}
html.auth-lite-html body.auth-lite.kkt-shell,
html.auth-lite-html body.auth-lite {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  color: #111 !important;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  background-color: #e7f6e3 !important;
  background:
    radial-gradient(58rem 32rem at 8% -12%, rgba(168, 230, 153, 0.62), transparent 58%),
    radial-gradient(46rem 28rem at 108% 8%, rgba(116, 216, 102, 0.38), transparent 52%),
    radial-gradient(40rem 24rem at 50% 118%, rgba(200, 240, 170, 0.5), transparent 55%),
    #e7f6e3 !important;
  background-size: auto !important;
  animation: none;
}
html.auth-lite-html .auth-lite__bg.kkt-bg {
  inset: 0;
  width: auto;
  height: auto;
  min-height: 0;
  background-color: #e7f6e3;
}
html.auth-lite-html body.auth-lite.kkt-shell > .auth-lite__home {
  position: absolute;
  z-index: 8;
  pointer-events: auto;
}
@keyframes auth-lite-bg-shift {
  0% { background-position: 0% 40%; }
  50% { background-position: 100% 60%; }
  100% { background-position: 0% 40%; }
}
.auth-lite__home {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  z-index: 8;
  color: #2f8a2a;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
}
.auth-lite__home:hover { color: #1e6b1c; }
.auth-lite__page {
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(3.25rem, env(safe-area-inset-top, 0px)) 1.25rem max(1.25rem, env(safe-area-inset-bottom, 0px));
}
html.auth-lite-html .pwa-ios-hint {
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
}
.auth-lite__card {
  width: min(22.5rem, 100%);
  text-align: center;
  pointer-events: auto;
}
.auth-lite__panel[hidden] { display: none !important; }
.auth-lite__panel { animation: none; }
.auth-faces {
  position: relative;
  width: min(18.6rem, 100%);
  height: 17.6rem;
  margin: 0.1rem auto 0.35rem;
  overflow: visible;
}
.auth-faces__phone {
  position: absolute;
  left: 50%;
  top: 0.25rem;
  transform: translateX(-50%);
  width: 7.7rem;
  height: 13.7rem;
  padding: 0.34rem;
  border-radius: 1.45rem;
  background: #1c1c1f;
  box-shadow: 0 18px 36px rgba(28, 50, 22, 0.22);
  z-index: 1;
}
.auth-faces__island {
  position: absolute;
  top: 0.48rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.05rem;
  height: 0.38rem;
  background: #0b0b0d;
  border-radius: 99px;
  z-index: 2;
}
.auth-faces__screen {
  height: 100%;
  border-radius: 1.08rem;
  background: linear-gradient(180deg, #eef6ea, #ffffff);
  overflow: hidden;
  padding: 0.82rem 0.34rem 0.34rem;
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  box-sizing: border-box;
}
.auth-faces__note {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 0.28rem;
  align-items: center;
  padding: 0.28rem 0.32rem 0.3rem 0.28rem;
  border-radius: 0.62rem;
  background: #fff;
  box-shadow: 0 6px 12px rgba(28, 36, 22, 0.08);
  text-align: left;
}
.auth-faces__note-ava {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  object-fit: cover;
}
.auth-faces__note-copy { min-width: 0; }
.auth-faces__note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem;
}
.auth-faces__note-head strong {
  font-size: 0.58rem;
  font-weight: 750;
  color: #111;
  letter-spacing: -0.02em;
}
.auth-faces__note-head time {
  font-size: 0.46rem;
  color: #8e8e93;
  font-weight: 500;
}
.auth-faces__note-text {
  display: block;
  font-size: 0.5rem;
  color: #5c5c63;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-faces__list {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-top: 0.08rem;
}
.auth-faces__item {
  display: grid;
  grid-template-columns: 0.95rem minmax(0, 1fr) auto;
  gap: 0.22rem;
  align-items: center;
  padding: 0.26rem 0.32rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.82);
  text-align: left;
  font-size: 0.52rem;
  color: #1c1917;
}
.auth-faces__item i,
.auth-faces__item span:first-child {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 0.28rem;
  display: grid;
  place-items: center;
  background: #4caf45;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 750;
  font-style: normal;
}
.auth-faces__item b {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-faces__item em {
  font-style: normal;
  color: #6b7368;
  font-variant-numeric: tabular-nums;
}
.auth-faces__item.is-now {
  background: #d9f3d4;
  box-shadow: 0 0 0 1px rgba(76, 175, 69, 0.45);
}
.auth-faces__ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.auth-faces__ava {
  --arc: none;
  --in-delay: 0s;
  position: absolute;
  width: 5.35rem;
  height: 5.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: 0 10px 22px rgba(40, 90, 32, 0.18);
  transform: var(--arc);
  transform-origin: center;
}
.auth-faces__ring .auth-faces__ava:nth-child(1) {
  left: calc(50% - 7.05rem);
  top: 10.85rem;
  --in-delay: 0.04s;
}
.auth-faces__ring .auth-faces__ava:nth-child(2) {
  width: 7rem;
  height: 7rem;
  left: 50%;
  top: 9.15rem;
  --arc: translateX(-50%);
  --in-delay: .12s;
  z-index: 4;
}
.auth-faces__ring .auth-faces__ava:nth-child(3) {
  left: calc(50% + 1.7rem);
  top: 10.85rem;
  --in-delay: .2s;
}
.auth-faces__ava img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-lite__card--tight .auth-faces {
  transform: scale(0.68);
  transform-origin: top center;
  margin-bottom: -4.2rem;
  height: 11.4rem;
}
.auth-lite__card--tight .auth-lite__mark {
  width: 4.2rem;
  height: 4.2rem;
  margin-bottom: 1rem;
}
.auth-lite__card--tight .auth-lite__title {
  font-size: clamp(1.5rem, 5vw, 2rem);
}
.auth-lite__card--tight .auth-lite__hint { margin-bottom: 1rem; }
.auth-lite__card--tight .auth-lite__form { gap: 0.55rem; }
@media (max-height: 820px) {
  .auth-faces {
    transform: scale(0.88);
    transform-origin: top center;
    height: 15.5rem;
    margin-bottom: 0.1rem;
  }
  .auth-lite__title { margin-bottom: 1rem; }
}
@media (max-height: 740px) {
  .auth-faces {
    transform: scale(0.76);
    height: 13.4rem;
  }
  .auth-lite__title {
    margin-bottom: 0.8rem;
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }
  .auth-lite__form { gap: 0.5rem; }
  .auth-lite__submit { height: 3.15rem; }
  .auth-lite__page { padding-top: max(2.6rem, env(safe-area-inset-top, 0px)); padding-bottom: 1rem; }
}
@media (max-height: 660px) {
  .auth-faces {
    transform: scale(0.62);
    height: 10.9rem;
  }
}
@media (max-height: 540px) {
  .auth-faces { display: none; }
}
.auth-lite__card--tight .auth-lite__input { height: 3.1rem !important; }
.auth-lite__mark {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: contain;
  margin: 0 auto 1.7rem;
  padding: 0.7rem;
  border-radius: 1.55rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(60, 30, 80, 0.08);
}
.auth-lite__title {
  margin: 0 0 1.35rem;
  font-size: clamp(1.55rem, 5.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: #111;
  font-family: inherit;
}
.auth-lite__hint {
  margin: 0 auto 1.7rem;
  max-width: 18.5rem;
  color: #8d8d96;
  font-size: 0.98rem;
  line-height: 1.45;
  font-weight: 450;
}
.auth-lite__form {
  display: grid;
  gap: 0.7rem;
  text-align: left;
}
.auth-lite .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.auth-lite__field { position: relative; display: block; }
.auth-lite__control { position: relative; }
.auth-lite__eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9a9aa3;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.auth-lite__eye-swap {
  position: relative;
  width: 1.3rem;
  height: 1.3rem;
  display: grid;
  place-items: center;
}
.auth-lite__eye-swap i {
  grid-area: 1 / 1;
  font-size: 1.2rem;
  line-height: 1;
  transition: opacity 0.28s ease, transform 0.35s cubic-bezier(.22, 1, .36, 1);
}
.auth-lite__eye-swap .bi-eye {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.auth-lite__eye-swap .bi-eye-slash {
  opacity: 0;
  transform: scale(0.55) rotate(-28deg);
}
.auth-lite__eye.is-on .bi-eye {
  opacity: 0;
  transform: scale(0.55) rotate(28deg);
}
.auth-lite__eye.is-on .bi-eye-slash {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  color: #2f8a2a;
}
.auth-lite__eye.is-on { color: #2f8a2a; }
.auth-lite__eye:hover {
  color: #111;
  background: rgba(17, 17, 17, 0.06);
}
.auth-lite__eye:active {
  transform: translateY(-50%) scale(0.88);
}
.auth-lite__input {
  width: 100%;
  height: 3.4rem;
  border: 0 !important;
  border-radius: 999px !important;
  background: #f2f2f5 !important;
  padding: 0 1.2rem !important;
  color: #111 !important;
  font: inherit;
  font-size: 1rem !important;
  outline: none;
  box-shadow: none !important;
}
.auth-lite__input--pass { padding-right: 3rem !important; }
.auth-lite__input::placeholder { color: #9a9aa3; }
.auth-lite__input:focus {
  background: #ececf1 !important;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08) !important;
}
.auth-lite__input.is-invalid {
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.35) !important;
}
.auth-lite__error,
.auth-lite__field-error {
  color: #3a3a3c;
  font-size: 0.86rem;
  line-height: 1.35;
  font-weight: 450;
}
.auth-lite__error {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.1rem;
  padding: 0.72rem 0.9rem 0.78rem 0.72rem;
  border-radius: 1.2rem;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.16);
  box-shadow: none;
  animation: auth-lite-err-pop 0.55s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-lite__error-ava {
  position: relative;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ff6b63, #e53935);
  color: #fff;
  flex-shrink: 0;
}
.auth-lite__error-bang {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.16rem;
  width: 100%;
  height: 100%;
}
.auth-lite__error-bang::before {
  content: '';
  width: 0.22rem;
  height: 0.86rem;
  border-radius: 99px;
  background: #fff;
}
.auth-lite__error-bang::after {
  content: '';
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background: #fff;
}
.auth-lite__error-copy { min-width: 0; }
.auth-lite__error-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.12rem;
}
.auth-lite__error-head strong {
  font-size: 0.92rem;
  font-weight: 750;
  color: #111;
}
.auth-lite__error-head time {
  color: #8e8e93;
  font-size: 0.78rem;
  font-weight: 500;
  flex-shrink: 0;
}
.auth-lite__error-text {
  display: block;
  color: #3a3a3c;
  font-size: 0.86rem;
  font-weight: 450;
}
.auth-lite__field .auth-lite__error { margin-top: 0.45rem; }
.auth-lite__field-error {
  display: block;
  margin: 0.4rem 0 0;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.1);
  animation: auth-lite-err-pop 0.45s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-lite__form--bad .auth-lite__control {
  animation: auth-lite-field-shake 0.4s ease;
}
@keyframes auth-lite-err-pop {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: none; }
}
@keyframes auth-lite-err-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
.auth-lite__error.is-out {
  animation: auth-lite-err-out 0.28s ease forwards;
}
.auth-lite__error-ava .bi {
  font-size: 1.18rem;
  line-height: 1;
  color: #fff;
}
.auth-lite__error-ava:has(.bi) .auth-lite__error-bang {
  display: none;
}
.auth-lite__error--ok .auth-lite__error-ava {
  background: linear-gradient(180deg, #6bcf5f, #4caf45);
}
.auth-lite__error--ok .auth-lite__error-bang {
  gap: 0;
}
.auth-lite__error--ok .auth-lite__error-bang::before {
  width: 0.42rem;
  height: 0.72rem;
  background: transparent;
  border: 2.4px solid #fff;
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 2px 0;
  transform: rotate(45deg) translate(-0.12rem, -0.14rem);
}
.auth-lite__error--ok .auth-lite__error-bang::after { display: none; }
.auth-lite__error--warn .auth-lite__error-ava {
  background: linear-gradient(180deg, #ffb74d, #f59e0b);
}
.auth-lite__error--info .auth-lite__error-ava {
  background: linear-gradient(180deg, #64b5f6, #1e88e5);
}
.auth-lite__error--info .auth-lite__error-bang {
  flex-direction: column-reverse;
  gap: 0.14rem;
}
.auth-lite__error--info .auth-lite__error-bang::before {
  height: 0.68rem;
}
html.auth-lite-html .toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(22.5rem, calc(100vw - 1.5rem));
  pointer-events: none;
}
.toast-container .auth-lite__error {
  pointer-events: auto;
  margin: 0;
}
@media (min-width: 992px) {
  .toast-container .auth-lite__error {
    animation: toast-in-br 0.4s cubic-bezier(.22, 1, .36, 1) both;
  }
  .toast-container .auth-lite__error.is-out {
    animation: toast-out-br 0.28s ease forwards;
  }
}
@media (max-width: 991px) {
  .toast-container .auth-lite__error {
    animation: toast-in-top 0.4s cubic-bezier(.22, 1, .36, 1) both;
  }
  .toast-container .auth-lite__error.is-out {
    animation: toast-out-top 0.28s ease forwards;
  }
}
@keyframes auth-lite-field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
.auth-lite__remember {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.05rem 0 0.1rem;
  font-size: 0.92rem;
  color: #6b7368;
  cursor: pointer;
  user-select: none;
  font-weight: 550;
  line-height: 1.3;
}
.auth-lite__remember input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.18rem;
  height: 1.18rem;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid rgba(28, 25, 23, 0.16);
  background: #f2f2f7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.78rem;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.auth-lite__remember input:hover { border-color: rgba(76, 175, 69, 0.55); }
.auth-lite__remember input:checked {
  background-color: #4caf45;
  border-color: #4caf45;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.2 8.3l3.1 3.1 6.5-6.6'/%3E%3C/svg%3E");
}
.auth-lite__remember input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.28);
}
.auth-lite__mark--question {
  width: 6.4rem;
  height: 6.4rem;
  margin: 0 auto 1.05rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  filter: drop-shadow(0 12px 20px rgba(40, 80, 30, 0.16));
}
.auth-lite__submit {
  margin-top: 0.45rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  background: #4caf45 !important;
  color: #fff !important;
  font: inherit;
  font-weight: 750;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: none;
  filter: none;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.auth-lite__submit:hover {
  background: #3d9a38 !important;
  color: #fff !important;
  filter: none;
  box-shadow: none;
  transform: scale(0.99);
}
.auth-lite__submit:active { transform: scale(0.985); }
.auth-lite__submit:disabled { opacity: 0.65; cursor: wait; }
.auth-lite__submit-busy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.auth-lite__submit-busy[hidden],
.auth-lite__submit-idle[hidden] { display: none !important; }
.auth-lite__submit .smile-loader { margin: 0; }
.auth-lite__skip {
  display: inline-block;
  margin-top: 1.2rem;
  color: #9a9aa3;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.auth-lite__skip:hover { color: #2f8a2a; text-decoration: none; }
@media (max-width: 430px) {
  .auth-lite__title {
    margin-bottom: 1rem;
    font-size: clamp(1.38rem, 6.4vw, 1.8rem);
  }
  .auth-lite__form { gap: 0.55rem; }
  .auth-lite__input,
  .auth-lite__submit { font-size: 16px !important; }
  .auth-lite__submit { height: 3.25rem; }
  .auth-lite__skip { margin-top: 0.9rem; }
}
@media (max-width: 430px) and (max-height: 680px) {
  .auth-faces {
    transform: scale(0.7);
    transform-origin: top center;
    height: 12.3rem;
  }
}
html.theme-dark.auth-lite-html {
  background: #141c12 !important;
  background-color: #141c12 !important;
}
html.theme-dark.auth-lite-html body.auth-lite.kkt-shell,
html.theme-dark.auth-lite-html body.auth-lite {
  background-color: #141c12 !important;
  background:
    radial-gradient(52rem 28rem at 10% -12%, rgba(76, 175, 69, 0.22), transparent 55%),
    radial-gradient(40rem 24rem at 100% 0%, rgba(109, 204, 99, 0.14), transparent 50%),
    linear-gradient(165deg, #141c12, #1a2318 48%, #121910) !important;
  background-size: auto !important;
  color: #f4f4f5 !important;
  animation: none !important;
}
html.theme-dark .auth-lite__title { color: #f4f4f5; }
html.theme-dark .auth-lite__hint,
html.theme-dark .auth-lite__skip,
html.theme-dark .auth-lite__remember { color: #8d8d96; }
html.theme-dark .auth-lite__remember input {
  background: #2c2c32;
  border-color: rgba(255, 255, 255, 0.16);
}
html.theme-dark .auth-lite__remember input:checked {
  background-color: #4caf45;
  border-color: #4caf45;
}
html.theme-dark .auth-lite__home { color: #8ee09a; }
html.theme-dark .auth-lite__home:hover,
html.theme-dark .auth-lite__skip:hover,
html.theme-dark .auth-lite__eye:hover { color: #fff; }
html.theme-dark .auth-lite__mark { background: #1c1c20; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
html.theme-dark .auth-lite__input {
  background: #232328 !important;
  color: #f4f4f5 !important;
}
html.theme-dark .auth-lite__input:focus { background: #2b2b31 !important; box-shadow: 0 0 0 3px rgba(92, 191, 82, 0.28) !important; }
html.theme-dark .auth-lite__submit {
  background: #4caf45 !important;
  color: #fff !important;
}
html.theme-dark .auth-lite__submit:hover {
  background: #6bcf5f !important;
  color: #fff !important;
}
html.theme-dark .auth-faces__ava { background: transparent; border-color: transparent; }
html.theme-dark .auth-faces__phone { background: #0f1110; box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4); }
html.theme-dark .auth-faces__screen { background: linear-gradient(180deg, #1c2319, #161a16); }
html.theme-dark .auth-faces__note { background: #2a2f2a; }
html.theme-dark .auth-faces__note-head strong { color: #f4f4f5; }
html.theme-dark .auth-faces__note-text { color: #b4b8b0; }
html.theme-dark .auth-faces__item { background: rgba(255, 255, 255, 0.06); color: #e8ece6; }
html.theme-dark .auth-faces__item.is-now { background: rgba(76, 175, 69, 0.22); }
html.theme-dark .auth-lite__error {
  background: #2a2a30;
  border: 1px solid rgba(109, 204, 99, 0.22);
  color: #d0d0d6;
  box-shadow: none;
}
html.theme-dark .auth-lite__error-head strong { color: #f4f4f5; }
html.theme-dark .auth-lite__error-text { color: #d0d0d6; }
html.theme-dark .auth-lite__error-head time { color: #8d8d96; }
html.theme-dark .auth-lite__field-error {
  background: #2a2a30;
  color: #ffb4ac;
}
@media (prefers-reduced-motion: reduce) {
  html.auth-lite-html body.auth-lite { animation: none !important; }
  .auth-lite__error,
  .auth-lite__field-error,
  .auth-lite__form--bad .auth-lite__control,
  .auth-faces__ava,
  .auth-lite__panel,
  .kkt-bg__iso { animation: none !important; }
  .auth-lite__eye-swap i { transition: none !important; }
}

.mod-hub__lead {
  margin: .35rem 0 0;
  color: var(--text-muted);
  font-size: .95rem;
  max-width: 40rem;
}
.mod-card { padding: 1.15rem 1.2rem 1.3rem; }
.mod-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.2rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.mod-card__head h3 {
  margin: 0 0 .25rem;
  font-size: 1.15rem;
}
.mod-card__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
}
.mod-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.mod-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  width: 100%;
  margin: 0 0 .85rem;
}
.mod-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  width: 100%;
  margin: 0 0 0;
}
.mod-card__meta div {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .7rem .8rem;
}
.mod-card__meta dt {
  font-size: .72rem;
  color: var(--text-muted);
  margin: 0 0 .2rem;
}
.mod-card__meta dd {
  margin: 0;
  font-weight: 750;
}
.mod-card__checks {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  width: 100%;
  margin: .95rem 0 0;
  padding-top: .95rem;
  border-top: 1px solid var(--border);
}
.mod-card__title {
  margin: 1.1rem 0 .35rem;
  font-size: 1rem;
}
.mod-card__hint {
  margin: 0 0 .75rem;
  color: var(--text-muted);
  font-size: .88rem;
}
.theme-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin: 0 0 .4rem;
}
.theme-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 14px;
  padding: .75rem .8rem .85rem;
  cursor: pointer;
  color: inherit;
}
.theme-pick:hover {
  border-color: var(--border-accent);
}
.theme-pick.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(76, 175, 69, .22);
}
.theme-pick strong { font-size: .92rem; }
.theme-pick small {
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.3;
}
.theme-pick__swatch {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 10px;
}
.theme-pick--default .theme-pick__swatch {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}
.theme-pick--school_year .theme-pick__swatch {
  background: linear-gradient(135deg, #fff3e0, #ffcc80 55%, #ef5350);
}
.theme-pick--snow .theme-pick__swatch {
  background: linear-gradient(135deg, #e3f2fd, #90caf9 50%, #eceff1);
}
html.theme-dark .theme-pick--default .theme-pick__swatch {
  background: linear-gradient(135deg, #1e2a20, #2e7d32);
}
html.theme-dark .theme-pick--school_year .theme-pick__swatch {
  background: linear-gradient(135deg, #3e2723, #ef6c00);
}
html.theme-dark .theme-pick--snow .theme-pick__swatch {
  background: linear-gradient(135deg, #1a237e, #90caf9);
}
@media (max-width: 720px) {
  .mod-card__meta,
  .theme-picks { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  html:has(body.landing-shell) {
    background: #e8f6e4 !important;
    background-color: #e8f6e4 !important;
  }
  html:has(body.landing-shell),
  html:has(body.landing-shell) body {
    height: auto;
    max-height: none;
    overflow: auto;
  }
  body.landing-shell.kkt-shell {
    height: auto;
    min-height: 100dvh;
    min-height: 100lvh;
    min-height: -webkit-fill-available;
    max-height: none;
    overflow: auto;
    background-color: #e8f6e4;
  }
  .landing-shell .kkt-top {
    padding: max(0.7rem, env(safe-area-inset-top, 0px)) 1.05rem 0.7rem;
    gap: 0.65rem;
    flex-shrink: 0;
  }
  .landing-shell .kkt-logo { font-size: 1.02rem; }
  .landing-shell .kkt-logo-img { width: 34px; height: 34px; }
  .landing-shell .kkt-top-link { padding: 0.48rem 1rem; font-size: 0.86rem; }
  .landing-shell .kkt-main {
    padding: 0.7rem 1.1rem 1.15rem;
    min-height: 0;
    place-items: start center;
  }
  .landing-shell .kkt-hero {
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }
  .landing-shell .kkt-hero-visual {
    order: -1;
    min-width: 0;
    justify-content: center;
  }
  .landing-shell .kkt-hero-visual img {
    width: min(62vw, 240px);
    max-height: min(34dvh, 250px);
    margin: 0 auto;
  }
  .landing-shell .kkt-panel h1 {
    font-size: clamp(1.55rem, 7vw, 2.05rem);
    margin: 0 0 0.5rem;
    line-height: 1.18;
  }
  .landing-shell .kkt-panel p {
    font-size: 0.96rem;
    line-height: 1.48;
    margin: 0 0 0.95rem;
  }
  .landing-shell .kkt-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.5rem;
  }
  .landing-shell .kkt-btn,
  .landing-shell .kkt-btn-outline {
    width: 100%;
    padding: 0.78rem 1rem;
    font-size: 0.95rem;
    justify-content: center;
  }
  .landing-shell .kkt-bottom {
    padding: 0.7rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.78rem;
    flex-shrink: 0;
    background: rgba(231, 246, 227, 0.72);
  }
  .landing-ios { padding: 0.85rem; }
  .landing-ios__card { padding: 1.1rem 1.15rem 1.05rem; border-radius: 18px; }
  .landing-ios__card h2 { font-size: 1.15rem; }
}
@media (min-width: 560px) and (max-width: 800px) {
  .landing-shell .kkt-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.8fr);
    gap: 0.85rem;
    align-items: center;
  }
  .landing-shell .kkt-hero-visual { order: 0; }
  .landing-shell .kkt-hero-visual img {
    width: min(100%, 220px);
    max-height: min(42dvh, 280px);
  }
}
@media (max-width: 800px) and (max-height: 480px) {
  .landing-shell .kkt-hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(120px, 0.7fr);
    align-items: center;
  }
  .landing-shell .kkt-hero-visual { order: 0; }
  .landing-shell .kkt-hero-visual img {
    width: min(100%, 160px);
    max-height: 68dvh;
  }
  .landing-shell .kkt-panel p {
    font-size: 0.88rem;
    margin: 0 0 0.7rem;
  }
}

.notify-dialog.achooser__panel,
.notify-dialog--wide.achooser__panel {
  display: none;
}

.kkt-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(76, 175, 69, 0.16);
  border-radius: 16px;
  background: #fff;
  box-shadow: none;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
}
.kkt-notice__ava,
.kkt-dialog__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(180deg, #64b5f6, #1e88e5);
  color: #fff;
}
.kkt-notice__ava i,
.kkt-dialog__icon i {
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
}
.kkt-notice--ok .kkt-notice__ava,
.kkt-notice--ok.kkt-dialog__icon,
.kkt-dialog__icon.kkt-notice--ok {
  background: linear-gradient(180deg, #6bcf5f, #4caf45);
}
.kkt-notice--warn .kkt-notice__ava,
.kkt-notice--warn.kkt-dialog__icon,
.kkt-dialog__icon.kkt-notice--warn {
  background: linear-gradient(180deg, #ffb74d, #f59e0b);
}
.kkt-notice--info .kkt-notice__ava,
.kkt-notice--info.kkt-dialog__icon,
.kkt-dialog__icon.kkt-notice--info {
  background: linear-gradient(180deg, #64b5f6, #1e88e5);
}
.kkt-notice--error .kkt-notice__ava,
.kkt-notice--error.kkt-dialog__icon,
.kkt-dialog__icon.kkt-notice--error {
  background: linear-gradient(180deg, #ff6b63, #e53935);
}
.kkt-notice__copy { min-width: 0; }
.kkt-notice__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}
.kkt-notice__head strong {
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kkt-notice__head time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.kkt-notice__text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
html.theme-dark .kkt-notice {
  background: var(--bg-card2);
  border-color: rgba(76, 175, 69, 0.22);
}

body.kkt-dialog-open,
body.kkt-notify-open,
body.kkt-busy-open {
  overflow: hidden;
}

.kkt-busy {
  position: fixed;
  inset: 0;
  z-index: 80000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(247, 252, 245, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.kkt-busy[hidden] { display: none !important; }
.kkt-busy__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  min-width: 168px;
  padding: 1.15rem 1.35rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(76, 175, 69, 0.18);
  box-shadow: 0 16px 40px rgba(40, 110, 35, 0.16);
}
.kkt-busy__card span {
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--text-primary);
}
.kkt-busy__card .smile-loader { margin: 0; }
html.theme-dark .kkt-busy {
  background: rgba(22, 27, 23, 0.72);
}
html.theme-dark .kkt-busy__card {
  background: var(--bg-card);
}

.kkt-dialog {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.kkt-dialog[hidden] { display: none !important; }
.kkt-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.kkt-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(82vh, 640px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.15rem 1.1rem;
  background: linear-gradient(180deg, #f7fcf5 0%, #ffffff 42%);
  border: 1px solid rgba(76, 175, 69, 0.18);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(40, 110, 35, 0.2);
}
@media (max-width: 768px) {
  .kkt-dialog {
    padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }
  .kkt-dialog__panel {
    max-height: min(68dvh, 520px);
  }
  .d3-row {
    min-height: 4.35rem;
    padding: 0.62rem 0.65rem 0.62rem 0.75rem;
  }
}
.kkt-dialog__panel--wide {
  width: min(720px, 100%);
  max-height: min(88vh, 780px);
}
html.theme-dark .kkt-dialog__panel {
  background: var(--bg-card);
  border-color: rgba(76, 175, 69, 0.28);
}
.kkt-dialog__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}
.kkt-dialog__top .kkt-dialog__icon {
  margin: 0;
}
.kkt-dialog__top .kkt-dialog__title {
  flex: 1;
  min-width: 0;
}
.kkt-dialog__icon {
  margin: 0 0 0.75rem;
}
.kkt-dialog__title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.kkt-dialog__time,
.kkt-dialog__meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}
.kkt-dialog__body {
  margin: 0.55rem 0 0;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-y: auto;
  max-height: 32vh;
}
.kkt-dialog__scroll {
  margin: 0.75rem 0 0;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card2);
}
.kkt-dialog__scroll .notify-log__table-wrap {
  padding: 0.15rem 0.55rem 0.35rem;
  overflow: visible;
}
.kkt-dialog__scroll .notify-log__empty {
  padding: 0.55rem 0.85rem 0.85rem;
}
.kkt-dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 1.15rem;
  flex-shrink: 0;
}
.kkt-dialog__actions--one {
  grid-template-columns: 1fr;
}
.kkt-dialog__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none !important;
  cursor: pointer;
}
.kkt-dialog__btn--ghost {
  background: rgba(28, 25, 23, 0.06);
  color: var(--text-muted);
}
.kkt-dialog__btn--ghost:hover {
  background: rgba(28, 25, 23, 0.1);
  color: var(--text-primary);
}
.kkt-dialog__btn--primary {
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%);
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(63, 168, 58, 0.28);
}
.kkt-dialog__btn--danger {
  background: #e53935;
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(229, 57, 53, 0.28);
}
.kkt-dialog__btn--danger:hover { background: #d32f2f; }
.kkt-dialog__btn[hidden] { display: none !important; }
.kkt-dialog__actions:not(.kkt-dialog__actions--one) [data-close-notice].kkt-dialog__btn--primary {
  background: rgba(28, 25, 23, 0.06);
  color: var(--text-muted) !important;
  box-shadow: none;
}

.btn-prim.is-busy,
.btn-prim:disabled,
.btn-primary.is-busy {
  opacity: 0.78;
  cursor: wait;
  pointer-events: none;
}
.btn-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.btn-busy[hidden] { display: none !important; }
.btn-prim .smile-loader,
.btn-primary .smile-loader { margin: 0; }

.achooser__close {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 10px;
  background: rgba(28, 25, 23, 0.05);
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}
.achooser__close:hover {
  background: rgba(28, 25, 23, 0.1);
}

.tg-write-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4caf45;
  color: #fff !important;
  font: inherit;
  font-weight: 750;
  font-size: 0.84rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(76, 175, 69, 0.28);
}
.tg-write-btn:hover,
.tg-write-btn:focus {
  background: #43a03d;
  color: #fff !important;
  transform: scale(1.04);
}
.tg-write-btn i,
.tg-write-btn__label {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.tg-write-btn i { font-size: 1.25rem; }
.tg-write-btn__label { display: none; }

.chat-picker {
  position: fixed;
  inset: 0;
  z-index: 50020;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.chat-picker[hidden] { display: none !important; }
.chat-picker__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(16, 24, 18, 0.52);
  cursor: pointer;
}
.chat-picker__sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 42rem);
  max-height: min(88dvh, 44rem);
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.chat-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem 0.55rem 1.1rem;
}
.chat-picker__head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.chat-picker__card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-picker__card .members-list {
  max-height: none;
  flex: 1;
}
.chat-picker__hint {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-muted);
}
.chat-picker__row-form {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
}
.chat-picker__lock {
  margin: 0 1.1rem 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}
.members-row--picker .members-row__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  grid-template-columns: none;
  width: 100%;
}
.members-row--picker .members-row__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.members-row--picker .members-row__status {
  text-align: left;
}
.members-row__ban {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #b42318;
  background: rgba(180, 35, 24, 0.1);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}
.tg-contact-ban {
  margin-left: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #b42318;
  background: rgba(180, 35, 24, 0.12);
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
  vertical-align: middle;
}
body.chat-picker-open { overflow: hidden; }
html.chat-picker-host-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50000;
  background: rgba(16, 24, 18, 0.52);
  pointer-events: none;
}
html.chat-picker-host-open .chat-sidebar {
  z-index: 50001 !important;
  width: min(42rem, 96vw) !important;
  transform: translateX(0) !important;
}

.chat-mod-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-mod-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.chat-mod-filters .notify-pill {
  text-decoration: none;
}
.chat-mod-filters .notify-pill.is-on span {
  background: rgba(76, 175, 69, 0.16);
}

.mod-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 74rem;
  align-items: start;
}
.mod-journal { grid-column: 1 / -1; }
.mod-page > .mod-card { margin-top: 0; }
.mod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.05rem 1.15rem 1.15rem;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}
.mod-card + .mod-card { margin-top: 1rem; }
.mod-page > .mod-card + .mod-card { margin-top: 0; }
.mod-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.mod-card__head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.mod-card__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 38rem;
}
.mod-count {
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 1.7rem;
  text-align: center;
  color: #9a3412;
  background: #fff4e5;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  white-space: nowrap;
}
.mod-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.mod-inbox {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.mod-case {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card2, #f6f8f6);
  padding: 0.75rem 0.85rem 0.8rem;
}
.mod-case__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.mod-case__tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #9a3412;
  background: #fff4e5;
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
}
.mod-case__head time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mod-case__who {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}
.mod-case__who span {
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.28rem;
}
.mod-case__quote {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid #4caf45;
  background: #fff;
  border-radius: 0 10px 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.4;
}
.mod-quote-img {
  max-width: 180px;
  border-radius: 10px;
  margin-top: 0.4rem;
}
.mod-case__meta {
  margin: 0.4rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.mod-case__meta a {
  margin-left: 0.35rem;
  font-weight: 700;
}
.mod-case__note {
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(28, 25, 23, 0.04);
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.mod-case__btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.mod-reviewed { margin-top: 0.85rem; }
.mod-reviewed > summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 650;
}
.mod-reviewed__list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.mod-issue {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
}
.mod-issue__list {
  max-height: 18rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.mod-issue__list .members-row.is-picked {
  background: rgba(76, 175, 69, 0.12);
}
.mod-issue__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(5.5rem, 0.6fr);
  gap: 0.55rem;
}
.mod-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}
.mod-picked {
  font-size: 0.85rem;
  font-weight: 650;
  color: #166534;
  background: rgba(76, 175, 69, 0.12);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
}
.mod-people {
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6rem;
  z-index: 8;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.12);
  max-height: 16rem;
  overflow: auto;
  padding: 0.3rem;
}
.mod-people__item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.mod-people__item:hover { background: rgba(76, 175, 69, 0.1); }
.mod-people__item span { font-size: 0.75rem; color: var(--text-muted); }
.mod-people__empty { padding: 0.7rem; color: var(--text-muted); font-size: 0.85rem; }
.mod-issue__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.mod-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.mod-table td { vertical-align: middle; }
.mod-journal .kkt-table-wrap { margin: 0; }
html.theme-dark .mod-card,
html.theme-dark .mod-case__quote,
html.theme-dark .mod-people {
  background: var(--bg-card);
}
html.theme-dark .mod-case,
html.theme-dark .mod-case__note {
  background: rgba(255,255,255,0.03);
}
html.theme-dark .mod-count,
html.theme-dark .mod-case__tag {
  background: rgba(234, 88, 12, 0.18);
  color: #fdba74;
}

@media (min-width: 900px) {
  .mod-page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .mod-issue__row { grid-template-columns: 1fr; }
  .mod-case__btns { justify-content: stretch; }
  .mod-case__btns form { flex: 1; }
  .mod-case__btns button { width: 100%; }
  .mod-journal .kkt-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .mod-table thead { display: none; }
  .mod-table,
  .mod-table tbody,
  .mod-table tr,
  .mod-table td {
    display: block;
    width: 100%;
  }
  .mod-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .mod-table tr {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    padding: 0.85rem 0.95rem 0.95rem;
    box-shadow: 0 8px 18px rgba(28, 25, 23, 0.05);
  }
  .mod-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.28rem 0;
    border: 0;
  }
  .mod-table td::before {
    content: attr(data-label);
    flex: 0 0 5.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-top: 0.15rem;
  }
  .mod-table td:last-child {
    justify-content: flex-end;
    padding-top: 0.55rem;
  }
  .mod-table td:last-child::before { content: none; }
  .mod-card__head { align-items: stretch; }
  .chat-mod-filters { width: 100%; }
}

@media (min-width: 769px) {
  .chat-picker {
    align-items: center;
  }
  .chat-picker__sheet {
    border-radius: 1.25rem;
    width: min(42rem, 94vw);
    max-height: min(82vh, 44rem);
  }
}

@media (max-width: 768px) {
  body.chat-page .chat-input-wrap {
    padding: 0.7rem 0.85rem calc(0.95rem + env(safe-area-inset-bottom, 0px)) !important;
    gap: 0.55rem !important;
    align-items: center;
  }
  body.chat-page .chat-input {
    min-height: 48px !important;
    font-size: 16px !important;
    padding: 0.7rem 1rem !important;
  }
  body.chat-page .chat-action-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.2rem !important;
  }
  input, textarea, select,
  .form-control, .form-select,
  .members-search input,
  .list-search__input {
    font-size: 16px !important;
  }
}

@media (max-width: 991px) {
  .tg-chat-layout.chat-list-mode .tg-write-btn {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(76, 175, 69, 0.28);
  }
  .tg-chat-layout.chat-list-mode .tg-write-btn__label {
    display: none !important;
  }
  .tg-chat-layout.chat-list-mode .tg-write-btn i {
    font-size: 1.25rem;
  }
  .tg-chat-layout.chat-list-mode .tg-chat-toolbar__end {
    width: auto;
    min-width: 40px;
    height: 40px;
    overflow: visible;
  }
  .tg-chat-layout.chat-list-mode .tg-sidebar-list {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

html.chat-theme-dark a.tg-back,
html.chat-theme-dark .tg-chat-toolbar .tg-back {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: 0 !important;
  box-shadow: none;
}
html.chat-theme-dark .tg-back:hover,
html.chat-theme-dark .tg-chat-toolbar .tg-back:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}
html.chat-theme-dark .chat-picker__sheet {
  background: var(--bg-card);
}
html.chat-theme-dark .chat-picker__backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Окна просмотра: лекция / тест / ДЗ / урок — читалка, без градиентов */
.study {
  width: min(42rem, 100%);
  margin: 0 auto 2.2rem;
  padding: 0 0.15rem;
}
.study-preview {
  margin: 0 auto 1rem;
  max-width: 42rem;
  padding: .7rem 1rem;
  border-radius: 12px;
  background: var(--primary-soft, rgba(76, 175, 69, .12));
  color: var(--text-primary, inherit);
  font-size: .92rem;
}
.study--wide { width: min(56rem, 100%); }
.study-head {
  margin: 0 0 1.15rem;
}
.study-head__lead {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem 0.55rem;
  margin: 0 0 0.55rem;
}
.study-head__lead .page-back { margin-top: 0.05rem; }
.study-head__lead .study-title { flex: 1 1 auto; min-width: 0; }
.study-back {
  display: none;
}
.study-kicker {
  margin: 0 0 0.28rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
}
.study-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}
.study-lead {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.study-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin-top: 0.7rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.study-meta a { color: var(--accent); font-weight: 700; text-decoration: none; }
.study-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}
.study-facts li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.study-facts b {
  color: var(--text-primary);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.study-paper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.05);
}
.study-paper.lecture-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.course-page--read .study-paper.lecture-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: none;
  overflow: visible;
}
.study-paper.lecture-content img,
.study-paper.lecture-content video,
.study-paper.lecture-content iframe,
.study-paper.lecture-content audio,
.lecture-content img,
.lecture-content video,
.lecture-content iframe,
.lecture-content audio {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}
.lecture-content .lec-table-scroll,
.ql-editor .lec-table-scroll {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}
.lecture-content table,
.ql-editor table {
  display: table !important;
  width: 100% !important;
  max-width: none;
  margin: 1rem 0;
  border-collapse: collapse;
  table-layout: auto;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
}
.lecture-content .lec-table-scroll table,
.ql-editor .lec-table-scroll table {
  margin: 0;
}
.lecture-content th,
.lecture-content td,
.ql-editor th,
.ql-editor td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
  color: var(--text-primary);
  background: var(--bg-card);
}
.lecture-content th,
.ql-editor th {
  background: rgba(var(--accent-rgb), 0.12);
  font-weight: 700;
}
.lecture-content pre {
  max-width: 100%;
  overflow-x: auto;
  display: block;
}
.study-paper.lecture-content h1,
.study-paper.lecture-content h2,
.study-paper.lecture-content h3 {
  margin: 1.35rem 0 0.45rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.study-paper.lecture-content p { margin: 0 0 0.9rem; }
.study-paper.lecture-content a { color: var(--accent); font-weight: 650; }
.study-related {
  margin-top: 1rem;
}
.study-related h2 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--text-primary);
}
.study-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
}
.study-link:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  text-decoration: none;
}
.study-link i {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}
.study-link strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.92rem;
}
.study-link span {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.study-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 0.9rem;
  align-items: start;
}
.study--hw {
  width: min(72rem, 100%);
}
.study--hw .study-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 1.15rem;
}
.study--hw .study-paper {
  padding: 1.5rem 1.55rem 1.65rem;
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(40, 70, 50, 0.08);
}
.hw-submit,
.course-body.hw-submit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 1rem;
  align-items: start;
  min-width: 0;
  width: 100%;
}
.hw-card {
  min-width: 0;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 22px;
  background: var(--bg-card, #fff);
  border: 1px solid rgba(28, 25, 23, 0.05);
  box-shadow: 0 12px 28px rgba(40, 70, 50, 0.08);
}
.hw-card__label {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hw-card__meta {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 650;
}
.hw-card__empty,
.hw-card__comment {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.hw-card__text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hw-card__text img,
.hw-card__text video,
.hw-card__text iframe {
  max-width: 100%;
  height: auto;
}
.hw-answer-form .hw-field { margin-bottom: 0.85rem; }
.hw-answer-form textarea.form-control {
  min-height: 8.5rem;
  border-radius: 16px;
  resize: vertical;
}
.hw-submit__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.hw-submit__bar .btn-prim,
.hw-submit__bar .btn-sec {
  min-height: 2.85rem;
  min-width: 8rem;
  justify-content: center;
}
.hw-file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.hw-file__wrap {
  position: relative;
}
.hw-file__box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 18px;
  border: 1.5px dashed rgba(76, 175, 69, 0.45);
  background: rgba(76, 175, 69, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}
.hw-file__copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.hw-file__copy strong {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 800;
}
.hw-file__copy span {
  font-size: 0.78rem;
  font-weight: 650;
}
.hw-file__box:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.hw-file__box i {
  flex: 0 0 auto;
  font-size: 1.35rem;
  color: var(--accent);
}
.hw-file__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0;
}
.hw-file__name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.hw-file-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-width: 0;
  margin-top: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), .28);
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  box-sizing: border-box;
}
.hw-file-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.theme-dark .hw-file__box {
  background: rgba(255,255,255,.04);
  border-color: rgba(109, 204, 99, 0.35);
}
html.theme-dark .hw-card {
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
@media (max-width: 640px) {
  .study { margin-bottom: 5.5rem; }
  .study-paper { padding: 1rem 0.95rem 1.15rem; border-radius: 18px; }
  .study-paper.lecture-content { font-size: 1rem; line-height: 1.7; }
  .study-title { font-size: 1.32rem; }
  .quiz-q { padding: 0.85rem 0.85rem 0.9rem; }
  .study-actions { flex-direction: column; }
  .study-actions .btn-prim,
  .study-actions .btn-sec { width: 100%; justify-content: center; }
}
.study-split .study-paper { min-width: 0; }
.study-label {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
}
.study-kv {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.study-kv span { color: var(--text-muted); }
.study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}
.study-actions .btn-prim,
.study-actions .btn-sec {
  min-height: 2.7rem;
  padding: 0 1.15rem;
}
.study-grade {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.study-grade b {
  display: block;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.quiz-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem 1.1rem 1.05rem;
  margin-bottom: 0.75rem;
  content-visibility: auto;
  contain-intrinsic-size: 0 220px;
}
.quiz-q__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.quiz-q__top b { color: var(--accent); }
.quiz-q p {
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}
.quiz-q img {
  max-width: 100%;
  max-height: 280px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}
.quiz-q .answer-option {
  background: var(--bg-card2);
  border-color: var(--border);
}
.quiz-q .answer-option:hover,
.quiz-q .answer-option:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: none;
}
.quiz-q textarea.form-control {
  min-height: 5.5rem;
}
.quiz-hint {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.quiz-score {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.quiz-score strong {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}
.quiz-review,
.review-q {
  margin-bottom: 0.75rem;
  padding: 0.95rem 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.04);
}
.quiz-review--ok { border-color: rgba(76, 175, 69, 0.35); }
.quiz-review--bad { border-color: rgba(180, 35, 24, 0.28); }
.quiz-review__top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.quiz-review__mark {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  background: var(--bg-card2);
  color: var(--text-muted);
}
.quiz-review--ok .quiz-review__mark {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-green);
}
.quiz-review--bad .quiz-review__mark {
  background: rgba(180, 35, 24, 0.12);
  color: var(--accent-red);
}
.quiz-review__top p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.4;
}
.quiz-review__pts {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
}
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.15rem;
  font-size: 0.86rem;
  color: var(--text-primary);
}
.quiz-opt--right { color: var(--accent-green); font-weight: 650; }
.quiz-opt--wrong { color: var(--accent-red); }

.review-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 1.15rem;
  align-items: center;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(40, 70, 50, 0.07);
}
.review-ring {
  --p: 0;
  --c: #4caf45;
  width: 7.1rem;
  height: 7.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background:
    radial-gradient(circle closest-side, var(--bg-card) 74%, transparent 75.5%),
    conic-gradient(var(--c) calc(var(--p) * 1%), rgba(28, 25, 23, 0.08) 0);
}
.review-score--mid .review-ring { --c: #c9a227; }
.review-score--bad .review-ring { --c: #c62828; }
.review-ring__in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 4.7rem;
  text-align: center;
  line-height: 1.05;
}
.review-ring strong {
  display: block;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.review-ring span {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}
.review-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr));
  gap: 0.45rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.review-facts li {
  min-width: 0;
}
.review-facts b {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.review-facts span {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
}
.review-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.review-filter {
  min-height: 2.15rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.review-filter.is-on {
  border-color: transparent;
  background: #14551c;
  color: #fff;
}
.review-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}
.review-jump__n {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none !important;
  background: var(--bg-card2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.review-jump__n.is-ok {
  background: rgba(76, 175, 69, 0.14);
  border-color: rgba(76, 175, 69, 0.28);
  color: #1b5e20;
}
.review-jump__n.is-bad {
  background: rgba(198, 40, 40, 0.1);
  border-color: rgba(198, 40, 40, 0.22);
  color: #9b1c1c;
}
.review-q { scroll-margin-top: 5.2rem; }
.review-q.is-ok { border-color: rgba(76, 175, 69, 0.32); }
.review-q.is-part { border-color: rgba(201, 162, 39, 0.4); }
.review-q.is-bad { border-color: rgba(198, 40, 40, 0.26); }
.review-q__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}
.review-q__num {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--bg-card2);
  color: var(--text-primary);
}
.review-q.is-ok .review-q__num { background: rgba(76, 175, 69, 0.16); color: #1b5e20; }
.review-q.is-bad .review-q__num { background: rgba(198, 40, 40, 0.12); color: #9b1c1c; }
.review-q.is-part .review-q__num { background: rgba(201, 162, 39, 0.18); color: #7a5b00; }
.review-q__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem 0.45rem;
  min-width: 0;
  flex: 1;
}
.review-q__kind {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.review-q__flag {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.review-q__flag.is-ok { background: rgba(76, 175, 69, 0.16); color: #1b5e20; }
.review-q__flag.is-part { background: rgba(201, 162, 39, 0.18); color: #7a5b00; }
.review-q__flag.is-bad { background: rgba(198, 40, 40, 0.12); color: #9b1c1c; }
.review-q__pts {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.review-q.is-ok .review-q__pts { color: #1b5e20; }
.review-q.is-bad .review-q__pts { color: #9b1c1c; }
.review-q__title {
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.review-opts { display: grid; gap: 0.38rem; }
.review-opt {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text-primary);
}
.review-opt i {
  margin-top: 0.08rem;
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0.55;
}
.review-opt em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 0.18rem;
}
.review-opt.is-ok {
  background: rgba(76, 175, 69, 0.12);
  border-color: rgba(76, 175, 69, 0.28);
}
.review-opt.is-ok i,
.review-opt.is-ok em { color: #1b5e20; opacity: 1; }
.review-opt.is-bad {
  background: rgba(198, 40, 40, 0.08);
  border-color: rgba(198, 40, 40, 0.22);
}
.review-opt.is-bad i,
.review-opt.is-bad em { color: #9b1c1c; opacity: 1; }
.review-opt.is-miss {
  background: rgba(76, 175, 69, 0.06);
  border-color: rgba(76, 175, 69, 0.2);
}
.review-opt.is-miss i,
.review-opt.is-miss em { color: #2e7d32; opacity: 1; }
.review-open__label {
  margin: 0 0 0.28rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.review-open__text {
  margin: 0 0 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 650;
}
.review-open__text.is-ok {
  background: rgba(76, 175, 69, 0.1);
  border-color: rgba(76, 175, 69, 0.28);
  color: #1b5e20;
}
.review-open__text.is-bad {
  background: rgba(198, 40, 40, 0.07);
  border-color: rgba(198, 40, 40, 0.2);
  color: #9b1c1c;
}
.review-q__empty,
.review-hidden,
.review-empty {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}
.review-hidden {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.review-empty { display: none; }
.review-list:not(:has(.review-q:not([hidden]))) .review-empty { display: block; }
html.theme-dark .review-filter.is-on { background: #2e7d32; }
html.theme-dark .review-ring {
  background:
    radial-gradient(circle closest-side, var(--bg-card) 74%, transparent 75.5%),
    conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0);
}
html.theme-dark .review-q.is-ok .review-q__num,
html.theme-dark .review-q__flag.is-ok,
html.theme-dark .review-jump__n.is-ok { color: #b7ecb4; }
html.theme-dark .review-q.is-bad .review-q__num,
html.theme-dark .review-q__flag.is-bad,
html.theme-dark .review-jump__n.is-bad { color: #ffb4b0; }
html.theme-dark .review-opt.is-ok i,
html.theme-dark .review-opt.is-ok em,
html.theme-dark .review-open__text.is-ok { color: #b7ecb4; }
html.theme-dark .review-opt.is-bad i,
html.theme-dark .review-opt.is-bad em,
html.theme-dark .review-open__text.is-bad { color: #ffb4b0; }
@media (max-width: 640px) {
  .review-score {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: stretch;
    align-items: center;
    text-align: left;
    gap: 0.75rem 0.85rem;
    padding: 0.85rem 0.9rem 0.95rem;
  }
  .review-ring {
    width: 5.5rem;
    height: 5.5rem;
  }
  .review-ring__in {
    width: 3.55rem;
  }
  .review-ring strong {
    font-size: 1.02rem;
  }
  .review-ring span {
    font-size: 0.55rem;
    margin-top: 0.12rem;
  }
  .review-facts {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 0.22rem 0;
    text-align: left;
  }
  .review-facts li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
  }
  .review-facts b {
    font-size: 0.88rem;
    text-align: right;
  }
  .review-facts span {
    margin-top: 0;
    order: -1;
    font-size: 0.72rem;
  }
  .review-opt {
    grid-template-columns: 1.15rem minmax(0, 1fr);
  }
  .review-opt em {
    grid-column: 2;
    margin-top: 0;
  }
}
.study .lesson-board {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
}
.study .lesson-mod {
  padding: 0.95rem 1.05rem;
}
.study .lesson-mod:hover { background: rgba(var(--accent-rgb), 0.04); }
@media (max-width: 860px) {
  .study-split,
  .hw-submit,
  .course-body.hw-submit {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-q { content-visibility: visible; }
}

/* Курс / 3D-ряды: дисциплина, тесты, занятия, экзамены */
.course-page {
  width: min(72rem, 100%);
  margin: 0 auto 1.4rem;
  overflow: visible;
}
.course-stage {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.course-hero {
  position: relative;
  overflow: visible;
  isolation: isolate;
  min-height: 0;
  padding: 1.1rem 1.15rem 1.35rem;
  border-radius: 34px;
  color: #fff;
  --g1: #4caf45;
  --g2: #2f8a36;
  --g3: #1b5e20;
  --blob: rgba(180, 232, 120, 0.28);
  background:
    radial-gradient(circle at 86% 8%, rgba(198, 240, 150, 0.55), transparent 42%),
    radial-gradient(circle at 8% 92%, rgba(46, 155, 58, 0.45), transparent 48%),
    linear-gradient(148deg, var(--g1) 0%, var(--g2) 46%, var(--g3) 100%);
  border: 0;
  box-shadow:
    0 18px 40px rgba(30, 90, 40, 0.24),
    inset 0 1px 0 rgba(255,255,255,.28);
}
.course-tint-0 { --g1:#4caf45; --g2:#2f8a36; --g3:#1b5e20; --blob:rgba(180,232,120,.28); }
.course-tint-1 { --g1:#8bc34a; --g2:#689f38; --g3:#33691e; --blob:rgba(205,220,57,.28); }
.course-tint-2 { --g1:#43a047; --g2:#2e7d32; --g3:#1b5e20; --blob:rgba(129,199,132,.3); }
.course-tint-3 { --g1:#66bb6a; --g2:#43a047; --g3:#2e7d32; --blob:rgba(165,214,167,.32); }
.course-tint-4 { --g1:#2e7d32; --g2:#1b5e20; --g3:#0d3b14; --blob:rgba(102,187,106,.26); }
.course-tint-5 { --g1:#9ccc65; --g2:#7cb342; --g3:#558b2f; --blob:rgba(220,231,117,.3); }
.course-hero::before,
.course-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.course-hero::before {
  width: 11rem;
  height: 11rem;
  right: -2.2rem;
  top: -3.4rem;
  background: rgba(255,255,255,.16);
}
.course-hero::after {
  display: none;
}
.course-hero__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  z-index: 0;
}
.course-hero__top,
.course-hero__title,
.course-hero__kicker,
.course-hero__badge,
.course-hero__lead {
  position: relative;
  z-index: 2;
}
.course-hero__iso {
  position: absolute;
  left: -1.05rem;
  top: 14%;
  z-index: 0;
  width: 4.8rem;
  height: 4.8rem;
  object-fit: contain;
  background: none;
  opacity: 0.42;
  pointer-events: none;
  transform: rotate(14deg);
  filter: drop-shadow(0 10px 16px rgba(20, 50, 30, 0.18));
}
.course-hero__mark {
  position: absolute;
  right: -0.15rem;
  bottom: -1.35rem;
  z-index: 1;
  width: 7.4rem;
  height: 7.4rem;
  object-fit: contain;
  background: none;
  pointer-events: none;
  transform: rotate(-8deg);
  filter: drop-shadow(0 14px 22px rgba(20, 50, 30, 0.3));
}
.course-hero__mark--prop {
  width: 8.2rem;
  height: 8.2rem;
  right: 0.05rem;
  bottom: -1.05rem;
  transform: rotate(-3deg);
}
.course-hero--list .course-hero__mark {
  width: 6.6rem;
  height: 6.6rem;
  bottom: -1.15rem;
}
.course-hero--profile {
  overflow: hidden !important;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 1.15rem 1.15rem 1.85rem;
}
.course-hero--profile::before {
  width: 9.2rem;
  height: 9.2rem;
  right: -3.4rem;
  top: -3.6rem;
}
.course-hero--profile::after {
  display: block;
  width: 11.5rem;
  height: 11.5rem;
  left: -4.6rem;
  bottom: -5.1rem;
  top: auto;
  right: auto;
  background: rgba(255, 255, 255, 0.16);
}
.course-hero--profile .course-hero__title {
  padding-right: 0;
  margin-left: auto;
  margin-right: auto;
  max-width: none;
}
.course-hero--profile .course-hero__kicker {
  padding-right: 0;
  margin: 0 0 0.12rem;
}
.course-hero--profile .course-hero__bio {
  position: relative;
  z-index: 2;
  margin: 0.28rem 0 0;
  max-width: 100%;
  padding: 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}
.course-hero--profile .course-hero__bio--sub {
  margin-top: 0.18rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  word-break: break-word;
}
.course-hero--profile .course-hero__mark,
.course-hero--profile .course-hero__iso,
.course-hero--profile .course-hero__top {
  display: none !important;
}
.course-hero__top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.2rem;
  position: relative;
  z-index: 3;
}
.course-hero__head {
  flex: 1 1 auto;
  min-width: 0;
}
.course-hero__head .course-hero__kicker { margin-bottom: 0.12rem; }
.course-hero__head .course-hero__title { max-width: none; }
.course-hero__back,
.course-hero__chip {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.18);
  color: #fff;
  text-decoration: none !important;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  font-size: 1.05rem;
  flex: 0 0 auto;
}
.course-hero__top > .course-hero__chip,
.course-hero__top > a.course-hero__chip {
  margin-left: auto;
}
.course-hero__back:hover { color: #fff; background: rgba(255,255,255,.28); }
.course-hero__tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.course-hero__tool {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.18);
  color: #fff;
  text-decoration: none !important;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  font-size: 1.05rem;
}
.course-hero__tool:hover { color: #fff; background: rgba(255,255,255,.28); }
.course-hero__top > .course-hero__tools .course-hero__chip {
  margin-left: 0;
}
.course-group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  margin: 0 0 1rem;
  width: 100%;
}
.course-group-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  flex: 1 1 18rem;
  max-width: 40rem;
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--text-muted);
}
.course-group-bar .custom-select-wrap--group,
.course-group-bar .custom-select-wrap--la,
.course-group-bar .la-select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 40rem;
}
.course-group-bar__hint { font-size: 0.8rem; color: var(--text-muted); padding-bottom: 0.35rem; }
.course-h-row__acts {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.course-h-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.course-h-row .course-h { margin: 0; }
.d3-row.is-block {
  gap: 0.45rem;
}
.d3-row__hit {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none !important;
}
.d3-row__acts {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.d3-row__acts form { margin: 0; }
.course-hero__chip {
  width: auto;
  height: 1.85rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #f4f0b8;
  color: #3d3a12;
  box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.course-hero__kicker {
  margin: 0 0 0.28rem;
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0.86;
  color: #fff;
}
.course-hero__lead {
  margin: 0.55rem 0 0;
  max-width: 34rem;
  padding-right: 6.6rem;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.9);
}
.course-hero:has(.course-hero__lead) {
  padding-bottom: 1.7rem;
}
.course-hero__title {
  margin: 0;
  max-width: 18ch;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 4.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: #fff;
}
.course-hero--compact {
  min-height: 0;
  padding: 1rem 1.1rem 1.15rem;
}
.course-hero--compact .course-hero__title { max-width: none; font-size: clamp(1.28rem, 3vw, 1.7rem); }
.course-hero--compact .course-hero__top { margin-bottom: 0.85rem; }
.course-hero--list {
  min-height: 0;
  padding: 1.15rem 1.2rem 1.55rem;
}
.course-hero--list .course-hero__title {
  max-width: none;
  font-size: clamp(1.78rem, 6.4vw, 2.28rem);
  line-height: 1.12;
}
.course-hero--list .course-hero__kicker {
  font-size: 0.9rem;
}
.course-hero--list .course-hero__top {
  margin-bottom: 0.15rem;
  justify-content: flex-start;
}
a.course-pill {
  text-decoration: none !important;
  color: #fff !important;
}
.course-pills {
  display: none;
}
.course-pills::-webkit-scrollbar { display: none; }
.course-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 2.65rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(20, 50, 30, 0.18);
}
.course-pill i { font-size: 1rem; color: #fff !important; }
.course-pill--lime {
  background: linear-gradient(145deg, #d4e85a, #b4c62e);
}
.course-pill--mint {
  background: linear-gradient(145deg, #6dcc63, #3d9a45);
}
.course-pill--cream {
  background: linear-gradient(145deg, #efc44a, #d4a017);
}
.course-pill--teal {
  background: linear-gradient(145deg, #5ec4b8, #2f8f86);
}
.course-pill--on-hero {
  background: rgba(255,255,255,.22);
  color: #fff !important;
}
.course-lead {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 550;
  line-height: 1.55;
}
.course-h {
  margin: 0.2rem 0 0.15rem;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.course-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.2rem;
  border-radius: 999px;
  background: #fff;
  color: #14551c;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: 0 12px 28px rgba(40, 70, 50, 0.16);
}
.course-cta:hover { color: #0d3d14; transform: translateY(-1px); }
.d3-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.d3-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.65rem;
  padding: 0.7rem 0.72rem 0.7rem 0.82rem;
  border-radius: 28px;
  color: inherit;
  text-decoration: none !important;
  background: linear-gradient(165deg, #f8fcf7 0%, #eef6ec 48%, #e3f0e1 100%);
  border: 0;
  box-shadow: none;
  transition: transform .18s ease, background .18s ease;
}
@media (hover: hover) and (pointer: fine) {
  .d3-row:hover {
    transform: translateY(-3px);
    color: inherit;
    text-decoration: none !important;
    box-shadow: none;
  }
}
.d3-row.is-block { cursor: default; }
.d3-row__ico {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fff, #e7f5e5);
  color: #2e9b3a;
  font-size: 1.18rem;
  box-shadow: 0 5px 12px rgba(46, 125, 50, 0.12), inset 0 1px 0 #fff;
}
.d3-row__ico i { line-height: 1; }
.d3-row__body { flex: 1 1 auto; min-width: 0; }
.d3-row__title {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.d3-row__meta {
  display: block;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.d3-row__go {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff, #eef5ee);
  color: #2e7d32;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(40, 70, 50, 0.12), inset 0 1px 0 #fff;
}
.d3-row--exam .d3-row__ico { color: #b45309; background: linear-gradient(160deg, #fff, #f8edd8); }
.d3-row--test .d3-row__ico { color: #1b7a28; }
.d3-row--hw .d3-row__ico { color: #0e7490; background: linear-gradient(160deg, #fff, #e4f3f4); }

.qbento {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.qbento--student {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas:
    "rating tests"
    "rating pvp"
    "courses courses"
    "subj subj"
    "cal hw"
    "exams hist";
}
.qbento--teacher {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas:
    "rating subj"
    "rating testbank"
    "exam tests"
    "groups analytics";
}
.qbento--student .qbento__rating,
.qbento--teacher .qbento__rating { grid-area: rating; }
.qbento--student .qbento__tests,
.qbento--teacher .qbento__tests { grid-area: tests; }
.qbento--student .qbento__lectures { grid-area: lectures; }
.qbento--student .qbento__pvp { grid-area: pvp; }
.qbento--student .qbento__subj,
.qbento--teacher .qbento__subj { grid-area: subj; }
.qbento--student .qbento__cal { grid-area: cal; }
.qbento--student .qbento__hw { grid-area: hw; }
.qbento--student .qbento__exams { grid-area: exams; }
.qbento--student .qbento__hist { grid-area: hist; }
.qbento--teacher .qbento__testbank { grid-area: testbank; }
.qbento--teacher .qbento__exam { grid-area: exam; }
.qbento--teacher .qbento__analytics { grid-area: analytics; }
.qbento--teacher .qbento__groups { grid-area: groups; }
.qbento--student .qbento__courses { grid-area: courses; }
.qbento__rating .qbento__ico,
.qbento__courses .qbento__ico {
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}
.qbento__hero { min-height: 13.4rem; }
.qbento__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  padding: 0.95rem 1rem 1.15rem;
  border-radius: 22px;
  background: #fff;
  color: inherit;
  text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(40, 70, 50, 0.08);
  transition: transform .18s ease, box-shadow .18s ease;
}
.qbento__wide {
  justify-content: flex-start;
  min-height: 7.4rem;
}
.qbento__copy {
  position: relative;
  z-index: 2;
  max-width: calc(100% - 5.6rem);
}
.qbento__copy strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}
.qbento__copy em {
  display: block;
  margin-top: 0.22rem;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-muted);
}
.qbento__ico {
  position: absolute;
  z-index: 1;
  width: 6.4rem;
  height: 6.4rem;
  object-fit: contain;
  border-radius: 0;
  background: none;
  right: 0.35rem;
  bottom: 0.3rem;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(20, 40, 30, 0.16));
}
.qbento__hero .qbento__ico {
  width: 8.8rem;
  height: 8.8rem;
  right: 0.4rem;
  bottom: 0.35rem;
}
.qbento__wide .qbento__ico {
  width: 5.8rem;
  height: 5.8rem;
  right: 0.3rem;
  bottom: 0.28rem;
}
.qbento__tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: inherit;
  text-decoration: none !important;
}
.qbento__face {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.12 / 1;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(40, 70, 50, 0.08);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.qbento__face img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  pointer-events: none;
}
.qbento__tile strong {
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text-primary);
}
@media (hover: hover) and (pointer: fine) {
  .qbento__card:hover,
  .qbento__tile:hover .qbento__face {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(40, 70, 50, 0.12);
  }
  .qbento__card:hover,
  .qbento__tile:hover {
    color: inherit;
    text-decoration: none !important;
  }
}
html.theme-dark .qbento__card,
html.theme-dark .qbento__face {
  background: #1e2620;
  box-shadow: none;
}

.course-form { margin: 0.15rem 0 0; }
.course-form .choice-opt { margin: 0.28rem 0; }
.course-group {
  margin: 0.55rem 0 0.15rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.course-body {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 0 0.15rem 0.4rem;
}
@media (min-width: 720px) {
  .d3-list--split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
}
@media (min-width: 992px) {
  .course-hero { min-height: 0; padding: 1.25rem 1.3rem 1.5rem; }
  .course-hero__title { max-width: 14ch; }
  .course-cta--dock {
    position: static;
    max-width: 22rem;
    margin: 1.1rem auto 0;
  }
  .d3-list--dash { grid-template-columns: 1fr 1fr; display: grid; }
  .course-pills { margin-top: 0; flex-wrap: wrap; }
  .course-hero--list { min-height: 0; padding: 1.25rem 1.4rem 1.55rem; }
  .course-hero--list .course-hero__title {
    max-width: none;
    font-size: clamp(2.28rem, 3.6vw, 3.05rem);
    line-height: 1.08;
  }
  .course-hero--list .course-hero__kicker { font-size: 1rem; }
  html:not(.chat-lock) #pageMain.course-open {
    overflow-x: clip !important;
    overflow-y: visible !important;
  }
  .course-body.hw-submit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    gap: 1.15rem;
    align-items: start;
    padding: 0.25rem 0.1rem 1.15rem;
  }
  .hw-submit__bar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 0.35rem;
    padding: 0;
    background: none;
  }
  .course-hero__mark { width: 8.6rem; height: 8.6rem; right: 0.35rem; bottom: -1.7rem; }
  .course-hero--list .course-hero__mark { width: 7.6rem; height: 7.6rem; }
  .course-hero__iso { width: 5.6rem; height: 5.6rem; }
  .dash-layout.dash-layout--flow {
    display: grid;
    grid-template-columns: 24rem minmax(0, 1fr);
    gap: 1.15rem;
    align-items: start;
  }
  .dash-side {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    width: 100%;
    min-width: 0;
  }
  .dash-side .prof-card.prof-flow,
  .dash-side .course-hero--profile {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  .dash-side .honor-bar {
    margin: 0.95rem 0 0.15rem;
  }
  .dash-main .dash-quick {
    padding: 0.1rem 0 0;
  }
  .dash-side .sd-section-title {
    margin: 0 0 0.55rem;
    font-size: 0.8rem;
  }
  .dash-side .d3-list { gap: 0.5rem; }
  .dash-side .d3-row {
    min-height: 3.85rem;
    padding: 0.58rem 0.7rem 0.58rem 0.72rem;
    border-radius: 18px;
  }
  .dash-side .d3-row__ico {
    width: 2.45rem;
    height: 2.45rem;
    font-size: 1.12rem;
  }
  .dash-side .d3-row__title { font-size: 0.94rem; }
  .dash-side .d3-row__meta { font-size: 0.74rem; }
  .dash-side .d3-row__go { font-size: 0.95rem; }
  .dash-main .qbento { gap: 0.75rem; }
  .dash-main .qbento--student {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
      "rating rating tests tests pvp pvp"
      "rating rating subj subj subj subj"
      "courses courses courses courses courses courses"
      "cal cal hw hw exams exams"
      "hist hist hist hist hist hist";
  }
  .dash-main .qbento--teacher {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-areas:
      "rating rating subj subj subj subj"
      "rating rating testbank testbank exam exam"
      "tests tests groups groups analytics analytics";
  }
  .dash-main .qbento__hero { min-height: 14.6rem; }
  .dash-main .qbento__wide { min-height: 7.8rem; }
  .dash-main .qbento__copy { max-width: calc(100% - 6.2rem); }
  .dash-main .qbento__copy strong { font-size: 1.32rem; }
  .dash-main .qbento__copy em { font-size: 0.92rem; }
  .dash-main .qbento__hero .qbento__ico { width: 9.4rem; height: 9.4rem; }
  .dash-main .qbento__wide .qbento__ico { width: 6.4rem; height: 6.4rem; }
  .course-hero--profile {
    min-height: 0;
    width: 100%;
    padding: 1.45rem 1.35rem 1.7rem;
    border-radius: 32px;
  }
}
@media (min-width: 1200px) {
  .dash-layout.dash-layout--flow {
    grid-template-columns: 34rem minmax(0, 1fr);
  }
}
@media (max-width: 991.98px) {
  #pageMain.course-open {
    padding: 0 0 calc(160px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: clip;
    overflow-y: auto;
    max-width: none;
    width: 100%;
  }
  .course-page {
    width: 100%;
    margin: 0 0 1.2rem;
  }
  .course-hero--flow {
    min-height: 0;
    margin: 0;
    padding: 1.05rem 1.2rem 1.55rem;
    border: 0;
    border-radius: 0 0 2.4rem 2.4rem;
    box-shadow: 0 16px 32px rgba(30, 90, 40, 0.2);
  }
  .course-hero--flow.course-hero--list {
    min-height: 0;
    padding: 1.15rem 1.2rem 1.55rem;
  }
  .course-hero--profile.course-hero--flow {
    width: 100%;
    min-height: 13.2rem;
    margin: 0;
    padding: 1.35rem 1.45rem 1.85rem;
    border: 0;
    border-radius: 0 0 3.6rem 3.6rem;
    overflow: hidden;
    box-shadow: 0 16px 32px rgba(30, 90, 40, 0.2);
  }
  .course-hero--profile .course-hero__title {
    max-width: none;
    padding-right: 0;
    padding-left: 0;
    text-align: center;
  }
  .dash-layout--flow {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
  }
  .dash-side { display: contents; }
  .dash-quick {
    order: 2;
    padding: 0.35rem 1.1rem 0.15rem;
  }
  .dash-layout--flow .dash-main {
    order: 3;
    padding: 0 1.1rem 0.85rem;
    width: 100%;
    min-width: 0;
    gap: 0.85rem;
  }
  .dash-layout--flow .dash-panel:not(.dash-quick) {
    padding: 0.15rem 0 0;
  }
  .dash-layout--flow .dash-quick {
    padding: 0.35rem 1.1rem 1.35rem;
  }
  .dash-quick .qbento { gap: 0.7rem; }
  .dash-quick .qbento--student {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "rating tests"
      "rating pvp"
      "subj subj"
      "cal hw"
      "courses courses"
      "exams hist";
  }
  .dash-quick .qbento--teacher {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "rating testbank"
      "rating exam"
      "subj subj"
      "tests groups"
      "analytics analytics";
  }
  .dash-quick .qbento__hero { min-height: 11.2rem; }
  .dash-quick .qbento__wide { min-height: 6.6rem; }
  .dash-quick .qbento__hero .qbento__ico {
    width: 5.8rem;
    height: 5.8rem;
    right: 0.2rem;
    bottom: 0.18rem;
  }
  .dash-quick .qbento__wide .qbento__ico {
    width: 3.7rem;
    height: 3.7rem;
    right: 0.16rem;
    bottom: 0.14rem;
  }
  .dash-quick .qbento__copy { max-width: calc(100% - 3.6rem); }
  .dash-quick .qbento__copy strong {
    font-size: 1.05rem;
    overflow-wrap: break-word;
  }
  .dash-quick .qbento__copy em {
    font-size: 0.78rem;
    line-height: 1.28;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .dash-layout--flow .sd-section-title { margin-bottom: 0.45rem; }
  .dash-profile-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
  }
  .dash-profile-grid .pcard,
  .dash-profile-grid .entity-card {
    aspect-ratio: 4 / 3;
    border-radius: 18px !important;
  }
  .dash-profile-grid .pcard-title,
  .dash-profile-grid--student .pcard-title {
    font-size: 0.95rem !important;
    line-height: 1.18 !important;
  }
  .dash-profile-grid .pcard-action,
  .dash-profile-grid--student .pcard-action {
    min-height: 30px;
    height: 30px;
    padding: 0 0.65rem !important;
    font-size: 0.72rem !important;
  }
  .dash-profile-grid .pcard-footer {
    padding: 0.08rem 0.5rem 0.5rem !important;
  }
  .dash-profile-grid .pcard-info {
    width: 28px;
    height: 28px;
    top: 0.55rem;
    right: 0.55rem;
    font-size: 0.78rem;
  }
  .dash-bottom-grid {
    grid-template-columns: 1fr;
  }
  .prof-flow .prof-card__bio,
  .prof-flow .prof-card__hint,
  .prof-flow .prof-card__bento,
  .prof-flow .honor-bar,
  .prof-flow .prof-card__rating,
  .prof-flow .prof-card__rating-btn,
  .prof-flow .prof-card__actions {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }
  .prof-flow .prof-card__bio,
  .prof-flow .prof-card__hint {
    text-align: center;
  }
  .course-body {
    padding: 0 1.1rem 6.4rem;
  }
  .course-hero--list .course-hero__top {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .course-hero--list .course-hero__head {
    flex: 1 1 100%;
    order: 3;
    padding-right: 5.4rem;
    min-width: 0;
  }
  .course-hero--list .course-hero__title {
    font-size: clamp(1.72rem, 7.2vw, 2.1rem);
  }
  .course-hero--flow:has(.course-hero__lead) {
    min-height: 0;
    padding-bottom: 2.35rem;
  }
  .course-hero__lead {
    max-width: none;
    padding-right: 5.6rem;
    font-size: 0.88rem;
  }
  .hw-submit,
  .course-body.hw-submit {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
  }
  .hw-card,
  .hw-answer-form,
  .hw-field,
  .hw-file,
  .hw-file__wrap,
  .hw-file__box,
  .hw-card__text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .hw-card { padding: 0.95rem 0.95rem 1.05rem; border-radius: 18px; }
  .hw-answer-form textarea.form-control,
  .hw-answer-form .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .hw-answer-form textarea.form-control { min-height: 7.2rem; }
  .hw-submit__bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    position: static;
    margin-top: 0.35rem;
    padding: 0;
    background: none;
  }
  .hw-submit__bar .btn-prim,
  .hw-submit__bar .btn-sec {
    min-width: 0;
    width: 100%;
  }
  .course-cta--dock {
    position: fixed;
    left: 1.1rem;
    right: 1.1rem;
    bottom: calc(5.15rem + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    width: auto;
    margin: 0;
  }
}
html.theme-dark .course-hero {
  box-shadow: 0 18px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
}
html.theme-dark .course-lead,
html.theme-dark .course-h,
html.theme-dark .d3-row__title { color: var(--text-primary); }
html.theme-dark .course-cta {
  background: #e8f6e6;
  color: #102410;
}
html.theme-dark .d3-row {
  background: linear-gradient(165deg, #232c24 0%, #1a221c 52%, #141a15 100%);
  border: 0;
  box-shadow: none;
}
html.theme-dark .d3-row__ico,
html.theme-dark .d3-row__go {
  background: linear-gradient(160deg, #2c382e, #1e2620);
  color: #8be08a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
html.theme-dark .d3-row--exam .d3-row__ico { color: #f0c674; }
html.theme-dark .d3-row--hw .d3-row__ico { color: #7dd3e0; }

.d3-row__go--score {
  width: auto;
  min-width: 2.7rem;
  height: 2.05rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.d3-row__go--score.is-ok { color: #1b7a28; }
.d3-row__go--score.is-mid { color: #b45309; }
.d3-row__go--score.is-bad { color: #b91c1c; }

.dash-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.dash-panel {
  padding: 1rem 0.15rem 0.2rem;
}
.dash-panel:not(:has(.sd-section-title)) {
  padding-top: 0.15rem;
}
.dash-empty { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* Профиль: мягкая 3D-карточка */
.prof-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0 1.15rem;
  border-radius: 32px;
  background: #fff;
  border: 1px solid rgba(28, 25, 23, 0.04);
  box-shadow: 0 16px 36px rgba(40, 70, 50, 0.1);
  max-width: 100%;
  box-sizing: border-box;
}
.prof-card__name,
.prof-card__bio,
.prof-card__hint,
.prof-card__bento,
.prof-card .honor-bar,
.prof-card .prof-achs,
.prof-card__rating,
.prof-card__actions {
  width: 100%;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  box-sizing: border-box;
}
.prof-card__banner {
  width: 100%;
  height: 7.2rem;
  margin: 0;
  background:
    radial-gradient(circle at 18% 120%, rgba(255,255,255,.55), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(198, 240, 150, 0.7), transparent 46%),
    linear-gradient(180deg, #8ed37a 0%, #5cbc55 52%, #3ea046 100%);
  clip-path: ellipse(92% 100% at 50% 0%);
}
.prof-card__plus {
  position: absolute;
  top: 0.85rem;
  right: 0.9rem;
  z-index: 2;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #1c1917;
  box-shadow: 0 8px 18px rgba(20, 40, 30, 0.16);
  text-decoration: none !important;
  font-size: 1.05rem;
}
.prof-card__plus:hover { color: #1c1917; }
.prof-card__avatar {
  position: relative;
  z-index: 1;
  margin-top: -3.35rem;
  margin-bottom: 0.55rem;
}
.prof-card__ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(#7ed275, #f4e07a, #7ec8f0, #c9a0f0, #7ed275);
  z-index: 0;
}
.prof-card__ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}
.prof-card .sd-avatar-wrap {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  margin-bottom: 0;
}
.prof-card .sd-avatar-img,
.prof-card .sd-avatar-fallback {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
}
.prof-card__name {
  margin: 0;
  max-width: 100%;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.prof-card__bio {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}
.prof-card__hint {
  margin: 0.12rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.prof-card__bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin: 0.65rem 0 0.45rem;
  padding: 0.7rem 0.35rem;
  border-radius: 22px;
  background: #f6f8f6;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.9), 0 8px 18px rgba(40,70,50,.06);
}
.prof-card__bento > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-right: 1px solid rgba(28, 25, 23, 0.08);
}
.prof-card__bento > div:last-child { border-right: 0; }
.prof-card__bento strong {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.prof-card__bento span {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
}
.prof-card .honor-bar { width: 100%; margin: 0.1rem 0 0.2rem; }
.prof-card--student > .honor-bar {
  margin: 1.05rem 0 0.45rem;
}
.prof-card__rating,
.prof-card__rating-btn {
  margin: 0.05rem 0 0.15rem;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none !important;
}
.prof-card__rating-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0.85rem 0 0.1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #5cbf52 0%, #3fa83a 100%);
  color: #fff !important;
  font-size: 1rem;
  box-shadow: 0 10px 22px rgba(63, 168, 58, 0.28);
}
.prof-card__actions {
  display: flex;
  justify-content: center;
  gap: 1.15rem;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(28, 25, 23, 0.06);
}
.prof-card__act-form { margin: 0; }
.prof-card__act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
}
.prof-card__act:hover { color: var(--text-primary); }
.prof-card__ico {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff, #eef4ee);
  color: #2e7d32;
  font-size: 1.05rem;
  box-shadow: 0 8px 16px rgba(40, 70, 50, 0.1), inset 0 1px 0 #fff;
}
html.theme-dark .prof-card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}
html.theme-dark .prof-card__bento {
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
html.theme-dark .prof-card__bento > div { border-color: rgba(255,255,255,.08); }
html.theme-dark .prof-card__ico {
  background: linear-gradient(160deg, #2c382e, #1e2620);
  color: #8be08a;
}
html.theme-dark .prof-card__ring::after { background: var(--bg-card); }
html.theme-dark .prof-card__plus { background: #1e2620; color: #eef3eb; }

.prof-card.prof-flow {
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding-bottom: 0.35rem;
}
.prof-flow__avatar {
  position: relative;
  z-index: 2;
  width: 6rem;
  height: 6rem;
  margin: 0.1rem auto 0.55rem;
  border-radius: 50%;
  overflow: visible;
  background: transparent;
  flex: 0 0 auto;
}
.prof-flow__avatar .prof-card__ring {
  display: none;
}
.prof-flow__avatar .sd-status {
  display: none !important;
}
.sd-status { display: none !important; }
.prof-flow__avatar .sd-avatar-wrap,
.prof-flow__avatar .sd-avatar-img,
.prof-flow__avatar .sd-avatar-fallback {
  width: 6rem;
  height: 6rem;
  margin: 0;
  border-radius: 50%;
  border: 0 !important;
  box-shadow: none;
}
.prof-flow__avatar .sd-avatar-wrap {
  box-shadow: 0 10px 22px rgba(30, 70, 40, 0.22);
}
.prof-card__menu {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 5;
}
.course-hero--profile .pcard-menu__btn {
  width: 40px;
  height: 40px;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.9);
  color: #14551c;
  box-shadow: 0 8px 18px rgba(20, 40, 24, 0.18);
}
.prof-flow .prof-card__bio,
.prof-flow .prof-card__hint,
.prof-flow .prof-card__bento,
.prof-flow .honor-bar,
.prof-flow .prof-achs,
.prof-flow .prof-card__rating,
.prof-flow .prof-card__rating-btn,
.prof-flow .prof-card__actions {
  position: relative;
  z-index: 1;
}

@media (max-width: 991.98px) {
  body.e-learn-profile .navbar,
  body.e-learn-profile #appNavbar {
    display: none !important;
  }
  body.e-learn-profile.app-shell:not(.chat-page) {
    padding-top: 0 !important;
  }
  body.e-learn-profile #pageMain.course-open {
    padding-top: 0 !important;
  }
  body.e-learn-profile .dash-layout,
  body.e-learn-profile .dash-layout--flow {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.e-learn-profile .dash-main,
  body.e-learn-profile .dash-quick,
  body.e-learn-profile .qbento,
  body.e-learn-profile .prof-card.prof-flow {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.e-learn-profile .course-hero--profile.course-hero--flow {
    padding-top: calc(1.15rem + env(safe-area-inset-top, 0px));
  }
  body.e-learn-profile .prof-card__menu {
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
  }
  body.app-shell > .navbar,
  .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
  }
  body.app-shell:not(.chat-page) {
    padding-top: calc(3.6rem + env(safe-area-inset-top, 0px));
  }
  #pageMain {
    overflow-x: hidden;
  }
}
@media (max-width: 479.98px) {
  .dash-quick .qbento--student {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.55rem;
    grid-template-areas:
      "rating rating"
      "subj subj"
      "tests pvp"
      "cal hw"
      "courses courses"
      "exams hist";
  }
  .dash-quick .qbento--teacher {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.55rem;
    grid-template-areas:
      "rating rating"
      "subj subj"
      "testbank exam"
      "tests groups"
      "analytics analytics";
  }
  .dash-quick .qbento__hero { min-height: 9.4rem; }
  .dash-quick .qbento__wide { min-height: 6.1rem; }
  .dash-quick .qbento__copy { max-width: calc(100% - 3.1rem); }
  .dash-quick .qbento__copy strong { font-size: 0.98rem; }
  .dash-quick .qbento__copy em {
    font-size: 0.74rem;
    line-height: 1.28;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .dash-quick .qbento__hero .qbento__ico {
    width: 4.6rem;
    height: 4.6rem;
    right: 0.1rem;
    bottom: 0.1rem;
  }
  .dash-quick .qbento__wide .qbento__ico {
    width: 3.05rem;
    height: 3.05rem;
    right: 0.08rem;
    bottom: 0.08rem;
  }
  body.e-learn-profile .course-hero--profile .course-hero__title {
    font-size: clamp(1.42rem, 8vw, 1.95rem);
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
  body.e-learn-profile .dash-layout--flow .dash-main,
  body.e-learn-profile .dash-layout--flow .dash-quick {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

.rating-page--personal { max-width: 880px; }

.rating-hero-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem 1.25rem 1.15rem;
  margin: 0 0 0.9rem;
  border-radius: 24px;
  border: 1px solid rgba(76, 175, 69, 0.22);
  background:
    radial-gradient(90% 80% at 100% -10%, rgba(255,255,255,.62), transparent 48%),
    linear-gradient(165deg, #f4fbef 0%, #e8f4e2 52%, #d7ebcf 100%);
  box-shadow: 0 16px 32px rgba(40, 70, 50, 0.1), inset 0 1px 0 #fff;
}
.rating-hero-card.is-good {
  background:
    radial-gradient(90% 80% at 100% -10%, rgba(255,255,255,.55), transparent 48%),
    linear-gradient(165deg, #eaf8e4 0%, #d4efc8 55%, #bfe6b0 100%);
  border-color: rgba(46, 125, 50, 0.28);
}
.rating-hero-card.is-bad {
  background:
    radial-gradient(90% 80% at 100% -10%, rgba(255,255,255,.5), transparent 48%),
    linear-gradient(165deg, #fff6f4 0%, #fde4e1 55%, #f8cfc9 100%);
  border-color: rgba(198, 40, 40, 0.22);
}
.rating-hero-card.is-mid {
  background:
    radial-gradient(90% 80% at 100% -10%, rgba(255,255,255,.58), transparent 48%),
    linear-gradient(165deg, #fffcec 0%, #f6f0c9 55%, #ece3a4 100%);
  border-color: rgba(192, 164, 24, 0.28);
}
.rating-hero-card::before,
.rating-hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.rating-hero-card::before {
  width: 11rem;
  height: 11rem;
  right: -2.4rem;
  top: -3.4rem;
  background: rgba(76, 175, 69, 0.16);
}
.rating-hero-card.is-bad::before { background: rgba(239, 83, 80, 0.16); }
.rating-hero-card.is-mid::before { background: rgba(251, 192, 45, 0.22); }
.rating-hero-card::after {
  width: 5.5rem;
  height: 5.5rem;
  right: 4.2rem;
  bottom: -2.2rem;
  background: rgba(255, 255, 255, 0.35);
}
.rating-hero-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.rating-hero-card__kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rating-hero-card__badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #2e7d32;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.12);
}
.rating-hero-card.is-bad .rating-hero-card__badge { color: #c62828; box-shadow: inset 0 0 0 1px rgba(198, 40, 40, 0.14); }
.rating-hero-card.is-mid .rating-hero-card__badge { color: #8d6e00; box-shadow: inset 0 0 0 1px rgba(192, 164, 24, 0.2); }
.rating-hero-card__score {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.rating-hero-card__score strong {
  font-size: 3.05rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--text-primary);
}
.rating-hero-card__score span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
}
.rating-hero-card__bar { position: relative; z-index: 1; margin-top: 0.7rem; }
.rating-hero-card .honor-bar { margin: 0; }
.rating-hero-card .honor-bar__head { display: none; }
.rating-hero-card__hint {
  position: relative;
  z-index: 1;
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text-muted);
}

.rating-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}
.rating-stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 11.2rem;
  padding: 1.05rem 1.05rem 0.95rem;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 110% -20%, rgba(255,255,255,.7), transparent 42%),
    linear-gradient(165deg, #f8fcf7 0%, #eef6ec 48%, #e3f0e1 100%);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 12px 24px rgba(40, 70, 50, 0.1), inset 0 1px 0 rgba(255,255,255,.9);
}
.rating-stat::after {
  content: "";
  position: absolute;
  width: 6.4rem;
  height: 6.4rem;
  right: -1.6rem;
  bottom: -2.1rem;
  border-radius: 50%;
  background: rgba(76, 175, 69, 0.1);
  pointer-events: none;
}
.rating-stat__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.rating-stat__face {
  position: absolute;
  z-index: 1;
  width: 4.35rem;
  height: 4.35rem;
  object-fit: cover;
  border-radius: 50%;
  right: -0.4rem;
  bottom: -0.55rem;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(20, 40, 30, 0.16));
}
.rating-stat--banner .rating-stat__face {
  width: 3.6rem;
  height: 3.6rem;
  right: -0.25rem;
  bottom: -0.4rem;
}
.rating-stat__ico {
  display: none;
}
.rating-stat__name {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rating-stat__num {
  position: relative;
  z-index: 1;
  margin: 0.55rem 0 0.1rem;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
}
.rating-stat__num small {
  font-size: 1.05rem;
  font-weight: 800;
  margin-left: 0.08rem;
  color: var(--text-muted);
}
.rating-stat__hint {
  position: relative;
  z-index: 1;
  margin: 0 0 auto;
  min-height: 2.5em;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text-muted);
}
.rating-stat__track {
  position: relative;
  z-index: 1;
  height: 7px;
  margin-top: 0.7rem;
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.12);
  overflow: hidden;
}
.rating-stat__track i {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #81c784, #2e7d32);
}
.rating-stat__chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.rating-stat__chips span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.1);
}
.rating-stat__chips b {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}
.rating-stat--wide,
.rating-stat--banner {
  grid-column: 1 / -1;
  min-height: 0;
}
.rating-stat--banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "head hint num"
    "track track track";
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.55rem;
  padding: 0.95rem 1.1rem;
}
.rating-stat--banner .rating-stat__head { grid-area: head; }
.rating-stat--banner .rating-stat__hint {
  grid-area: hint;
  min-height: 0;
  margin: 0;
}
.rating-stat--banner .rating-stat__num {
  grid-area: num;
  margin: 0;
  font-size: 1.85rem;
}
.rating-stat--banner .rating-stat__track { grid-area: track; margin-top: 0; }
.rating-stat.is-ok {
  background:
    radial-gradient(120% 80% at 110% -20%, rgba(255,255,255,.65), transparent 42%),
    linear-gradient(165deg, #eef8ea, #d9efd0);
}
.rating-stat.is-warn {
  background:
    radial-gradient(120% 80% at 110% -20%, rgba(255,255,255,.6), transparent 42%),
    linear-gradient(165deg, #fff6f4, #fde4e1);
  border-color: rgba(255, 205, 210, 0.8);
}
.rating-stat.is-warn::after { background: rgba(239, 83, 80, 0.12); }
.rating-stat.is-warn .rating-stat__ico {
  background: linear-gradient(160deg, #fff, #fdecea);
  color: #c62828;
  box-shadow: 0 8px 16px rgba(198, 40, 40, 0.12), inset 0 1px 0 #fff;
}
.rating-stat.is-warn .rating-stat__track { background: rgba(198, 40, 40, 0.12); }
.rating-stat.is-warn .rating-stat__track i {
  background: linear-gradient(90deg, #ef9a9a, #c62828);
}
.rating-stat.is-ok .rating-stat__track i {
  background: linear-gradient(90deg, #a5d6a7, #2e7d32);
}

.rating-page--personal .rating-part {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  border-radius: 20px;
  padding: 1rem 1.05rem;
  background: linear-gradient(165deg, #f8fcf7, #e8f3e6);
  box-shadow: 0 10px 22px rgba(40, 70, 50, 0.08), inset 0 1px 0 #fff;
}
.rating-part__face,
.rating-penalty__face {
  position: absolute;
  z-index: 1;
  width: 3.15rem;
  height: 3.15rem;
  object-fit: cover;
  border-radius: 50%;
  right: -0.3rem;
  bottom: -0.4rem;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(20, 40, 30, 0.14));
}
.rating-part__meta { position: relative; z-index: 2; min-width: 0; padding-right: 2.2rem; }
.rating-part__note {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-muted);
}
.rating-page--personal .rating-part__icon {
  display: none;
}
.rating-page--personal .rating-ach {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  padding: 1.05rem 1.1rem;
  border-radius: 20px;
  border-left: 0;
  background: linear-gradient(165deg, #f8fcf7, #eef6ec);
  box-shadow: 0 10px 22px rgba(40, 70, 50, 0.08), inset 0 1px 0 #fff;
}
.rating-page--personal .rating-ach__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  font-size: 1.35rem;
}
.rating-page--personal .rating-ach__body p { margin-bottom: 0.15rem; }
.rating-page--personal .rating-ach__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.rating-page--personal .rating-ach__meta em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  background: rgba(76, 175, 69, 0.14);
  color: #2e7d32;
}

html.theme-dark .rating-hero-card,
html.theme-dark .rating-stat,
html.theme-dark .rating-page--personal .rating-part,
html.theme-dark .rating-page--personal .rating-ach {
  background: linear-gradient(165deg, #232c24, #141a15);
  border-color: rgba(255,255,255,.08);
  box-shadow: none;
}
html.theme-dark .rating-hero-card.is-good { background: linear-gradient(165deg, #1e3320, #141a15); }
html.theme-dark .rating-hero-card.is-bad { background: linear-gradient(165deg, #3a2222, #1a1414); }
html.theme-dark .rating-hero-card.is-mid { background: linear-gradient(165deg, #332e18, #1a1810); }
html.theme-dark .rating-hero-card__badge,
html.theme-dark .rating-stat__chips span {
  background: rgba(255,255,255,.06);
  color: #c8e6c9;
}
html.theme-dark .rating-stat__ico,
html.theme-dark .rating-page--personal .rating-part__icon {
  background: linear-gradient(160deg, #2c382e, #1e2620);
  color: #8be08a;
  box-shadow: none;
}
html.theme-dark .rating-stat.is-warn {
  background: linear-gradient(165deg, #3a2222, #1a1414);
  border-color: rgba(239, 83, 80, 0.22);
}
html.theme-dark .rating-stat.is-ok { background: linear-gradient(165deg, #1e3320, #141a15); }
html.theme-dark .rating-stat.is-warn .rating-stat__ico {
  background: linear-gradient(160deg, #4a2a2a, #2a1a1a);
  color: #ef9a9a;
}
html.theme-dark .rating-page--personal .rating-ach__meta em {
  background: rgba(76, 175, 69, 0.2);
  color: #a5d6a7;
}

@media (max-width: 560px) {
  .rating-hero-card__score strong { font-size: 2.45rem; }
  .rating-stat { min-height: 10.2rem; padding: 0.9rem 0.85rem 0.85rem; }
  .rating-stat__num { font-size: 1.75rem; }
  .rating-stat--banner {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "head num"
      "hint hint"
      "track track";
  }
}

/* Скролл документа в ЭО: один скроллер — html. Чат и логин не трогаем. */
html:not(.chat-lock):not(.auth-lite-html) {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  touch-action: auto !important;
  overscroll-behavior: auto !important;
}
html:not(.chat-lock):not(.auth-lite-html) body {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  touch-action: auto !important;
  overscroll-behavior: auto !important;
}
html:not(.chat-lock) #pageMain {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  transform: none !important;
}
.fade-in {
  opacity: 1;
  transform: none;
}
.kkt-dialog[hidden],
.kkt-notify[hidden],
.kkt-busy[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Календарь выбора даты */
.kkt-cal {
  position: relative;
  width: 100%;
}
.kkt-cal__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: 0;
}
.kkt-cal__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
.kkt-cal__btn:hover {
  border-color: rgba(76, 175, 69, 0.4);
}
.kkt-cal__btn[aria-expanded="true"] {
  border-color: #4caf45;
  box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.18);
}
.kkt-cal__label.is-empty { color: var(--text-muted); font-weight: 550; }
.kkt-cal__btn i {
  color: #4caf45;
  font-size: 1.05rem;
}
.kkt-cal-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 13990;
  background: rgba(12, 18, 14, 0.42);
}
.kkt-cal-mask.is-open { display: block; }
.kkt-cal-pop {
  display: none;
  position: fixed;
  z-index: 14000;
  width: min(22.5rem, calc(100vw - 1.2rem));
  padding: 0.85rem 0.9rem 0.8rem;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 22px 48px rgba(28, 25, 23, 0.18);
  font-family: var(--font-sans);
}
.kkt-cal-pop.is-open { display: block; }
.kkt-cal-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.kkt-cal-pop__title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  border: 0;
  background: transparent;
  padding: 0.2rem 0.35rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.kkt-cal-pop__title:hover { background: rgba(76, 175, 69, 0.12); }
.kkt-cal-pop__pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 0.15rem 0 0.35rem;
}
.kkt-cal-pop__cell {
  min-height: 2.5rem;
  border: 0;
  border-radius: 12px;
  background: #f3f7f3;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  cursor: pointer;
}
.kkt-cal-pop__cell.is-today { box-shadow: inset 0 0 0 1.5px rgba(76, 175, 69, 0.55); }
.kkt-cal-pop__cell.is-sel,
.kkt-cal-pop__cell.is-sel.is-today {
  background: #4caf45;
  color: #fff;
  box-shadow: none;
}
.kkt-cal-pop__cell:hover:not(.is-sel) { background: rgba(76, 175, 69, 0.16); }
.kkt-cal-pop__nav {
  flex: 0 0 auto;
  width: 2.15rem;
  min-width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 50%;
  background: #f3f7f3;
  color: #2e7d32;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.kkt-cal-pop__week,
.kkt-cal-pop__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.18rem;
}
.kkt-cal-pop__grid {
  transition: opacity 0.16s ease;
}
.kkt-cal-pop__grid.is-swap {
  opacity: 0.35;
}
.kkt-cal-pop__week {
  margin-bottom: 0.28rem;
}
.kkt-cal-pop__week span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 750;
  color: var(--text-muted);
  padding: 0.15rem 0;
}
.kkt-cal-pop__day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.kkt-cal-pop__day.is-out { color: #b7c0b6; }
.kkt-cal-pop__day.is-today { box-shadow: inset 0 0 0 1.5px rgba(76, 175, 69, 0.55); }
.kkt-cal-pop__day.is-sel,
.kkt-cal-pop__day.is-sel.is-today {
  background: #4caf45;
  color: #fff;
  box-shadow: none;
}
.kkt-cal-pop__day:hover:not(.is-sel) { background: rgba(76, 175, 69, 0.12); }
.kkt-cal-pop__time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin: 0.75rem 0 0.35rem;
  padding: 0.65rem 0.7rem;
  border-radius: 16px;
  background: #f3f7f3;
}
.kkt-cal-pop__time > span {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
}
.kkt-cal-pop__clock {
  display: flex;
  align-items: center;
  gap: 0.28rem;
}
.kkt-cal-pop__clock button {
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #2e7d32;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.06);
}
.kkt-cal-pop__clock strong {
  min-width: 1.6rem;
  text-align: center;
  font-size: 1.05rem;
}
.kkt-cal-pop__clock i { color: var(--text-muted); font-style: normal; font-weight: 800; }
.kkt-cal-pop__foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.kkt-cal-pop__ghost,
.kkt-cal-pop__ok {
  border: 0;
  border-radius: 999px;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.kkt-cal-pop__ghost {
  background: #f3f7f3;
  color: #2e7d32;
}
.kkt-cal-pop__ok {
  margin-left: auto;
  background: #4caf45;
  color: #fff;
  padding: 0 1.15rem;
}
html.theme-dark .kkt-cal__btn {
  background: var(--bg-card2);
  color: var(--text-primary);
}
html.theme-dark .kkt-cal-pop {
  background: #222a24;
  border-color: rgba(255,255,255,.08);
}
html.theme-dark .kkt-cal-pop__nav,
html.theme-dark .kkt-cal-pop__ghost,
html.theme-dark .kkt-cal-pop__time,
html.theme-dark .kkt-cal-pop__cell {
  background: #2c362f;
  color: #cfe3cc;
}
html.theme-dark .kkt-cal-pop__title:hover { background: rgba(76, 175, 69, 0.18); }
html.theme-dark .kkt-cal-pop__clock button {
  background: #1c231e;
  color: #9ee296;
}
html.theme-dark .kkt-cal-pop__day.is-out { color: #6b786c; }

@media (max-width: 768px) {
  .kkt-cal__btn { min-height: 3.1rem; font-size: 1rem; }
  .kkt-cal-pop.is-sheet {
    left: 0.55rem !important;
    right: 0.55rem !important;
    bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
    top: auto !important;
    width: auto;
    padding: 1rem 0.95rem 0.95rem;
    border-radius: 24px 24px 18px 18px;
  }
  .kkt-cal-pop.is-sheet .kkt-cal-pop__day,
  .kkt-cal-pop.is-sheet .kkt-cal-pop__cell {
    min-height: 2.55rem;
    font-size: 0.95rem;
  }
  .kkt-cal-pop.is-sheet .kkt-cal-pop__clock button {
    width: 2.15rem;
    height: 2.15rem;
  }
  .kkt-cal-pop.is-sheet .kkt-cal-pop__ok,
  .kkt-cal-pop.is-sheet .kkt-cal-pop__ghost {
    min-height: 2.7rem;
  }
}

/* ── Teacher compose: tests, lectures, lessons, resources ── */
.teach-compose {
  width: 100%;
  max-width: 880px;
  padding: 1.4rem 1.35rem 1.5rem;
}
.teach-compose .form-label {
  font-size: 0.95rem;
  font-weight: 750;
  margin-bottom: 0.45rem;
}
.teach-compose .form-control,
.teach-compose .form-select,
.teach-compose .la-select,
.teach-compose textarea.form-control {
  min-height: 3.25rem;
  padding: 0.9rem 1.05rem;
  font-size: 1.02rem;
  border-radius: 16px;
}
.teach-compose textarea.form-control {
  min-height: 10rem;
  line-height: 1.45;
}
.teach-compose--card {
  max-width: none;
  padding: 0;
}
.teach-compose input[type="file"],
.teach-compose .form-control,
.teach-compose .form-select,
.teach-compose input[type="datetime-local"],
.builder-field input,
.builder-field textarea,
.builder-field select,
.lecture-compose input[type="file"] {
  max-width: 100%;
  min-width: 0;
}
.teach-compose input[type="datetime-local"] {
  width: 100%;
}
.teach-compose__limits {
  display: grid;
  grid-template-columns: 6.2rem 6.2rem minmax(0, 1fr);
  gap: 0.55rem 0.65rem;
  margin-bottom: 0.35rem;
}
.teach-compose__limits .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.82rem;
}
.teach-compose__limits .form-control {
  min-height: 2.55rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
}
.teach-compose__limits-hint {
  margin: 0 0 1.15rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-muted);
}
@media (max-width: 560px) {
  .teach-compose__limits { grid-template-columns: 1fr 1fr; }
  .teach-compose__limits-deadline { grid-column: 1 / -1; }
}
.teach-compose__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.builder-wrap.teach-builder {
  margin: 0;
  min-height: calc(100dvh - 9rem);
  max-width: 100%;
  overflow-x: clip;
}
.builder-wrap.teach-builder .builder-sidebar,
.builder-wrap.teach-builder .builder-main {
  min-width: 0;
}
.lecture-compose {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  max-width: 52rem;
}
.lecture-compose__main,
.lecture-compose__side {
  min-width: 0;
  width: 100%;
}
.lecture-compose .quill-wrap,
.lecture-compose .ql-container.ql-snow,
.lecture-compose .ql-editor {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.lecture-compose .ql-container.ql-snow,
.lecture-compose .ql-editor {
  min-height: 22rem;
}
.lecture-compose .ql-editor {
  overflow-wrap: break-word;
}
.lecture-compose .ql-editor img,
.lecture-compose .ql-editor video,
.lecture-compose .ql-editor audio,
.lecture-compose .ql-editor iframe,
.lecture-compose .ql-video,
.lec-media-file {
  display: block;
  max-width: 100% !important;
  width: 100%;
  height: auto;
  margin: 0.65rem 0;
  border-radius: 12px;
}
.lecture-compose .ql-editor iframe.ql-video,
.lecture-content iframe.ql-video {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 12rem;
}
.lecture-media {
  padding: 0.75rem 0.85rem 0.8rem;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.lecture-media__h {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lecture-media__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.lecture-media__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(76, 175, 69, 0.28);
  background: rgba(76, 175, 69, 0.1);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}
.lecture-media__btn:hover { background: rgba(76, 175, 69, 0.18); }
.lecture-media__hint {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 650;
}
.lecture-media__hint.is-err { color: #c62828; }
.course-page--read,
.course-page--read .course-body,
.course-page--hw,
.hw-card,
.hw-assign-desc {
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  max-height: none !important;
  overflow-x: visible;
  overflow-y: visible;
}
.course-page--read .study-paper.lecture-content {
  overflow-x: visible;
  overflow-y: visible;
}
.study-paper.lecture-content,
.lecture-content,
.hw-card__text,
.hw-assign-desc {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.lecture-content .ql-code-block-container,
.lecture-content pre,
.lecture-content pre.ql-syntax,
.ql-editor .ql-code-block-container,
.ql-editor pre.ql-syntax {
  display: block;
  margin: 0.85rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #24302a !important;
  color: #eef6ea !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.lecture-content .ql-code-block-container *,
.ql-editor .ql-code-block-container *,
.lecture-content .ql-code-block,
.ql-editor .ql-code-block,
.lecture-content pre.ql-syntax *,
.ql-editor pre.ql-syntax * {
  color: #eef6ea !important;
  background: transparent !important;
  font-family: inherit;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}
.lecture-content code,
.ql-editor code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
  word-break: normal;
  color: #1b5e20;
  background: rgba(76, 175, 69, 0.12);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}
html.theme-dark .lecture-content code,
html.theme-dark .ql-editor code {
  color: #c8f0b8;
}
.lecture-content img,
.lecture-content video,
.lecture-content audio,
.lecture-content iframe,
.hw-card__text img,
.hw-card__text video,
.hw-card__text iframe,
.hw-assign-desc img,
.hw-assign-desc video,
.hw-assign-desc iframe {
  max-width: 100% !important;
  width: auto;
  height: auto;
}

@media (max-width: 991.98px) {
  .teach-compose:not(.teach-compose--card) {
    max-width: none;
    padding: 1rem 0.95rem;
  }
  .teach-compose .btn-primary,
  .teach-compose button[type="submit"].btn {
    min-height: 46px;
  }
  .teach-compose > .btn-primary,
  .teach-compose > button[type="submit"] {
    width: 100%;
    justify-content: center;
  }
  .teach-compose__actions {
    flex-direction: column;
  }
  .teach-compose__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .lecture-compose > .row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .lecture-compose .col-lg-4 {
    order: -1;
  }
  .lecture-compose .editor-sidebar-card .btn {
    min-height: 46px;
  }
  .editor-title-input {
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0 0.55rem;
  }
  .ql-container.ql-snow,
  .ql-editor {
    min-height: 240px !important;
  }
  .ql-editor {
    padding: 1rem !important;
  }
  .builder-wrap.teach-builder {
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0.5rem;
  }
  .builder-wrap.teach-builder .builder-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.05rem 1.15rem;
  }
  .builder-wrap.teach-builder .builder-main {
    padding: 1rem 0.15rem 1.25rem;
  }
  .builder-main-header {
    flex-wrap: wrap;
    gap: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bg-dark);
    margin: 0 -0.15rem;
    padding: 0.35rem 0.15rem 0.9rem;
  }
  .builder-test-title {
    font-size: 1.15rem;
    width: 100%;
    line-height: 1.3;
  }
  .builder-add-btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }
  .builder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .qb-header {
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
  }
  .qb-drag { display: none; }
  .qb-preview {
    flex: 1 1 100%;
    order: 8;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
  }
  .qb-actions { margin-left: auto; }
  .qb-editor { padding: 0.95rem 0.85rem 1.05rem; }
  .qb-editor-row {
    flex-direction: column;
  }
  .qb-editor-meta { width: 100%; }
  .qb-answers-header {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .qb-add-answer-btn {
    min-height: 36px;
  }
  .qb-answer-row .form-control {
    min-width: 0;
  }
  .qb-editor-footer {
    flex-wrap: wrap;
  }
  .qb-editor-footer .btn {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: center;
    min-height: 42px;
  }
  .qb-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .qb-modal {
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: min(92dvh, 100%);
    overflow: auto;
  }
  .qb-modal-footer {
    flex-wrap: wrap;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .qb-modal-footer .btn {
    flex: 1;
    min-height: 44px;
    justify-content: center;
  }
  .lesson-board__head {
    flex-direction: column;
    align-items: stretch;
  }
  .lesson-board__tools { margin-left: 0; width: 100%; }
  .lesson-board__add,
  .lesson-board__tools .btn-sec,
  .lesson-board__tools .btn-prim {
    width: auto;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }
  .lesson-toolbar .la-select {
    max-width: none !important;
    width: min(100%, 100%);
    flex: 1 1 12rem;
  }
  .lesson-mod__actions {
    width: 100%;
    margin-left: 0;
  }
  .lesson-mod__actions .btn {
    min-height: 38px;
  }
  .achooser {
    place-items: end center;
    padding: 0;
  }
  .achooser__panel {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 22px 22px 0 0;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  }
  .achooser__panel::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    margin: 0.55rem auto 0.15rem;
  }
  .achooser__head {
    padding: 0.55rem 1rem 0.2rem;
  }
  .achooser__search {
    margin: 0.35rem 1rem 0.65rem;
  }
  .achooser__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 0.65rem;
    scrollbar-width: none;
  }
  .achooser__tabs::-webkit-scrollbar { display: none; }
  .achooser__tab {
    flex: 0 0 auto;
    min-height: 40px;
  }
  .achooser__grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.1rem 0.9rem 1.1rem;
  }
  .achooser__card {
    flex-direction: row;
    text-align: left;
    align-items: center;
    min-height: 0;
    padding: 0.7rem 0.8rem;
    gap: 0.75rem;
  }
  .achooser__badge {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    font-size: 1.15rem;
  }
  .achooser__name,
  .achooser__hint {
    width: 100%;
  }
  .achooser__hint {
    -webkit-line-clamp: 2;
  }
  .disc-attach__row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .disc-attach__row .btn {
    width: 100%;
    min-height: 44px;
  }
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .builder-actions {
    grid-template-columns: 1fr;
  }
  .page-header h2 .bi {
    display: none;
  }
  .course-hero__chip {
    max-width: 9.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* PvP battle */
.pvp-page {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: 0 0 1.5rem;
}
.pvp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem 1.15rem 1.4rem;
  box-shadow: 0 16px 36px rgba(28, 25, 23, 0.08);
}
.pvp-card__ico {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.85rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #e8f7e8, #cfe9cf);
  color: #1b7a28;
  font-size: 1.45rem;
}
.pvp-card__title {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.pvp-card__lead {
  margin: 0 0 1.15rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.pvp-code-input {
  width: 100%;
  height: 3.4rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card2, var(--bg-card));
  color: var(--text-primary);
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.pvp-code-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pvp-go {
  width: 100%;
  margin-top: 0.85rem;
  min-height: 48px;
}
.pvp-code-box {
  margin: 0.35rem 0 1.15rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(76, 175, 69, 0.1);
  text-align: center;
}
.pvp-code-box span {
  display: block;
  margin-bottom: 0.28rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.pvp-code-box strong {
  font-size: clamp(1.55rem, 6vw, 2.1rem);
  letter-spacing: 0.22em;
  font-weight: 800;
  color: var(--accent);
}
.pvp-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: center;
  margin: 0.4rem 0 1rem;
}
.pvp-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.7rem 0.4rem;
  border-radius: 18px;
  background: var(--bg-card2, rgba(0,0,0,.03));
}
.pvp-avatar {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
}
.pvp-avatar.active {
  background: var(--accent);
  color: #fff;
}
.pvp-player span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}
.pvp-vs__mark {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.pvp-count {
  margin: 0;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 750;
  color: var(--accent);
}
.pvp-game-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}
.pvp-game-bar__score { text-align: right; }
.pvp-timer {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.pvp-opp {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.pvp-opp__bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.pvp-opp__bar > div {
  height: 100%;
  width: 0;
  background: #ef4444;
  transition: width .3s;
}
.pvp-q {
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.35;
  margin: 0 0 0.9rem;
}
.pvp-answer {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  margin: 0.45rem 0;
  background: var(--bg-card2, rgba(0,0,0,.03));
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-weight: 650;
}
.pvp-answer:hover { border-color: var(--accent); }
.pvp-answer.selected { border-color: var(--accent); background: rgba(76, 175, 69, .12); }
.pvp-answer.correct { border-color: #10b981; background: rgba(16,185,129,.15); }
.pvp-answer.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); }
.pvp-wait {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem 0.5rem;
}
.pvp-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}
.pvp-board__cell {
  padding: 0.9rem 0.8rem;
  border-radius: 16px;
  background: var(--bg-card2, rgba(0,0,0,.03));
  text-align: center;
}
.pvp-board__cell.is-me { box-shadow: inset 0 0 0 2px var(--accent); }
.pvp-board__cell b {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.35rem;
  color: var(--accent);
}
.pvp-form .form-group { margin-bottom: 0.85rem; }
html.theme-dark .pvp-card__ico {
  background: linear-gradient(160deg, #2c382e, #1e2620);
  color: #8be08a;
}
@media (max-width: 560px) {
  .pvp-page { width: 100%; }
  .pvp-card { padding: 1.05rem 0.9rem 1.2rem; border-radius: 20px; }
  .pvp-game-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "q timer" "score score";
  }
  .pvp-game-bar > :first-child { grid-area: q; }
  .pvp-timer { grid-area: timer; justify-self: end; }
  .pvp-game-bar__score { grid-area: score; text-align: left; }
  .pvp-board { grid-template-columns: 1fr; }
  .pvp-code-input { letter-spacing: 0.16em; font-size: 1.25rem; }
}

.builder-save-btn {
  background: linear-gradient(135deg, #5cbf52, #3fa83a) !important;
  box-shadow: 0 8px 18px rgba(63, 168, 58, 0.22) !important;
  color: #fff !important;
}
.builder-save-btn:hover { filter: brightness(1.04); }
.question-block:hover { border-color: rgba(76, 175, 69, 0.35) !important; }
.question-block.qb-open {
  border-color: #4caf45 !important;
  box-shadow: 0 0 0 1px rgba(76, 175, 69, 0.35), 0 10px 24px rgba(46, 125, 50, 0.08) !important;
}
.qb-type-single { background: rgba(76, 175, 69, 0.14) !important; color: #2e7d32 !important; }
.qb-editor { background: rgba(76, 175, 69, 0.04) !important; }
.qb-edit-btn:hover {
  color: #2e7d32 !important;
  border-color: rgba(76, 175, 69, 0.4) !important;
  background: rgba(76, 175, 69, 0.1) !important;
}
.builder-action-btn:hover { border-color: rgba(76, 175, 69, 0.35); color: var(--text-primary); }

.stat-page { max-width: 72rem; }
.stat-sub {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}
.stat-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1.1rem;
}
.stat-kpi--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-kpi__card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid rgba(28, 25, 23, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat-kpi__card b {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.stat-kpi__card span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}
.stat-kpi__card.is-warn b { color: #b54708; }
.stat-kpi__card.is-ok b { color: #1b7a28; }
.stat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.stat-grid--wide { grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.7fr); }
.stat-card-block,
.reopen-box {
  background: var(--bg-card);
  border: 1px solid rgba(28, 25, 23, 0.06);
  border-radius: 20px;
  padding: 1rem 1.05rem 1.1rem;
}
.stat-card-block h3,
.reopen-box__h {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  font-weight: 800;
}
.stat-empty, .stat-muted, .reopen-box__lead, .reopen-box__empty {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 650;
}
.stat-dist {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 8.5rem;
}
.stat-dist__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.stat-dist__track {
  width: 100%;
  height: 6.2rem;
  display: flex;
  align-items: flex-end;
  background: #f3f7f2;
  border-radius: 10px;
  overflow: hidden;
}
.stat-dist__bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, #7ed275, #3fa83a);
  border-radius: 10px 10px 0 0;
}
.stat-dist__n, .stat-dist__label {
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--text-muted);
}
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(28, 25, 23, 0.06);
  font-size: 0.88rem;
}
.stat-row:first-of-type { border-top: 0; padding-top: 0; }
.stat-row span { display: block; color: var(--text-muted); font-size: 0.76rem; }
.stat-table-wrap { overflow: auto; }
.stat-table { width: 100%; border-collapse: collapse; }
.stat-table th, .stat-table td {
  padding: 0.6rem 0.45rem;
  border-bottom: 1px solid rgba(28, 25, 23, 0.06);
  text-align: left;
  font-size: 0.86rem;
}
.stat-table th { color: var(--text-muted); font-size: 0.74rem; font-weight: 750; }
.stat-table tr.is-click { cursor: pointer; }
.stat-table tr.is-click:hover { background: rgba(76, 175, 69, 0.06); }
.stat-mini {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.stat-mini i {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: #3fa83a;
  min-width: 4px;
}
.stat-side { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.heat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 0 0 1rem;
}
.heat-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 750;
  color: var(--text-muted);
}
.heat-filters .form-select { min-width: 10rem; }
.heat-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}
.heat-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 5px;
  display: inline-block;
}
.heat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}
.heat-cell {
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
}
.heat-cell span { font-size: 0.68rem; font-weight: 750; }
.heat-cell b { font-size: 0.82rem; }
.heat-cell--easy { background: #d8f0d4; color: #1b7a28; }
.heat-cell--ok { background: #e7f0c8; color: #4d6b14; }
.heat-cell--mid { background: #f6e7c2; color: #8a5a0a; }
.heat-cell--hard { background: #f4d4c4; color: #b54708; }
.heat-cell--hot { background: #f3c9c6; color: #b42318; }
.stat-note {
  margin-top: 0.9rem;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: #fbf4ea;
  border: 1px solid rgba(181, 71, 8, 0.12);
}
.stat-note h3 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.stat-note p { margin: 0 0 0.55rem; color: var(--text-muted); font-size: 0.86rem; }
.stat-note__tags, .stat-tag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.stat-tag {
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}
.heat-modal[hidden] { display: none !important; }
.heat-modal { position: fixed; inset: 0; z-index: 40000; display: grid; place-items: center; }
.heat-modal__bg { position: absolute; inset: 0; border: 0; background: rgba(20, 30, 22, 0.42); }
.heat-modal__panel {
  position: relative;
  z-index: 1;
  width: min(32rem, calc(100% - 1.5rem));
  max-height: 85vh;
  overflow: auto;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1rem 1.1rem 1.2rem;
}
.heat-modal__panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.heat-modal__x { border: 0; background: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); }
.heat-q { margin: 0 0 0.85rem; font-weight: 750; }
.heat-ans {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  margin-bottom: 0.3rem;
  background: #f4f7f3;
  font-size: 0.86rem;
}
.heat-ans.is-ok { background: #e4f4e0; }
.heat-ans.is-wrong { background: #f8e8e6; }
.reopen-box { margin-top: 0.85rem; }
.reopen-box__radio, .reopen-box__person {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.28rem 0;
  font-size: 0.86rem;
  font-weight: 700;
}
.reopen-box__people {
  margin: 0.45rem 0 0.65rem;
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem;
}
.reopen-box__search {
  width: 100%;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
}
.reopen-box__extra {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.55rem 0;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-muted);
}
.reopen-box__extra input { width: 5rem; }
.reopen-box__go { width: 100%; justify-content: center; }
.reopen-box__log {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.reopen-box__log time { margin-left: 0.35rem; }
html.theme-dark .stat-kpi__card,
html.theme-dark .stat-card-block,
html.theme-dark .reopen-box,
html.theme-dark .heat-modal__panel { background: var(--bg-card); }
html.theme-dark .stat-dist__track { background: var(--bg-card2); }
html.theme-dark .achooser__card { background: var(--bg-card2); }
html.theme-dark .heat-cell--easy { background: #1e3d22; color: #b6e8b0; }
html.theme-dark .heat-cell--ok { background: #3a431c; color: #d5e48a; }
html.theme-dark .heat-cell--mid { background: #4a3a16; color: #f0d48a; }
html.theme-dark .heat-cell--hard { background: #4a2a18; color: #f0b48a; }
html.theme-dark .heat-cell--hot { background: #4a1c1c; color: #f0a8a8; }
@media (max-width: 900px) {
  .stat-kpi, .stat-grid, .stat-grid--wide { grid-template-columns: 1fr 1fr; }
  .stat-grid--wide { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stat-kpi { grid-template-columns: 1fr 1fr; }
}
.cleanup-page {
  max-width: 58rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.cleanup-notice {
  cursor: default;
  pointer-events: none;
  border-color: rgba(245, 158, 11, 0.22);
  background: var(--bg-card);
}
.cleanup-notice .kkt-notice__text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.cleanup-kpi { margin: 0; }
.cleanup-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: none;
}
.cleanup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}
.cleanup-card__head {
  margin: 0 0 0.85rem;
}
.cleanup-card__head h3 {
  margin: 0 0 0.22rem;
  font-size: 1.02rem;
  font-weight: 800;
}
.cleanup-card__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
}
.cleanup-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.cleanup-tile {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-height: 7.2rem;
  padding: 0.85rem 0.9rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card2, #f7faf7);
  cursor: pointer;
  position: relative;
}
.cleanup-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cleanup-tile i {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.cleanup-tile strong {
  font-size: 0.92rem;
  font-weight: 800;
}
.cleanup-tile span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}
.cleanup-tile.is-on {
  border-color: var(--accent);
  background: rgba(76, 175, 69, 0.12);
}
.cleanup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.9rem;
}
.cleanup-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}
.cleanup-toolbar .members-search { flex: 1; }
.cleanup-all {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.cleanup-list {
  max-height: 16rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.3rem;
  background: var(--bg-card2, #f7faf7);
}
.cleanup-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}
.cleanup-row:hover { background: rgba(76, 175, 69, 0.08); }
.cleanup-row.is-on { background: rgba(76, 175, 69, 0.14); }
.cleanup-row input { margin-top: 0.28rem; flex-shrink: 0; accent-color: var(--accent); }
.cleanup-row span { display: flex; flex-direction: column; gap: 0.08rem; min-width: 0; }
.cleanup-row strong { font-size: 0.9rem; }
.cleanup-row em {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.cleanup-extra {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}
.cleanup-bar {
  position: sticky;
  bottom: 0.6rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.1);
}
.cleanup-bar__hint {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}
.cleanup-bar .kkt-dialog__btn {
  border-radius: 999px;
  min-width: 11.5rem;
}
.cleanup-bar .kkt-dialog__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.cleanup-dlg-notice {
  margin: 0.75rem 0 0;
  cursor: default;
  pointer-events: none;
  border-color: rgba(245, 158, 11, 0.22);
}
.cleanup-dlg-notice .kkt-notice__text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.cleanup-dlg-input {
  margin-top: 0.75rem;
  border-radius: 14px;
}
#cleanupDialog .kkt-dialog__actions .kkt-dialog__btn {
  border-radius: 999px;
}
#cleanupDialog .kkt-dialog__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
html.theme-dark .cleanup-card,
html.theme-dark .cleanup-bar,
html.theme-dark .cleanup-notice {
  background: var(--bg-card);
}
html.theme-dark .cleanup-tile,
html.theme-dark .cleanup-list {
  background: rgba(255,255,255,0.03);
}
.group-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2, #f7faf7);
}
.group-move .cleanup-all { margin: 0; }
.group-move .form-control,
.group-move .custom-select-wrap {
  flex: 1 1 12rem;
  min-width: 12rem;
  margin: 0;
}
.group-move .btn-prim {
  flex: 0 0 auto;
  min-height: 40px;
}
.group-move__check {
  width: 2.2rem;
  text-align: center;
  vertical-align: middle;
}
.group-move__check input {
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
}
html.theme-dark .group-move {
  background: rgba(255,255,255,0.03);
}
@media (max-width: 800px) {
  .cleanup-grid,
  .cleanup-tiles { grid-template-columns: 1fr; }
  .cleanup-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .cleanup-bar .kkt-dialog__btn { width: 100%; min-width: 0; }
}
@media (min-width: 992px) {
  .dash-side .prof-card .honor-bar {
    margin: 1.15rem 0 0.2rem;
  }
  .dash-side .prof-card--student > .honor-bar {
    margin: 1.7rem 0 0.45rem;
  }
  .dash-side .prof-card {
    padding-bottom: 1.05rem;
  }
  .dash-side {
    gap: 1.65rem;
  }
}
.prof-achs {
  display: none;
  width: 100%;
  padding: 0.85rem 1.1rem 0.15rem;
  text-align: left;
  box-sizing: border-box;
}
.prof-achs__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.prof-achs__head a {
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
}
.prof-achs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.prof-achs li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 14px;
  background: rgba(76, 175, 69, 0.08);
  border: 1px solid rgba(76, 175, 69, 0.12);
}
.prof-achs li i {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ach-color, #4caf45) 18%, transparent);
  color: var(--ach-color, #4caf45);
}
.prof-achs li span {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
}
.prof-achs__empty {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}
@media (min-width: 992px) {
  .prof-achs { display: block; }
}

/* ── Конструктор теста ── */
main.tb-page {
  max-width: 54rem;
  padding-top: 0.85rem;
  padding-bottom: 5rem;
}
body:has(.tb) .fab-wrap { display: none; }
.tb {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}
.tb-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}
.tb-top__back {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  text-decoration: none !important;
  flex-shrink: 0;
}
.tb-top__back:hover { border-color: var(--border-accent); }
.tb-top__titles { flex: 1 1 12rem; min-width: 0; }
.tb-top__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tb-top__name {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tb-top__title-input {
  width: 100%;
  margin: 0;
  padding: 0.1rem 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}
.tb-top__title-input:hover,
.tb-top__title-input:focus {
  border-bottom-color: var(--border-accent);
  outline: none;
}
.tb-top__save {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 1.05rem;
  border-radius: 999px;
}
.tb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--text-primary);
}
.tb-chip strong { font-weight: 850; }
.tb-top__gear {
  min-height: 40px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.tb-top__gear:hover { border-color: var(--border-accent); }
.tb-add {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.tb-add__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-height: 4.6rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 18px;
  border: 1px solid rgba(76, 175, 69, 0.18);
  background: linear-gradient(165deg, #f8fcf7, #eef6ec);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tb-add__btn i {
  font-size: 1.15rem;
  color: #2e9b3a;
}
.tb-add__btn strong {
  font-size: 0.92rem;
  font-weight: 850;
}
.tb-add__btn span {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--text-muted);
  line-height: 1.3;
}
.tb-add__btn:hover {
  border-color: rgba(76, 175, 69, 0.4);
  background: #fff;
}
.tb-empty {
  text-align: center;
  padding: 2.2rem 1rem 1.6rem;
  border-radius: 20px;
  border: 1px dashed var(--border);
  background: var(--bg-card);
}
.tb-empty p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.9rem;
}
.tb-empty strong { color: var(--text-primary); font-size: 1.05rem; }
.tb-list { display: flex; flex-direction: column; gap: 0.55rem; }
.tb-q {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  min-width: 0;
}
.tb-q.is-open { border-color: rgba(76, 175, 69, 0.45); box-shadow: 0 0 0 3px rgba(76, 175, 69, 0.12); }
.tb-q.is-drag { opacity: 0.55; }
.tb-q__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  min-width: 0;
}
.tb-q__grip {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tb-q__n {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: rgba(76, 175, 69, 0.12);
  color: #2e7d32;
  font-size: 0.78rem;
  font-weight: 850;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tb-q__kind {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}
.tb-q[data-type="single"] .tb-q__kind { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.tb-q[data-type="multiple"] .tb-q__kind { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.tb-q[data-type="open"] .tb-q__kind { background: rgba(14, 165, 233, 0.14); color: #0369a1; }
.tb-q__preview {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-q__pts {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
}
.tb-q__ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.tb-q__ico:hover { background: var(--bg-card2); color: var(--text-primary); }
.tb-q__ico--danger:hover { color: #c62828; background: rgba(198, 40, 40, 0.08); }
.tb-q__edit {
  display: none;
  padding: 0 0.9rem 1rem;
  border-top: 1px solid var(--border);
}
.tb-q.is-open .tb-q__edit { display: block; }
.tb-field { margin-top: 0.85rem; }
.tb-field label, .tb-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tb-q__text {
  width: 100%;
  min-height: 4.4rem;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
}
.tb-q__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin-top: 0.85rem;
  align-items: flex-end;
}
.tb-types { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tb-type {
  min-height: 38px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  color: var(--text-primary);
}
.tb-type.is-on {
  border-color: rgba(76, 175, 69, 0.45);
  background: rgba(76, 175, 69, 0.14);
  color: #1b5e20;
}
.tb-pts {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.tb-pts input {
  width: 4.2rem;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-weight: 800;
}
.tb-opts { margin-top: 0.9rem; }
.tb-q[data-type="open"] .tb-opts { display: none; }
.tb-opts__h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.tb-opts__hint { font-size: 0.8rem; font-weight: 650; color: var(--text-muted); }
.tb-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}
.tb-opt__ltr {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 850;
  flex-shrink: 0;
}
.tb-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.tb-mark.is-on {
  background: rgba(76, 175, 69, 0.18);
  border-color: rgba(76, 175, 69, 0.45);
  color: #2e7d32;
}
.tb-opt input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font: inherit;
}
.tb-opt__x {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
}
.tb-opt__x:hover { color: #c62828; background: rgba(198, 40, 40, 0.08); }
.tb-add-opt {
  margin-top: 0.35rem;
  min-height: 38px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px dashed rgba(76, 175, 69, 0.4);
  background: transparent;
  color: #2e7d32;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}
.tb-open-note {
  display: none;
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.08);
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 650;
}
.tb-q[data-type="open"] .tb-open-note { display: block; }
.tb-img {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.tb-img__preview {
  position: relative;
  width: 7.5rem;
  height: 5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.tb-img__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-img__preview[hidden] { display: none !important; }
.tb-img__rm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
}
.tb-upload {
  min-height: 38px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.tb-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}
.tb-foot .btn-prim, .tb-foot .btn-sec {
  min-height: 42px;
  padding: 0 1rem;
}
.tb-drawer {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: none;
}
.tb-drawer.is-on { display: block; }
.tb-drawer__dim {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 20, 0.42);
}
.tb-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(26rem, 100%);
  height: 100%;
  overflow: auto;
  background: var(--bg-card);
  color: var(--text-primary);
  border-left: 1px solid var(--border);
  padding: 1rem 1.05rem 2rem;
  box-shadow: -12px 0 40px rgba(0,0,0,.12);
}
.tb-drawer__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.tb-drawer__h h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 850;
}
.tb-drawer__x {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tb-meta { display: flex; flex-direction: column; gap: 0.7rem; }
.tb-meta__row {
  display: grid;
  grid-template-columns: 5.4rem 5.4rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
}
.tb-meta__row .form-control {
  min-height: 2.4rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.9rem;
}
.tb-meta__row .tb-label { margin-bottom: 0.25rem; }
@media (max-width: 420px) {
  .tb-meta__row { grid-template-columns: 1fr 1fr; }
  .tb-meta__deadline { grid-column: 1 / -1; }
}
.tb-meta .form-control, .tb-meta .form-select, .tb-meta input:not([type="hidden"]), .tb-meta textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 14px;
}
.tb-cover {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: 110px;
}
.tb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tb-hint { font-size: 0.74rem; color: var(--text-muted); font-weight: 650; }
.tb-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 1rem 0 0.5rem;
}
.tb-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.4rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: inherit !important;
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 750;
}
.tb-link:hover { border-color: var(--border-accent); }
.tb-link--danger { color: #c62828 !important; }
html.theme-dark .tb-add__btn {
  background: var(--bg-card2);
  border-color: rgba(109, 204, 99, 0.2);
}
html.theme-dark .tb-add__btn:hover { background: #2a342c; }
html.theme-dark .tb-type.is-on { color: #c8f0c4; }
html.theme-dark .tb-q__n { color: #c8f0c4; }
html.theme-dark .tb-q[data-type="single"] .tb-q__kind { color: #c8f0c4; }
html.theme-dark .tb-mark.is-on { color: #c8f0c4; }
@media (max-width: 700px) {
  .tb-add { grid-template-columns: 1fr; }
  .tb-add__btn { min-height: 3.4rem; flex-direction: row; align-items: center; gap: 0.65rem; }
  .tb-q__preview {
    flex-basis: 100%;
    order: 8;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .tb-q__bar { flex-wrap: wrap; }
  .tb-q__grip { display: none; }
  .tb-drawer__panel {
    top: auto;
    left: 0;
    width: 100%;
    height: min(92dvh, 100%);
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0;
    padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
  }
}

.maint-page { align-items: center; }
html.auth-lite-html.maint-html,
html.auth-lite-html.maint-html body.maint-on {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}
.auth-lite__page.maint-page {
  overflow: hidden !important;
  overscroll-behavior: none;
  padding: 1.25rem 1.2rem;
  height: 100%;
  max-height: 100%;
}
.maint-window {
  width: min(22.5rem, 100%);
  padding: 0.4rem 0.4rem 0.2rem;
  background: transparent;
  text-align: center;
  box-shadow: none;
  position: relative;
  overflow: visible;
}
.maint-scene {
  width: 5.6rem;
  height: 5.6rem;
  margin: 0 auto 1.05rem;
  overflow: visible;
  display: grid;
  place-items: center;
}
.maint-scene__gear {
  width: 5.6rem;
  height: 5.6rem;
  display: block;
  color: #2e7d32;
  transform-origin: 50% 50%;
  animation: maint-spin 5.5s linear infinite;
  filter: drop-shadow(0 8px 16px rgba(46, 125, 50, 0.18));
}
.maint-window__title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
}
.maint-window__text {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--text-muted);
}
.maint-dots {
  display: inline-flex;
  gap: 0.22rem;
  margin-left: 0.28rem;
  vertical-align: 0.12em;
}
.maint-dots i {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: #66bb6a;
  animation: maint-dot 1.15s ease-in-out infinite;
}
.maint-dots i:nth-child(2) { animation-delay: 0.16s; }
.maint-dots i:nth-child(3) { animation-delay: 0.32s; }
.maint-window__staff {
  margin-top: 1.15rem;
  text-align: center;
}
.maint-window__staff summary {
  display: inline-block;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--text-muted);
  list-style: none;
  text-align: center;
}
.maint-window__staff summary::-webkit-details-marker { display: none; }
.maint-window__form {
  margin-top: 0.75rem;
  gap: 0.55rem;
  text-align: left;
}
.maint-window__form .auth-lite__error {
  margin: 0 0 0.15rem;
}
.maint-window__err {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c62828;
}
html.theme-dark .maint-window {
  background: transparent;
  box-shadow: none;
}
html.theme-dark .maint-scene__gear { color: #8be08a; }
@keyframes maint-spin {
  to { transform: rotate(360deg); }
}
@keyframes maint-dot {
  0%, 80%, 100% { opacity: 0.28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .maint-scene__gear,
  .maint-dots i {
    animation: none !important;
  }
}
html.reduce-motion .maint-scene__gear,
html.reduce-motion .maint-dots i {
  animation: none !important;
}

/* Короткий тур по главной ЭО */
body.eo-tour-open {
  overflow: hidden;
}
.eo-tour {
  position: fixed;
  inset: 0;
  z-index: 200000;
  pointer-events: auto;
  background: rgba(12, 22, 16, 0.22);
}
.eo-tour[hidden] { display: none !important; }
.eo-tour__spot {
  position: absolute;
  pointer-events: none;
  box-shadow:
    0 0 0 3px rgba(76, 175, 80, 0.95),
    0 10px 28px rgba(27, 94, 32, 0.28);
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease, border-radius .28s ease;
}
.eo-tour--welcome .eo-tour__spot { display: none !important; }
.eo-tour__card {
  pointer-events: auto;
  position: fixed;
  z-index: 1;
  width: min(22.5rem, calc(100vw - 1.5rem));
  padding: 1.15rem 1.2rem 1.05rem;
  border-radius: 24px;
  background: #fff;
  color: #14331a;
  box-shadow:
    0 24px 60px rgba(16, 40, 20, 0.28),
    0 0 0 1px rgba(46, 125, 50, 0.08);
  outline: none;
}
.eo-tour__card[data-place="center"] {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}
.eo-tour__card[data-place="dock"] {
  left: 50%;
  right: auto;
  top: auto;
  transform: translateX(-50%);
}
.eo-tour__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2e7d32;
}
.eo-tour__kicker i { font-size: 0.95rem; }
.eo-tour__count {
  position: absolute;
  top: 1.15rem;
  right: 1.2rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  color: #7a9080;
}
.eo-tour__title {
  margin: 0.15rem 2.4rem 0.4rem 0;
  font-size: 1.22rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #14331a;
}
.eo-tour__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: #4a6352;
}
.eo-tour__dots {
  display: flex;
  gap: 0.32rem;
  margin: 0.95rem 0 0.85rem;
}
.eo-tour__dots i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 99px;
  background: #d5e6d6;
}
.eo-tour__dots i.is-on {
  width: 1.05rem;
  background: #43a047;
}
.eo-tour__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}
.eo-tour__skip,
.eo-tour__next {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.eo-tour__skip {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.1rem;
  font-size: 0.92rem;
  font-weight: 750;
  color: #6b8170;
  cursor: pointer;
}
.eo-tour__skip:hover { color: #2e7d32; }
.eo-tour__next {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  min-width: 7.2rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #66bb6a, #2e7d32);
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.28);
}
.eo-tour__next:hover { filter: brightness(1.05); }
.eo-tour__next:focus,
.eo-tour__next:focus-visible,
.eo-tour__skip:focus,
.eo-tour__skip:focus-visible {
  outline: none;
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.28);
}
html.theme-dark .eo-tour {
  background: rgba(4, 10, 6, 0.28);
}
html.theme-dark .eo-tour__spot {
  box-shadow:
    0 0 0 3px rgba(129, 199, 132, 0.9),
    0 10px 28px rgba(0, 0, 0, 0.4);
}
html.theme-dark .eo-tour__card {
  background: #1a241c;
  color: #e8f5e9;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(129, 199, 132, 0.16);
}
html.theme-dark .eo-tour__title { color: #f1f8e9; }
html.theme-dark .eo-tour__text { color: #b7cbb8; }
html.theme-dark .eo-tour__count { color: #8aa08c; }
html.theme-dark .eo-tour__kicker { color: #81c784; }
html.theme-dark .eo-tour__dots i { background: #345038; }
html.theme-dark .eo-tour__dots i.is-on { background: #81c784; }
html.theme-dark .eo-tour__skip { color: #9bb39e; }
@media (prefers-reduced-motion: reduce) {
  .eo-tour__spot { transition: none; }
}
html.reduce-motion .eo-tour__spot { transition: none; }

.hw-read { display: flex; flex-direction: column; gap: 1rem; max-width: 52rem; }
.hw-read__block { margin: 0; }
.hw-read__text { font-size: 1.02rem; line-height: 1.65; }
.hw-read__meta { color: var(--text-muted); font-size: .9rem; margin: 0 0 .5rem; }
.hw-read__empty { color: var(--text-muted); margin: 0; }
.hw-read__grade { font-size: 1.35rem; font-weight: 800; margin: 0 0 .35rem; }
.hw-read__comment { margin: 0; }
.hw-read__answer {
  padding: .9rem 1rem;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  line-height: 1.55;
  margin-bottom: .65rem;
}
html.theme-dark .hw-read__answer { background: var(--bg-card2); }
.lec-read { max-width: 52rem; }
.lec-read__body { font-size: 1.05rem; line-height: 1.65; }
.lec-read__foot {
  margin-top: 2rem;
  padding: 1.15rem 0 2rem;
  border-top: 1px solid var(--border);
}
.lec-read__hint,
.lec-read__done { color: var(--text-muted); margin: 0 0 .75rem; }
.lec-readers {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.lec-readers__head {
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .5rem;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.lec-readers__list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 14rem;
  overflow: auto;
  font-size: .82rem;
}
.lec-readers__list li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .28rem 0;
  border-bottom: 1px solid var(--border);
}
.lec-readers__list span { color: var(--text-muted); white-space: nowrap; }
html.theme-dark .sched-table {
  --bs-table-bg: var(--bg-card);
  --bs-table-color: var(--text-primary);
  --bs-table-border-color: rgba(244, 248, 241, 0.16);
  --bs-table-striped-bg: var(--bg-card2, #24302a);
  --bs-table-hover-bg: rgba(76, 175, 69, 0.12);
  color: var(--text-primary) !important;
  background: var(--bg-card) !important;
  border-color: rgba(244, 248, 241, 0.16) !important;
}
html.theme-dark .sched-table td,
html.theme-dark .sched-table th,
html.theme-dark .sched-table > :not(caption) > * > * {
  color: var(--text-primary) !important;
  background-color: var(--bg-card) !important;
  border-color: rgba(244, 248, 241, 0.16) !important;
  box-shadow: none !important;
}
html.theme-dark .sched-table thead th {
  background-color: var(--bg-card2, #24302a) !important;
  color: var(--text-muted) !important;
}
html.theme-dark #lesson-grid {
  background: var(--bg-card);
  border-color: var(--border);
}
html.theme-dark .sched-days__item {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-card2, var(--bg-card));
}
html.theme-dark .sched-days__item.is-on {
  background: rgba(76, 175, 69, 0.22);
  border-color: var(--accent);
  color: var(--text-primary);
}

.lesson-board__group-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.disc-set { display: flex; flex-direction: column; gap: .75rem; }
.disc-set__bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  align-items: end;
  padding: .65rem .85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.disc-set__bar label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
}
.disc-set__bar .form-select { min-width: 9rem; max-width: 16rem; }
.disc-set__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 800px) { .disc-set__grid { grid-template-columns: 1fr; } }
.disc-set__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .55rem .75rem;
}
.disc-set__card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 800;
  margin-bottom: .35rem;
}
.disc-set__row {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .28rem 0;
  border-top: 1px solid var(--border);
  font-size: .88rem;
}
.disc-set__row:first-of-type { border-top: 0; }
.disc-set__row a { flex: 1; min-width: 0; }
.disc-set__meta { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.disc-set__empty { color: var(--text-muted); font-size: .82rem; margin: .2rem 0; }
.disc-set__attach, .disc-set__upload {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-top: .4rem;
}
.disc-set__card input, .disc-set__card select { border-radius: 10px; }
.hw-cal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: .75rem .85rem 1rem;
  margin-bottom: 1rem;
}
.hw-cal__month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.hw-cal__nav {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.hw-cal__dow, .hw-cal__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .2rem;
  text-align: center;
}
.hw-cal__dow { font-size: .68rem; color: var(--text-muted); font-weight: 700; margin-bottom: .25rem; }
.hw-cal__day {
  min-height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 650;
}
.hw-cal__day.is-out { opacity: .28; }
.hw-cal__day.is-today { outline: 2px solid var(--accent); }
.hw-cal__day.has-hw { background: rgba(225, 29, 72, .16); color: #e11d48; }
.hw-cal__soon { display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1rem; }
.hw-cal__soon a { font-size: .88rem; font-weight: 650; }









