/* ==========================================================================
   mTasks — Студенческий дизайн-система (Inter, Mobile-first, Dark/Light)
   ========================================================================== */

:root {
  --bg: #000;
  --g1: #a984ff;
  --g2: #2a1470;
  --card: #1b1b1e;
  --card2: #26262a;
  --fg: #fff;
  --mu: #9a9aa3;
  --chip: rgba(255, 255, 255, 0.18);
  --nav: #232327;
  --ok: #1fd8a4;
  --hot: #ff6b81;
  --top-bar-padding: 12px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  :root {
    --top-bar-padding: max(calc(var(--tg-safe-top, 0px) + 8px), calc(env(safe-area-inset-top, 0px) + 54px), 64px);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f3fb;
    --g1: #c9bafc;
    --g2: #e8e1fb;
    --card: #ffffff;
    --card2: #f2edfa;
    --fg: #151326;
    --mu: #686580;
    --chip: rgba(21, 19, 38, 0.08);
    --nav: #151326;
    --hot: #e0405c;
    --ok: #0d9488;
  }
}

:root[data-theme="light"] {
  --bg: #f4f3fb;
  --g1: #c9bafc;
  --g2: #e8e1fb;
  --card: #ffffff;
  --card2: #f2edfa;
  --fg: #151326;
  --mu: #686580;
  --chip: rgba(21, 19, 38, 0.08);
  --nav: #151326;
  --hot: #e0405c;
  --ok: #0d9488;
}

:root[data-theme="dark"] {
  --bg: #000;
  --g1: #a984ff;
  --g2: #2a1470;
  --card: #1b1b1e;
  --card2: #26262a;
  --fg: #fff;
  --mu: #9a9aa3;
  --chip: rgba(255, 255, 255, 0.18);
  --nav: #232327;
  --ok: #1fd8a4;
  --hot: #ff6b81;
}

* {
  box-sizing: border-box;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  height: var(--tg-viewport-height, 100dvh);
  min-height: var(--tg-viewport-height, 100dvh);
  background: var(--bg);
}

body {
  width: 100%;
  height: 100%;
  height: var(--tg-viewport-height, 100dvh);
  min-height: var(--tg-viewport-height, 100dvh);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg) linear-gradient(180deg, var(--g1), var(--g2) 52%, var(--bg)) top/100% 560px no-repeat;
  color: var(--fg);
  font: 16px/1.3 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.svg-icon {
  display: inline-block;
  vertical-align: -3px;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  height: var(--tg-viewport-height, 100dvh);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
  display: flex;
  gap: 8px;
  padding: var(--top-bar-padding) 14px 10px;
  align-items: center;
  flex: none;
  z-index: 10;
}

.ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex: none;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
}

.ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  transform: scale(1.14);
  display: block;
}

.ava:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.25);
}

.search {
  flex: 1;
  height: 42px;
  border-radius: 22px;
  background: var(--chip);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-width: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.search svg,
.ib svg {
  width: 20px;
  height: 20px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.ib {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--chip);
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: transform 0.15s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ib:hover {
  transform: scale(1.05);
}

.sync-spinning .sync-svg {
  animation: mtasks-rotate 1s linear infinite;
}

@keyframes mtasks-rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Main & Views
   ========================================================================== */
main {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px calc(92px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

main::-webkit-scrollbar {
  display: none;
}

.view {
  display: none;
}

.view.on {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Home top widget spacing when hero is disabled or reordered */
#v-home> :first-child:not(.hero) {
  margin-top: 8px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 18px 0 20px;
  color: var(--fg);
}

.hero .l {
  font-size: 15px;
  opacity: 0.9;
  letter-spacing: -0.2px;
}

.hero .n {
  font-size: 58px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 4px 0 10px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.hero .n small {
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 99px;
  background: var(--chip);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  color: var(--fg);
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Quick Actions */
.acts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 4px 0 16px;
  text-align: center;
}

.acts button {
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

.acts button:hover {
  transform: translateY(-2px);
}

.acts i {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.acts svg {
  width: 22px;
  height: 22px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 6px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--mu);
  padding: 12px 0 2px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.row+.row {
  border-top: 1px solid var(--card2);
}

.ic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #10101a;
  flex: none;
}

.ic svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sp {
  flex: 1;
  min-width: 0;
}

.nm {
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nm a {
  color: inherit;
  text-decoration: none;
}

.nm a:hover {
  text-decoration: underline;
}

.mu {
  color: var(--mu);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rt {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.rt.hot {
  color: var(--hot);
  font-weight: 600;
}

.done .nm {
  color: var(--mu);
  text-decoration: line-through;
}

.cb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--mu);
  background: none;
  display: grid;
  place-items: center;
  color: transparent;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: all 0.2s ease;
}

.cb.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #06241b;
}

.more {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 0 10px;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  border-top: 1px solid var(--card2);
  cursor: pointer;
}

.more:hover {
  opacity: 0.8;
}

/* Chips */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -14px 12px;
  padding: 0 14px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 99px;
  border: 0;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.on {
  background: var(--fg);
  color: var(--bg);
}

/* Schedule / Days */
.cal-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 2px 0;
}

.cal-arrow-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: none;
}

.cal-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

.cal-arrow-btn:active {
  transform: scale(0.92);
}

.cal-arrow-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-today-pill {
  border: 1px solid rgba(169, 132, 255, 0.35);
  background: rgba(169, 132, 255, 0.15);
  color: var(--g1);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-block;
}

.btn-today-pill:hover {
  background: rgba(169, 132, 255, 0.28);
}

.days {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.d {
  width: 44px;
  padding: 8px 0 6px 0;
  border-radius: 22px;
  border: 0;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  flex: none;
}

.d:hover {
  background: rgba(255, 255, 255, 0.1);
}

.d small {
  display: block;
  font-size: 11px;
  color: var(--mu);
}

.d b {
  font-size: 16px;
  font-weight: 600;
}

.d.on {
  background: var(--fg);
  color: var(--bg);
}

.d.on small {
  color: var(--bg);
  opacity: 0.7;
}

.d.on .day-dot {
  background: var(--bg);
}

.day-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--g1);
  margin: 3px auto 0 auto;
}

.tm {
  width: 46px;
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.tm span {
  display: block;
  color: var(--mu);
  font-weight: 400;
  font-size: 12px;
}

.live {
  color: var(--ok);
}

/* Forms & Inputs in Export/Settings */
.inp-group {
  margin: 10px 0;
}

.inp-group label {
  display: block;
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 4px;
  font-weight: 500;
}

.inp-group input {
  width: 100%;
  height: 40px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.inp-group input:focus {
  border-color: var(--g1);
}

.btn-pill {
  width: 100%;
  padding: 12px;
  border-radius: 99px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, opacity 0.2s;
}

.btn-pill:hover {
  transform: translateY(-1px);
}

.btn-pill.sec {
  background: var(--card2);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Terminal in Logs */
.terminal {
  background: #09090b;
  border-radius: 20px;
  padding: 12px 14px;
  height: 260px;
  overflow-y: auto;
  font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #a1a1aa;
  word-break: break-all;
  white-space: pre-wrap;
  scrollbar-width: thin;
}

.terminal .t-strategy {
  color: #93c5fd;
  font-weight: 600;
}

.terminal .t-ok {
  color: #34d399;
  font-weight: 600;
}

.terminal .t-err {
  color: #f87171;
  font-weight: 600;
}

.terminal .t-time {
  color: #52525b;
}

/* Bottom Navigation Pill */
nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--nav);
  border-radius: 34px;
  padding: 6px;
  display: flex;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

nav button {
  width: 52px;
  height: 48px;
  border-radius: 24px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

nav svg {
  width: 22px;
  height: 22px;
  stroke: #b9b9c4;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

nav button.on {
  background: #fff;
}

nav button.on svg {
  stroke: #000;
}

/* Toast */
#toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: var(--fg);
  color: var(--bg);
  padding: 9px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Profile & Settings View */
.profile-avatar-big {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin: 4px auto 0 auto;
  box-shadow: 0 8px 24px rgba(169, 132, 255, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.profile-stat-box {
  background: var(--card);
  border-radius: 18px;
  padding: 12px 6px;
  text-align: center;
}

.profile-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
}

.profile-stat-label {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
}

.btn-back-pill {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-back-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  cursor: pointer;
}

.toggle-row+.toggle-row {
  border-top: 1px solid var(--card2);
}

.toggle-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

.toggle-sub {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: none;
}

.toggle-switch:checked {
  background: var(--g1);
}

.toggle-switch::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: #fff;
  transition: all 0.25s ease;
}

.toggle-switch:checked::before {
  transform: translateX(20px);
}

.select-clean {
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* Auth Screen — единый градиент как на главной и в макете */
body.auth-mode {
  background: var(--bg) linear-gradient(180deg, var(--g1), var(--g2) 52%, var(--bg)) top/100% 560px no-repeat;
}

body.auth-mode .auth-box {
  padding: 50px 0 24px;
}

body.auth-mode .auth-header {
  text-align: left;
  margin-bottom: 42px;
}

body.auth-mode .auth-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

body.auth-mode .auth-sub {
  font-size: 14px;
  color: var(--mu);
  line-height: 1.4;
}

body.auth-mode .auth-field {
  margin-bottom: 14px;
}

body.auth-mode .auth-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--mu);
  margin-bottom: 6px;
}

body.auth-mode .auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

body.auth-mode .auth-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

body.auth-mode .auth-input:focus {
  border-color: #2e4a80;
  box-shadow: 0 0 0 3px rgba(46, 74, 128, 0.22);
}

body.auth-mode .auth-btn {
  width: 100%;
  height: 48px;
  border-radius: 16px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  transition: all 0.15s ease;
}

body.auth-mode .auth-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

body.auth-mode .auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

body.auth-mode .auth-security-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--mu);
  line-height: 1.4;
}

/* Входы / Турникеты (Doors & ACS) */
.bar {
  height: 10px;
  border-radius: 5px;
  background: var(--card2);
  flex: 1;
  overflow: hidden;
  margin: 0 10px;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--g1), #6b4cff);
  transition: width 0.3s ease;
}

/* ==========================================================================
   Onboarding & Connect Services (Макет Авторизации)
   ========================================================================== */
#v-auth {
  display: none;
  flex-direction: column;
  height: 100%;
}

#v-auth.on {
  display: flex;
}

body:not(.auth-mode) #v-auth {
  display: none !important;
}

