:root {
  --brand: #0e7c86;
  --brand-deep: #0a5c64;
  --brand-soft: color-mix(in srgb, var(--brand) 14%, transparent);
  --ink: #15202b;
  --muted: #6b7785;
  --danger: #d53a3a;
  --warn: #c98500;
  --ok: #1f8a5b;
  --mail: #2f6fed;
  --kids: #0e7c86;
  --hot: #d53a3a;
  --today: #5b4fcf;
  --sched: #c45d1a;
  --cal: #1f8a5b;
  --assess: #db2777;
  --tasks: #0d9488;
  --tools: #455a64;
  --settings: #64748b;
  --bg: var(--tg-theme-bg-color, #eef3f5);
  --text: var(--tg-theme-text-color, var(--ink));
  --hint: var(--tg-theme-hint-color, var(--muted));
  --link: var(--tg-theme-link-color, var(--brand));
  --button: var(--tg-theme-button-color, var(--brand));
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --sec: var(--tg-theme-secondary-bg-color, #ffffff);
  /* Borders/controls derived from text so they stay visible in Telegram dark theme */
  --line: color-mix(in srgb, var(--text) 16%, transparent);
  --control-bg: color-mix(in srgb, var(--text) 8%, var(--sec));
  --control-border: color-mix(in srgb, var(--text) 28%, transparent);
  --radius: 16px;
  --shadow: 0 8px 24px color-mix(in srgb, #0a2a30 8%, transparent);
  --app-sat: var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --app-sab: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --app-sal: var(--tg-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --app-sar: var(--tg-safe-area-inset-right, env(safe-area-inset-right, 0px));
  --app-csat: var(--tg-content-safe-area-inset-top, 0px);
  --app-csab: var(--tg-content-safe-area-inset-bottom, 0px);
  --app-csal: var(--tg-content-safe-area-inset-left, 0px);
  --app-csar: var(--tg-content-safe-area-inset-right, 0px);
  --pad-top: calc(var(--app-sat) + var(--app-csat));
  --pad-bottom: calc(var(--app-sab) + var(--app-csab));
  --pad-left: calc(var(--app-sal) + var(--app-csal));
  --pad-right: calc(var(--app-sar) + var(--app-csar));
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(120% 80% at 0% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, color-mix(in srgb, #1f8a5b 10%, transparent), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
}
body.mini-app {
  overscroll-behavior-y: none;
}
body.mini-app .app-shell,
body.mini-app main {
  overscroll-behavior-y: contain;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--pad-left);
  padding-right: var(--pad-right);
  padding-bottom: calc(16px + var(--pad-bottom));
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: calc(10px + var(--pad-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top[hidden] { display: none !important; }
.top-text { min-width: 0; flex: 1; }
.top-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.top-sub {
  font-size: 13px;
  color: var(--hint);
  margin-top: 3px;
  min-height: 1.1em;
}

.icon-btn {
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.back-btn[hidden] { display: none !important; }
.top-help-btn {
  flex-shrink: 0;
  margin-top: 1px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 12px;
}
.top-help-btn[hidden] { display: none !important; }
.top-refresh-btn {
  flex-shrink: 0;
  margin-top: 1px;
}
.top-refresh-btn[hidden] { display: none !important; }
.top-refresh-btn.is-spinning svg {
  animation: top-refresh-spin 0.7s linear infinite;
}
@keyframes top-refresh-spin {
  to { transform: rotate(360deg); }
}

main {
  flex: 1;
  padding: 12px 16px 28px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
body.home-screen main {
  padding-top: calc(12px + var(--pad-top));
}

.muted { color: var(--hint); }
.error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--sec));
  border-radius: var(--radius);
  padding: 14px 16px;
}
.spinner {
  color: var(--hint);
  padding: 40px 0;
  text-align: center;
  font-weight: 600;
}
.content-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  padding: 28px 12px;
  color: var(--hint);
  font-weight: 650;
  text-align: center;
}
.content-busy-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  animation: home-pulse 1s ease-in-out infinite;
  flex: 0 0 auto;
}

/* —— Home —— */
.hero {
  background: linear-gradient(145deg, var(--brand-deep), var(--brand) 55%, #14919b);
  color: #fff;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: color-mix(in srgb, #fff 14%, transparent);
}
.hero-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 6px 0 4px;
  position: relative;
  z-index: 1;
}
.hero-sub {
  font-size: 14px;
  opacity: .9;
  position: relative;
  z-index: 1;
}
.hero-stats {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.stat-pill {
  background: color-mix(in srgb, #fff 16%, transparent);
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-head .linkish {
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 480px) {
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
}

.tile {
  appearance: none;
  border: 0;
  background: var(--sec);
  border-radius: 18px;
  padding: 14px 10px 12px;
  text-align: left;
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  cursor: pointer;
  transition: transform .12s ease;
}
.tile:active { transform: scale(.97); }
.tile-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
}
.tile-ico.mail { background: var(--mail); }
.tile-ico.kids { background: var(--kids); }
.tile-ico.assessment { background: var(--assess); }
.tile-ico.hot { background: var(--hot); }
.tile-ico.tasks { background: var(--tasks); }
.tile-ico.today { background: var(--today); }
.tile-ico.sched { background: var(--sched); }
.tile-ico.cal { background: var(--cal); }
.tile-ico.crm { background: #4f46e5; }
.tile-ico.incidents { background: #ea580c; }
.tile-ico.analytics { background: #7c3aed; }
.tile-ico.docs { background: #0f766e; }
.tile-ico.menu { background: #c2410c; }
.tile-ico.settings { background: var(--settings); }
.tile-ico.info { background: #536984; }
.tile-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.tile-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-item {
  background: var(--sec);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}
.feed-item:disabled {
  cursor: default;
  opacity: 1;
}
.feed-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.feed-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.feed-tag.hot { background: color-mix(in srgb, var(--hot) 14%, transparent); color: var(--hot); }
.feed-tag.mail { background: color-mix(in srgb, var(--mail) 14%, transparent); color: var(--mail); }
.feed-tag.cal { background: color-mix(in srgb, var(--cal) 14%, transparent); color: var(--cal); }
.feed-tag.chat { background: color-mix(in srgb, var(--tools) 14%, transparent); color: var(--tools); }
.feed-tag.db { background: color-mix(in srgb, var(--today) 14%, transparent); color: var(--today); }
.feed-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--hint);
  font-weight: 600;
}
.feed-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.feed-body {
  font-size: 13px;
  color: var(--hint);
  margin-top: 4px;
  line-height: 1.4;
}

.card {
  background: var(--sec);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.card.clickable { cursor: pointer; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 750; }
.card .meta { font-size: 13px; color: var(--hint); }
.card .body { font-size: 14px; margin-top: 8px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.row-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.row-line { font-size: 13px; color: var(--hint); margin-top: 3px; }

.section { margin-bottom: 18px; }
.section > h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--hint);
  margin: 0 0 8px;
  font-weight: 800;
}

.chip {
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.on {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
}
.chip.assess-attend-chip {
  border-color: color-mix(in srgb, #d97706 55%, var(--line));
  background: color-mix(in srgb, #d97706 14%, var(--sec));
  color: color-mix(in srgb, #fbbf24 70%, var(--text));
}
.chip.assess-attend-chip.on {
  background: color-mix(in srgb, #d97706 78%, #78350f);
  border-color: #d97706;
  color: #fff7ed;
}
.attend-week-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 10px;
}
.attend-week-label {
  font-weight: 700;
  font-size: 13px;
  min-width: 7.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.attend-table .attend-day {
  min-width: 48px;
  width: 52px;
  max-width: 56px;
  padding: 6px 4px;
  vertical-align: middle;
}
.attend-day-wd,
.attend-day-num {
  display: block;
  line-height: 1.2;
}
.attend-day-wd {
  font-size: 11px;
  color: var(--hint);
  font-weight: 650;
  text-transform: lowercase;
}
.attend-day-num {
  font-size: 12px;
  font-weight: 750;
}
.attend-mark {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  font-weight: 800;
  font-size: 15px;
  color: color-mix(in srgb, #f59e0b 80%, var(--text));
  border-radius: 8px;
}
.attend-mark:disabled {
  cursor: default;
  opacity: 0.85;
}
.attend-mark.on {
  background: color-mix(in srgb, #d97706 22%, transparent);
}
.attend-mark:not(:disabled):hover {
  background: color-mix(in srgb, #d97706 16%, transparent);
}
.attend-table thead th.attend-day {
  background: color-mix(in srgb, #d97706 12%, var(--sec));
}
.chip.on .level-dot {
  box-shadow: 0 0 0 1px color-mix(in srgb, #fff 40%, transparent);
}

.search {
  width: 100%;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.class-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.class-chips .chip {
  flex: 0 0 auto;
}

.kids-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--sec);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.folder-card:active {
  transform: scale(0.985);
}
.folder-ico {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #0f766e 22%, var(--sec));
  color: #2dd4bf;
}
.folder-ico svg {
  width: 22px;
  height: 22px;
}
.folder-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.folder-body .row-title {
  line-height: 1.25;
}
.folder-body .row-line {
  margin-top: 2px;
}
.folder-card .chev {
  color: var(--hint);
  font-size: 16px;
  flex: 0 0 auto;
}
.kids-card {
  margin-bottom: 0;
  padding: 14px 14px 12px;
  overflow: hidden;
}
.kids-card-main {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.kids-incident-btn {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}
.kids-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.kids-card-head .row-title {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  line-height: 1.35;
  padding-right: 4px;
}
.kids-card .row-line {
  margin-top: 6px;
  line-height: 1.35;
}

.class-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kids, var(--brand)) 22%, var(--sec));
  color: color-mix(in srgb, var(--kids, var(--brand)) 55%, var(--text));
  border: 1px solid color-mix(in srgb, var(--kids, var(--brand)) 28%, var(--line));
  white-space: nowrap;
  margin-left: 0;
}
.muted-pill {
  opacity: .55;
  background: color-mix(in srgb, var(--hint) 16%, var(--sec));
  color: var(--hint);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--button);
  color: var(--button-text);
  font-size: 14px;
  font-weight: 750;
  font-family: inherit;
}
.btn.ghost {
  background: var(--control-bg);
  color: var(--text);
  border: 1px solid var(--control-border);
}
.btn.ghost:active {
  background: color-mix(in srgb, var(--text) 14%, var(--sec));
}
.btn.danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.back {
  border: 0;
  background: none;
  color: var(--link);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 0 0 12px;
}

.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.flag.off { opacity: .4; }

.prio-high { color: var(--danger); font-weight: 800; }
.prio-medium { color: var(--warn); font-weight: 750; }

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--sec) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 6;
}
.tabs button {
  border: 0;
  background: none;
  color: var(--hint);
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 750;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tabs button .tab-ico { font-size: 16px; line-height: 1; }
.tabs button.active { color: var(--brand); }

.dl { font-size: 14px; }
.dl div { display: flex; gap: 8px; margin: 6px 0; }
.dl dt { color: var(--hint); min-width: 38%; font-weight: 650; }
.dl dd { margin: 0; flex: 1; font-weight: 650; white-space: pre-wrap; word-break: break-word; }

.child-card { margin-bottom: 12px; }
.child-parent {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hint);
}
.child-edit-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.child-edit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.child-edit-ico {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.child-edit-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.child-comments-card {
  margin-bottom: 12px;
}
.incidents-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 12px;
}
.incidents-toolbar .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.incidents-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.incident-card {
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
}
button.incident-card-compact {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--control-border);
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
}
button.incident-card-compact:active {
  transform: scale(0.99);
}
.incident-card-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.incident-conspect {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.incident-hints {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
}
.incident-open-hint {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 750;
  color: var(--link);
}
.incident-child {
  font-size: 14px;
  font-weight: 800;
}
.incident-meta {
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
}
.incident-comment {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.incident-action {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.incident-action-lab {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 4px;
}
.incident-atts {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.att-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.att-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line);
}
.att-item-main { min-width: 0; flex: 1 1 auto; }
.att-name {
  font-size: 13px;
  font-weight: 750;
  word-break: break-word;
}
.att-meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 650;
  color: var(--hint);
}
.att-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 0 0 auto;
  justify-content: flex-end;
}
.att-btn {
  padding: 6px 10px;
  min-height: 0;
  font-size: 12px;
}
.att-add {
  display: block;
  margin-top: 8px;
  cursor: pointer;
}
.att-add-btn {
  width: 100%;
  pointer-events: none;
}
.att-empty { margin-top: 4px; }
.att-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, #000 72%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.att-preview-panel {
  width: min(100%, 560px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.att-preview-img {
  width: 100%;
  max-height: calc(90vh - 52px);
  object-fit: contain;
  border-radius: 12px;
  background: #111;
}
.att-preview-close { align-self: flex-end; }
.incidents-pager {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.incidents-pager-lab {
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  color: var(--hint);
}
.incidents-pager .btn:disabled {
  opacity: .35;
}

/* —— Interactive list pager (CRM / kids) —— */
.pager {
  margin: 16px 0 8px;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, var(--sec)), var(--sec));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 6%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: pager-in .28s ease-out;
}
@keyframes pager-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.pager-solo {
  padding: 10px 12px;
  box-shadow: none;
}
.pager-meta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  letter-spacing: .01em;
}
.pager-range {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pager-total {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pager-sep { opacity: .75; }
.pager-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pager-nums {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  max-width: min(100%, 320px);
}
.pager-nav,
.pager-num {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  background: color-mix(in srgb, var(--text) 6%, var(--sec));
  color: var(--text);
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    transform .12s ease,
    background .15s ease,
    border-color .15s ease,
    color .15s ease,
    box-shadow .15s ease;
  touch-action: manipulation;
}
.pager-nav {
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  min-width: 42px;
}
.pager-nav:hover:not(:disabled),
.pager-num:hover:not(.on) {
  background: color-mix(in srgb, var(--brand) 14%, var(--sec));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--brand-deep);
  transform: translateY(-1px);
}
.pager-nav:active:not(:disabled),
.pager-num:active:not(.on) {
  transform: translateY(0) scale(.97);
}
.pager-num.on {
  background: linear-gradient(145deg, var(--brand-deep), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent);
  cursor: default;
}
.pager-nav:disabled {
  opacity: .32;
  cursor: default;
  transform: none;
}
.pager-gap {
  min-width: 22px;
  text-align: center;
  color: var(--hint);
  font-weight: 700;
  user-select: none;
}
@media (max-width: 420px) {
  .pager { padding: 10px; }
  .pager-nav, .pager-num {
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 13px;
  }
  .pager-nav { min-width: 38px; font-size: 20px; }
}

.inc-combo {
  position: relative;
}
.inc-picked {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inc-dd-clear {
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.inc-dd {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.inc-dd-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 10px 12px;
  cursor: pointer;
}
.inc-dd-item:last-child { border-bottom: 0; }
.inc-dd-item.on,
.inc-dd-item:active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.inc-dd-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.inc-dd-meta {
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
}
.inc-dd-empty {
  padding: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  text-align: center;
}
.inc-parts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}
.inc-part-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kids, var(--brand)) 16%, var(--sec));
  border: 1px solid color-mix(in srgb, var(--kids, var(--brand)) 24%, var(--line));
  font-size: 12px;
  font-weight: 700;
}
.inc-part-remove {
  border: 0;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.incident-participants {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
  line-height: 1.35;
}
.child-work {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.child-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  align-content: start;
}
.child-work-card {
  border: 1px solid var(--line);
  background: var(--sec);
  border-radius: 18px;
  padding: 14px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.child-actions {
  display: grid;
  gap: 8px;
  margin: 0;
}
.child-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  min-width: 0;
  max-width: 100%;
}
.child-field-lab {
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
}
.child-field-control {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}
input[type="date"].child-field-control,
input[type="datetime-local"].child-field-control,
input[type="time"].child-field-control {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.child-field-area {
  min-height: 84px;
  resize: vertical;
  line-height: 1.4;
}
.child-full-btn { width: 100%; }
.child-work-card.readonly {
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  text-align: center;
}
.child-work-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 12px;
}
.child-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.child-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.child-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.child-save-msg {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hint);
  text-align: center;
}
.child-save-msg.ok { color: var(--ok); }
.child-save-msg.err { color: var(--danger); }
.child-comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.child-comment-line {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.obs-list { display: grid; gap: 8px; }
.obs-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.obs-item-title { font-size: 14px; font-weight: 750; }
.obs-item-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
}
.obs-form {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.obs-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.obs-form-row > .child-field {
  margin-bottom: 0;
}
.obs-rebuild-btn {
  margin: 12px 0 14px;
}
.obs-day-card {
  margin: 12px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, var(--sec));
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.obs-day-head {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.obs-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
@media (max-width: 420px) {
  .obs-scores { grid-template-columns: minmax(0, 1fr); }
  .obs-form-row { grid-template-columns: minmax(0, 1fr); }
}
.obs-view .mail-body { white-space: pre-wrap; }

.menu-weeks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.menu-week-card { margin-bottom: 0; }
.menu-week-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.menu-gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-items: stretch;
}
.menu-day-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--sec);
  color: var(--text);
  border-radius: 16px;
  padding: 12px;
  font: inherit;
  cursor: pointer;
  min-width: 0;
}
.menu-day-card:hover {
  border-color: color-mix(in srgb, var(--accent, #2dd4bf) 45%, var(--line));
}
.menu-day-head {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.25;
}
.menu-day-thumb-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  aspect-ratio: 3 / 4;
  min-height: 140px;
}
.menu-day-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
}
.menu-day-thumb-ph[hidden],
.menu-day-thumb[hidden] {
  display: none !important;
}
.menu-day-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: top;
}
@media (min-width: 1100px) {
  .menu-gallery {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
body.web-browser .menu-gallery {
  gap: 14px;
}
body.web-browser .desk-menu-wrap {
  width: 100%;
  max-width: none;
}
body.web-browser .desk-menu-wrap .child-work-card,
body.web-browser .desk-menu-wrap .menu-create-card {
  max-width: none;
  width: 100%;
}
body.web-browser .menu-create-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px 20px;
  align-items: end;
}
body.web-browser .menu-create-card .child-work-label {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
body.web-browser .menu-create-card .child-field {
  margin: 0;
}
body.web-browser .menu-create-card .btn {
  width: auto;
  min-width: 200px;
  justify-self: start;
}
body.web-browser .menu-create-card .row-line,
body.web-browser .menu-create-card .child-save-msg {
  grid-column: 1 / -1;
}
body.web-browser .menu-weeks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  width: 100%;
}
body.web-browser .menu-week-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}
body.web-browser .menu-week-actions {
  margin-top: auto;
  padding-top: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  body.web-browser .menu-week-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.web-browser .menu-week-actions .btn {
    width: 100%;
  }
}
@media (max-width: 720px) {
  body.web-browser .menu-create-card {
    grid-template-columns: 1fr;
  }
  body.web-browser .menu-create-card .btn {
    width: 100%;
    min-width: 0;
  }
}
.btn.ghost.danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--sec));
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--control-border));
}
.att-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.att-preview-title {
  font-size: 14px;
  font-weight: 750;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.slot:last-child { border-bottom: 0; }
.slot-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-deep);
  line-height: 1.3;
}
.slot-title { font-size: 14px; font-weight: 700; }
.slot-day {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
}
button.slot-hit {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.slot-hit:active {
  opacity: 0.85;
}

.list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  background: var(--sec);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  cursor: pointer;
}
.list-link span.chev { color: var(--hint); }

.today-cta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--sec);
  border-radius: 18px;
  padding: 14px 16px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 0 var(--line);
}
.today-cta:active { transform: scale(.985); }
.today-cta-text { flex: 1; min-width: 0; }
.today-cta-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.today-cta-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--hint);
  font-weight: 600;
  line-height: 1.35;
}
.today-cta-go {
  flex-shrink: 0;
  background: var(--button);
  color: var(--button-text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}



.tile-ico svg { width: 20px; height: 20px; display: block; }
.tile-ico { color: #fff; }

.week-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 0 12px;
  -webkit-overflow-scrolling: touch;
}
.week-chip {
  flex: 1 0 auto;
  min-width: 56px;
  border: 1px solid var(--line);
  background: var(--sec);
  color: var(--text);
  border-radius: 14px;
  padding: 8px 6px;
  font-family: inherit;
  font-weight: 750;
  font-size: 12px;
  text-align: center;
}
.week-chip .d { display: block; font-size: 11px; color: var(--hint); font-weight: 650; margin-top: 2px; }
.week-chip.on {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
}
.week-chip.on .d { color: color-mix(in srgb, #fff 75%, transparent); }
.week-chip.today:not(.on) { border-color: var(--brand); }

.mail-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.mail-actions {
  display: grid;
  gap: 8px;
}
.mail-cta {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--button) 28%, transparent);
}
.mail-cta-secondary {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--mail) 55%, var(--control-border));
  background: var(--control-bg);
  color: color-mix(in srgb, var(--mail) 75%, var(--text));
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  padding: 10px 14px;
}
.mail-filters {
  display: grid;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.mail-filter-lab {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hint);
}
.mail-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--hint) 10%, var(--bg));
  border: 1px solid transparent;
}
.mail-seg-status {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: row;
}
.mail-seg-btn {
  border: 0;
  background: transparent;
  color: var(--hint);
  border-radius: 8px;
  min-height: 32px;
  padding: 6px 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}
