/* БРС 104 КПИБ: минималистичное оформление.
   Цвета заданы токенами в :root; тёмная тема — по настройкам системы. */

:root {
  /* светлая кремовая тема — по умолчанию */
  --bg: #f6f1e4;
  --surface: #fdfaf2;
  --fg: #2a2519;
  --muted: #6f6650;
  --faint: #aca38a;
  --line: #e5dcc6;
  --fill: #efe8d4;

  /* акцент и цвета точек логотипа (inline в разметке) */
  --accent: #2f54d8;
  --accent-soft: #eef2fd;
  --blue: #2f54d8;
  --red: #d64933;
  --yellow: #d9a520;
  --green: #2e8b57;

  /* статусы: приглушённые фоны и текст */
  --ok-bg: #e8f4ee; --ok-fg: #1f6b43;
  --warn-bg: #fbf3dc; --warn-fg: #7a5a0c;
  --bad-bg: #fbeae7; --bad-fg: #a33a28;

  --radius: 12px;
  --radius-sm: 8px;
  --font: "Google Sans", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04);
}

/* светлая тема — по умолчанию (не зависит от системы); тёмная включается переключателем */
:root[data-theme="dark"] {
  --bg: #111110;
  --surface: #181816;
  --fg: #ededeb;
  --muted: #9b9b96;
  --faint: #5f5f5b;
  --line: #2a2a27;
  --fill: #20201e;
  --accent: #7c9cff;
  --accent-soft: #1d2540;
  --blue: #7c9cff;
  --red: #ef7a66;
  --yellow: #e8b84a;
  --green: #5fbf8a;
  --ok-bg: #16281f; --ok-fg: #7ed3a5;
  --warn-bg: #2b2412; --warn-fg: #e8c060;
  --bad-bg: #2d1a16; --bad-fg: #f09a88;
  --shadow: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ---------- каркас ---------- */
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right, 0px)) 64px max(20px, env(safe-area-inset-left, 0px));
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }

h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.userbox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.userbox #me { color: var(--muted); font-size: 14px; }

.status {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
  min-height: 1.2em;
}

/* ---------- вкладки ---------- */
nav {
  display: flex;
  gap: 4px;
  margin: 22px 0 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }
nav button {
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
nav button:hover { color: var(--fg); }
nav button.on { color: var(--fg); border-bottom-color: var(--accent); }
nav button:disabled { opacity: .4; cursor: default; }

section[id^="t-"] { animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* ---------- текст и подсказки ---------- */
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.err-text { color: var(--bad-fg); }
.linkbtn {
  font: inherit;
  font-size: 13px;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}
.linkbtn:hover { color: var(--fg); }

/* ---------- кнопки ---------- */
.btn {
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity .15s, transform .05s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--line);
}
.btn.ghost:hover { background: var(--fill); opacity: 1; }

/* ---------- фокус (клавиатура) ---------- */
input, select, textarea, button, summary {
  outline-color: var(--accent);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- поля ---------- */
select, input, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
input[type="file"] { padding: 6px; font-size: 13px; }
.err { box-shadow: 0 0 0 2px var(--bad-fg) !important; border-color: var(--bad-fg) !important; }

/* ---------- карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow);
}

/* ---------- Итоги ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 14px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.thead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.thead h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.005em; }
.thead small { color: var(--faint); font-size: 12px; text-align: right; }

.nums { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nums b {
  font: 500 38px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.nums span { color: var(--muted); font-size: 13px; }
.nums span b { font-size: 15px; color: var(--fg); letter-spacing: 0; }

/* полоса прогресса: тонкая, без лишних деталей */
.bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--fill);
  overflow: hidden;
}
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.bar .f { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.bar .c { background: var(--accent); }
.bar .t {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--fg);
  opacity: .45;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.row b { color: var(--fg); font-weight: 600; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.p-ok { background: var(--ok-bg); color: var(--ok-fg); }
.p-warn { background: var(--warn-bg); color: var(--warn-fg); }
.p-bad { background: var(--bad-bg); color: var(--bad-fg); }

details.cfg summary,
details.more summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  list-style: none;
  user-select: none;
}
details.cfg summary::-webkit-details-marker,
details.more summary::-webkit-details-marker { display: none; }
details.cfg summary::before,
details.more summary::before { content: "+ "; color: var(--faint); }
details.cfg[open] summary::before,
details.more[open] summary::before { content: "− "; }
details.cfg summary:hover,
details.more summary:hover { color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.grid label,
.calc label,
.f2 label,
.edit label,
.authcard label,
.rep-opts label.col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- По дням ---------- */
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 0;
}
.c {
  display: inline-block;
  min-width: 32px;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.c.ok { background: var(--ok-bg); color: var(--ok-fg); }
.c.on { background: var(--warn-bg); color: var(--warn-fg); }
.c.miss { background: var(--bad-bg); color: var(--bad-fg); }
.c.plus { background: var(--accent-soft); color: var(--accent); }
.c.fut {
  min-width: 18px;
  height: 18px;
  padding: 0;
  border: 1px dashed var(--line);
  background: transparent;
  vertical-align: middle;
}
.bar .c { min-width: 0; padding: 0; border-radius: 0; }

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table.days {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-variant-numeric: tabular-nums;
}
.days th, .days td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
}
.days th {
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  position: sticky;
  top: 0;
  letter-spacing: 0.01em;
}
.days td:first-child, .days th:first-child { text-align: left; white-space: nowrap; }
.days tbody tr:hover td { background: var(--fill); }
.days tr.today td { background: var(--accent-soft); }
.days tr.sum td { font-weight: 600; background: var(--fill); }
.days tr:last-child td { border-bottom: 0; }

/* ---------- списки заявок ---------- */
.bar2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list li {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.list li:hover { background: var(--fill); }
.list li:last-child { border-bottom: 0; }
.list li.ed { flex-wrap: wrap; }
.list .t { min-width: 0; }
.list .t div { font-weight: 500; overflow-wrap: anywhere; }
.list .t small { color: var(--muted); font-size: 12.5px; }
.list .t small a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.list .r { display: flex; align-items: center; gap: 10px; flex: none; }
.list .r > b { font-family: var(--mono); font-size: 14px; color: var(--accent); font-weight: 500; }

.edit {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.edit .wide { grid-column: 1 / -1; }
.edit .chk {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
}
.edit .act { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* расчёт вручную */
.more {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.calc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  margin-top: 14px;
}
.big {
  font: 500 26px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Подать ---------- */
.seg {
  display: inline-flex;
  background: var(--fill);
  border-radius: 99px;
  padding: 3px;
  gap: 2px;
  align-self: flex-start;
}
.seg button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.seg button.on {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.f2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}
.f2 .wide { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.chips label:hover { border-color: var(--faint); }
.chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chips input { width: 15px; height: 15px; margin: 0; }
.chips .hint { display: inline; align-self: center; }
.f2 .chips label { flex-direction: row; font-size: 13px; }

.sendrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ---------- Отчёт ---------- */
.rep-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.rep-opts fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.rep-opts legend { font-size: 12px; color: var(--muted); padding: 0 6px; }
.rep-opts label { display: flex; gap: 9px; align-items: center; font-size: 14px; }
.rep-opts label.col { flex-direction: column; align-items: stretch; gap: 5px; font-size: 12px; color: var(--muted); }
.rep-who {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

/* ---------- правила ---------- */
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-top: 14px;
}
.rules table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rules td { border-bottom: 1px solid var(--line); padding: 7px 0; }
.rules td:last-child { text-align: right; padding-left: 10px; color: var(--muted); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 36px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

/* ---------- вход и смена пароля ---------- */
.auth {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.authcard { width: min(380px, 100%); gap: 16px; padding: 28px; }
.authh { font-size: 20px; margin: 0; font-weight: 600; letter-spacing: -0.015em; }
.authcard .sendrow { border-top: 0; padding-top: 4px; }
.authcard .btn { min-width: 110px; }
.showpw {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 13px !important;
  color: var(--muted) !important;
  cursor: pointer;
}
.showpw input { width: 15px; height: 15px; margin: 0; }

/* ---------- адаптив ---------- */
@media (max-width: 600px) {
  .wrap { padding: 20px 16px 48px; }
  nav button { padding: 10px 11px; }
  .card, .tile { padding: 16px; }
  .nums b { font-size: 32px; }
  .list li { flex-wrap: wrap; }
  .list .r { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- лендинг на экране входа: кафедра и факультет ---------- */
.auth.auth-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
  max-width: 1000px;
  min-height: 84vh;
  margin: 0 auto;
  padding: 40px 20px;
}
.auth-forms { display: flex; flex-direction: column; gap: 14px; }
.auth-landing .authcard { width: 100%; }

.landing { display: flex; flex-direction: column; gap: 18px; }
.emblem { width: 72px; height: auto; display: block; }
.landing-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.landing-title {
  margin: 0;
  font: 600 34px/1.2 var(--font);
  letter-spacing: -0.02em;
}
.landing-lead { margin: 0; color: var(--muted); font-size: 16px; max-width: 52ch; }
.landing-facts {
  margin: 8px 0 0;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.landing-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.landing-facts dt {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}
.landing-facts dd { margin: 0; font-size: 14px; }
.landing-facts a,
.landing-links a { color: var(--accent); }
.landing-links { margin: 0; font-size: 13px; color: var(--muted); }
.landing-links a { text-decoration: none; }
.landing-links a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .auth.auth-landing { grid-template-columns: 1fr; gap: 32px; padding: 24px 16px; min-height: 0; }
  .landing-title { font-size: 26px; }
  .landing-facts div { grid-template-columns: 1fr; gap: 2px; }
}
.landing { text-align: left; }

header.landing { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px; }


/* ---------- логотип факультета и название кафедры в шапке ---------- */
.brand { gap: 14px; }
.faculty-logo { width: 52px; height: 52px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text .dept {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.35;
}
@media (max-width: 600px) {
  .faculty-logo { width: 44px; height: 44px; }
  .brand-text .dept { font-size: 12px; }
}
.head-end { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.dept-logo { height: 64px; width: auto; display: block; }
@media (max-width: 600px) { .dept-logo { height: 48px; } .head-end { gap: 12px; } }

header > .brand { flex: 1 1 0; min-width: 0; }
.brand-text .dept { overflow-wrap: anywhere; }

.dept-logo { height: 72px; }

/* ---------- переключатель темы: плавающая кнопка внизу справа ---------- */
.theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .05s;
}
.theme-toggle:hover { background: var(--fill); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
@media print { .theme-toggle { display: none; } }

/* ---------- аккаунт: кнопка с аватаром и выпадающее меню ---------- */
.acct { position: relative; }
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .15s, border-color .15s;
}
.acct-btn:hover { background: var(--fill); }
.acct-btn[aria-expanded="true"] { border-color: var(--accent); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.acct-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.acct-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 20, 18, 0.10);
  padding: 6px;
  animation: fade .12s ease-out;
}
:root[data-theme="dark"] .acct-menu { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.acct-head { padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-head b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.acct-head .hint { font-size: 12px; }
.acct-menu button[role="menuitem"] {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  cursor: pointer;
}
.acct-menu button[role="menuitem"]:hover,
.acct-menu button[role="menuitem"]:focus-visible { background: var(--fill); outline: none; }
.acct-menu .danger { color: var(--bad-fg); }
.acct-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- диалог смены пароля ---------- */
.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  padding: 0;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(20, 20, 18, 0.18);
}
.dialog::backdrop { background: rgba(20, 20, 18, 0.35); }
.dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.dialog-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.dialog-body .showpw { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.dialog-body .sendrow { border-top: 0; padding-top: 2px; }
.dialog-actions { display: flex; gap: 8px; }

/* ---------- ближайшие занятия ---------- */
.upcoming {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.upcoming-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.upcoming-head h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -0.005em; }
.upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.upcoming-list li {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.upcoming-list li:first-child { border-top: 0; }
.up-date { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.up-subj { font-weight: 500; }
.upcoming-list .hint { text-align: right; font-size: 12.5px; }
.faint { color: var(--faint); }
@media (max-width: 600px) {
  .upcoming-list li { grid-template-columns: 90px 1fr; }
  .upcoming-list li .hint { grid-column: 1 / -1; text-align: left; }
  .acct-name { max-width: 110px; }
}

/* ---------- вход через Telegram ---------- */
.tgpanel { margin: 0 0 20px; gap: 12px; }
.tgpanel .thead { align-items: center; }
.tgpanel .sendrow { border-top: 0; padding-top: 4px; }
.tgtoggle { display: block; margin: 14px auto 0; }