#v-auth .hero {
  text-align: center;
  padding: 36px 0 20px;
  color: var(--fg);
}

#v-auth .hero .title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 8px;
  color: var(--fg);
}

#v-auth .hero .desc {
  font-size: 15px;
  color: var(--mu);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.4;
}

.card-services {
  background: var(--card);
  border-radius: 28px;
  padding: 10px 18px;
  margin-bottom: 14px;
}

.service-btn {
  width: 100%;
  background: none;
  border: 0;
  color: var(--fg);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  font: inherit;
  cursor: pointer;
  transition: opacity .15s ease;
}

.service-btn:active {
  opacity: 0.7;
}

.service-btn+.service-btn {
  border-top: 1px solid var(--card2);
}

.status-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  transition: all .25s ease;
}

.status-badge.fail {
  background: var(--hot);
  color: #fff;
}

.status-badge.ok {
  background: var(--ok);
  color: #06241b;
}

.status-badge.warn {
  background: #f59e0b;
  color: #2b1d03;
}

.btn-check-pulse {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

[data-theme="light"] .btn-check-pulse {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4f46e5;
}

.btn-check-pulse:active {
  transform: scale(0.98);
  background: rgba(99, 102, 241, 0.22);
}

.pulse-check-box {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  transition: all .25s ease;
}

.pulse-check-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.pulse-check-box.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.pulse-check-box.loading {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--mu);
}

.status-badge svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sp {
  flex: 1;
  min-width: 0;
}

.nm {
  font-size: 17px;
  font-weight: 600;
}

.mu {
  color: var(--mu);
  font-size: 13px;
  margin-top: 2px;
}

.chevron svg {
  width: 20px;
  height: 20px;
  stroke: var(--mu);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-bar {
  margin-top: auto;
  padding: 16px 0 24px;
}

.btn-primary {
  width: 100%;
  height: 56px;
  border-radius: 28px;
  border: 0;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  width: 100%;
  height: 56px;
  border-radius: 28px;
  border: 1px solid var(--bd);
  background: var(--card2);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  box-sizing: border-box;
}

.btn-secondary:active {
  transform: scale(0.98);
  background: var(--card);
}

.btn-secondary:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}

/* Модальная форма логина (Sheet) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  border-radius: 32px 32px 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.btn-close {
  background: var(--card2);
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--mu);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.input-group {
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 13px;
  color: var(--mu);
  margin-bottom: 6px;
  margin-left: 4px;
}

.input-box {
  background: var(--card2);
  height: 50px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.input-box input {
  width: 100%;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
}

.input-box input::placeholder {
  color: var(--mu);
}

/* Поле для 2FA кода */
.code-input-box input {
  letter-spacing: 0.35em;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.step {
  display: none;
}

.step.active {
  display: block;
}

/* ==========================================================================
   Экран блокировки браузера (Telegram Mini App Only)
   ========================================================================== */
.browser-block {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 25%, rgba(42, 171, 238, 0.16) 0%, rgba(10, 11, 16, 0.98) 75%), #050608;
  z-index: 99999;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #fff;
  box-sizing: border-box;
}

.block-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(22, 24, 34, 0.9);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: 38px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.block-icon-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin-bottom: 22px;
}

.block-tg-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-tg-svg {
  width: 50px;
  height: 50px;
  fill: #fff;
}

.block-badge-lock {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1b1c24;
  border: 2px solid #2AABEE;
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-badge-lock svg {
  width: 18px;
  height: 18px;
  fill: #2AABEE;
}

.block-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: #fff;
}

.block-subtitle {
  font-size: 14.5px;
  line-height: 1.5;
  color: #a4a7b5;
  margin: 0 0 24px;
}

.block-subtitle b {
  color: #fff;
}

.block-guide-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #cfd2dc;
}

.guide-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(42, 171, 238, 0.2);
  color: #2AABEE;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-open-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.btn-open-tg:active {
  transform: scale(0.98);
}

.btn-open-tg svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

/* ==========================================================================
   Личный кабинет: Редизайн профиля, сервисов и настроек
   ========================================================================== */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 0 16px;
}

.profile-avatar-center {
  width: 76px;
  height: 76px;
  min-width: 76px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  margin: 0 auto;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

.profile-avatar-center img {
  width: 110%;
  height: 110%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name-center {
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.25;
  margin-top: 12px;
  text-align: center;
  letter-spacing: -0.02em;
}

/* Единый прямоугольный закругленный блок с почтой и юзом тг */
.profile-user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 7px 14px;
  margin-top: 10px;
  max-width: 100%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.profile-user-badge .badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--mu);
}

.profile-user-badge .badge-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.profile-user-badge .badge-tg span {
  color: #2AABEE;
  font-weight: 600;
}

.profile-user-badge .badge-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
}

.profile-user-badge .badge-icon {
  width: 14px;
  height: 14px;
  min-width: 14px;
  flex-shrink: 0;
}