.mail-seg-btn.on {
  background: var(--sec);
  color: var(--text);
  box-shadow: 0 1px 2px color-mix(in srgb, #000 18%, transparent);
  border: 1px solid var(--line);
}
.mail-compose {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.mail-compose-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.mail-to-area {
  min-height: 64px;
  resize: vertical;
  line-height: 1.35;
  font-weight: 550;
}
.mail-body-area {
  min-height: 180px;
  height: 180px;
  resize: vertical;
  line-height: 1.45;
  font-weight: 550;
}
.mail-selected-count {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mail) 12%, transparent);
  font-size: 13px;
  font-weight: 650;
}
.mail-compose-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.mail-rcpt-box {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.mail-rcpt-chips {
  margin-top: 8px;
  max-height: 72px;
  overflow: auto;
}
.mail-rcpt-bulk {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.mail-rcpt-bulk .btn {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 13px;
}
.mail-rcpt-list {
  margin-top: 10px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.mail-rcpt-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.mail-rcpt-item:last-child { border-bottom: 0; }
.mail-rcpt-item.on {
  background: color-mix(in srgb, var(--mail) 14%, transparent);
}
.mail-rcpt-check {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--mail);
  background: var(--sec);
}
.mail-rcpt-item.on .mail-rcpt-check {
  border-color: var(--mail);
  background: color-mix(in srgb, var(--mail) 18%, var(--sec));
}
.mail-rcpt-meta { min-width: 0; display: grid; gap: 2px; }
.mail-rcpt-title {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}
.mail-rcpt-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--hint);
  word-break: break-word;
}

.reply-box {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  background: var(--sec);
  color: var(--text);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  resize: vertical;
}

body.reply-open .app-shell {
  padding-bottom: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.reply-open main {
  padding: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.reply-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px - var(--pad-top));
  padding: 0 0 calc(8px + var(--pad-bottom));
}
.reply-head {
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.reply-screen .reply-box {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 16px;
  margin: 0;
}
.reply-actions {
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + var(--pad-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--sec) 94%, transparent);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reply-actions-row {
  display: flex;
  gap: 8px;
}
.reply-actions-row .btn {
  flex: 1;
}
.reply-cancel {
  width: 100%;
}
.mail-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-weight: 600;
}
.mail-link {
  color: var(--link);
  text-decoration: underline;
  word-break: break-all;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
@media (min-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
}
.kpi-card {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
}
.kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
}
.kpi-lab {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
}
.bar-row { margin: 0 0 12px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, var(--sec));
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
}
.conv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.conv-pill {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.conv-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-deep);
}
.conv-lab {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  line-height: 1.3;
}
.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 650;
}
.stat-line:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-line:first-child { padding-top: 0; }
.doc-snip {
  margin-top: 6px !important;
  font-size: 12px !important;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ask-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--sec);
  color: var(--hint);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 4px 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ask-bar:active { transform: scale(.985); }
.ask-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand-deep);
  flex: 0 0 auto;
}
.ask-ico svg { width: 20px; height: 20px; }
.ask-text { flex: 1; min-width: 0; }

body.chat-open {
  background: var(--tg-theme-secondary-bg-color, #dbe4ea);
}
body.chat-open .app-shell {
  padding-bottom: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.chat-open main {
  padding: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
body.chat-open .top {
  background: color-mix(in srgb, var(--sec) 92%, transparent);
}

.chat-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 64px - var(--pad-top));
}
.chat-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 6px 14px 0;
}
.chat-reset {
  border: 0;
  background: transparent;
  color: var(--hint);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 4px;
}
.chat-reset:disabled { opacity: .45; }
.chat-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty {
  margin: auto 12px;
  text-align: center;
  padding: 24px 12px;
  color: var(--hint);
}
.chat-empty-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.chat-empty-sub {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}
.bubble {
  max-width: min(88%, 520px);
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 600;
  word-break: break-word;
  box-shadow: 0 1px 0 color-mix(in srgb, #000 6%, transparent);
}
.bubble.me {
  align-self: flex-end;
  background: var(--button);
  color: var(--button-text);
  border-bottom-right-radius: 6px;
}
.bubble.bot {
  align-self: flex-start;
  background: var(--sec);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.bubble-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  padding: 1px 4px;
  border-radius: 4px;
}
.bubble.me .bubble-text code {
  background: color-mix(in srgb, #fff 18%, transparent);
}
.bubble.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
}
.bubble.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hint);
  opacity: .55;
  animation: chat-dot 1.2s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: .15s; }
.bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-3px); opacity: .9; }
}
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px calc(10px + var(--pad-bottom));
  background: color-mix(in srgb, var(--sec) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 18px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.chat-input:disabled { opacity: .65; }
.chat-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--button);
  color: var(--button-text);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}
.chat-send svg { width: 20px; height: 20px; margin-left: 2px; }
.chat-send:disabled { opacity: .45; }

.settings-card { padding: 12px 14px; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toggle-text { flex: 1; min-width: 0; }
.toggle {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 0;
  background: color-mix(in srgb, var(--hint) 35%, var(--sec));
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  transition: background .15s ease;
}
.toggle.on { background: var(--brand); }
.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px color-mix(in srgb, #000 25%, transparent);
  transition: transform .15s ease;
}
.toggle.on .toggle-knob { transform: translateX(20px); }
.toggle:disabled { opacity: .5; }

.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: 0; padding-bottom: 0; }
.user-main { flex: 1; min-width: 0; text-align: left; }
button.user-open {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.role-select {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  max-width: 118px;
}
.access-matrix {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.access-row {
  min-width: 0;
}
.access-row-lab {
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
}
.access-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.access-lv {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.access-lv.on {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
}
.settings-access {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-access-head {
  margin: 0;
}
.settings-access-card {
  overflow: visible;
}
.settings-access-card > .child-work-label:first-child {
  margin-top: 0;
}
.settings-bind {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.settings-bind-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.settings-bind-block .child-work-label {
  margin: 0;
}
.settings-bind-chips {
  margin: 0;
  gap: 8px;
}
.settings-bind-chips .chip {
  cursor: pointer;
  line-height: 1.2;
}
.settings-bind-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--hint);
  font-weight: 600;
}
.danger-btn {
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
}
.danger-btn:disabled { opacity: .35; }
.add-user-card { margin-top: 10px; }
.add-user-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.add-user-form .add-user-id {
  margin: 0;
  grid-column: 1 / -1;
}
.add-user-form .role-select { max-width: none; }
.btn-primary {
  border: 0;
  background: var(--button);
  color: var(--button-text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}
.btn-primary:disabled { opacity: .5; }
.settings-flash {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
  line-height: 1.35;
}

.info-lead { margin-bottom: 12px; }
.info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-item { margin: 0; padding: 14px; }
.info-steps {
  margin: 10px 0 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text);
}
.info-steps li::marker {
  font-weight: 800;
  color: var(--brand);
}
.info-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.doc-meta-card { margin-bottom: 10px; }
.doc-send-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.doc-send-btn { width: 100%; }
.sheet-switcher {
  position: sticky;
  top: calc(58px + var(--pad-top));
  z-index: 3;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--sec) 92%, transparent);
  backdrop-filter: blur(10px);
}
.sheet-switcher.single {
  padding: 10px 12px;
}
.sheet-switcher-top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.sheet-switcher-label {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hint);
}
.sheet-nav-btn {
  min-width: 44px;
  padding: 8px 0;
  font-size: 16px;
  font-weight: 800;
}
.sheet-nav-btn:disabled {
  opacity: .35;
}
.sheet-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  margin-bottom: 8px;
}
.sheet-tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-tab.on {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
}
.sheet-current-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}
.sheet-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sec);
  max-height: min(70vh, 560px);
}
.sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12.5px;
  font-weight: 600;
}
.sheet-table th,
.sheet-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  max-width: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}
.sheet-table th {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--brand) 12%, var(--sec));
  color: var(--text);
  font-weight: 800;
  z-index: 1;
}
.sheet-table tr:nth-child(even) td {
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.sheet-text { margin: 0; }

.slide-deck { display: flex; flex-direction: column; gap: 12px; }
.slide-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand-deep) 88%, #000), var(--brand));
  color: #fff;
  border-radius: 18px;
  padding: 22px 18px 20px;
  min-height: 280px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.slide-num {
  font-size: 12px;
  font-weight: 700;
  opacity: .75;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.slide-title {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.slide-body {
  margin-top: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slide-line {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
  opacity: .95;
}
.slide-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slide-btn {
  flex: 0 0 auto;
  padding: 10px 12px;
  font-size: 13px;
}
.slide-btn:disabled { opacity: .4; }
.slide-dots {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-height: 36px;
  overflow: hidden;
}
.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: color-mix(in srgb, var(--hint) 45%, transparent);
}
.slide-dot.on { background: var(--brand); transform: scale(1.25); }

.home-today-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 8px;
  color: var(--hint);
  font-weight: 650;
}
.home-today-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  animation: home-pulse 1s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes home-pulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}
.home-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.home-kpi {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 750;
  background: var(--sec);
  border: 1px solid var(--line);
  color: var(--text);
}
.home-today-block { margin-bottom: 10px; }
.home-today-actions {
  margin: 0 0 10px;
}
.home-today-lab {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--hint);
  margin: 0 0 6px 2px;
}
.home-today-item { margin-bottom: 8px; }
.home-today-item:last-child { margin-bottom: 0; }