.profile-user-badge .badge-email .badge-icon {
  stroke: var(--mu);
  stroke-width: 2;
  fill: none;
}

.profile-user-badge .badge-tg .badge-icon {
  fill: #2AABEE;
}

/* Светлая тема */
:root[data-theme="light"] .profile-user-badge {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .profile-user-badge .badge-divider {
  background: rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .profile-avatar-center {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(110, 80, 200, 0.25);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .profile-user-badge {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  :root:not([data-theme="dark"]) .profile-user-badge .badge-divider {
    background: rgba(0, 0, 0, 0.12);
  }

  :root:not([data-theme="dark"]) .profile-avatar-center {
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 24px rgba(110, 80, 200, 0.25);
  }
}

/* Сервисы МИРЭА */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.service-row-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card2);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon.sdo {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.service-icon.pulse {
  background: linear-gradient(135deg, #2AABEE 0%, #0284c7 100%);
}

.service-icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

.service-text {
  flex: 1;
  min-width: 0;
}

.service-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.service-sub {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-badge-connected {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
  background: rgba(31, 216, 164, 0.12);
  border: 1px solid rgba(31, 216, 164, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.btn-connect-service {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(169, 132, 255, 0.25);
  transition: transform 0.15s;
}

.btn-connect-service:active {
  transform: scale(0.94);
}

.btn-settings-full {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 0;
  cursor: pointer;
  text-align: left;
}

.btn-settings-full svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
  stroke: var(--g1);
  stroke-width: 2;
  fill: none;
}

.btn-settings-full .chevron-right {
  margin-left: auto;
  stroke: var(--mu);
  width: 18px;
  height: 18px;
}

/* Модальное окно настроек */
.settings-sheet {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-content {
  padding: 10px 0 24px;
}

.settings-group {
  background: var(--card2);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  margin-bottom: 16px;
}

.settings-group-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--mu);
  margin-bottom: 12px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  cursor: pointer;
}

.setting-item:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.setting-info {
  display: flex;
  flex-direction: column;
}

.setting-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.setting-sub {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}

/* Переключатель Switch (iOS toggle) */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 48px;
  height: 28px;
  min-width: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 0.25s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch:checked {
  background: var(--ok);
}

.switch:checked::after {
  transform: translateX(20px);
}

/* Theme picker */
.theme-picker-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 8px;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.theme-pill svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.theme-pill.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--g1);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-pill {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.12);
  color: #151326;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .theme-pill.active {
  background: #ffffff;
  border: 2px solid #7c3aed;
  color: #6d28d9;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.18);
}

.btn-danger-outline {
  width: 100%;
  background: rgba(255, 92, 122, 0.08);
  color: var(--hot);
  border: 1px solid rgba(255, 92, 122, 0.2);
  border-radius: 14px;
  padding: 13px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger-outline:active {
  background: rgba(255, 92, 122, 0.16);
}

/* ==========================================================================
   Модальное окно 3 вариантов подключения СДО
   ========================================================================== */
.sdo-sheet {
  max-height: 88vh;
  overflow-y: auto;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding-bottom: 28px;
}

.sdo-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sdo-option-card {
  background: var(--card2);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all .2s ease;
}

.sdo-opt-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sdo-opt-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdo-opt-icon.online,
.sdo-opt-icon.ical,
.sdo-opt-icon.ext {
  background: linear-gradient(to bottom right, rgba(60, 60, 60, 0.3), rgba(41, 37, 234, 0.08));
  color: var(--ac);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(31, 216, 164, 0.15);
}

.sdo-opt-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.sdo-opt-meta {
  flex: 1;
  min-width: 0;
}

.sdo-opt-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.sdo-opt-sub {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}

.sdo-opt-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--mu);
  white-space: nowrap;
}

.sdo-opt-status.connected {
  background: rgba(31, 216, 164, 0.2);
  color: var(--ok);
}

.sdo-opt-status.warn {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.sdo-opt-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sdo-opt-body {
  margin-top: 12px;
}

.btn-sdo-act {
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform .15s;
}

.btn-sdo-act:active {
  transform: scale(0.96);
}

.btn-sdo-disconnect {
  background: rgba(255, 107, 129, 0.15);
  color: var(--hot);
  border: 1px solid rgba(255, 107, 129, 0.3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
}

.btn-sdo-disconnect:active {
  transform: scale(0.96);
}

.sdo-help-text {
  font-size: 11.5px;
  color: var(--mu);
  line-height: 1.45;
  margin-top: 8px;
}

.ext-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ext-id-label {
  font-size: 12px;
  color: var(--mu);
}

.ext-id-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.5px;
}

.btn-copy-id {
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fg);
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}

.btn-copy-id:active {
  transform: scale(0.94);
}

/* ==========================================================================
   Расписание занятий (Schedule)
   ========================================================================== */
.sched-hero-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  padding: 6px 14px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: all .2s ease;
}

.sched-hero-group:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.15);
}

.sched-pill-edit {
  color: var(--mu);
  font-size: 11px;
  font-weight: 400;
}

/* Карточки пар */
.pair-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pair-card {
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, border-color .15s ease;
}

.pair-card:active {
  transform: scale(0.99);
}

.pair-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pair-time-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pair-bell {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.pair-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--mu);
}

.pair-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 8px;
  text-transform: capitalize;
}

.pair-type-badge.practice {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pair-type-badge.lecture {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pair-type-badge.lab,
.pair-type-badge.laboratory {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pair-type-badge.exam,
.pair-type-badge.credit,
.pair-type-badge.consultation,
.pair-type-badge.unknown {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.pair-subject {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--fg);
}

.pair-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.pair-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--mu);
}

.pair-meta-item svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Пустое состояние дня без пар */
.empty-day-card {
  text-align: center;
  padding: 36px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-day-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 4px;
}

.empty-day-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
}

.empty-day-sub {
  font-size: 13px;
  color: var(--mu);
  max-width: 280px;
  line-height: 1.4;
}

/* Выбор группы в расписании (если не выбрана) */
.sched-nogroup-card {
  text-align: center;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sched-nogroup-icon {
  font-size: 44px;
  line-height: 1;
}

.sched-nogroup-title {
  font-size: 18px;
  font-weight: 700;
}

.sched-nogroup-sub {
  font-size: 13px;
  color: var(--mu);
  max-width: 300px;
  line-height: 1.45;
}

.btn-select-group-act {
  background: var(--fg);
  color: var(--bg);
  border: 0;
  border-radius: 14px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: transform .15s ease;
}

.btn-select-group-act:active {
  transform: scale(0.96);
}

/* Список результатов поиска групп */
.group-sheet {
  max-height: 82vh;
  overflow-y: auto;
}

.group-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 4px;
}

.group-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all .15s ease;
}

.group-result-item:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}

.group-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.group-result-check {
  font-size: 14px;
  color: var(--ok);
  font-weight: 700;
}

/* ==========================================================================
   Переключатель режимов расписания (День / Неделя / Месяц)
   ========================================================================== */
.sched-view-switcher {
  display: inline-flex;
  background: var(--card2);
  padding: 4px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
  gap: 2px;
}

.sched-view-btn {
  background: transparent;
  border: 0;
  color: var(--mu);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all .2s ease;
}

.sched-view-btn.on {
  background: var(--fg);
  color: var(--bg);
}

.sched-view-btn.active {
  background: var(--fg);
  color: var(--bg);
}

/* Вкладки типов в поиске расписания */
.sched-type-tabs {
  display: flex;
  background: var(--card2);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 12px;
}

.sched-tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--mu);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s ease;
}

.sched-tab-btn.on {
  background: var(--fg);
  color: var(--bg);
}