.digest-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.digest-topic {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 6%, var(--sec));
  border: 1px solid var(--control-border);
}
.digest-chat-card,
.digest-db-card {
  margin-bottom: 8px;
}
.digest-chat-card:last-child,
.digest-db-card:last-child {
  margin-bottom: 0;
}
.digest-chat-summary {
  margin-top: 4px;
  line-height: 1.4;
  white-space: normal;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 12px;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cal-toolbar .chips { margin: 0; }
.cal-toolbar .btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.cal-ev {
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}
.cal-ev-head { margin-bottom: 8px; }
.cal-ev-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.cal-ev-when {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal) 16%, transparent);
  color: color-mix(in srgb, var(--cal) 70%, var(--text));
  font-size: 12px;
  font-weight: 750;
}
.cal-ev-loc {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  line-height: 1.35;
}
.cal-ev-desc {
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 72%, var(--sec));
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.cal-ev-link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.cal-ev-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cal-ev-btn {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 750;
}
.cal-form {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.cal-form-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.cal-form-check {
  margin: 4px 0 12px;
}
.cal-form-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 380px) {
  .cal-form-times { grid-template-columns: 1fr; }
}
.cal-desc-area {
  min-height: 220px;
  height: 220px;
  resize: vertical;
  line-height: 1.45;
  font-weight: 550;
}
.cal-form-actions {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.cal-nav-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  text-align: center;
  flex: 1;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 8px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--hint);
  text-transform: uppercase;
  padding: 4px 0 8px;
}
.cal-cell {
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  min-height: 36px;
  min-width: 0;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.cal-cell.empty { pointer-events: none; }
.cal-cell.today {
  box-shadow: inset 0 0 0 1.5px var(--brand);
}
.cal-cell.sel {
  background: var(--button);
  color: var(--button-text);
}
.cal-cell.has:not(.sel) {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.cal-daynum { line-height: 1; }
.cal-dot {
  font-size: 9px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--brand);
  font-weight: 900;
}
.cal-cell.sel .cal-dot { color: color-mix(in srgb, #fff 85%, transparent); }


.hot-reply {
  white-space: pre-wrap;
  font: inherit;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--sec);
  border: 1px solid var(--line);
}

.hot-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.hot-sum-card {
  background: var(--sec);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.hot-sum-card.urg {
  background: color-mix(in srgb, var(--danger) 12%, var(--sec));
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.hot-sum-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hot-sum-card.urg .hot-sum-val { color: var(--danger); }
.hot-sum-lab {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hot-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--sec);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hot-card:active { transform: scale(.985); }
.hot-card.mini { margin-bottom: 8px; }
.hot-card-accent {
  width: 5px;
  flex: 0 0 auto;
  background: var(--warn);
}
.hot-card.prio-high .hot-card-accent { background: var(--danger); }
.hot-card.prio-medium .hot-card-accent { background: var(--warn); }
.hot-card.prio-low .hot-card-accent { background: var(--ok); }
.hot-card-body {
  flex: 1;
  min-width: 0;
  padding: 12px 10px 12px 12px;
}
.hot-card-chev {
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: var(--hint);
  font-weight: 700;
}
.hot-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
  background: color-mix(in srgb, var(--hint) 14%, transparent);
  color: var(--hint);
}
.hot-badge.prio {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
}
.hot-card.prio-high .hot-badge.prio,
.hot-detail.prio-high .hot-badge.prio {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
}
.hot-badge.kind-conflict {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: #ff8a8a;
}
.hot-badge.kind-unanswered {
  background: color-mix(in srgb, #2f6fed 16%, transparent);
  color: #8bb4ff;
}
.hot-badge.kind-action {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: #5fd0d8;
}
.hot-badge.src { opacity: .9; }
.hot-card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.hot-card-reason {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hint);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-card-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
}
.hot-who.on { color: var(--ok); }
.hot-who.miss { color: var(--danger); }

.hot-detail {
  border: 1px solid var(--line);
  background: var(--sec);
  border-radius: 18px;
  overflow: hidden;
  border-left: 5px solid var(--warn);
  margin-bottom: 12px;
}
.hot-detail.prio-high { border-left-color: var(--danger); }
.hot-detail.prio-low { border-left-color: var(--ok); }
.hot-detail-head { padding: 14px 14px 8px; }
.hot-detail-chat {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}
.hot-block {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.hot-block h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--hint);
}
.hot-block p {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}
.hot-block.action {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.hot-work {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hot-work-card {
  border: 1px solid var(--line);
  background: var(--sec);
  border-radius: 18px;
  padding: 14px;
}
.hot-work-card.done {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
  background: color-mix(in srgb, var(--ok) 6%, var(--sec));
}
.hot-work-card.readonly {
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  text-align: center;
}
.hot-work-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 12px;
}
.hot-assignee-status {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  margin-bottom: 12px;
}
.hot-assignee-status.on {
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}
.hot-assignee-status.sug {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.hot-assignee-status.off {
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}
.hot-assignee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  flex-shrink: 0;
}
.hot-assignee-status.on .hot-assignee-avatar { background: var(--ok); }
.hot-assignee-status.off .hot-assignee-avatar { background: var(--warn); }
.hot-assignee-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}
.hot-assignee-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
  line-height: 1.3;
}
.hot-suggest-btn {
  width: 100%;
  margin-bottom: 12px;
}
.hot-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.hot-field-lab {
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
}
.hot-field-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}
.hot-field-area {
  min-height: 84px;
  resize: vertical;
  line-height: 1.4;
}
.hot-full-btn { width: 100%; }
.hot-comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hot-comments-empty {
  padding: 14px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  text-align: center;
}
.hot-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.hot-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: color-mix(in srgb, var(--brand) 75%, #15202b);
  flex-shrink: 0;
}
.hot-comment-main {
  flex: 1;
  min-width: 0;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-radius: 12px;
  padding: 8px 10px;
}
.hot-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 3px;
}
.hot-comment-who {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
}
.hot-comment-when {
  font-size: 11px;
  font-weight: 650;
  color: var(--hint);
}
.hot-comment-text {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.hot-done-hint {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--hint);
  line-height: 1.35;
}
.hot-person-lab {
  display: block;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
.hot-person-lab .hot-select {
  display: block;
  width: 100%;
  margin-top: 6px;
}
.mail-row-sub {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  margin-bottom: 4px;
}
.mail-row-who,
.mail-row-meta {
  font-size: 13px;
  color: var(--hint);
  font-weight: 650;
  line-height: 1.35;
}
.mail-row-who { margin-bottom: 2px; }


/* —— Browser theme (match Telegram Mini App dark UI) —— */
body.web-browser {
  color-scheme: dark;
  --bg: #0f172a;
  --text: #f8fafc;
  --hint: #94a3b8;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --sec: #1e293b;
  --line: rgba(148, 163, 184, 0.16);
  --control-bg: rgba(148, 163, 184, 0.1);
  --control-border: rgba(148, 163, 184, 0.28);
  --link: #2dd4bf;
  --button: #0e7c86;
  --button-text: #ffffff;
  --brand-soft: rgba(14, 124, 134, 0.24);
  --shadow: 0 10px 28px rgba(2, 8, 23, 0.45);
  background:
    radial-gradient(120% 80% at 0% -10%, rgba(14, 124, 134, 0.22), transparent 55%),
    radial-gradient(90% 60% at 100% 0%, rgba(31, 138, 91, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
}
body.web-browser .app-shell {
  max-width: none;
  width: 100%;
  margin: 0;
}
body.web-browser .top {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding-left: max(24px, var(--pad-left));
  padding-right: max(24px, var(--pad-right));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
}
body.web-browser .ask-ico {
  color: #5eead4;
  background: rgba(14, 124, 134, 0.28);
}
body.web-browser main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 28px 48px;
}
body.web-browser .feed-tag {
  color: #5eead4;
}
body.web-browser .chip.on,
body.web-browser .btn-primary,
body.web-browser .access-lv.on {
  color: #fff;
}

/* Desktop home dashboard */
.home-desk {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.home-desk-top,
.home-desk-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: stretch;
}
.home-desk-top .hero {
  margin-bottom: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 22px;
}
.home-desk-top .hero-title {
  font-size: 28px;
}
.ask-bar-desk {
  margin: 0;
  height: auto;
  min-height: 112px;
  border-radius: 22px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 18px 20px;
  text-align: left;
}
.ask-bar-desk .ask-ico {
  width: 42px;
  height: 42px;
}
.ask-bar-desk .ask-text {
  font-size: 16px;
  font-weight: 750;
}
.home-panel {
  background: color-mix(in srgb, var(--sec) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 16px 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.home-panel .section-head {
  margin-top: 0;
  margin-bottom: 12px;
}
.menu-grid-desk {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.menu-grid-desk .tile {
  min-height: 58px;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 55%, var(--sec));
  border: 1px solid var(--line);
  box-shadow: none;
  overflow: hidden;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.menu-grid-desk .tile:hover {
  background: color-mix(in srgb, var(--brand) 16%, var(--sec));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  transform: translateY(-1px);
}
.menu-grid-desk .tile:active {
  transform: translateY(0) scale(.99);
}
.menu-grid-desk .tile-ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex: 0 0 auto;
}
.menu-grid-desk .tile-ico svg {
  width: 18px;
  height: 18px;
}
.menu-grid-desk .tile-label {
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.25;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}
.home-today-panel {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  align-self: start;
}
.home-today-panel .home-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-today-panel .home-today-block {
  margin-top: 12px;
}
body.web-browser.chat-drawer-open .home-desk-top,
body.web-browser.chat-drawer-open .home-desk-body {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
}
body.web-browser.chat-drawer-open .menu-grid-desk {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Wider inner screens on desktop */
@media (min-width: 960px) {
  body.web-browser .card,
  body.web-browser .feed-item,
  body.web-browser .kids-card,
  body.web-browser .hot-card {
    border-radius: 16px;
  }
}
@media (max-width: 1100px) {
  .home-desk-top,
  .home-desk-body,
  body.web-browser.chat-drawer-open .home-desk-top,
  body.web-browser.chat-drawer-open .home-desk-body {
    grid-template-columns: 1fr;
  }
  .ask-bar-desk {
    min-height: 64px;
  }
  .home-today-panel {
    position: static;
    max-height: none;
  }
}
@media (max-width: 900px) {
  .menu-grid-desk {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.login-screen .top {
  background: transparent;
  backdrop-filter: none;
}
body.login-screen main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20px;
  max-width: 520px;
}
.login-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.login-hero-card {
  margin-bottom: 14px;
}
.login-card {
  padding: 18px 16px 16px;
}
.login-msg {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 14%, var(--sec));
  color: #fecaca;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}
.tg-login-mount {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 4px 0 12px;
}
.login-fallback {
  margin-top: 4px;
}
.login-fallback summary {
  cursor: pointer;
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 8px;
}
.login-code-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text, #e2e8f0) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text, #e2e8f0) 12%, transparent);
}
.login-code-lab {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
}
.login-code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text, #e2e8f0) 8%, transparent);
  user-select: all;
}
.login-tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
}
.login-hint {
  font-size: 12px;
  line-height: 1.45;
}
@media (min-width: 720px) {
  body.web-browser:not(.login-screen) main {
    padding-top: 12px;
  }
}

/* —— Desktop internal screens —— */
body.web-browser .desk-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.web-browser .desk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  flex: 0 0 auto;
}
body.web-browser .desk-toolbar-wrap {
  align-items: stretch;
  flex-direction: column;
  flex: 0 0 auto;
}
body.web-browser .desk-toolbar .search {
  margin: 0;
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 14px;
  line-height: 44px;
  box-sizing: border-box;
}
body.web-browser .desk-aside {
  background: color-mix(in srgb, var(--sec) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: fit-content;
}
body.web-browser .desk-panel {
  background: color-mix(in srgb, var(--sec) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px 16px;
}
body.web-browser .desk-panel h2,
body.web-browser .desk-panel .section-head {
  margin: 0 0 12px;
}
body.web-browser .desk-panel .section-head {
  margin-top: 0;
}
body.web-browser .desk-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.web-browser .desk-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
body.web-browser .desk-actions-col .btn {
  width: 100%;
  justify-content: center;
}

/* Mail list as inbox table */
body.web-browser .desk-mail {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
body.web-browser .desk-mail .mail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.web-browser .desk-mail .mail-actions .btn,
body.web-browser .desk-mail .mail-actions .mail-cta,
body.web-browser .desk-mail .mail-actions .mail-cta-secondary {
  width: 100%;
}
body.web-browser .desk-mail-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.web-browser .mail-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(140px, 0.9fr) 170px;
  gap: 12px 16px;
  align-items: center;
  margin: 0;
  padding: 12px 16px;
}
body.web-browser .mail-row-sub {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  min-width: 0;
}
body.web-browser .mail-row-who,
body.web-browser .mail-row-meta {
  font-size: 13px;
  color: var(--hint);
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.web-browser .mail-row.mail-unseen {
  border-color: color-mix(in srgb, var(--mail) 45%, var(--line));
  background: color-mix(in srgb, var(--mail) 10%, var(--sec));
}
body.web-browser .desk-mail-one {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
body.web-browser .desk-mail-body-card {
  min-height: 420px;
}
body.web-browser .desk-mail-body-card .mail-body {
  font-size: 15px;
  line-height: 1.55;
}

/* Today digest columns */
body.web-browser .desk-today-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
body.web-browser .desk-today-grid .desk-panel {
  min-height: 160px;
}

/* Kids / CRM / docs cards */
body.web-browser .kids-list,
body.web-browser .desk-docs-results .kids-list,
body.web-browser .desk-docs-results .folder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
body.web-browser .kids-list .kids-card,
body.web-browser .desk-docs-results .kids-card {
  margin: 0;
  height: 100%;
}
body.web-browser .folder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
body.web-browser .folder-card {
  margin: 0;
}

/* Child detail split */
body.web-browser .desk-child {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}
body.web-browser .desk-child-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}

/* Incidents */
body.web-browser .desk-incidents-results .incidents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

/* Hot / tasks */
body.web-browser .desk-hot-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: color-mix(in srgb, var(--sec) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
body.web-browser .desk-hot-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
body.web-browser .desk-hot .hot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
body.web-browser .desk-hot .hot-card {
  margin: 0;
  height: 100%;
}

/* Schedule */
body.web-browser .desk-sched-top {
  background: color-mix(in srgb, var(--sec) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
body.web-browser .desk-sched-board {
  margin: 0;
  padding: 8px;
}
body.web-browser .desk-sched-board .slot,
body.web-browser .desk-sched-board .slot-hit {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  width: 100%;
}

/* Analytics */
body.web-browser .desk-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
body.web-browser .desk-analytics .kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 4px;
}

/* Settings / info */
body.web-browser .desk-settings {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
body.web-browser .desk-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
body.web-browser .desk-info-list .info-item {
  margin: 0;
  height: 100%;
}

/* Calendar / forms / chat */
@media (min-width: 721px) {
  body.web-browser .cal-grid {
    gap: 8px;
  }
  body.web-browser .cal-cell {
    min-height: 64px;
  }
}
body.web-browser .mail-compose,
body.web-browser .child-work-card,
body.web-browser .cal-form,
body.web-browser .reply-screen {
  max-width: 920px;
}

/* Calendar: month left, day events right */
.desk-cal-wrap .cal-toolbar {
  margin-bottom: 4px;
}
.desk-cal {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.desk-cal-main,
.desk-cal-side {
  min-width: 0;
}
.desk-cal-main .cal-nav {
  margin-bottom: 10px;
}
.desk-cal-main .cal-grid {
  margin: 0;
}
.desk-cal-side {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.desk-cal-day-head {
  margin: 0;
}
.desk-cal-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.desk-cal-events .cal-ev {
  margin: 0;
}
.desk-cal-add {
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}
.desk-cal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.desk-cal-list .cal-ev {
  margin: 0;
  height: 100%;
}
@media (max-width: 980px) {
  .desk-cal {
    grid-template-columns: 1fr;
  }
  .desk-cal-side {
    position: static;
    max-height: none;
  }
}

body.web-browser.chat-open main,
body.web-browser .chat-screen {
  max-width: none;
  margin: 0;
  width: 100%;
}
body.web-browser.chat-open .top {
  max-width: none;
}
body.web-browser .chat-msgs {
  max-width: min(920px, 100%);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
body.web-browser .chat-composer {
  max-width: min(920px, 100%);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
body.web-browser.chat-open .chat-composer {
  max-width: none;
  border-radius: 0;
}
body.web-browser .bubble {
  max-width: min(72%, 640px);
}
body.web-browser.chat-open .bubble {
  max-width: min(88%, 640px);
}

/* AI chat drawer (web) — side panel that pushes content, not full-screen */
body.web-browser {
  --chat-drawer-w: 380px;
}
body.web-browser .app-shell {
  transition: width 0.28s ease, max-width 0.28s ease, margin 0.28s ease;
}
body.web-browser.chat-drawer-open .app-shell {
  width: calc(100% - var(--chat-drawer-w));
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
body.web-browser.chat-drawer-open .top,
body.web-browser.chat-drawer-open main {
  max-width: none;
}
.chat-drawer-root {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--chat-drawer-w, 380px);
  z-index: 60;
  pointer-events: none;
}
.chat-drawer-root[hidden] {
  display: none !important;
}
.chat-drawer-root.open {
  pointer-events: auto;
}
.chat-drawer-backdrop {
  display: none;
}
.chat-drawer {
  position: absolute;
  inset: 0;
  width: 100%;
  background: var(--sec, #1e293b);
  color: var(--text, #f8fafc);
  border-left: 1px solid var(--line, rgba(148, 163, 184, 0.16));
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s ease;
}
.chat-drawer-root.open .chat-drawer {
  transform: translateX(0);
}
.chat-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line, rgba(148, 163, 184, 0.16));
  flex: 0 0 auto;
}
.chat-drawer-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.chat-drawer-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint, #94a3b8);
}
.chat-drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chat-drawer-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--control-bg, rgba(148, 163, 184, 0.1));
  color: var(--text, #f8fafc);
  font: inherit;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding-bottom: 4px;
}
.chat-drawer-close:hover {
  background: color-mix(in srgb, var(--brand, #0e7c86) 22%, transparent);
}
.chat-drawer .chat-msgs {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 10px;
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}
.chat-drawer .chat-composer,
body.web-browser .chat-drawer .chat-composer {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line, rgba(148, 163, 184, 0.16));
  background: color-mix(in srgb, var(--bg, #0f172a) 55%, var(--sec, #1e293b));
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
body.web-browser .chat-drawer .chat-msgs {
  max-width: none;
  margin: 0;
  width: 100%;
}
.chat-drawer .chat-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.chat-drawer .bubble {
  max-width: 92%;
}
body.web-browser.chat-drawer-open .ask-bar-desk {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}

/* —— Left nav drawer —— */
body {
  --nav-drawer-w: 280px;
}
.nav-toggle {
  display: grid;
  place-items: center;
  padding: 0;
}
.nav-toggle svg {
  display: block;
}
.nav-fab {
  position: fixed;
  top: calc(10px + var(--pad-top));
  left: calc(12px + var(--pad-left));
  z-index: 45;
  width: 42px;
  height: 42px;
  border: 1px solid var(--control-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--sec) 92%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.nav-fab[hidden] {
  display: none !important;
}
.nav-drawer-root {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-drawer-w);
  z-index: 70;
  pointer-events: none;
}
.nav-drawer-root[hidden] {
  display: none !important;
}
.nav-drawer-root.open {
  pointer-events: auto;
}
.nav-drawer-backdrop {
  display: none;
}
.nav-drawer {
  position: absolute;
  inset: 0;
  width: 100%;
  background: var(--sec, #1e293b);
  color: var(--text);
  border-right: 1px solid var(--line);
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  padding-top: var(--pad-top);
  padding-bottom: var(--pad-bottom);
}
.nav-drawer-root.open .nav-drawer {
  transform: translateX(0);
}
.nav-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.nav-drawer-kicker {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
}
.nav-drawer-title {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.nav-drawer-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  font-size: 26px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  padding-bottom: 4px;
  flex: 0 0 auto;
}
.nav-drawer-close:hover {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
.nav-drawer-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  min-width: 0;
}
.nav-item:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.nav-item.on {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--text);
}
.nav-item-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
.nav-item-ico svg {
  width: 17px;
  height: 17px;
}
.nav-item-ico.mail { background: color-mix(in srgb, var(--mail) 22%, transparent); color: #93c5fd; }
.nav-item-ico.kids { background: color-mix(in srgb, var(--kids) 22%, transparent); color: #5eead4; }
.nav-item-ico.assessment { background: color-mix(in srgb, var(--assess) 24%, transparent); color: #f9a8d4; }
.nav-item-ico.crm { background: color-mix(in srgb, #4f46e5 22%, transparent); color: #a5b4fc; }
.nav-item-ico.incidents { background: color-mix(in srgb, #ea580c 22%, transparent); color: #fdba74; }
.nav-item-ico.analytics { background: color-mix(in srgb, #7c3aed 22%, transparent); color: #c4b5fd; }
.nav-item-ico.docs { background: color-mix(in srgb, #0f766e 22%, transparent); color: #5eead4; }
.nav-item-ico.hot { background: color-mix(in srgb, var(--hot) 22%, transparent); color: #fca5a5; }
.nav-item-ico.tasks { background: color-mix(in srgb, var(--tasks) 22%, transparent); color: #5eead4; }
.nav-item-ico.today { background: color-mix(in srgb, var(--today) 22%, transparent); color: #c4b5fd; }
.nav-item-ico.sched { background: color-mix(in srgb, var(--sched) 22%, transparent); color: #fdba74; }
.nav-item-ico.cal { background: color-mix(in srgb, var(--cal) 22%, transparent); color: #86efac; }
.nav-item-ico.menu { background: color-mix(in srgb, #c2410c 22%, transparent); color: #fdba74; }
.nav-item-ico.settings { background: color-mix(in srgb, var(--settings) 22%, transparent); color: #cbd5e1; }
.nav-item-ico.info { background: color-mix(in srgb, #536984 22%, transparent); color: #94a3b8; }
.nav-item-ico.chat { background: color-mix(in srgb, var(--brand) 24%, transparent); color: #5eead4; }
.nav-item-ico.home { background: color-mix(in srgb, var(--brand) 20%, transparent); color: #5eead4; }
.nav-item-label {
  min-width: 0;
  line-height: 1.25;
}
body.nav-drawer-open .app-shell {
  transition: width 0.28s ease, margin 0.28s ease;
}
@media (min-width: 960px) {
  body.nav-drawer-open .app-shell {
    width: calc(100% - var(--nav-drawer-w));
    margin-left: var(--nav-drawer-w);
  }
  body.nav-drawer-open .top,
  body.nav-drawer-open main {
    max-width: none;
  }
  body.nav-drawer-open.chat-drawer-open .app-shell {
    width: calc(100% - var(--nav-drawer-w) - var(--chat-drawer-w, 380px));
  }
}
@media (max-width: 959px) {
  .nav-drawer-root {
    width: 100%;
  }
  .nav-drawer {
    width: min(var(--nav-drawer-w), 86vw);
  }
  .nav-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    left: min(var(--nav-drawer-w), 86vw);
    background: rgba(2, 8, 23, 0.42);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: auto;
  }
  .nav-drawer-root.open .nav-drawer-backdrop {
    opacity: 1;
  }
  body.nav-drawer-open .app-shell {
    width: 100%;
    margin-left: 0;
  }
}
body.login-screen .nav-toggle,
body.login-screen .nav-fab,
body.login-screen .nav-drawer-root {
  display: none !important;
}
body.web-browser.home-screen .top {
  display: flex;
}

@media (max-width: 960px) {
  body.web-browser {
    --chat-drawer-w: min(360px, 42vw);
  }
}
@media (max-width: 720px) {
  body.web-browser {
    --chat-drawer-w: min(340px, 86vw);
  }
  body.web-browser.chat-drawer-open .app-shell {
    width: 100%;
  }
  .chat-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    right: var(--chat-drawer-w);
    background: rgba(2, 8, 23, 0.4);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: auto;
  }
  .chat-drawer-root.open .chat-drawer-backdrop {
    opacity: 1;
  }
}


/* Generic search/chips denser on desktop */
body.web-browser .chips {
  gap: 8px;
}
body.web-browser .search {
  font-size: 14px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 14px;
  line-height: 44px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
body.web-browser .desk-kids .desk-toolbar .search,
body.web-browser .desk-docs .desk-toolbar .search,
body.web-browser .desk-incidents .search,
body.web-browser .desk-sched .search {
  max-width: 420px;
}

@media (max-width: 980px) {
  body.web-browser .desk-mail,
  body.web-browser .desk-mail-one,
  body.web-browser .desk-child,
  body.web-browser .desk-settings,
  body.web-browser .desk-hot-top,
  body.web-browser .desk-today-grid,
  body.web-browser .desk-analytics-grid,
  body.web-browser .desk-info-list,
  body.web-browser .desk-hot .hot-list {
    grid-template-columns: 1fr;
  }
  body.web-browser .mail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  body.web-browser .desk-child-side {
    position: static;
    max-height: none;
  }
}

/* —— Mobile web layout —— */
@media (max-width: 720px) {
  body.web-browser .top {
    max-width: none;
    padding-left: max(12px, var(--pad-left));
    padding-right: max(12px, var(--pad-right));
  }
  body.web-browser main {
    max-width: none;
    padding: 12px 14px 28px;
  }
  body.web-browser.chat-open main {
    padding: 0;
  }

  body.web-browser .home-desk {
    gap: 12px;
  }
  body.web-browser .home-desk-top .hero {
    min-height: 0;
    padding: 16px;
  }
  body.web-browser .home-desk-top .hero-title {
    font-size: 22px;
  }
  body.web-browser .ask-bar-desk {
    min-height: 56px;
    padding: 14px 16px;
    border-radius: 18px;
  }
  body.web-browser .home-panel {
    border-radius: 18px;
    padding: 14px;
    box-shadow: none;
  }
  body.web-browser .menu-grid-desk {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  body.web-browser .menu-grid-desk .tile {
    min-height: 52px;
    padding: 10px 12px;
    gap: 10px;
  }
  body.web-browser .menu-grid-desk .tile-label {
    font-size: 12.5px;
  }

  body.web-browser .desk-screen {
    gap: 12px;
  }
  body.web-browser .desk-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  body.web-browser .desk-toolbar .search,
  body.web-browser .desk-kids .desk-toolbar .search,
  body.web-browser .desk-docs .desk-toolbar .search,
  body.web-browser .desk-incidents .search,
  body.web-browser .desk-sched .search {
    max-width: none;
    width: 100%;
  }
  body.web-browser .desk-aside,
  body.web-browser .desk-panel {
    position: static;
    max-height: none;
  }
  body.web-browser .desk-actions-col {
    flex-direction: column;
  }
  body.web-browser .desk-mail .mail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  body.web-browser .desk-analytics .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.web-browser .desk-sched-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.web-browser .desk-hot-controls {
    flex-direction: column;
    align-items: stretch;
  }

  body.web-browser .mail-compose,
  body.web-browser .child-work-card,
  body.web-browser .cal-form,
  body.web-browser .reply-screen {
    max-width: none;
    width: 100%;
  }

  body.web-browser .desk-cal-wrap {
    width: 100%;
    max-width: none;
    gap: 10px;
  }
  body.web-browser .desk-cal {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.web-browser .desk-cal-main.home-panel,
  body.web-browser .desk-cal-side.home-panel {
    padding: 10px;
    border-radius: 16px;
    box-shadow: none;
  }
  body.web-browser .desk-cal-main .cal-nav {
    margin-bottom: 8px;
  }
  body.web-browser .cal-nav-title {
    font-size: 14px;
  }
  body.web-browser .cal-grid {
    gap: 2px;
    padding: 4px 2px 6px;
    border: 0;
    background: transparent;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  body.web-browser .cal-dow {
    font-size: 10px;
    padding: 2px 0 4px;
  }
  body.web-browser .cal-cell {
    min-height: 0;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    font-size: 12px;
    gap: 1px;
  }
  body.web-browser .cal-dot {
    font-size: 7px;
    letter-spacing: 0.5px;
  }
  body.web-browser .cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  body.web-browser .cal-toolbar .chips {
    flex: 1 1 auto;
    min-width: 0;
  }
  body.web-browser .desk-cal-side {
    position: static;
    max-height: none;
  }
  body.web-browser .desk-cal-list {
    grid-template-columns: 1fr;
  }
  body.web-browser .cal-ev-actions {
    flex-wrap: wrap;
  }

  body.web-browser .menu-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body.web-browser .menu-weeks {
    grid-template-columns: 1fr;
  }
  body.web-browser .menu-week-actions {
    grid-template-columns: 1fr;
  }

  .desk-cal {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .desk-cal-side {
    position: static;
    max-height: none;
  }
  .desk-cal-list {
    grid-template-columns: 1fr;
  }

  body.web-browser .chat-msgs,
  body.web-browser .chat-composer,
  body.web-browser.chat-open .chat-msgs,
  body.web-browser.chat-open .chat-composer {
    max-width: none;
    margin: 0;
    width: 100%;
  }
  body.web-browser .bubble,
  body.web-browser.chat-open .bubble {
    max-width: min(88%, 520px);
  }
  body.web-browser .chat-screen {
    height: calc(100dvh - 58px - var(--pad-top, 0px));
  }
  body.web-browser .chat-toolbar {
    padding: 4px 12px 0;
  }

  body.web-browser .chips {
    flex-wrap: wrap;
  }
  body.web-browser .search {
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    line-height: 42px;
  }

  body.login-screen main {
    max-width: none;
    padding: 16px 14px 28px;
  }
  .login-wrap {
    max-width: none;
  }
}

/* Assessment journal */
.assess-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.assess-toolbar .chips {
  gap: 6px;
}
.assess-actions {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.assess-actions-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
  flex: 0 0 auto;
}
.btn.assess-module-stats-btn {
  background: color-mix(in srgb, var(--brand) 22%, var(--sec));
  border: 1px solid color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--text);
  font-weight: 750;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}
.btn.assess-module-stats-btn:hover {
  background: color-mix(in srgb, var(--brand) 32%, var(--sec));
  border-color: color-mix(in srgb, var(--brand) 70%, var(--line));
}
.assess-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 650;
}
.assess-crumb-sep {
  color: var(--hint);
  opacity: 0.7;
}
.assess-crumb-link {
  all: unset;
  cursor: pointer;
  color: var(--link, var(--brand));
  font-weight: 700;
}
.assess-crumb-link:hover {
  text-decoration: underline;
}
.assess-crumb-cur {
  color: var(--text);
  font-weight: 750;
}
.assess-path-line {
  margin: 0;
  line-height: 1.35;
}
.assess-path-line .assess-crumb-cur {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.assess-nav-hint {
  margin: -4px 0 10px;
  font-size: 12px;
}
.assess-nav-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assess-nav-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sec);
  overflow: hidden;
}
.assess-nav-card-topic,
.assess-nav-card-lesson {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.assess-nav-card-topic {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
.assess-nav-card-topic:hover,
.assess-nav-card-lesson:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.assess-nav-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.assess-nav-card-title {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.assess-nav-card-lessons {
  display: flex;
  flex-direction: column;
}
.assess-nav-card-lesson + .assess-nav-card-lesson {
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.assess-nav-card-lesson .assess-nav-card-title {
  font-weight: 650;
  font-size: 13px;
}
.assess-nav-card-lesson-solo {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sec);
  align-items: center;
}
.assess-nav-empty {
  padding: 0 14px 12px;
  font-size: 12px;
}
.assess-nav-row-end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-top: 1px;
}
.assess-nav-chevron {
  color: var(--hint);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.assess-form-lessons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assess-form-lesson-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.assess-form-lesson-field {
  flex: 1;
  min-width: 0;
}
.assess-form-lesson-remove {
  margin-bottom: 2px;
}
.assess-form-add-lesson-btn {
  align-self: flex-start;
}
.assess-form-select {
  appearance: none;
  cursor: pointer;
}
/* Assessment journal table */
.assess-scroll {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  touch-action: pan-x pan-y;
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 35%, transparent) transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sec);
}
.assess-scroll::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.assess-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 28%, transparent);
  border-radius: 999px;
}
.assess-scroll::-webkit-scrollbar-track {
  background: transparent;
}
body.web-browser .assess-scroll {
  overflow-y: hidden;
  overscroll-behavior-y: auto;
}
.assess-table {
  --assess-num-w: 36px;
  --assess-name-w: 136px;
  --assess-head-h1: 42px;
  --assess-head-h2: 42px;
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
@media (min-width: 720px) {
  .assess-table {
    --assess-num-w: 40px;
    --assess-name-w: 188px;
    --assess-head-h1: 80px;
    --assess-head-h2: 148px;
  }
  .assess-table:not(.diary-table) .assess-lesson {
    min-width: 168px;
    width: 176px;
    max-width: 200px;
    vertical-align: middle;
  }
  .assess-table:not(.diary-table) .assess-topic .assess-head-text,
  .assess-table:not(.diary-table) .assess-lesson .assess-head-text {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 7;
    line-clamp: 7;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 100%;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 4px 5px;
    line-height: 1.2;
    text-align: left;
  }
  .assess-table:not(.diary-table) .assess-topic .assess-head-text {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    text-align: center;
    padding: 6px 8px;
  }
}
@media (max-width: 719px) {
  .assess-table:not(.diary-table) {
    --assess-z: 1;
    --assess-num-w: 0px;
    --assess-name-w: calc(80px * var(--assess-z));
    --assess-head-h1: calc(56px * var(--assess-z));
    --assess-head-h2: calc(64px * var(--assess-z));
    font-size: calc(13px * var(--assess-z));
  }
  .assess-table:not(.diary-table) > thead > tr > th.assess-sticky:not(.assess-sticky-name),
  .assess-table:not(.diary-table) tbody td.assess-num {
    display: none;
  }
  .assess-table:not(.diary-table) .assess-sticky-name,
  .assess-table:not(.diary-table) .assess-name {
    left: 0;
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    padding: calc(8px * var(--assess-z)) calc(8px * var(--assess-z));
    line-height: 1.25;
  }
  .assess-table:not(.diary-table) .assess-name-btn {
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: calc(12px * var(--assess-z));
  }
  /* max-width:0 — тема не раздувает таблицу шире суммы колонок уроков */
  .assess-table:not(.diary-table) .assess-topic {
    min-width: 0;
    width: auto;
    max-width: 0;
    overflow: hidden;
    vertical-align: middle;
  }
  .assess-table:not(.diary-table) .assess-topic .assess-head-text {
    writing-mode: horizontal-tb;
    transform: none;
    white-space: normal;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: calc(var(--assess-head-h1) - 2px);
    margin: 0;
    padding: calc(4px * var(--assess-z)) calc(6px * var(--assess-z));
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    text-overflow: ellipsis;
    font-size: calc(11px * var(--assess-z));
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .assess-table:not(.diary-table) .assess-lesson {
    min-width: calc(72px * var(--assess-z));
    width: calc(72px * var(--assess-z));
    max-width: calc(80px * var(--assess-z));
    padding: 0;
    overflow: hidden;
    vertical-align: middle;
  }
  .assess-table:not(.diary-table) .assess-lesson .assess-head-text {
    white-space: normal;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: calc(var(--assess-head-h2) - 2px);
    margin: 0;
    padding: calc(4px * var(--assess-z)) calc(4px * var(--assess-z));
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    text-overflow: ellipsis;
    font-size: calc(10px * var(--assess-z));
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .assess-table:not(.diary-table) .assess-cell {
    padding: calc(4px * var(--assess-z)) calc(2px * var(--assess-z));
  }
  .assess-table:not(.diary-table) th.assess-avg {
    width: calc(40px * var(--assess-z));
    min-width: calc(40px * var(--assess-z));
    max-width: calc(44px * var(--assess-z));
    padding: calc(4px * var(--assess-z)) calc(2px * var(--assess-z));
    font-size: calc(9px * var(--assess-z));
  }
  .assess-table:not(.diary-table) th.assess-module {
    width: calc(52px * var(--assess-z));
    min-width: calc(52px * var(--assess-z));
    max-width: calc(56px * var(--assess-z));
    padding: calc(6px * var(--assess-z)) calc(4px * var(--assess-z));
    font-size: calc(10px * var(--assess-z));
  }
  .assess-table:not(.diary-table) td.assess-avg-cell,
  .assess-table:not(.diary-table) td.assess-module-avg {
    font-size: calc(12px * var(--assess-z));
    padding: calc(6px * var(--assess-z)) calc(4px * var(--assess-z));
  }
}
.assess-scroll-zoom {
  display: block;
  width: max-content;
  min-width: 100%;
}
.assess-table th,
.assess-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
  color: var(--text);
  background: var(--sec);
  box-sizing: border-box;
}
.assess-table th {
  background: color-mix(in srgb, var(--text) 8%, var(--sec));
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.01em;
}
.assess-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.assess-table thead tr:nth-child(1) th {
  height: var(--assess-head-h1);
}
.assess-table thead tr:nth-child(2) th {
  top: var(--assess-head-h1);
  height: var(--assess-head-h2);
}
/* Sticky № + ФИО flush — widths via vars so left offset never drifts */
.assess-num,
.assess-table:not(.diary-table) > thead > tr > th.assess-sticky:not(.assess-sticky-name) {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--assess-num-w);
  min-width: var(--assess-num-w);
  max-width: var(--assess-num-w);
  padding: 8px 0;
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  border-right: 0 !important;
  background: color-mix(in srgb, var(--text) 7%, var(--sec));
}
.assess-table tbody td.assess-num {
  z-index: 2;
  background: var(--sec);
  font-weight: 650;
  color: var(--hint);
}
.assess-sticky-name,
.assess-name {
  position: sticky;
  left: var(--assess-num-w);
  z-index: 3;
  width: var(--assess-name-w);
  min-width: var(--assess-name-w);
  max-width: var(--assess-name-w);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 7%, var(--sec));
  box-shadow: 8px 0 12px color-mix(in srgb, #000 14%, transparent);
}
.assess-table thead th.assess-sticky-name {
  z-index: 5;
  text-align: left;
  font-weight: 700;
  padding-left: 10px;
}
.assess-table tbody td.assess-name {
  z-index: 2;
  background: var(--sec);
  font-weight: 600;
}
.assess-topic,
.assess-lesson {
  padding: 0;
  min-width: 120px;
  max-width: none;
  width: 148px;
  vertical-align: middle;
}
.assess-topic {
  max-width: none;
  min-width: 0;
}
.assess-head-edit {
  cursor: pointer;
}
.assess-head-edit:hover {
  background: color-mix(in srgb, var(--brand) 18%, var(--sec));
}
.assess-head-edit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.assess-head-text {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 9px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.assess-topic .assess-head-text {
  max-width: 100%;
  padding: 10px 12px;
}
.assess-head-text-lesson {
  font-weight: 600;
  font-size: 11px;
}
.assess-name-btn {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--link, var(--brand));
  font-weight: 650;
  font-size: 13px;
  line-height: 1.3;
}
.assess-name-btn:hover {
  text-decoration: underline;
}
.assess-table th.assess-module,
.assess-table th.assess-avg {
  background: color-mix(in srgb, var(--text) 14%, var(--sec));
  color: var(--text);
  box-sizing: border-box;
  vertical-align: middle;
}
.assess-table th.assess-module {
  width: 76px;
  min-width: 76px;
  max-width: 84px;
  padding: 8px 6px;
  white-space: normal;
  line-height: 1.2;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}
.assess-table th.assess-avg {
  width: 52px;
  min-width: 52px;
  max-width: 56px;
  padding: 6px 4px;
  white-space: normal;
  line-height: 1.2;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.assess-avg-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}
.assess-avg-label > span {
  display: block;
}
.assess-add-lesson-col {
  width: 48px;
  min-width: 48px;
  max-width: 52px;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}
.assess-add-topic-col {
  width: 48px;
  min-width: 48px;
  max-width: 52px;
  padding: 4px;
  text-align: center;
  vertical-align: middle;
  background: color-mix(in srgb, var(--text) 8%, var(--sec));
}
.assess-add-lesson-btn {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand) 55%, var(--line));
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.assess-add-lesson-btn:hover {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  border-style: solid;
}
.assess-add-lesson-cell {
  width: 48px;
  min-width: 48px;
  max-width: 52px;
  padding: 0;
  background: color-mix(in srgb, var(--text) 3%, var(--sec));
}
.assess-form-topic-fixed {
  margin-bottom: 12px;
}
.assess-form-topic-fixed .row-line {
  margin-top: 4px;
  font-weight: 650;
  color: var(--text);
}
.assess-table td.assess-avg-cell,
.assess-table td.assess-module-avg {
  background: color-mix(in srgb, var(--text) 11%, var(--sec));
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
}
.assess-table td.assess-avg-cell {
  width: 52px;
  min-width: 52px;
  max-width: 56px;
  padding: 6px 4px;
  font-size: 11px;
}
.assess-table td.assess-module-avg {
  width: 76px;
  min-width: 76px;
  max-width: 84px;
  padding: 8px 6px;
  font-size: 12px;
}
.assess-cell {
  padding: 0;
  text-align: center;
  min-width: 52px;
}
.assess-mark {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 52px;
  min-height: 44px;
  padding: 6px;
  color: var(--text);
  transition: background 0.12s ease;
}
.assess-mark:disabled {
  cursor: default;
}
.assess-mark:not(:disabled):hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.assess-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.level-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--level-dot, #94a3b8);
  vertical-align: -0.05em;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--level-dot, #94a3b8) 35%, transparent);
}
.level-dot-sm {
  width: 8px;
  height: 8px;
}
.level-dot-md {
  width: 12px;
  height: 12px;
}
.level-dot-lg {
  width: 16px;
  height: 16px;
}
.level-dot-lab {
  font-weight: 650;
}
.diary-level-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
}
.diary-level-sep {
  color: var(--hint);
  margin: 0 2px;
}
.diary-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.assess-empty {
  color: var(--hint);
  font-size: 16px;
}

.child-assess-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.child-assess-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.child-assess-summary-subj {
  font-weight: 650;
}
.child-assess-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.child-assess-preview .child-full-btn {
  margin-top: 2px;
}
.child-assess-preview-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
.child-assess-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.child-assess-kpi {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--line);
}
.child-assess-kpi .muted {
  font-size: 11px;
  font-weight: 700;
}
.child-assess-kpi-val {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.diary-stats-card {
  margin-top: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.diary-stats-chips {
  flex-wrap: wrap;
  gap: 6px;
}
.diary-stats-grid,
.diary-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.diary-stats-panel {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
  box-sizing: border-box;
}
.diary-stats-panel-wide {
  grid-column: 1 / -1;
}
.diary-charts-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diary-topic-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diary-topic-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.diary-topic-select-wrap > .muted {
  font-size: 12px;
  font-weight: 700;
}
.diary-topic-select {
  width: 100%;
  max-width: 100%;
}
.diary-subj-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diary-subj-stat {
  display: grid;
  grid-template-columns: minmax(88px, 1.1fr) 1fr minmax(52px, auto);
  gap: 8px;
  align-items: center;
}
.diary-subj-stat-lab {
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diary-subj-stat-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.diary-chart-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
  padding: 6px 4px 2px;
}
.diary-chart-wrap-mini {
  margin-top: 10px;
  padding: 4px 2px 0;
}
@media (max-width: 720px) {
  .diary-stats-grid,
  .diary-charts-grid {
    grid-template-columns: 1fr;
  }
  .diary-stats-panel-wide {
    grid-column: auto;
  }
}
.diary-stats-panel .diary-chart-wrap {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.diary-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}
.diary-chart-grid {
  stroke: color-mix(in srgb, var(--text) 12%, transparent);
  stroke-width: 1;
}
.diary-chart-axis {
  fill: var(--hint);
  font-size: 9px;
  font-weight: 650;
}
.diary-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}
.diary-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--hint);
}
.diary-chart-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.diary-chart-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--hint);
  font-weight: 600;
}
.diary-hero {
  margin-bottom: 4px;
}
.diary-scroll {
  margin-top: 4px;
}
.diary-table {
  --assess-num-w: 140px;
  --assess-name-w: 140px;
  --assess-head-h1: 44px;
  --assess-head-h2: 48px;
  width: max-content;
  min-width: 100%;
}
@media (min-width: 720px) {
  .diary-table {
    --assess-num-w: 168px;
    --assess-name-w: 168px;
  }
}
.diary-table .diary-subj {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--assess-num-w);
  min-width: var(--assess-num-w);
  max-width: none;
  text-align: left;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--text) 7%, var(--sec));
  box-shadow: 8px 0 12px color-mix(in srgb, #000 14%, transparent);
}
.diary-subj-btn {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 9px 12px;
  cursor: pointer;
  color: var(--link, var(--brand));
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.diary-subj-btn:hover {
  text-decoration: underline;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.diary-table thead .diary-subj {
  z-index: 5;
  padding: 8px 12px;
  white-space: normal;
  line-height: 1.25;
  vertical-align: middle;
}
.diary-table th.diary-topic {
  min-width: 0;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  background: color-mix(in srgb, var(--text) 10%, var(--sec));
}
.diary-head-lab {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
  line-height: 1.1;
}
.diary-head-num {
  display: block;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  color: var(--text);
}
.diary-col,
.diary-cell {
  width: 48px;
  min-width: 48px;
  max-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.diary-table th.diary-col {
  padding: 4px;
  vertical-align: middle;
}
.diary-cell {
  position: relative;
  padding: 6px 4px;
  cursor: help;
}
.diary-cell-empty {
  color: var(--hint);
  opacity: 0.55;
  cursor: default;
}
.diary-mark {
  font-size: 18px;
  line-height: 1;
}
.diary-table th.diary-avg,
.diary-table td.diary-avg {
  width: 56px;
  min-width: 56px;
  max-width: 64px;
  padding: 6px 4px;
  text-align: center;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
  background: color-mix(in srgb, var(--text) 14%, var(--sec));
  color: var(--text);
}
.diary-table td.diary-avg {
  background: color-mix(in srgb, var(--text) 11%, var(--sec));
}
.diary-table tfoot th,
.diary-table tfoot td {
  border-top: 2px solid color-mix(in srgb, var(--text) 22%, var(--line));
  font-weight: 750;
}
.diary-total-row .diary-total-lab {
  padding: 9px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 12%, var(--sec));
}
.diary-table td.diary-total-cell {
  background: color-mix(in srgb, var(--text) 9%, var(--sec));
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 8px 4px;
  white-space: nowrap;
}
.diary-table td.diary-avg.diary-total-cell {
  background: color-mix(in srgb, var(--text) 14%, var(--sec));
}
.diary-table th.diary-module-total,
.diary-table td.diary-module-total {
  width: 64px;
  min-width: 64px;
  max-width: 72px;
  background: color-mix(in srgb, var(--text) 18%, var(--sec));
  font-weight: 800;
}
.diary-table td.diary-module-total {
  background: color-mix(in srgb, var(--text) 14%, var(--sec));
}
.diary-table td.diary-avg.diary-total-cell.diary-module-total {
  background: color-mix(in srgb, var(--text) 18%, var(--sec));
}
.diary-tip {
  position: fixed;
  z-index: 10000;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 11px;
  border-radius: 10px;
  background: #15202b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.diary-tip-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.diary-tip-row + .diary-tip-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.diary-tip-lab {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.diary-tip-val {
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  line-height: 1.35;
}
.diary-tip-grade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.diary-chart-hit {
  cursor: pointer;
}
.diary-tip[hidden] {
  display: none !important;
}
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.diary-subject-title {
  font-size: 15px;
  font-weight: 750;
  margin-bottom: 8px;
}
.diary-module {
  margin-top: 8px;
}
.diary-module-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.diary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.diary-row:last-child {
  border-bottom: 0;
}
.diary-row-main {
  flex: 1;
  min-width: 0;
}
.diary-lesson {
  font-size: 14px;
  font-weight: 650;
}
.diary-topic {
  font-size: 12px;
  color: var(--hint);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-card-hero {
  margin-bottom: 12px;
}
.lesson-card-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.lesson-card-kpis-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.lesson-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.topic-lesson-row {
  all: unset;
  box-sizing: border-box;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.topic-lesson-row:last-child {
  border-bottom: 0;
}
.topic-lesson-row:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.topic-lesson-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.topic-lesson-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-lesson-avg {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  flex: 0 0 auto;
}
.topic-student-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.lesson-stat-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) 1fr minmax(52px, auto);
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.assess-shares {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) 148px;
  gap: 12px 14px;
  align-items: center;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
.assess-shares-labs {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
}
.assess-share-lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  min-height: 28px;
}
.assess-shares-bars {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 4px;
  overflow: hidden;
}
.assess-share-bar-row {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 44px;
  gap: 10px;
  align-items: center;
  width: min(100%, 220px);
  min-height: 28px;
  box-sizing: border-box;
}
.assess-share-bar-row .lesson-stat-bar {
  width: 100%;
  min-width: 0;
}
.assess-shares-pie {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 148px;
  height: 148px;
  max-width: 148px;
  flex: 0 0 148px;
  overflow: hidden;
  box-sizing: border-box;
}
.assess-pie-svg {
  display: block;
  width: 140px;
  height: 140px;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
}
.assess-pie-slice {
  cursor: pointer;
  stroke: color-mix(in srgb, var(--sec) 70%, transparent);
  stroke-width: 1.5;
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.assess-pie-slice:hover {
  filter: brightness(1.12);
  opacity: 0.95;
}
@media (max-width: 560px) {
  .assess-shares {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .assess-shares-pie {
    grid-column: 1 / -1;
    justify-self: center;
    width: 148px;
    height: 148px;
    max-width: 148px;
  }
  .assess-pie-svg {
    width: 140px;
    height: 140px;
  }
}
.lesson-stat-lab {
  font-size: 13px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.lesson-stat-bar {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}
.lesson-stat-bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.lesson-stat-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  gap: 1px;
}
.lesson-stat-share {
  font-size: 10px;
  font-weight: 650;
  color: var(--hint);
}
.assess-stats-card {
  padding: 14px;
}
.assess-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.assess-stats-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 720px) {
  .assess-stats-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.assess-stats-kpi {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--line);
}
.assess-stats-kpi.is-warn {
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border-color: color-mix(in srgb, var(--warn) 28%, var(--line));
}
.assess-stats-kpi-lab {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.assess-stats-kpi-val {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.assess-stats-kpi-sub {
  margin-top: 3px;
  font-size: 11px;
  color: var(--hint);
  line-height: 1.3;
}
.assess-stats-block-title {
  font-size: 12px;
  font-weight: 750;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}
.assess-stats-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.assess-stats-block-head .assess-stats-block-title {
  margin-bottom: 0;
}
.assess-stats-chart-chips {
  margin: 0;
  flex: 0 1 auto;
}
.assess-stats-chart-chips .chip {
  padding: 4px 10px;
  font-size: 12px;
}
.assess-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 0 0 6px;
  padding: 0 2px;
}
.assess-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--hint);
}
.assess-trend-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.assess-hist,
.assess-lesson-hist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 140px;
}
.assess-lesson-hist {
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.assess-lesson-chart-wrap {
  width: 100%;
  height: 280px;
  min-height: 280px;
  max-height: 280px;
  padding: 8px 6px 6px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
}
.assess-trend-plot {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.assess-trend-plot .diary-chart-svg,
.assess-trend-plot .assess-lesson-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.assess-trend-xlabels {
  flex: 0 0 auto;
  display: grid;
  gap: 2px 4px;
  margin-top: 4px;
  align-items: start;
}
.assess-trend-xlabel {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  color: color-mix(in srgb, var(--text) 78%, var(--hint));
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.assess-lesson-chart-wrap .diary-chart-axis {
  font-size: 12px;
  font-weight: 700;
  fill: color-mix(in srgb, var(--text) 72%, var(--hint));
}
.assess-hist-col,
.assess-lesson-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.assess-hist-val,
.assess-lesson-val {
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.assess-hist-track {
  width: 100%;
  max-width: 42px;
  height: 96px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 0 auto;
}
.assess-hist-track > span {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 10px 10px 4px 4px;
  transition: height 0.28s ease;
}
.assess-hist-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-height: 16px;
}
.assess-hist-lab,
.assess-lesson-lab {
  font-size: 10px;
  font-weight: 650;
  text-align: center;
  color: var(--hint);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assess-hist-pct {
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.assess-stack {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.assess-stack > span {
  display: block;
  height: 100%;
  min-width: 0;
}
.assess-stack > span.is-empty {
  background: color-mix(in srgb, var(--text) 16%, transparent);
}
.assess-stats-note {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--hint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.lesson-student-list {
  padding: 4px 0;
}
.assess-student-sort-chips {
  margin: 0 0 10px;
}
.lesson-student-row {
  all: unset;
  box-sizing: border-box;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.lesson-student-row:last-child {
  border-bottom: 0;
}
.lesson-student-row:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.lesson-student-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-student-mark {
  font-size: 20px;
  line-height: 1;
}
.assess-empty-card {
  padding: 16px;
}
.assess-picker {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, #000 48%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--pad-bottom, 0px));
}
.assess-picker-card {
  width: min(420px, 100%);
  background: var(--sec);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.assess-help {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, #000 48%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--pad-bottom, 0px));
}
@media (min-width: 720px) {
  .assess-help {
    align-items: center;
  }
}
.assess-help-card {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--sec);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.assess-help-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
  min-height: 0;
}
.assess-help-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .assess-help-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.assess-help-tip {
  margin: 0;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 4%, var(--sec));
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}
.assess-help-tip-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.assess-help-tip-ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--assess, #db2777);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
}
.assess-help-tip:nth-child(2) .assess-help-tip-ico { background: #0e7c86; }
.assess-help-tip:nth-child(3) .assess-help-tip-ico { background: #4f46e5; font-size: 14px; }
.assess-help-tip:nth-child(4) .assess-help-tip-ico { background: #ca8a04; }
.assess-help-tip:nth-child(5) .assess-help-tip-ico { background: #ea580c; font-size: 11px; }
.assess-help-tip:nth-child(6) .assess-help-tip-ico { background: #64748b; }
.assess-help-tip-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.assess-help-tip-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.assess-help-tip-list li {
  position: relative;
  padding-left: 12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}
.assess-help-tip-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 70%, var(--text));
}
.assess-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.assess-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.assess-form-label {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hint);
}
.assess-form-input {
  width: 100%;
}
.assess-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.assess-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.assess-pick-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.assess-pick-opt.ghost {
  color: var(--hint);
}
.assess-pick-dot {
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (min-width: 960px) {
  .assess-picker {
    align-items: center;
  }
}