/* Режим: Неделя */
.sched-week-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sched-week-day-block {
  background: var(--card2);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sched-week-day-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

/* Режим: Месяц */
.month-calendar-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.month-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  padding: 0 4px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.month-cell {
  aspect-ratio: 1;
  background: var(--card2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  transition: all .15s ease;
}

.month-cell:active {
  transform: scale(0.92);
}

.month-cell.empty {
  background: transparent;
  border: 0;
  cursor: default;
}

.month-cell.today {
  border-color: var(--hot);
  color: #ff859b;
}

.month-cell.selected {
  background: var(--fg);
  color: var(--bg);
}

.month-cell-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  position: absolute;
  bottom: 4px;
}

.month-cell.selected .month-cell-dot {
  background: var(--bg);
}

/* ==========================================================================
   Раздел БРС (Оценки и баллы в стиле PairX)
   ========================================================================== */
#v-grades {
  padding-top: 12px;
}

.grades-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.grades-summary-card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .grades-summary-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.grades-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mu);
}

.grades-summary-val {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--fg);
  margin: 6px 0;
}

.grades-summary-val small {
  font-size: 15px;
  font-weight: 600;
  color: var(--mu);
}

.grades-summary-sub {
  font-size: 11px;
  color: var(--mu);
  line-height: 1.3;
}

.attendance-forecast-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .attendance-forecast-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.attendance-forecast-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.attendance-forecast-icon {
  font-size: 20px;
  color: #f59e0b;
}

.attendance-forecast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}

.attendance-forecast-desc {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
}

/* Switch toggle */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
}

[data-theme="light"] .ios-switch-slider {
  background-color: rgba(0, 0, 0, 0.14);
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ios-switch input:checked+.ios-switch-slider {
  background-color: var(--accent);
}

.ios-switch input:checked+.ios-switch-slider:before {
  transform: translateX(18px);
}

.grades-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grade-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

[data-theme="light"] .grade-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.grade-card:active {
  transform: scale(0.985);
}

.grade-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.grade-subject-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--fg);
}

.grade-score-val {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--fg);
  white-space: nowrap;
}

.grade-score-val small {
  font-size: 13px;
  font-weight: 500;
  color: var(--mu);
}

.grade-score-sub {
  font-size: 12px;
  color: var(--mu);
  font-weight: 500;
}

.grade-progress-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

[data-theme="light"] .grade-progress-wrap {
  background: rgba(0, 0, 0, 0.06);
}

.grade-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

.grade-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--mu);
}

/* Детализация в Grade Modal */
.grade-sheet {
  max-height: 88vh;
  overflow-y: auto;
}

.grade-modal-score-hero {
  text-align: center;
  padding: 12px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.grade-modal-score-num {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.grade-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.grade-breakdown-item {
  background: var(--card2);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .grade-breakdown-item {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.grade-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.grade-edit-panel {
  margin-top: 16px;
  background: var(--card2);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="light"] .grade-edit-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.grade-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grade-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grade-edit-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--mu);
}

.grade-edit-field input {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

[data-theme="light"] .grade-edit-field input {
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.grade-edit-field input:focus {
  border-color: var(--accent);
}

.grade-btn-save {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease;
}

.grade-btn-save:active {
  opacity: 0.85;
}

.grade-btn-toggle-edit {
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--accent);
  padding: 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 14px;
  transition: background .15s ease;
}

[data-theme="light"] .grade-btn-toggle-edit {
  border: 1px dashed rgba(0, 0, 0, 0.2);
}

.grade-btn-toggle-edit:active {
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Сканер QR (QR Scanner Modal)
   ========================================================================== */
.qr-sheet {
  text-align: center;
}

.qr-modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 20px;
  gap: 16px;
}

.qr-viewfinder {
  position: relative;
  width: 140px;
  height: 140px;
  background: #0d0f17;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.qr-mockup-svg {
  width: 104px;
  height: 104px;
}

.qr-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid var(--g1);
  box-shadow: 0 0 10px rgba(169, 132, 255, 0.35);
}

.qr-corner.top-left {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 8px;
}

.qr-corner.top-right {
  top: 8px;
  right: 8px;
  border-left: 0;
  border-bottom: 0;
  border-top-right-radius: 8px;
}

.qr-corner.bottom-left {
  bottom: 8px;
  left: 8px;
  border-right: 0;
  border-top: 0;
  border-bottom-left-radius: 8px;
}

.qr-corner.bottom-right {
  bottom: 8px;
  right: 8px;
  border-left: 0;
  border-top: 0;
  border-bottom-right-radius: 8px;
}

.qr-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, var(--g1), #d4bfff, transparent);
  box-shadow: 0 0 10px var(--g1);
  animation: scanLaser 2s ease-in-out infinite alternate;
}

@keyframes scanLaser {
  0% {
    top: 10px;
  }

  100% {
    top: 126px;
  }
}

.qr-text-main {
  font-size: 14px;
  font-weight: 500;
  color: var(--mu);
  max-width: 280px;
  line-height: 1.4;
}

.qr-mode-wrap {
  width: 100%;
}

.qr-select-wrapper {
  position: relative;
  width: 100%;
}

.qr-mode-select {
  width: 100%;
  height: 48px;
  background: var(--card2);
  color: var(--fg);
  border: 1px solid var(--bd);
  border-radius: 16px;
  padding: 0 42px 0 16px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.qr-mode-select:focus {
  border-color: var(--g1);
  box-shadow: 0 0 0 2px rgba(169, 132, 255, 0.2);
}

.qr-select-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--mu);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-users-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card2);
  border: 1px solid var(--bd);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--g1);
  box-shadow: 0 0 8px var(--g1);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

.qr-friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.qr-friend-item:active {
  transform: scale(0.98);
}

.qr-friend-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qr-friend-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.qr-friend-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card2);
  color: var(--fg);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-friend-info {
  flex: 1;
  min-width: 0;
}

.qr-friend-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-friend-sub {
  font-size: 11px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-badge-ready {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ok);
  background: rgba(31, 216, 164, 0.12);
  border: 1px solid rgba(31, 216, 164, 0.25);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.pulse-badge-not-ready {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--mu);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.qr-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--bd);
  text-align: left;
  gap: 10px;
}

.qr-result-card.ok {
  border-color: rgba(31, 216, 164, 0.4);
  background: rgba(31, 216, 164, 0.08);
}

.qr-result-card.err {
  border-color: rgba(255, 92, 122, 0.35);
  background: rgba(255, 92, 122, 0.08);
}

.qr-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.qr-result-card.ok .qr-result-icon {
  background: rgba(31, 216, 164, 0.2);
  color: var(--ok);
}

.qr-result-card.err .qr-result-icon {
  background: rgba(255, 92, 122, 0.2);
  color: var(--err);
}

/* ==========================================================================
   Настройка быстрых кнопок в Settings (Интерактивное превью и карточки)
   ========================================================================== */
.quick-settings-preview-wrap {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

[data-theme="light"] .quick-settings-preview-wrap {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.quick-settings-preview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
  margin-bottom: 10px;
}

.quick-settings-preview-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 6px;
  justify-items: center;
}

.quick-preview-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.quick-preview-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: var(--fg);
}

[data-theme="light"] .quick-preview-icon {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quick-preview-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-preview-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68px;
}

.quick-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

[data-theme="light"] .quick-setting-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.quick-setting-card.inactive {
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.02);
}

.quick-setting-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.quick-setting-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: var(--fg);
}

[data-theme="light"] .quick-setting-badge {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quick-setting-badge svg {
  width: 22px;
  height: 22px;
  stroke: var(--fg);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-setting-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quick-setting-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-setting-desc {
  font-size: 12px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-setting-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.quick-reorder-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

[data-theme="light"] .quick-reorder-group {
  background: rgba(0, 0, 0, 0.06);
}

.btn-quick-reorder {
  background: none;
  border: 0;
  color: var(--fg);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-reorder:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.btn-quick-reorder:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-quick-reorder:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Анимация свайпа для карточки расписания */
.sched-day-card-wrap {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform, opacity;
}

.sched-day-card-wrap.swipe-left {
  animation: schedSwipeLeft 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sched-day-card-wrap.swipe-right {
  animation: schedSwipeRight 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes schedSwipeLeft {
  0% {
    transform: translateX(36px);
    opacity: 0.25;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes schedSwipeRight {
  0% {
    transform: translateX(-36px);
    opacity: 0.25;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Hero Carousel & 3 варианта на Главном экране (Часы, Дедлайн, След пара)
   ========================================================================== */
.hero-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hero-arrow-btn {
  background: none;
  border: 0;
  color: var(--fg);
  opacity: 0.45;
  font-size: 26px;
  line-height: 1;
  padding: 8px 6px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
  flex: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-arrow-btn:hover {
  opacity: 0.95;
  transform: scale(1.15);
}

.hero-arrow-btn:active {
  transform: scale(0.9);
}

.hero-content-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.hero-content-wrap .hero {
  margin-bottom: 0;
}

.hero-swipe-left {
  animation: heroSwipeLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-swipe-right {
  animation: heroSwipeRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroSwipeLeft {
  0% {
    transform: translateX(28px);
    opacity: 0.3;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes heroSwipeRight {
  0% {
    transform: translateX(-28px);
    opacity: 0.3;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.hero-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 6px 0 14px;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mu);
  opacity: 0.35;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 0;
  padding: 0;
}

.hero-dot.active {
  width: 18px;
  border-radius: 99px;
  background: var(--fg);
  opacity: 0.95;
}

/* ==========================================================================
   Светлая тема: Контрастные, сочные стили и адаптация всех элементов
   ========================================================================== */
[data-theme="light"] body {
  background: #f4f3fb linear-gradient(180deg, #d3c4fc 0%, #ece5fc 50%, #f4f3fb 100%) top/100% 520px no-repeat;
  color: #151326;
}

[data-theme="light"] .search {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.12);
  box-shadow: 0 3px 12px rgba(90, 70, 150, 0.08);
}

[data-theme="light"] .search input {
  color: #151326;
}

[data-theme="light"] .search input::placeholder {
  color: #686580;
}

[data-theme="light"] .search svg,
[data-theme="light"] .ib svg {
  stroke: #151326;
}

[data-theme="light"] .ib {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.12);
  box-shadow: 0 3px 12px rgba(90, 70, 150, 0.08);
}

[data-theme="light"] .hero {
  color: #151326;
}

[data-theme="light"] .hero .l {
  color: #3e3b56;
  opacity: 1;
  font-weight: 600;
}

[data-theme="light"] .hero .n {
  color: #151326;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .pill {
  background: #ffffff;
  color: #5b21b6;
  border: 1.5px solid rgba(124, 58, 237, 0.28);
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.12);
  font-weight: 600;
}

[data-theme="light"] .hero-arrow-btn {
  color: #151326;
  opacity: 0.65;
}

[data-theme="light"] .hero-arrow-btn:hover {
  opacity: 1;
  color: #7c3aed;
}

[data-theme="light"] .hero-dot {
  background: #7c3aed;
  opacity: 0.25;
}

[data-theme="light"] .hero-dot.active {
  background: #7c3aed;
  opacity: 1;
}

[data-theme="light"] .card {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 4px 18px rgba(80, 60, 140, 0.05);
}

[data-theme="light"] .card h3 {
  color: #151326;
}

[data-theme="light"] .row .nm {
  color: #151326;
}

[data-theme="light"] .row .mu {
  color: #686580;
}

[data-theme="light"] .row .rt {
  color: #8c89a0;
}

[data-theme="light"] .more {
  background: #f3effc;
  color: #5b21b6;
  border: 1px solid rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .more:active {
  background: #e9e2fa;
}

[data-theme="light"] .acts button {
  color: #151326;
  font-weight: 600;
}

[data-theme="light"] .acts i {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.09);
  box-shadow: 0 4px 14px rgba(90, 70, 150, 0.08);
}

[data-theme="light"] .acts svg {
  stroke: #151326;
}

[data-theme="light"] .sched-hero-group {
  background: #ffffff;
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #151326;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .sched-view-switcher {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .sched-view-btn {
  color: #686580;
}

[data-theme="light"] .sched-view-btn.active,
[data-theme="light"] .sched-view-btn.on {
  background: #7c3aed;
  color: #ffffff;
}

[data-theme="light"] .d {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  color: #151326;
}

[data-theme="light"] .d.on {
  background: #7c3aed;
  color: #ffffff;
}

[data-theme="light"] .d.on small {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .d.on .day-dot {
  background: #ffffff;
}

[data-theme="light"] .pair-card {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 2px 8px rgba(80, 60, 140, 0.04);
}

[data-theme="light"] .pair-subject {
  color: #151326;
}

[data-theme="light"] .pair-time {
  color: #151326;
}

[data-theme="light"] .pair-bell {
  color: #5b21b6;
  background: #f3effc;
}

[data-theme="light"] .btn-today-pill {
  background: #ffffff !important;
  color: #5b21b6 !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.1) !important;
}

[data-theme="light"] .cal-arrow-btn {
  color: #151326 !important;
}

[data-theme="light"] .modal-sheet {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.1);
  box-shadow: 0 -8px 30px rgba(50, 30, 90, 0.15);
  color: #151326;
}

[data-theme="light"] .modal-title {
  color: #151326;
}

[data-theme="light"] .btn-close {
  background: #f3effc;
  color: #151326;
}

[data-theme="light"] .settings-group-title {
  color: #5b21b6;
}

[data-theme="light"] .setting-label {
  color: #151326;
}

[data-theme="light"] .setting-sub {
  color: #686580;
}

[data-theme="light"] .grade-card-compact {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 2px 8px rgba(80, 60, 140, 0.04);
}

[data-theme="light"] .grade-title-text {
  color: #151326;
}

[data-theme="light"] .grade-total-val {
  color: #151326;
}

[data-theme="light"] .grade-stat-card {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 2px 8px rgba(80, 60, 140, 0.04);
}

[data-theme="light"] .grade-stat-val {
  color: #151326;
}

[data-theme="light"] .doors-stat-card {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
  box-shadow: 0 2px 8px rgba(80, 60, 140, 0.04);
}

[data-theme="light"] .doors-stat-val {
  color: #151326;
}

[data-theme="light"] .door-event-card {
  background: #ffffff;
  border: 1px solid rgba(21, 19, 38, 0.08);
}

[data-theme="light"] .door-event-title {
  color: #151326;
}

/* =========================================================================
   FRIENDS VIEW (Раздел "Друзья" - 1:1 по дизайну)
   ========================================================================= */
#v-friends {
  min-height: auto;
  padding: 6px 0 90px;
  background: transparent;
  color: var(--fg);
}

.friends-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.friends-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-friends-back {
  background: var(--chip);
  border: 0;
  color: var(--fg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
}

.btn-friends-back:active {
  transform: scale(0.92);
}

.friends-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.02em;
}

/* Hero Stats: 4 чел / 3 сейчас в университете */
.friends-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 6px 0 24px;
  text-align: center;
}

.friends-hero-count {
  font-size: 52px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.friends-hero-unit {
  font-size: 24px;
  font-weight: 600;
  color: var(--mu);
}

.friends-hero-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 24px;
  background: var(--chip);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid rgba(124, 58, 237, 0.28);
  color: var(--fg);
  font-family: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
  backdrop-filter: blur(8px);
}

/* Поле поиска / добавления с кнопкой + */
.friends-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.friends-search-box {
  flex: 1;
  height: 50px;
  background: var(--card);
  border: 1px solid var(--card2);
  border-radius: 25px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.friends-search-box:focus-within {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.friends-search-box .search-ic {
  color: var(--mu);
  flex-shrink: 0;
}

.friends-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 15px;
  width: 100%;
}

.friends-search-box input::placeholder {
  color: var(--mu);
}

.friends-btn-add {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, background-color 0.15s;
}

.friends-btn-add:active {
  transform: scale(0.92);
}

/* Фильтр-табы */
.friends-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 20px;
  scrollbar-width: none;
}

.friends-filter-row::-webkit-scrollbar {
  display: none;
}

.friend-pill {
  border: none;
  border-radius: 22px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--chip);
  color: var(--fg);
  border: 1px solid var(--card2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.friend-pill.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.friend-pill:active {
  transform: scale(0.96);
}

.pill-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Карточки секций */
.friends-section-card {
  background: var(--card);
  border: 1px solid var(--card2);
  border-radius: 24px;
  padding: 18px 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.friends-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mu);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  padding: 0 4px;
}

/* Список друзей и запросов */
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  gap: 12px;
}

.friend-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.friend-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.friend-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.friend-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid var(--card);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.friend-info {
  min-width: 0;
  flex: 1;
}

.friend-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.friend-status {
  font-size: 13px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status.online {
  color: #2dd4bf;
  font-weight: 600;
}

.friend-status.offline {
  color: var(--mu);
}

.friend-status.request-sub {
  color: var(--mu);
}

/* Кнопки действий справа */
.friend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-friend-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-friend-action:active {
  transform: scale(0.9);
}

.btn-friend-accept {
  background: #10b981;
  color: #042f1f;
  font-weight: 900;
  font-size: 18px;
}

.btn-friend-accept:active {
  background: #059669;
}

.btn-friend-star {
  font-size: 20px;
  color: #6b7280;
}

.btn-friend-star.active {
  color: #f59e0b;
}

.friends-empty-msg {
  text-align: center;
  color: #9ca3af;
  padding: 24px 12px;
  font-size: 14px;
}

/* =========================================================================
   ИНТЕРАКТИВНЫЙ ОНБОРДИНГ И ГАЙДЫ (FULLSCREEN)
   ========================================================================= */
#onboarding-modal {
  background: var(--card);
  backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  z-index: 999;
}

#onboarding-modal .onboarding-sheet {
  width: 100vw;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  margin: 0;
  padding: max(var(--top-bar-padding, 64px), calc(env(safe-area-inset-top, 0px) + 54px), 68px) 24px max(28px, env(safe-area-inset-bottom, 24px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  transform: none;
  transition: opacity 0.25s ease;
}

#onboarding-modal .modal-header {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

#onboarding-modal .modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

#onboarding-modal .btn-close {
  width: 36px;
  height: 36px;
  background: var(--card2);
  color: var(--fg);
  font-size: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bd);
  cursor: pointer;
  transition: all 0.2s ease;
}

#onboarding-modal .btn-close:active {
  transform: scale(0.92);
}

.onboarding-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 0;
}

.onboarding-cards-slider {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  margin: auto 0;
  width: 100%;
  padding: 10px 0;
}

.onboarding-slide {
  width: 100%;
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease;
  box-sizing: border-box;
}

.onboarding-slide.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.onboarding-badge-icon {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: var(--card2);
  border: 1.5px solid var(--bd);
  color: var(--fg);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.onboarding-badge-icon svg {
  width: 42px;
  height: 42px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-slide h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--fg);
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.onboarding-slide p {
  font-size: 15px;
  color: var(--mu);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 380px;
}

.btn-link-privacy {
  background: none;
  border: none;
  color: var(--ac);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  margin-top: 16px;
  cursor: pointer;
  padding: 6px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 20px 0 20px;
  flex-shrink: 0;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--card2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.ob-dot.active {
  width: 28px;
  background: var(--fg);
  border-radius: 4px;
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 4px;
  width: 100%;
  flex-shrink: 0;
}

.onboarding-actions button {
  height: 54px;
  border-radius: 27px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  padding: 0 20px;
  margin: 0;
  transition: all .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.onboarding-actions button:active {
  transform: scale(0.97);
}

.onboarding-actions #btn-ob-prev {
  background: var(--card2);
  color: var(--fg);
  border: 1px solid var(--bd);
  box-shadow: none;
}

.onboarding-actions #btn-ob-next {
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.onboarding-actions #btn-ob-next.btn-ob-finish {
  font-size: 15.5px;
  letter-spacing: -0.2px;
  padding: 0 16px;
}

/* =========================================================================
   ПОЛИТИКА КОНФИДЕНЦИАЛЬНОСТИ
   ========================================================================= */
.privacy-sheet {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.privacy-content {
  overflow-y: auto;
  padding: 10px 0 20px;
  line-height: 1.6;
}

.privacy-article h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  margin: 16px 0 6px;
}

.privacy-article h4:first-child {
  margin-top: 0;
}

.privacy-article p {
  font-size: 13px;
  color: var(--mu);
  margin-bottom: 8px;
}

.privacy-article ul {
  padding-left: 20px;
  font-size: 13px;
  color: var(--mu);
  margin-bottom: 12px;
}

.privacy-article li {
  margin-bottom: 6px;
}

/* =========================================================================
   НАСТРОЙКА ВИДЖЕТОВ ГЛАВНОГО ЭКРАНА
   ========================================================================= */
.btn-customize-home {
  width: 100%;
  padding: 14px 16px;
  background: var(--card);
  border: 1px dashed var(--bd);
  border-radius: 14px;
  color: var(--mu);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s ease;
}

.btn-customize-home:hover,
.btn-customize-home:active {
  border-color: var(--ac);
  color: var(--fg);
  background: var(--card2);
}

.widgets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.widget-config-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--bd);
  border-radius: 12px;
}

.widget-config-info {
  flex: 1;
  min-width: 0;
}

.widget-config-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}

.widget-config-desc {
  font-size: 12px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-config-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-widget-order {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--fg);
  font-size: 14px;
  cursor: pointer;
}

.btn-widget-order:disabled {
  opacity: 0.3;
  cursor: default;
}

/* =========================================================================
   НОВЫЕ ВИДЖЕТЫ ГЛАВНОГО ЭКРАНА
   ========================================================================= */
.widget-lesson-badge {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.widget-lesson-badge.ongoing {
  background: var(--card2);
  color: var(--g1);
  border: 1px solid rgba(169, 132, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.widget-lesson-badge.time {
  background: var(--card2);
  color: var(--mu);
  border: 1px solid var(--bd);
}

.widget-lesson-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--g1);
  box-shadow: 0 0 6px var(--g1);
  animation: pulseDot 1.5s infinite;
}

/* Карточки истории посещаемости */
.att-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--bd);
  border-radius: 14px;
  gap: 12px;
}

.att-history-item.ok {
  border-color: rgba(31, 216, 164, 0.25);
}

.att-history-item.err {
  border-color: rgba(255, 92, 122, 0.25);
}

.att-history-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-history-item.ok .att-history-icon {
  background: rgba(31, 216, 164, 0.15);
  color: var(--ok);
}

.att-history-item.err .att-history-icon {
  background: rgba(255, 92, 122, 0.15);
  color: var(--err);
}

.widget-grades-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.widget-grade-pill {
  background: var(--card2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.widget-grade-pill-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--fg);
}

.widget-grade-pill-label {
  font-size: 11px;
  color: var(--mu);
}

/* =========================================================================
   АДМИНИСТРАТИВНАЯ ПАНЕЛЬ (#v-admin)
   ========================================================================= */
#v-admin {
  padding-bottom: 90px;
}

.admin-banner {
  background: linear-gradient(135deg, rgba(31, 216, 164, 0.15) 0%, rgba(5, 150, 105, 0.08) 100%);
  border: 1px solid rgba(31, 216, 164, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-banner-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-shield-badge {
  background: #10b981;
  color: #042f1f;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.admin-nav-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 20px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 14px;
}

.admin-stat-num {
  font-size: 24px;
  font-weight: 900;
  color: var(--fg);
  line-height: 1.2;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--mu);
  margin-top: 4px;
}

.admin-search-box {
  margin-bottom: 12px;
}

.admin-user-card {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.admin-badge-ban {
  background: rgba(255, 92, 122, 0.2);
  color: var(--err);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 92, 122, 0.3);
}

.admin-badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.admin-user-details {
  font-size: 12px;
  color: var(--mu);
  line-height: 1.5;
}

.admin-user-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.admin-log-item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.admin-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.admin-log-action {
  font-weight: 700;
  color: var(--ac);
}

.admin-log-time {
  color: var(--mu);
  font-size: 11px;
}

.admin-sched-item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* =========================================================================
   ИНВАЙТЫ (Онбординг и Админ-панель)
   ========================================================================= */
.ob-invite-container {
  width: 100%;
  max-width: 360px;
  margin: 36px auto 0;
}

.ob-invite-status-msg.ok {
  color: var(--ok);
  background: rgba(31, 216, 164, 0.12);
  border: 1px solid rgba(31, 216, 164, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
}

.ob-invite-status-msg.err {
  color: var(--err);
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
}

.admin-invite-card {
  background: var(--card);
  border: 1px solid var(--card2);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.admin-invite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-invite-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--card2);
  padding: 6px 12px;
  border-radius: 12px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-badge-active {
  background: rgba(31, 216, 164, 0.15);
  color: var(--ok);
  border: 1px solid rgba(31, 216, 164, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.admin-badge-revoked {
  background: rgba(255, 92, 122, 0.15);
  color: var(--err);
  border: 1px solid rgba(255, 92, 122, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.admin-badge-expired {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.admin-badge-exhausted {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
}

.admin-invite-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12.5px;
  color: var(--mu);
  margin-bottom: 12px;
}

.admin-invite-details div b {
  color: var(--fg);
  display: block;
  font-size: 13px;
  margin-top: 2px;
}

.admin-invite-usages {
  border-top: 1px solid var(--card2);
  padding-top: 10px;
  margin-top: 10px;
}

.admin-invite-usages-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mu);
  margin-bottom: 8px;
}

.admin-invite-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed var(--card2);
}

.admin-invite-user-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   ФОНЫ И КАСТОМИЗАЦИЯ ТЕМЫ (MTASKS THEME & BACKGROUND PRESETS)
   ========================================================================== */

/* Dark Mode Backgrounds */
:root[data-theme="dark"] body[data-bg="default"],
body[data-bg="default"]:not([data-theme="light"]) {
  background: var(--bg) linear-gradient(180deg, #a984ff, #2a1470 52%, #000000) top/100% 560px no-repeat;
}

:root[data-theme="dark"] body[data-bg="cyber"] {
  background: #090615 linear-gradient(180deg, #00f2fe 0%, #4facfe 32%, #210d47 65%, #090615 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="dark"] body[data-bg="sunset"] {
  background: #0d0614 linear-gradient(180deg, #ff512f 0%, #dd2476 38%, #3b0933 68%, #0d0614 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="dark"] body[data-bg="emerald"] {
  background: #040f0c linear-gradient(180deg, #0ba360 0%, #3cba92 34%, #0d3829 68%, #040f0c 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="dark"] body[data-bg="crimson"] {
  background: #0e0307 linear-gradient(180deg, #ff0844 0%, #ffb199 30%, #420a1f 68%, #0e0307 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="dark"] body[data-bg="minimal"] {
  background: #0a0a0c linear-gradient(180deg, #373840 0%, #1e1f26 45%, #0a0a0c 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="dark"] body[data-bg="dots"] {
  background: radial-gradient(rgba(169, 132, 255, 0.45) 1.5px, transparent 1.5px) 0 0 / 20px 20px, linear-gradient(180deg, #1b0e3b 0%, #090314 100%) fixed !important;
}

:root[data-theme="dark"] body[data-bg="grid"] {
  background: linear-gradient(rgba(100, 160, 255, 0.20) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(100, 160, 255, 0.20) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(180deg, #0e1526 0%, #060913 100%) fixed !important;
}

:root[data-theme="dark"] body[data-bg="mesh"] {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cpath d='M14 0l14 8v16L14 32 0 24V8zM14 48l14-8V24L14 32 0 24v16z' fill='none' stroke='rgba(169,132,255,0.18)' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 28px 48px, linear-gradient(180deg, #160d2d 0%, #070311 100%) fixed !important;
}

:root[data-theme="dark"] body[data-bg="lines"] {
  background: repeating-linear-gradient(45deg, rgba(169, 132, 255, 0.08) 0, rgba(169, 132, 255, 0.08) 2px, transparent 0, transparent 14px), linear-gradient(180deg, #1d0f3d 0%, #070310 100%) fixed !important;
}

/* Light Mode Backgrounds */
:root[data-theme="light"] body[data-bg="default"] {
  background: var(--bg) linear-gradient(180deg, #c9bafc, #e8e1fb 52%, #f4f3fb) top/100% 560px no-repeat;
}

:root[data-theme="light"] body[data-bg="peach"] {
  background: #faf4f4 linear-gradient(180deg, #ffb199 0%, #ffcda5 38%, #faf4f4 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="light"] body[data-bg="mint"] {
  background: #f2f9f7 linear-gradient(180deg, #84fab0 0%, #8fd3f4 40%, #f2f9f7 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="light"] body[data-bg="sky"] {
  background: #f2f7fc linear-gradient(180deg, #90d5ff 0%, #bde4ff 40%, #f2f7fc 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="light"] body[data-bg="rose"] {
  background: #faf5f9 linear-gradient(180deg, #fbc2eb 0%, #a6c1ee 40%, #faf5f9 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="light"] body[data-bg="minimal"] {
  background: #f8fafc linear-gradient(180deg, #cbd5e1 0%, #e2e8f0 40%, #f8fafc 100%) top/100% 560px no-repeat !important;
}

:root[data-theme="light"] body[data-bg="dots"] {
  background: radial-gradient(rgba(100, 80, 160, 0.28) 1.5px, transparent 1.5px) 0 0 / 20px 20px, linear-gradient(180deg, #ede7fb 0%, #f6f3fd 100%) fixed !important;
}

:root[data-theme="light"] body[data-bg="grid"] {
  background: linear-gradient(rgba(70, 95, 175, 0.16) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(70, 95, 175, 0.16) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(180deg, #eef2ff 0%, #f7f9fe 100%) fixed !important;
}

:root[data-theme="light"] body[data-bg="mesh"] {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48' viewBox='0 0 28 48'%3E%3Cpath d='M14 0l14 8v16L14 32 0 24V8zM14 48l14-8V24L14 32 0 24v16z' fill='none' stroke='rgba(90,70,180,0.16)' stroke-width='1'/%3E%3C/svg%3E") 0 0 / 28px 48px, linear-gradient(180deg, #edf0fb 0%, #f8f9fe 100%) fixed !important;
}

:root[data-theme="light"] body[data-bg="lines"] {
  background: repeating-linear-gradient(45deg, rgba(110, 90, 190, 0.10) 0, rgba(110, 90, 190, 0.10) 2px, transparent 0, transparent 14px), linear-gradient(180deg, #ede8fc 0%, #f8f6fe 100%) fixed !important;
}

/* Кнопка перехода в кастомизацию из настроек */
.btn-customization-open-row {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-customization-open-row:active {
  transform: scale(0.98);
}

[data-theme="light"] .btn-customization-open-row {
  border-color: rgba(0, 0, 0, 0.08);
}

.customization-open-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(169, 132, 255, 0.3);
}

.customization-open-text {
  flex: 1;
  min-width: 0;
}

.customization-open-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fg);
}

.customization-open-sub {
  font-size: 11.5px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.customization-open-chevron {
  font-size: 18px;
  color: var(--mu);
  font-weight: 600;
}

/* Customization sheet & content */
.customization-sheet {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.customization-content {
  overflow-y: auto;
  padding: 0 2px 24px;
  -webkit-overflow-scrolling: touch;
}

/* Живой предпросмотр */
.customization-preview-card {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] .customization-preview-card {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 24px rgba(110, 80, 200, 0.12);
}

.custom-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.custom-preview-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(8px);
}

[data-theme="light"] .custom-preview-tag {
  background: rgba(0, 0, 0, 0.08);
  color: var(--fg);
}

.custom-preview-mode {
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  padding-left: 10px;
}

.custom-preview-body-mock {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-hero {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  backdrop-filter: blur(12px);
}

.mock-hero-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}

.mock-hero-sub {
  font-size: 11px;
  color: var(--mu);
  margin-top: 2px;
}

.mock-pills {
  display: flex;
  gap: 6px;
}

.mock-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 10px;
  background: var(--card2);
  color: var(--mu);
  border: 1px solid var(--bd);
}

.mock-pill.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Subtext & hints */
.customization-subtext {
  font-size: 12px;
  color: var(--mu);
  line-height: 1.4;
  margin-top: 8px;
}

/* Переключатель режима для настройки фона */
.custom-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.custom-target-mode-toggle {
  display: inline-flex;
  background: var(--card2);
  border-radius: 12px;
  padding: 3px;
  border: 1px solid var(--bd);
}

.target-mode-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.target-mode-btn.active {
  background: var(--card);
  color: var(--fg);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Список пресетов фонов */
.custom-bg-presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-bg-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card2);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.custom-bg-card:active {
  transform: scale(0.985);
}

.custom-bg-card.active {
  border-color: var(--g1);
  background: var(--card);
  box-shadow: 0 4px 16px rgba(169, 132, 255, 0.2);
}

.custom-bg-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .custom-bg-thumb {
  border-color: rgba(0, 0, 0, 0.1);
}

.custom-bg-info {
  flex: 1;
  min-width: 0;
}

.custom-bg-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-bg-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--fg);
}

.custom-bg-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--mu);
}

.custom-bg-card.active .custom-bg-badge {
  background: rgba(169, 132, 255, 0.2);
  color: var(--g1);
}

.custom-bg-desc {
  font-size: 11.5px;
  color: var(--mu);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-bg-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--mu);
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.custom-bg-card.active .custom-bg-check {
  border-color: var(--g1);
  background: var(--g1);
  color: #fff;
}

/* ==========================================================================
   ФУЛЛСКРИН СПЛЭШ-АНИМАЦИЯ ПРИ ЗАПУСКЕ MINIAPP (СТАРТОВАЯ, НЕ ПРИ ПЕРЕКЛЮЧЕНИИ)
   ========================================================================== */
#app-splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg, #000);
  color: var(--fg, #fff);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#app-splash.splash-hiding {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-ambient-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(169, 132, 255, 0.16) 0%, rgba(42, 20, 112, 0.08) 50%, transparent 75%);
  pointer-events: none;
  animation: splashPulseGlow 2.5s ease-in-out infinite alternate;
}

.splash-stage {
  position: relative;
  width: 280px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -30px;
}

.splash-pulse-ring {
  position: absolute;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 1.5px solid rgba(169, 132, 255, 0.4);
  animation: splashRingPulse 1.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}

/* Центральный логотип */
.splash-emblem {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--card, #1b1b1e);
  border: 1.5px solid rgba(169, 132, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 35px rgba(169, 132, 255, 0.25);
  z-index: 10;
  animation: splashPopIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.splash-m-logo {
  width: 44px;
  height: 44px;
  display: block;
}

.splash-brand {
  margin-top: 22px;
  text-align: center;
  position: relative;
  z-index: 12;
  animation: splashPopIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

.splash-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--fg, #ffffff);
  line-height: 1.1;
}

.splash-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--mu, #9a9aa3);
  margin-top: 4px;
}

/* Разлетающиеся иконки */
.splash-fly-icon {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transform: translate(0, 0) scale(0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  background: var(--card, #1b1b1e);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation-fill-mode: both;
  animation-duration: 0.75s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

/* Цвета и задержки для каждого направления */
.splash-fly-icon.ic-sched {
  color: #a984ff;
  background: rgba(169, 132, 255, 0.12);
  border-color: rgba(169, 132, 255, 0.35);
  animation-name: flySched;
  animation-delay: 0.12s;
}

.splash-fly-icon.ic-qr {
  color: #1fd8a4;
  background: rgba(31, 216, 164, 0.12);
  border-color: rgba(31, 216, 164, 0.35);
  animation-name: flyQr;
  animation-delay: 0.16s;
}

.splash-fly-icon.ic-pulse {
  color: #ffb347;
  background: rgba(255, 179, 71, 0.12);
  border-color: rgba(255, 179, 71, 0.35);
  animation-name: flyPulse;
  animation-delay: 0.20s;
}

.splash-fly-icon.ic-tasks {
  color: #ff6b81;
  background: rgba(255, 107, 129, 0.12);
  border-color: rgba(255, 107, 129, 0.35);
  animation-name: flyTasks;
  animation-delay: 0.24s;
}

.splash-fly-icon.ic-grades {
  color: #5cc8ff;
  background: rgba(92, 200, 255, 0.12);
  border-color: rgba(92, 200, 255, 0.35);
  animation-name: flyGrades;
  animation-delay: 0.28s;
}

.splash-fly-icon.ic-friends {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.35);
  animation-name: flyFriends;
  animation-delay: 0.32s;
}

/* Keyframes */
@keyframes splashPopIn {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes splashPulseGlow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

@keyframes splashRingPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes flySched {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(-105px, -85px) scale(1.08); opacity: 1; }
  100% { transform: translate(-98px, -78px) scale(1); opacity: 1; }
}
@keyframes flyQr {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(105px, -85px) scale(1.08); opacity: 1; }
  100% { transform: translate(98px, -78px) scale(1); opacity: 1; }
}
@keyframes flyPulse {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(128px, 6px) scale(1.08); opacity: 1; }
  100% { transform: translate(118px, 6px) scale(1); opacity: 1; }
}
@keyframes flyTasks {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(88px, 72px) scale(1.08); opacity: 1; }
  100% { transform: translate(80px, 64px) scale(1); opacity: 1; }
}
@keyframes flyGrades {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(-88px, 72px) scale(1.08); opacity: 1; }
  100% { transform: translate(-80px, 64px) scale(1); opacity: 1; }
}
@keyframes flyFriends {
  0% { transform: translate(0, 0) scale(0); opacity: 0; }
  70% { transform: translate(-128px, 6px) scale(1.08); opacity: 1; }
  100% { transform: translate(-118px, 6px) scale(1); opacity: 1; }
}